You are not logged in.

Applications: [GameMaster: OPEN] | [Volunteer Testers: OPEN]


This forum will be permanently shut down on Friday 13.07.2018
Please copy or save all important information from old forum before they will be deactivated
We have moved to new board. https://forum.runesofmagic.gameforge.com/Come join us.

241

Wednesday, April 21st 2010, 2:11pm

Quoted from "ZeroChow;259714"

1. how to check a skill is still in cooldown? I think if the macro use a "cooldown" skill, it will waste the time?


The MyCombat() function is already doing a cooldown check before it even attempts to use the skill. So you don't need to do that check yourself. That's the whole reason I have the ReadSkills() function so it can pass the page/slot numbers to the CD() function for checking whether that skill is on cooldown or not.

Or did you mean in general for writing your own code?

Quoted from "ZeroChow;259714"

2. for the target buffcheck, will it mix with other team members in a party? for example, 3 rogue in a group, what happen to the "bleed" effect check?


As far as I know there's no way to distinguish your debuff effects from someone elses. There is a pseudo-method (which I think was discussed earlier in this thread) by checking the time remaining on the effect to verify whether it coincides with the skill you executed or not, but that's not part of the code I posted.

242

Wednesday, April 21st 2010, 3:19pm

3 Rogues in a group has the benefit of inflecting bleed, wound, and Grievous wound faster since you can leverage off of another rogues previous skill usage. Just imagine your burst damage times 3. That is what you get and it is awesome. Seen it on a boss once the damage got down to 25% then it immediately dropped to zero!

243

Wednesday, April 21st 2010, 5:29pm

Quoted from "Geistware;259949"

3 Rogues in a group has the benefit of inflecting bleed, wound, and Grievous wound faster since you can leverage off of another rogues previous skill usage. Just imagine your burst damage times 3. That is what you get and it is awesome. Seen it on a boss once the damage got down to 25% then it immediately dropped to zero!


I believe that was just an example to illustrate his point about being able to distinguish your effects from others. I know this is a common problem for groups with multiple healers where they all want to stack their HoT's on the tank, but can't tell who already has it running by just the buff name.

244

Thursday, April 22nd 2010, 12:17pm

Other group member rogue buff effect also work on my rogue skill?

245

Thursday, April 22nd 2010, 12:20pm

Quoted from "Sixpax;259927"

The MyCombat() function is already doing a cooldown check before it even attempts to use the skill. So you don't need to do that check yourself. That's the whole reason I have the ReadSkills() function so it can pass the page/slot numbers to the CD() function for checking whether that skill is on cooldown or not.

Or did you mean in general for writing your own code?



As far as I know there's no way to distinguish your debuff effects from someone elses. There is a pseudo-method (which I think was discussed earlier in this thread) by checking the time remaining on the effect to verify whether it coincides with the skill you executed or not, but that's not part of the code I posted.



I use your fucntion, but adjust a little bit on skills priority.


i=i+1; Skill = { ['name'] = "Vampire Arrows", ['use'] = ((not friendly) and (not string.find(tbuffs,"Vampire Arrows"))) }
i=i+1; Skill[i] = { ['name'] = "Wound Attack", ['use'] = ((not friendly) and (energy >=35) and string.find(tbuffs,"Bleed") and string.find(tbuffs,"Grievous Wound")) }
i=i+1; Skill[i] = { ['name'] = "Low Blow", ['use'] = ((not friendly) and (energy >=35) and string.find(tbuffs,"Bleed")) }
i=i+1; Skill[i] = { ['name'] = "Shadowstab", ['use'] = ((not friendly) and (energy >=35)) }


The reason I ask to check the cooldown is that the "skill not available" message keep posting on screen, so I think the skill is activated by the macro again and again. :confused:

246

Thursday, April 22nd 2010, 5:21pm

Quoted from "ZeroChow;260530"

The reason I ask to check the cooldown is that the "skill not available" message keep posting on screen, so I think the skill is activated by the macro again and again. :confused:


First I need to clarify a couple of things... is that message popping up in your chat box with the name of the skill that's not available? Or is it popping up in the middle of your screen?

Also, how often are you hitting the macro?

jsalemi

Trainee

Posts: 133

Location: VA, USA

  • Send private message

247

Thursday, April 22nd 2010, 6:09pm

I've seen the "skill not available" message pop up in the middle of the screen on occasion, usually when I'm spamming the combat engine and the server lag can't keep up.

248

Thursday, April 22nd 2010, 6:47pm

"skill not available" message will also pop up in the middle of the screen if you are rooted.

249

Thursday, April 22nd 2010, 8:54pm

I have code in the combat engine to say "Skill not available: <skill name>" in the chat box if you list a skill that isn't usable by your class. That could happen for several reasons: 1) you're not high enough level to use the skill yet; 2) you mistyped the skill name; 3) it's not a skill that your class combo knows.

Thus the reason I asked whether it was showing up in the chat box or the middle of the screen.

If it's in the middle of the screen it's typically because the macro is being executed faster than the combat engine can complete one pass through the code. Typically 2-3 times per second is acceptable, but more than that or in the event of lag, and you'll start getting that message.

bronislav84

Beginner

Posts: 11

Location: Brooklyn, NY, USA

Occupation: College Student

  • Send private message

250

Thursday, April 22nd 2010, 11:25pm

Six would the DIYSCE be able to be used as part of a macro that does other things?

I was originally trying to make my own mini-addon, but whenever I try to run the game with it in my addons folder ROM won't take it. I swear I followed all the directions in the addon tutorial, your help on making a macro, and also asked around. Anyway I know the lua is correct, but it won't run as an addon, so I've decided to give trying with that.

But here's the file contents if you can figure out what's wrong with it:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
bron = {}

function bron.wws()
	FocusUnit(2,"target")
	CastSpellByName("Whirlwind Shield")
	TargetUnit("focus2")
	FocusUnit(2,"")
end

function bron.prayer()
	if (UnitExists("target")) then
		FocusUnit(2, "target");
	end
	TargetUnit("pet");
	CastSpellByName("Elven Prayer");
	if (UnitExists("focus2")) then
		TargetUnit("focus2");
		FocusUnit(2, "");
	else
		TargetUnit(nil);
	end
end


Would the DISCE be able to check if target is self and set it to nil or your last target?

Like for example, whenever my Priest casts Enhanced GOL without a target I end up targeting myself. Whenever my Knight casts WWS without a target I'm stuck targeting myself.

Would you be able to put something in the DIYSCE that can be called after a /cast that checks for self target and clears/restores previous target? Or any other way to implement this?

Unrelated to the untarget question, but would the DIYSCE be able to implement the pet heal lua listed above, and possibly enable the pet skill once a pet summons? Seeing as somebody reported ntbuff broke and PetAbilityAlwaysOn was running the same way, I can only assume they both broke.
[sigpic][/sigpic]
Others: Zeria 17P/21K, Zelah 15Wd/9S

Class Maximum Expansion Ticket
Credit to indyin99 for showing me this.

Yes, it exists. Is it actually obtainable? No. When will we get to use it? No clue.

But feel free to gaze at it and dream.

251

Friday, April 23rd 2010, 12:19am

Anyone got one of these scripts for a Knight Rogue?

252

Friday, April 23rd 2010, 2:27am

Quoted from "Sixpax;260953"

First I need to clarify a couple of things... is that message popping up in your chat box with the name of the skill that's not available? Or is it popping up in the middle of your screen?

Also, how often are you hitting the macro?


in the middle of your screen.

Maybe I hit the macro too often? I would say my frequency is similar to......playing a STG game...:D

253

Friday, April 23rd 2010, 6:47am

been looking at all the pages and still stuck.

I have the knight basic code along with rouge/knight. But i cant seem to work out how to add the rouge skill to the knight. I tried and found that the it would cast shadow stab , but wouldnt cast the seal or punishment.
here is my code.

function KnightGeneric(arg1,arg2)
local Skill = {}
local i = 0
local energy = UnitMana("player")
local mana = UnitSkill("player")
local friendly = (not UnitCanAttack("player","target"))
local shield = (GetEquipSlotInfo(17) ~= nil)
local combat = GetPlayerCombatState()
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
i=i+1; Skill = { ['name'] = "Whirlwind Shield", ['use'] = ((not friendly) and shield) }
i=i+1; Skill[i] = { ['name'] = "Enhanced Armor", ['use'] = (not string.find(pbuffs,"Enhanced Armor")) }
i=i+1; Skill[i] = { ['name'] = "Holy Seal", ['use'] = (not string.find(pbuffs,"Holy Seal")) }
i=i+1; Skill[i] = { ['name'] = "Threaten", ['use'] = (string.find(tbuffs,"Holy Seals 3") and (not string.find(pbuffs,"Threaten")) and (arg2 == "threaten")) }
i=i+1; Skill[i] = { ['name'] = "Mana Return", ['use'] = (string.find(tbuffs,"Holy Seals 3")) }
i=i+1; Skill[i] = { ['name'] = "Shadowstab", ['use'] = ((not friendly) and (energy >=70)) }
i=i+1; Skill[i] = { ['name'] = "Punishment", ['use'] = ((not friendly) and string.find(tbuffs,"Light Seal III")) }
i=i+1; Skill[i] = { ['name'] = "Holy Strike", ['use'] = (not friendly) }
MyCombat(Skill,arg1)
end

Thanks

Tigsman

Trainee

Posts: 126

Location: ATL

Occupation: Fixing Things

  • Send private message

254

Friday, April 23rd 2010, 2:24pm

holy seal not available to R/K, only K/R as a K primary skill.

not sure how a r/k gets to put on light seals to use punishment, but that would be a r/k skill question only you or someone with exp with an r/k can answer, not I.


T

255

Friday, April 23rd 2010, 3:01pm

is there a way to check if enough nature's power is available for a druid?

256

Friday, April 23rd 2010, 5:09pm

The short answer is yes.
My daughter plays a R/S and she was in a party of 3 rogues and healer who ran clops.
She called me and wanted me to modify her code to allow her to apply SS but not LB or GW. She wanted to leave that to the rogue tanking the group.
She said the rogue tank was doing 3.8K DPS average that way. She was using this for BOSS fights.

Quoted from "ZeroChow;260527"

Other group member rogue buff effect also work on my rogue skill?

257

Friday, April 23rd 2010, 6:21pm

Quoted from "bronislav84;261937"

Six would the DIYSCE be able to be used as part of a macro that does other things?


I'm not exactly sure what you mean by this. The functions in the combat engine are loaded globally, so you can run any of them from a macro or even from your own functions that you create in another .lua file.

Quoted from "bronislav84;261937"

I was originally trying to make my own mini-addon, but whenever I try to run the game with it in my addons folder ROM won't take it. I swear I followed all the directions in the addon tutorial, your help on making a macro, and also asked around. Anyway I know the lua is correct, but it won't run as an addon, so I've decided to give trying with that.


I'll be more than happy to help you with setting up your own addon. I have one I created (a group-based DPS meter) that runs perfectly so I do have some experience with setting one up from scratch. The only part I'm not adept with is making UI frames.

Send me a PM or start a new thread about your addon and I'll see what I can do.

Quoted from "bronislav84;261937"

But here's the file contents if you can figure out what's wrong with it:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
bron = {}

function bron.wws()
    FocusUnit(2,"target")
    CastSpellByName("Whirlwind Shield")
    TargetUnit("focus2")
    FocusUnit(2,"")
end

function bron.prayer()
    if (UnitExists("target")) then
        FocusUnit(2, "target");
    end
    TargetUnit("pet");
    CastSpellByName("Elven Prayer");
    if (UnitExists("focus2")) then
        TargetUnit("focus2");
        FocusUnit(2, "");
    else
        TargetUnit(nil);
    end
end
Would the DISCE be able to check if target is self and set it to nil or your last target?

Like for example, whenever my Priest casts Enhanced GOL without a target I end up targeting myself. Whenever my Knight casts WWS without a target I'm stuck targeting myself.

Would you be able to put something in the DIYSCE that can be called after a /cast that checks for self target and clears/restores previous target? Or any other way to implement this?


I think what's tripping you up is I'm pretty sure that even though you're assigning the current target to "focus2", if you don't have a "focus1" defined, it will reassign your's to "focus1". Try using "focus1" instead in that code and see if it works.

In regard to targeting nothing if you had nothing targeted, change this line:

Source code

1
      TargetUnit(nil)
To this:

Source code

1
      TargetUnit("")
See if that works.

Also, for what it's worth, you never need a semicolon at the end of a line. A semicolon is used to separate two different commands on the same line.

Quoted from "bronislav84;261937"

Unrelated to the untarget question, but would the DIYSCE be able to implement the pet heal lua listed above, and possibly enable the pet skill once a pet summons? Seeing as somebody reported ntbuff broke and PetAbilityAlwaysOn was running the same way, I can only assume they both broke.


Take a look at post #133 of this thread for an example of how to incorporate the pet heal into your custom function.

As for enabling a pet skill, I haven't been able to solve that one because it requires right-clicking on the skill, but there must be some command to perform that action.

258

Friday, April 23rd 2010, 6:25pm

Quoted from "snapcity;262353"

been looking at all the pages and still stuck.

I have the knight basic code along with rouge/knight. But i cant seem to work out how to add the rouge skill to the knight. I tried and found that the it would cast shadow stab , but wouldnt cast the seal or punishment.
here is my code.


Are you Knight/Rogue or Rogue/Knight?

259

Friday, April 23rd 2010, 7:03pm

Quoted from "Calico;262553"

is there a way to check if enough nature's power is available for a druid?


The last word I heard on Nature's Power was that the buff name doesn't indicate how many you have, just that you have some.

To check this using the combat engine code, you can run this command from your chat box after you have accumulated a few Nature's Power:

Source code

1
/run Msg(BuffList("player"))
If it still doesn't list how many Nature's Power you have, then the best you can do is use GetActionUsable() to verify the spell is available.

If you want to do this within the combat engine, make sure you have the version of the MyCombat() function from post #162 of this thread and then you can do your skills like so:

Source code

1
   i=i+1; Skill[i] = { name = "Action: 10",      use = (not friendly) }
Replace the number 10 with your hotbar location for whichever skill needs Nature's Power. Of course you can modify the "use" definition however you like.

260

Friday, April 23rd 2010, 7:21pm

Running into a bigger problem, myfunction.lua just doesn't seem to be loading at all. /run ReadSkills() returns nothing. File types are definitely correct, and it is in a subfolder of my addon folder. Did I break it?

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
g_skill = {}

function Msg(outstr,a1,a2,a3)
   DEFAULT_CHAT_FRAME:AddMessage(tostring(outstr),a1,a2,a3)
end

function ReadSkills()
   g_skill = {}
   local skillname,slot

   Msg("- Reading Class Skills")
   for page = 2,4 do
      slot = 1
      skillname = GetSkillDetail(page,slot)
      repeat
         local a1,a2,a3,a4,a5,a6,a7,a8,skillusable = GetSkillDetail(page,slot)
         if skillusable then
            g_skill[skillname] = { ['page'] = page, ['slot'] = slot }
         end
         slot = slot + 1
         skillname = GetSkillDetail(page,slot)
      until skillname == nil
   end
end
ReadSkills() -- Read skills into g_skill table at login

function PctH(tgt)
   return (UnitHealth(tgt)/UnitMaxHealth(tgt))
end

function ChkBuff(tgt,buffname)
   local cnt = 1
   local buffcmd = UnitBuff

   if UnitCanAttack("player",tgt) then
      buffcmd = UnitDebuff
   end
   local buff = buffcmd(tgt,cnt)

   while buff ~= nil do
      if string.gsub(buff, "(%()(.)(%))", "%2") == buffname then
         return true
      end
      cnt = cnt + 1
      buff = buffcmd(tgt,cnt)
   end
   return false
end

function BuffList(tgt)
   local cnt = 1
   local buffcmd = UnitBuff
   local buffstr = "/"

   if UnitCanAttack("player",tgt) then
      buffcmd = UnitDebuff
   end
   local buff = buffcmd(tgt,cnt)

   while buff ~= nil do
      buffstr = buffstr..buff.."/"
      cnt = cnt + 1
      buff = buffcmd(tgt,cnt)
   end

   return string.gsub(buffstr, "(%()(.)(%))", "%2")
end

function DebuffList(tgt)
   local cnt = 1
   local buffcmd = UnitDebuff
   local buffstr = "/"

   if UnitCanAttack("player",tgt) then
      buffcmd = UnitBuff
   end
   local buff = buffcmd(tgt,cnt)

   while buff ~= nil do
      buffstr = buffstr..buff.."/"
      cnt = cnt + 1
      buff = buffcmd(tgt,cnt)
   end

   return string.gsub(buffstr, "(%()(.*)(%))", "%2")
end

function CD(skillname)
   local firstskill = GetSkillDetail(2,1)
   if (g_skill[firstskill] == nil) or (g_skill[firstskill].page ~= 2) then
      ReadSkills()
   end

   if g_skill[skillname] ~= nil then
      local tt,cd = GetSkillCooldown(g_skill[skillname].page,g_skill[skillname].slot)
      return cd==0
   else
      Msg("Skill not available: "..skillname)
      return false
   end
end

function MyCombat(Skill,arg1)
   local spell_name,cast_max,cast_current = UnitCastingTime("player")
   local talktome = ((arg1 == "v1") or (arg1 == "v2"))
   local action,actioncd
   
   if spell_name ~= nil then
      if (arg1 == "v2") then Msg("- ['..spell_name..']",0,1,1) end
      return true
   end

   for x,tbl in ipairs(Skill) do
      if string.find(Skill[x].name, "Action:") then
         if Skill[x].use then
            action = tonumber((string.gsub(Skill[x].name, "(Action:)( *)(.*)", "%3")))
            _1,actioncd = GetActionCooldown(action)
            if GetActionUsable(action) and (actioncd == 0) then
               if talktome then Msg("- "..Skill[x].name) end
               UseAction(action)
               return true
            end
         end
      elseif string.find(Skill[x].name, "Item:") then
         if Skill[x].use then
            action = string.gsub(Skill[x].name, "(Item:)( *)(.*)", "%3")
            if talktome then Msg("- "..Skill[x].name) end
            UseItemByName(action)
            return true
         end
      elseif CD(Skill[x].name) and Skill[x].use then
         if talktome then Msg("- "..Skill[x].name) end
         CastSpellByName(Skill[x].name)
         return true
      end
   end
   if (arg1 == "v2") then Msg("- IDLE") end

   return false
end

function DruidWarden(arg1)
   local Skill = {}
   local i = 0
   local tgt = "player"
   local friendly = false
   local combat = GetPlayerCombatState()

   if not UnitCanAttack("player","target") then
      tgt = "target"
      friendly = true
   end
   local health = PctH(tgt)
   local pbuffs = BuffList("player")
   local tbuffs = BuffList("target")
   local dbuffs = DebuffList("player")

   i=i+1; Skill[i] = { ['name'] = "Rock Protection",                ['use'] = (PctH("player") <= .30) }
   i=i+1; Skill[i] = { ['name'] = "Elven Amulet",                ['use'] = (PctH("player") <= .70) }
   i=i+1; Skill[i] = { ['name'] = "Mother Earth's Protection",        ['use'] = ((friendly) and (PctH(tgt) <= .30)) }
   i=i+1; Skill[i] = { ['name'] = "Savage Blessing",                ['use'] = ((not combat) and (friendly) and (not string.find(tbuffs,"Savage Blessing"))) }
   i=i+1; Skill[i] = { ['name'] = "Concentration Prayer",           ['use'] = ((not combat) and (not string.find(pbuffs,"Concentration Prayer"))) }
   i=i+1; Skill[i] = { ['name'] = "Briar Shield",           ['use'] = ((not combat) and (not string.find(pbuffs,"Briar Shield"))) }
   i=i+1; Skill[i] = { ['name'] = "Antidote",                        ['use'] = (string.find(dbuffs,"Poisoned")) }
   i=i+1; Skill[i] = { ['name'] = "Antidote",                        ['use'] = (string.find(dbuffs,"Lethal Sting")) }
   i=i+1; Skill[i] = { ['name'] = "Antidote",                        ['use'] = (string.find(dbuffs,"Snake Poison")) }
   i=i+1; Skill[i] = { ['name'] = "Purify",                        ['use'] = (string.find(dbuffs,"Cursed")) }
   i=i+1; Skill[i] = { ['name'] = "Curing Seed",                    ['use'] = ((not friendly) and (health <= .60) and (not string.find(pbuffs,"Curing Seed"))) }
   i=i+1; Skill[i] = { ['name'] = "Curing Seed",                    ['use'] = ((friendly) and (health <= .60) and(not string.find(tbuffs,"Curing Seed"))) }}
   i=i+1; Skill[i] = { ['name'] = "Blossoming Life",                   ['use'] = ((not friendly) and (health <= .80) and (not string.find(pbuffs,"Blossoming Life"))) }
   i=i+1; Skill[i] = { ['name'] = "Blossoming Life",                ['use'] = ((friendly) and (health <= .80) and (not string.find(tbuffs,"Blossoming Life"))) }
   i=i+1; Skill[i] = { ['name'] = "Recover",                        ['use'] = ((((AbsHP("player")) > 2000) and (not string.find(pbuffs,"Life Guide"))) or ((friendly) and ((PctH(tgt)) <= .50) and (not string.find(tbuffs,"Recover")))) }
   i=i+1; Skill[i] = { ['name'] = "Restore Life",                   ['use'] = ((friendly) and ((PctH(tgt)) <= .60)) }
   i=i+1; Skill[i] = { ['name'] = "Weakening Seed",                 ['use'] = ((not friendly) and (ChkBuff(tgt,"Weakening Seed"))) }
   i=i+1; Skill[i] = { ['name'] = "Earth Pulse",                       ['use'] = (not friendly) }
   i=i+1; Skill[i] = { ['name'] = "Briar Entwinement",                 ['use'] = ((not friendly) and (not string.find(tbuffs,"Briar Entwinement"))) }
   i=i+1; Skill[i] = { ['name'] = "Rockslide",                 ['use'] = ((not friendly) and (not string.find(tbuffs,"Rockslide"))) }
   i=i+1; Skill[i] = { ['name'] = "Earth Arrow",                       ['use'] = (not friendly) }

   MyCombat(Skill,arg1)
end