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.

121

Wednesday, March 17th 2010, 6:16pm

Quoted from "Sixpax;246018"

If I'm not mistaken, the bleed from Shadowstab is called "Shadowstab Bleed" and the one from Slash is just "Bleed". Please correct me if I'm wrong there.

...

I think Sneak Attack and maybe even Blind Spot have their own bleed names as well (not sure), so you might want to check for those names in your Rogue attacks too.


They are all, including Blind Spot an Sneak attack, simply "Bleed" unless it's changed in a recent patch. I haven't played a warrior or the rogue half in a while, but that's the way it used to be.

Further the Slash bleed has a distinct icon, but as I recall the Blind Spot, Shadowstab and Sneak Attack icons are indistinguishable. Sneak Attack adds an additional debuff for the stun component.

122

Wednesday, March 17th 2010, 6:33pm

Quoted from "ghostbiker;246052"

Also i noticed if i spam to fast at the start of a fight sometimes target area and bloodarrow turn off and onn a few times before it settles down.


What you're probably experiencing is what I call "overlap", where you're running the function again before the previous run has time to finish. You should be able to safely spam it 2-3 times per second, but more than that and you'll run into this type of problem.

Quoted from "ghostbiker;246052"

heres my set up so far, note its in 2 parts as i have 2 macro keys scoutgroup / scoutsolo self explanitry realy, 1 uses blood arrow the other drops blood and picks up vamp


I think I can give you everything you want in a single function, rather than making two, unless they are drastically different, but that doesn't appear to be the case.

I'm adding a check to see if you're in combat for the BA usage, and another check to see if you're solo or not. Also, because you're doing so many ChkBuff operations, I changed it so that it captures all of your buffs at the beginning into a string called "pbuffs", then it's just a matter of using string.find() on that. That will speed up the execution time because it only has to check your buffs one time rather multiple times (one for each ChkBuff operation).

Give this one a try:

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
function ScoutTest(arg1)
   local Skill = {}
   local i = 0
   local focus = UnitMana("player")
   local friendly = (not UnitCanAttack("player","target"))
   local combat = GetPlayerCombatState()
   local solo = ((GetNumPartyMembers() == 0) and (GetNumRaidMembers() == 0))
   local a1,a2,a3,a4,a5,ASon = GetActionInfo(29)  -- # is your Autoshot slot number
   local pbuffs = BuffList("player")
   
   i=i+1; Skill[i] = { ['name'] = "Frost Arrow",    ['use'] = (not string.find(pbuffs,"Frost Arrow")) }
   i=i+1; Skill[i] = { ['name'] = "Serenity",       ['use'] = ((not CD("Concentration")) and (not string.find(pbuffs,"Concentration")) and (focus < 15)) }
   i=i+1; Skill[i] = { ['name'] = "Target Area",    ['use'] = ((not string.find(pbuffs,"Target Area")) and (focus > 20)) }
   i=i+1; Skill[i] = { ['name'] = "Concentration",  ['use'] = ((not string.find(pbuffs,"Concentration")) and (focus <= 30)) }
   i=i+1; Skill[i] = { ['name'] = "Blood Arrow",    ['use'] = ((not solo) and combat and (PctH("player") >= .7) and (not string.find(pbuffs, "Blood Arrow"))) }
   i=i+1; Skill[i] = { ['name'] = "Blood Arrow",    ['use'] = (string.find(pbuffs, "Blood Arrow") and ((not combat) or (PctH("player") < .4))) }
   i=i+1; Skill[i] = { ['name'] = "Autoshot",       ['use'] = ((not friendly) and (not ASon)) }
   i=i+1; Skill[i] = { ['name'] = "Combo Shot",     ['use'] = (not friendly) }
   i=i+1; Skill[i] = { ['name'] = "Shot",           ['use'] = (not friendly) }
   i=i+1; Skill[i] = { ['name'] = "Vampire Arrows", ['use'] = ((not friendly) and solo and (focus >= 20)) }
   i=i+1; Skill[i] = { ['name'] = "Wind Arrows",    ['use'] = ((not friendly) and (focus >= 15)) }

   MyCombat(Skill,arg1)
end
That's untested, so I called it ScoutTest in case it doesn't work you can revert to your other ones until I fix it.

123

Wednesday, March 17th 2010, 6:35pm

Quoted from "delve;246135"

They are all, including Blind Spot an Sneak attack, simply "Bleed" unless it's changed in a recent patch. I haven't played a warrior or the rogue half in a while, but that's the way it used to be.


To be sure, put the Shadowstab bleed on the target and run the macro I posted. Then do the same for Slash. That will tell you if they are indeed the same name.

124

Wednesday, March 17th 2010, 8:27pm

I use 7 different versions of your script for my S/W one for questing (fast/instant dps) one for instance trash (fast dps with blood arrow) and one for boss fights (fully self-buffing then MAX dps) the other 4 are varying versions of those with/without blood arrow and with/without peircing arrow (for those boss fights where AoE is NOT adivised)

here is the full boss script tweaked for max dps (on S/W of course)

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
function Scoutboss(arg1,arg2)
   local Skill = {}
   local i = 0
   local hp = (UnitHealth("player")/UnitMaxHealth("player"))
   local focus = UnitMana("player")
   local rage = UnitSkill("player")
   local friendly = (not UnitCanAttack("player","target"))
   local tbuffs = BuffList("target")
   local pbuffs = BuffList("player")

   i=i+1; Skill[i] = { ['name'] = "Target Area",     ['use'] = ((not friendly) and (focus >= 20) and (not string.find(pbuffs,"Target Area"))) }
   i=i+1; Skill[i] = { ['name'] = "Blood Arrow",     ['use'] = ((hp >= .80) and (not string.find(pbuffs,"Blood Arrow"))) }
   i=i+1; Skill[i] = { ['name'] = "Concentration",     ['use'] = ((not friendly) and (not string.find(pbuffs,"Concentration"))) }
   i=i+1; Skill[i] = { ['name'] = "Enraged",           ['use'] = ((not friendly) and (rage <= 30)) }
   i=i+1; Skill[i] = { ['name'] = "Target Lock",    ['use'] = ((not friendly) and (focus >= 30) and (not string.find(tbuffs,"Target Lock"))) }
   i=i+1; Skill[i] = { ['name'] = "Berserk",    ['use'] = ((not friendly) and (rage >= 25) and (not string.find(pbuffs,"Berserk")) and (not string.find(pbuffs,"Defensive Formation"))) }
   i=i+1; Skill[i] = { ['name'] = "Serenity",     ['use'] = ((not friendly) and (not string.find(pbuffs,"Berserk")) and (rage >=30)) }
   i=i+1; Skill[i] = { ['name'] = "Arrow of Essence",     ['use'] = ((not friendly) and (string.find(pbuffs,"Berserk"))) }
   i=i+1; Skill[i] = { ['name'] = "Vampire Arrows",     ['use'] = ((not friendly) and (focus >= 50)) }   
   i=i+1; Skill[i] = { ['name'] = "Combo Shot",     ['use'] = (not friendly) }
   i=i+1; Skill[i] = { ['name'] = "Shot",           ['use'] = (not friendly) }
   i=i+1; Skill[i] = { ['name'] = "Piercing Arrow", ['use'] = (not friendly) }
   i=i+1; Skill[i] = { ['name'] = "Shot",           ['use'] = (not friendly) }
   i=i+1; Skill[i] = { ['name'] = "Wind Arrows",    ['use'] = ((not friendly) and (focus >= 20)) }
   i=i+1; Skill[i] = { ['name'] = "Shot",           ['use'] = (not friendly) }



the only thing this script is missing is a way to call out skills by their slot numbers such as for macro's or food buffs (the quick 30sec long ones)

125

Thursday, March 18th 2010, 2:11am

Quoted from "Sixpax;246157"

To be sure, put the Shadowstab bleed on the target and run the macro I posted. Then do the same for Slash. That will tell you if they are indeed the same name.



I tried it

Source code

1
/run Msg(BuffList("target"))
did shadowstab bleed with dagger and got
/Bleed/

did slash bleed with axe and got
/Bleed/

did bot on target at same time got
/Bleed/Bleed/

adBuffBars addon is able to distinguish some how the two bleed with it's down timer and icon. Has to be a way.
Blueman0x76 has attached the following images:
  • RAScrnShot_20100317_200621.png
  • RAScrnShot_20100317_2006212.png

126

Thursday, March 18th 2010, 2:39am

I think I've found a way to distinguish the two types of bleed.

Using code:

Source code

1
/script for i=1,100,1 do local name, icon, count, ID = UnitDebuff("target",i);Msg(i..name..ID);end
I was able to determine
ID------Bleed
500081 Slash
500654 Shadowstab

Althought, I'm not sure if the ID number will change over time or not.
I've confirmed that both Slash and Shadowstab Bleed both share the exact names, but found they have different Icons and ID number associated with them.

127

Thursday, March 18th 2010, 5:39am

I use Axe/Dagger. Dagger for shadowstab and Axe for everything else.
Here is my macro for R/W

First I use this macro every time time i log in to initialize

Source code

1
2
3
/run axename = "Shark Fin Axe"

/run daggername = "Bone Chipping Thorn"
Then I use this macro to fight

Source code

1
/run RogueWar("v2");
I need to swap axe/dagger around like guideshows, but LUA doesn't provide /wait command so I had to edit the Combat Engine a little.

Here is the complete code with edits

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
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, icon, count, ID = buffcmd(tgt,cnt)

   while buff ~= nil do
      buffstr = buffstr..buff.."/"..ID.."/"
      cnt = cnt + 1
      buff, icon, count, ID  = 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 = UnitCastingTime("player")
   local talktome = false
   
   if (arg1 == "v1") or (arg1 == "v2") then
      talktome = true
   end

   if spell_name ~= nil then
      if (arg1 == "v2") then Msg("- ['..spell_name..']",0,1,1) end
      return false
   end

   for x,tbl in ipairs(Skill) do
      if 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 MyCombatRW(Skill,arg1)
   local spell_name = UnitCastingTime("player")
   local talktome = false
   local _,_,mainhandname = GetInventoryItemDurable("player", 15)
   
   if (arg1 == "v1") or (arg1 == "v2") then
      talktome = true
   end

   if spell_name ~= nil then
      if (arg1 == "v2") then Msg("- ['..spell_name..']",0,1,1) end
      return false
   end
    
    --Msg("MH: ".. mainhandname);
    --Msg("Axe: ".. axename);
    
    for x,tbl in ipairs(Skill) do
        if CD(Skill[x].name) and Skill[x].use then
            if ((Skill[x].name == "Shadowstab") and (mainhandname == axename)) then
                PickupEquipmentItem(16) PickupEquipmentItem(15)
                if (arg1 == "v2") then Msg("- Swap to Dagger") end
                return
            elseif (Skill[x].name == "Shadowstab") then
                CastSpellByName(Skill[x].name)
                if talktome then Msg("- "..Skill[x].name) end
                return true
            end
            
            if (mainhandname ~= axename) then
                PickupEquipmentItem(16) PickupEquipmentItem(15)
                if (arg1 == "v2") then Msg("- Swap to Axe") end
                return
            else
                CastSpellByName(Skill[x].name)
                if talktome then Msg("- "..Skill[x].name) end
                return true
            end
        end
    end
    if (arg1 == "v2") then Msg("- IDLE") end

    return false
end


function RogueWar(arg1,arg2)
    local Skill = {}
    local i = 0
    local energy = UnitMana("player")
    local rage = UnitSkill("player")
    local friendly = (not UnitCanAttack("player","target"))
    local pbuffs = BuffList("player")
    local tbuffs = BuffList("target")
    local Shadowstab_Bleed = "500654" -- Slash/Shadowstab bleeds share the same exact name

    --Msg(tbuffs);
   
    i=i+1; Skill[i] = { ['name'] = "Wound Attack",   ['use'] = ((not friendly) and (energy >=35) and (string.find(tbuffs,Shadowstab_Bleed) and (string.find(tbuffs,"Grievous Wound")))) }
    i=i+1; Skill[i] = { ['name'] = "Low Blow",       ['use'] = ((not friendly) and (energy >=30) and (string.find(tbuffs,Shadowstab_Bleed))) }
    i=i+1; Skill[i] = { ['name'] = "Poisonous Infection",     ['use'] = ((not friendly) and (rage >=20) and string.find(pbuffs,"Poisonous") and string.find(tbuffs,"Bleed") and (not string.find(tbuffs,"Poisonous Infection"))) }
    i=i+1; Skill[i] = { ['name'] = "Shadowstab",     ['use'] = ((not friendly) and (energy >=75)) }
    i=i+1; Skill[i] = { ['name'] = "Slash",     ['use'] = ((not friendly) and (rage >=25)) }
    
    MyCombatRW(Skill,arg1)
end
Because Slash bleed and Shadowstab bleed used the same name I had to edit BuffList() to include the bleed ID which was different.

There is no /wait for LUA functions so I editted MyCombat() to do the axe/dagger swap.

128

Thursday, March 18th 2010, 2:51pm

Quoted from "redcrux;246244"

I use 7 different versions of your script for my S/W one for questing (fast/instant dps) one for instance trash (fast dps with blood arrow) and one for boss fights (fully self-buffing then MAX dps) the other 4 are varying versions of those with/without blood arrow and with/without peircing arrow (for those boss fights where AoE is NOT adivised)


Depending on how different the 7 are, you could consolidate them into fewer functions and use arg2 as a trigger for which version to run. For instance, you could run your macro like so:

/run ScoutWarrior("","boss")

and then in your skills have something like:

Source code

1
   i=i+1; Skill[i] = { name = "Blood Arrow",     use = ([B](arg2 == "boss") and [/B](hp  >= .80) and (not string.find(pbuffs,"Blood Arrow"))) }
Just something to think about. That could make it more complicated to maintain though, so it's entirely up to you.

Either way, I'm glad to see people getting some use out of this. :)

Quoted from "redcrux;246244"

the only thing this script is missing is a way to call out skills by their slot numbers such as for macro's or food buffs (the quick 30sec long ones)


What I do is put that as code within my macro. So here's an example of the one I run:

Source code

1
/run local tt,cd=GetActionCooldown(52); if (PctH("player")<.75) and (cd==0) then UseAction(52) else ScoutRogue() end
So assuming my health pots are in slot #52, that will check my health and its cooldown and drink if needed, otherwise it runs my custom function.

You could certainly add something like that to the combat engine itself instead if you prefer. I'd suggest passing the pot slot number as an argument to your function. So your function would have this code in it:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function SampleFunction(arg1,potslot)
   local _1,potcd
   if potslot ~= nil then
      _1,potcd=GetActionCooldown(potslot)
   end

   if (PctH("player")<.75) and (potcd == 0) then
      UseAction(potslot)
      return
   end

   <... rest of your code...>

end
And your macro would use the health pot number:

/run SampleFunction("",52)

129

Thursday, March 18th 2010, 2:53pm

Quoted from "Blueman0x76;246522"

Because Slash bleed and Shadowstab bleed used the same name I had to edit BuffList() to include the bleed ID which was different.

There is no /wait for LUA functions so I editted MyCombat() to do the axe/dagger swap.


Very nice customization. This is exactly why I created this engine in the first place so that others could tailor it to their specific needs.

Bravo!

130

Thursday, March 18th 2010, 4:20pm

To those who may concern, I use the following to cancel Blood Arrow. Save 1 second GCD! :D


function SearchBuffSlot(target,buffName)
local i = 1;
local r = 1;
while(UnitBuff(target,i) ~= buffName and UnitBuff(target,i)~=nil)do
if(UnitBuff(target,i) ~= buffName)then
r = r + 1;
end
i = i + 1;
end
if(SearchBuff(target,buffName)==false)then
r = 0;
end
return r;
end

/run CancelPlayerBuff(SearchBuffSlot("player", "Blood Arrow"));

131

Thursday, March 18th 2010, 4:43pm

Here's the one I use:

Source code

1
2
3
4
5
6
7
8
9
10
11
function CancelBuff(buffname)
    local i = 1
    while UnitBuff("player",i) ~= nil do
        if UnitBuff("player",i) == buffname then
            CancelPlayerBuff(i)
            return true
        end
        i = i + 1
    end
    return false
end
Usage: CancelBuff("Blood Arrow")

132

Sunday, March 21st 2010, 6:53pm

I am working on a combat macro for my wife who plays a warden. What I can't figure out is how to check pet status. I know the "pet" instead of "player" will look at the pet, but not sure how to tie it into the combat engine.

133

Monday, March 22nd 2010, 3:45pm

Quoted from "Geistware;247747"

I am working on a combat macro for my wife who plays a warden. What I can't figure out is how to check pet status. I know the "pet" instead of "player" will look at the pet, but not sure how to tie it into the combat engine.


I started working on that last night myself. The main problem I ran into was Elven Prayer requiring your pet to be targeted (how stupid is that... it's not like I'm going to cast it on anything else). For that I just put in some code before the Skill definitions to handle it.

I noticed the pet skills can be set to automatically fire so I didn't need to worry about managing them within the engine.

Be aware that my Warden is only level 11 so I'm still fairly ignorant of the challenges in playing the class, but I'll be happy to help if you can spell out what they are.

I don't have my code in front of me, but basically it looks something like this:

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
function WardenScout(arg1)
    local Skill = {}
    local i = 0
    local mana = UnitMana("player")/UnitMaxMana("player")
    local friendly = (not UnitCanAttack("player","target"))
    local pet = UnitExists("playerpet")
    local combat = GetPlayerCombatState()
   
    if pet then
        if (PctH("playerpet") < 0.5) and CD("Elven Prayer") then
            if UnitExists("target") then
                FocusUnit(1,"target")
                TargetUnit("playerpet")
                CastSpellByName("Elven Prayer")
                TargetUnit("focus1")
                FocusUnit(1,"")
                return
            else
                TargetUnit("playerpet")
                CastSpellByName("Elven Prayer")
                return
            end
        elseif combat and (not friendly) then
            UsePetAction(3)        -- Pet attacks my target
        end
    end

    i=i+1; Skill[i] = { name = "Briar Shield",                use = (not combat) }
    i=i+1; Skill[i] = { name = "Summon Spirit of the Oak",    use = ((not combat) and (not pet)) }
    i=i+1; Skill[i] = { name = "Shot",                        use = (not friendly) }
    i=i+1; Skill[i] = { name = "Thorny Vine",                 use = (not friendly) }
    i=i+1; Skill[i] = { name = "Vampire Arrows",              use = (not friendly) }
    i=i+1; Skill[i] = { name = "Power of the Wood Spirit",    use = (not friendly) }

   MyCombat(Skill,arg1)
end

jsalemi

Trainee

Posts: 133

Location: VA, USA

  • Send private message

134

Monday, March 22nd 2010, 5:37pm

Does BuffList also return debuffs on yourself, or would that require a new function? Reason I ask is I'm building combat functions for my druid/scout, and since the druid has a general skill that actually works and removes the "Poisoned" effect, it would be nice to automate it as part of the engine.

135

Monday, March 22nd 2010, 5:46pm

Yes, it only returns buffs on yourself. It does a check to see if the specified unit is friendly and if so, it uses the UnitBuff command (otherwise it uses the UnitDebuff command). You could add logic in there to use UnitDebuff on yourself or make a 2nd function to do the reverse behavior.

The same goes for the ChkBuff function.

So something like:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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
The name doesn't exactly make sense when using it on enemy targets, but you get the idea. :)

jsalemi

Trainee

Posts: 133

Location: VA, USA

  • Send private message

136

Monday, March 22nd 2010, 6:05pm

Wow, that was quick -- thanks, Sixpax! I'll let you know how it works out.

137

Monday, March 22nd 2010, 8:44pm

Being a low level WoW convert (31Druid/20scout) on Osha, I am very interested in what you come up with!

jsalemi

Trainee

Posts: 133

Location: VA, USA

  • Send private message

138

Tuesday, March 23rd 2010, 6:44pm

Here's the scout/druid, druid/scout routines I've been fine-tuning and using. Thanks to shadowmagi for the original druidscout() that I based mine on.

Note that these use the DebuffList() routine Sixpax posted a couple of messages up, so be sure to add it to your file.


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
function ScoutDruid(arg1)
   local Skill = {}
   local i = 0
   local focus = UnitMana("player")
   local mana  = UnitSkill("player")
   local friendly = (not UnitCanAttack("player","target"))
   local pbuffs = BuffList("player")
   local tbuffs = BuffList("target")
   local dbuffs = DebuffList("player")

   i=i+1; Skill[i] = { ['name'] = "Savage Blessing",   ['use'] = (not string.find(pbuffs,"Savage Blessing")) }
   i=i+1; Skill[i] = { ['name'] = "Frost Arrow",    ['use'] = (not string.find(pbuffs,"Frost Arrow")) }
   i=i+1; Skill[i] = { ['name'] = "Focus",            ['use'] = (not string.find(pbuffs,"Focus")) }
   i=i+1; Skill[i] = { ['name'] = "Antidote",        ['use'] = (string.find(dbuffs,"Poisoned")) }
--   i=i+1; Skill[i] = { ['name'] = "Target Area",    ['use'] = (not string.find(pbuffs,"Target Area") and (focus >= 85)) }
   i=i+1; Skill[i] = { ['name'] = "Combo Shot",     ['use'] = (not friendly) }
   i=i+1; Skill[i] = { ['name'] = "Shot",           ['use'] = (not friendly) }
   i=i+1; Skill[i] = { ['name'] = "Snake Poison Arrow", ['use'] = ((not friendly) and (mana >= 500)) }
   i=i+1; Skill[i] = { ['name'] = "Vampire Arrows", ['use'] = ((not friendly) and (focus >= 20)) }
   i=i+1; Skill[i] = { ['name'] = "Wind Arrows",    ['use'] = ((not friendly) and (focus >= 15)) }
--   i=i+1; Skill[i] = { ['name'] = "Piercing Arrow", ['use'] = (not friendly) }
   i=i+1; Skill[i] = { ['name'] = "Snipe",          ['use'] = (not friendly) }

   MyCombat(Skill,arg1)
end

function DruidScout(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'] = "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'] = "Antidote",                        ['use'] = (string.find(dbuffs,"Poisoned")) }
   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'] = "Camellia Flower",                   ['use'] = ((not friendly) and (health <= .70) and (not string.find(pbuffs,"Camellia Flower"))) }
   i=i+1; Skill[i] = { ['name'] = "Camellia Flower",                ['use'] = ((friendly) and (health <= .70) and (not string.find(tbuffs,"Camellia Flower"))) }
   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'] = "Briar Entwinement",                 ['use'] = ((not friendly) and (not string.find(tbuffs,"Briar Entwinement"))) }
   i=i+1; Skill[i] = { ['name'] = "Earth Arrow",                       ['use'] = (not friendly) }
   i=i+1; Skill[i] = { ['name'] = "Camellia Flower",                ['use'] = (friendly) }
   i=i+1; Skill[i] = { ['name'] = "Weakening Seed",                 ['use'] = ((not friendly) and (ChkBuff(tgt,"Weakening Seed"))) }
--   i=i+1; Skill[i] = { ['name'] = "Binding Silence",                ['use'] = (not friendly) }

   MyCombat(Skill,arg1)
end

139

Friday, March 26th 2010, 12:48am

Quoted from "Sixpax;214214"

This one is a baseline Knight function so it won't have any secondary or elite skills. We can use this one to build on for the various different Knight combos.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function KnightGeneric(arg1,arg2)
   local Skill = {}
   local i = 0
   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[i] = { ['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'] = "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
You'll have to pass it the string "threaten" as the 2nd argument if you want to use the Threaten skill or not. So that way you can have one macro for soloing:

Source code

1
/run KnightGeneric()
and one for grouping:

Source code

1
/run KnightGeneric("","threaten")


This macro has been working great for me but I found one small issue. If you are using threaten but for some reason end up with not enough mana to cast it, the macro wont move on to mana return.

140

Friday, March 26th 2010, 4:15am

For people who want to use Auto Attack as part of their rotation you must edit the ReadSkill() function since "Attack" is in page1.

Change this line of code

Source code

1
   for page = 2,4 do
to

Source code

1
   for page = 1,4 do
I use

Source code

1
i=i+1; Skill[i] = { ['name'] = "Attack",     ['use'] = ((not  friendly)) }
because when I tab target a new mob but have no energy/rage left as a rogue I want it to start doing white dmg