Quoted from "spamely;339029"
well, yes, thats THE way to do it. without a macro. you press TAB.
Quoted from "ghostwolf82;341673"
Thanks for the information which I obviously already knew..
|
|
Source code |
1 2 3 4 5 6 7 8 9 |
if enemy then
if tWound then
TargetNearestEnemy()
i=i+1; Skill[i] = { name = "Attack", use = true }
end-- i=i+1; Skill[i] = { name = "Wound Attack", use = ((energy >= 35) and tBleed and tWound) }
i=i+1; Skill[i] = { name = "Low Blow", use = ((energy >= 30) and tBleed) }
i=i+1; Skill[i] = { name = "Shadowstab", use = ((energy >= 43) and (not (string.find(tbuffs,"Blind Spot Bleed") or tBleed))) }
i=i+1; Skill[i] = { name = "Disarmament", use = ((not tDisarmed) or (BuffTimeLeft("target","Disarmament") <= 3)) }
end
|
|
|
Source code |
1 |
local tDead = UnitIsDeadOrGhost() |
|
|
Source code |
1 2 3 4 |
if tDead then
TargetNearestEnemy()
i=i+1; Skill[i] = { name = "Attack", use = true }
end
|
Quoted from "Cajule;341530"
Anyway, I do have another question, and I havent gotten a chance to test this yet.
Found your post on the party check function.
![]()
Source code
1 2 3 4local solo = true if GetNumPartyMembers() > 1 then solo = false end
|
|
Source code |
1 |
local party = (GetNumPartyMembers() > 0) |
Quoted from "Cajule;341530"
![]()
Source code
1 2i=i+1; Skill[i] = { ['name'] = "Combat Master", ['use'] = ((solo) and (not string.find(pbuffs,"Combat Master"))) } i=i+1; Skill[i] = { ['name'] = "Informer", ['use'] = ((solo) and (not string.find(pbuffs,"Informer"))) }
What I want to accomplish here, is cast Informer if in a group, but the CD for it is 5 minutes and duration of only 60 seconds. While Combat Master is a 15 minute self buff, with no CD. So if in a party cast Informer, but if it is gone and it is on CD, then pop Combat Master. Regardless, I would still want Informer going off every 5 minutes, boss fight or not. So in between, for 4 minutes a rogue would still have that crit buff.
Not sure how to even word my thoughts here, I may need to eat lol. I could try something like the psudo range check with a (melee)/(not melee) check as was done with Shadowstab. If it was on CD it just wont cast, but it would still need to cast Combat Master.
Im not sure if Informer will cancel for party members if say, you cast it then drop it to get CM which more than likely has more TP put into it.
Edit: After thinking about this, if you where in a party the solo check would always return as false, so it would never cast CM. I'll have to work this one out in game, but most of you guys on here are a bit more savvy than I, and probably already know how to work it out.![]()
|
|
Source code |
1 2 |
i=i+1; Skill[i] = { ['name'] = "Informer", ['use'] = ((party) and (not string.find(pbuffs,"Informer"))) }
i=i+1; Skill[i] = { ['name'] = "Combat Master", ['use'] = ((not string.find(pbuffs,"Informer")) and (not string.find(pbuffs,"Combat Master"))) }
|
Quoted from "Cajule;341530"
Anyway, I do have another question, and I havent gotten a chance to test this yet.
Found your post on the party check function.
![]()
Source code
1 2 3 4local solo = true if GetNumPartyMembers() > 1 then solo = false end
What I want to accomplish here, is cast Informer if in a group, but the CD for it is 5 minutes and duration of only 60 seconds. While Combat Master is a 15 minute self buff, with no CD. So if in a party cast Informer, but if it is gone and it is on CD, then pop Combat Master. Regardless, I would still want Informer going off every 5 minutes, boss fight or not. So in between, for 4 minutes a rogue would still have that crit buff.
![]()
Source code
1 2i=i+1; Skill[i] = { ['name'] = "Combat Master", ['use'] = ((solo) and (not string.find(pbuffs,"Combat Master"))) } i=i+1; Skill[i] = { ['name'] = "Informer", ['use'] = ((solo) and (not string.find(pbuffs,"Informer"))) }
|
|
Source code |
1 |
local solo = (GetNumPartyMembers() < 2) |
|
|
Source code |
1 2 |
i=i+1; Skill[i] = { name = "Informer", use = ((not solo) and combat) }
i=i+1; Skill[i] = { name = "Combat Master", use = ((not string.find(pbuffs, "Combat Master")) and (not string.find(pbuffs, "Informer"))) }
|
Quoted from "spamely;341705"
so assuming you declare a variable for dead (which you may use for looting)
![]()
Source code
1 local tDead = UnitIsDeadOrGhost()
|
|
Source code |
1 |
local tDead = UnitIsDeadOrGhost("target")
|
BE CAREFUL! This will not loot the body as it is right now. Consider the fact that when UnitIsDeadOrGhost("target") is true, UnitCanAttack("player", "target") is false. And since the UnitCanAttack check is used by 99% of the scripts to determine friendly/enemy status, any DIYCE script lines with enemy status in them will be false as well. Meaning the only line that is guaranteed to run when MyCombat is called is the Attack line. Which will then attack the freshly targetted, full health enemy instead of looting the body. Fine if you're a warrior or a knight, not so fine if you're a mage or a priest. But there are ways around this. First you can set up the macro to look like this:
Quoted from "spamely;341705"
![]()
Source code
1local tDead = UnitIsDeadOrGhost("target")
then you have
![]()
Source code
1 2 3 4if tDead then TargetNearestEnemy() i=i+1; Skill[i] = { name = "Attack", use = true } end
|
|
Source code |
1 |
/run if UnitIsDeadOrGhost("target") then CastSpellByName("Attack"); TargetNearestEnemy(); end; WarriorRogue()
|
|
|
Source code |
1 2 3 4 5 6 |
i=i+1; Skill[i] = { name = "Attack", use = tDead }
MyCombat(Skill,arg1)
if tDead then
TargetNearestEnemy()
end
end
|
Quoted from "Silandro;341889"
BE CAREFUL! This will not loot the body as it is right now.
|
|
Source code |
1 2 3 |
local tDead = UnitIsDeadOrGhost()
i=i+1; Skill[i] = { ['name'] = "Attack", ['use'] = (tDead or (not combat and not enemy)) }
|
Quoted from "Sixpax;341726"
You can simplify the solo declaration/check like so:
I'm not sure if it returns 1 or zero when not in a party, but I do know that it does count yourself when you are in a party, thus the < 2 check.
![]()
Source code
1 local solo = (GetNumPartyMembers() < 2)
What I think you're looking for as far as the buffs is to cast Informer whenever you're in a party and it's available, otherwise cast CM.
So here's how I'd code that:
Make sure you have the combat variable defined.
![]()
Source code
1 2i=i+1; Skill[i] = { name = "Informer", use = ((not solo) and combat) } i=i+1; Skill[i] = { name = "Combat Master", use = ((not string.find(pbuffs, "Combat Master")) and (not string.find(pbuffs, "Informer"))) }
So this casts Informer any time you're not solo and you're in combat. It casts CM whether you're in a party or not as long as you have neither buff on you.
|
|
Source code |
1 2 3 4 5 6 |
-- Boss/Cast check
local isboss = (UnitSex("target") >= 2)
local tspell,ttime,telapsed = UnitCastingTime("target")
-- From post #396
local interrupt_list = "/Crimson Whirl/Counter/" -- "/Fireball/Thunderstorm/Spell of Doom/" interrupt skill
|
|
|
Source code |
1 2 3 4 |
i=i+1; Skill[i] = { ['name'] = "Silence", ['use'] = ((isboss) and (tspell ~= nil) and string.find(interrupt_list,tspell)) }
-- uses no checks for boss or specific spells being cast. Just checks if a spell is being cast by the mob, and cast silence, or whichever interupt you have for your class.
i=i+1; Skill[i] = { ['name'] = "Silence", ['use'] = ((not friendly) and (tspell ~= nil) and (ttime >= 1) and ((ttime - telapsed) > 0.5) and (energy >= 15)) }
|
Quoted from "Cajule;341930"
![]()
Source code
1 2 3local tDead = UnitIsDeadOrGhost("target") i=i+1; Skill[i] = { ['name'] = "Attack", ['use'] = (tDead or (not combat and not enemy)) }
This works, "if" you are close enough to the dead mob. That is what is in mine, which I got from this thread somewhere. I know this is about a "macro", dunno if this helps or not.
|
|
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 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 |
function WarriorRogue(arg1, potslot)
local Skill = {}
local i = 0
local combat = GetPlayerCombatState()
local friendly = (not UnitCanAttack("player", "target"))
local enemy = (UnitCanAttack("player","target"))
local rage = UnitMana("player")
local energy = UnitSkill("player")
local tbuffs = BuffList("target")
local pbuffs = BuffList("player")
local front = UnitIsUnit("player", "targettarget")
local tDead = UnitIsDeadOrGhost("target")
local melee = GetActionUsable(32)
local LockedOn = UnitExists("target")
local _1,potcd
if potslot ~= nil then
_1,potcd=GetActionCooldown(potslot)
end
if (PctH("player")<.70) and (potcd == 0) then
UseAction(potslot)
return
end
i=i+1; Skill[i] = { name = "Survival Instinct", use = (PctH("player") < .33) }
i=i+1; Skill[i] = { name = "Throw", use = ((not friendly) and (not melee) and (not CD("Shadow Step")) and (not CD("Surprise Attack"))) }
i=i+1; Skill[i] = { name = "Shadow Step", use = ((not friendly) and (not melee) and not CD("Surprise Attack")) }
i=i+1; Skill[i] = { name = "Surprise Attack", use = ((not friendly) and (not melee)) }
i=i+1; Skill[i] = { name = "Blind Stab", use = (front and (not friendly) and (not string.find(tbuffs,"Blind"))) }
i=i+1; Skill[i] = { name = "Shadowstab", use = ((not friendly) and (not string.find(tbuffs,"Excessive Bleeding"))and (not CD("Probing Attack"))) }
i=i+1; Skill[i] = { name = "Enraged", use = (rage < 50) }
i=i+1; Skill[i] = { name = "Slash", use = ((not friendly) and (rage >= 25) and (not string.find(tbuffs,"/Bleed/"))) }
i=i+1; Skill[i] = { name = "Splitting Chop", use = ((not friendly) and (rage >= 15) and (string.find(tbuffs,"Weakened"))) }
i=i+1; Skill[i] = { name = "Thunder", use = ((not friendly) and (rage >= 15) and (string.find(tbuffs,"Weakened"))) }
i=i+1; Skill[i] = { name = "Open Flank", use = ((not friendly) and (rage >= 10) and (string.find(tbuffs,"Vulnerable"))) }
i=i+1; Skill[i] = { name = "Keen Attack", use = ((not friendly) and (energy >= 20) and (string.find(tbuffs,"Vulnerable"))) }
i=i+1; Skill[i] = { name = "Probing Attack", use = ((not friendly) and (rage >= 20)) }
i=i+1; Skill[i] = { name = "Blood Dance", use = ((not friendly) and (PctH("player") >= 0.8)) }
i=i+1; Skill[i] = { name = "Attack", use = ((not friendly) and (PctH("target") == 1)) }
i=i+1; Skill[i] = { name = "Slash", use = ((not friendly) and (rage >= 40)) }
i=i+1; Skill[i] = { name = "Shadowstab", use = (not friendly) }
i=i+1; Skill[i] = { name = "Attack", use = tDead }
MyCombat(Skill,arg1)
if tDead then
TargetNearestEnemy()
end
if (not LockedOn) then
TargetNearestEnemy()
end
end
function RogueWarrior(arg1, potslot)
local Skill = {}
local i = 0
local combat = GetPlayerCombatState()
local friendly = (not UnitCanAttack("player", "target"))
local enemy = (UnitCanAttack("player","target"))
local rage = UnitMana("player")
local energy = UnitSkill("player")
local tbuffs = BuffList("target")
local pbuffs = BuffList("player")
local front = UnitIsUnit("player", "targettarget")
local tDead = UnitIsDeadOrGhost("target")
local melee = GetActionUsable(32)
local LockedOn = UnitExists("target")
local _1,potcd
if potslot ~= nil then
_1,potcd=GetActionCooldown(potslot)
end
if (PctH("player")<.70) and (potcd == 0) then
UseAction(potslot)
return
end
i=i+1; Skill[i] = { name = "Poison", use = ((not string.find(pbuffs, "Poisonous") and (not combat))) }
i=i+1; Skill[i] = { name = "Premeditation", use = ((not friendly) and (not string.find(pbuffs,"Premeditation") and (not combat))) }
i=i+1; Skill[i] = { name = "Assassins Rage", use = (not friendly) }
i=i+1; Skill[i] = { name = "Throw", use = ((not friendly) and (not melee) and (not CD("Shadow Step"))) }
i=i+1; Skill[i] = { name = "Shadow Step", use = ((not front) and (not friendly) and (not melee)) }
-- i=i+1; Skill[i] = { name = "Blind Spot", use = ((not front) and (not friendly) and (rage >=30)) }
i=i+1; Skill[i] = { name = "Blind Stab", use = (front and (not friendly) and (not string.find(tbuffs,"Blind"))) }
i=i+1; Skill[i] = { name = "Poisonous Infection",use = ((not friendly) and (string.find(pbuffs, "Poisonous")) and (energy >= 20)) }
i=i+1; Skill[i] = { name = "Poison Spray", use = ((not friendly) and (string.find(tbuffs, "Poison")) and (energy >= 15)) }
i=i+1; Skill[i] = { name = "Enraged", use = (energy < 50) }
i=i+1; Skill[i] = { name = "Slash", use = ((not friendly) and (energy >= 40)) }
i=i+1; Skill[i] = { name = "Wound Attack", use = ((not friendly) and (rage >=35) and string.find(tbuffs,"Bleed") and string.find(tbuffs,"Grievous Wound")) }
i=i+1; Skill[i] = { name = "Low Blow", use = ((not friendly) and (rage >=35) and string.find(tbuffs,"Bleed")) }
i=i+1; Skill[i] = { name = "Shadowstab", use = ((not friendly) and (rage >=35)) }
i=i+1; Skill[i] = { name = "Enraged", use = (energy < 50) }
i=i+1; Skill[i] = { name = "Slash", use = ((not friendly) and (energy >= 25) and (not string.find(tbuffs,"/Bleed/"))) }
i=i+1; Skill[i] = { name = "Whirlwind", use = ((not friendly) and (energy >= 50)) }
i=i+1; Skill[i] = { name = "Attack", use = ((not friendly) and (PctH("target") == 1)) }
i=i+1; Skill[i] = { name = "Slash", use = ((not friendly) and (energy >= 40)) }
i=i+1; Skill[i] = { name = "Shadowstab", use = (not friendly) }
i=i+1; Skill[i] = { name = "Attack", use = tDead }
MyCombat(Skill,arg1)
if tDead then
TargetNearestEnemy()
end
if (not LockedOn) then
TargetNearestEnemy()
end
end
function WarriorMage(arg1, potslot)
local Skill = {}
local i = 0
local combat = GetPlayerCombatState()
local friendly = (not UnitCanAttack("player", "target"))
local enemy = (UnitCanAttack("player","target"))
local rage = UnitMana("player")
local energy = UnitSkill("player")
local tbuffs = BuffList("target")
local pbuffs = BuffList("player")
local front = UnitIsUnit("player", "targettarget")
local tDead = UnitIsDeadOrGhost("target")
local melee = GetActionUsable(32)
local LockedOn = UnitExists("target")
local _1,potcd
if potslot ~= nil then
_1,potcd=GetActionCooldown(potslot)
end
if (PctH("player")<.70) and (potcd == 0) then
UseAction(potslot)
return
end
i=i+1; Skill[i] = { name = "Surprise Attack", use = ((not friendly) and (melee)) }
i=i+1; Skill[i] = { name = "Enraged", use = (rage < 50) }
i=i+1; Skill[i] = { name = "Electrical Rage", use = ((not friendly) and (rage >= 20) and (not string.find(pbuffs,"High Voltage III"))) }
i=i+1; Skill[i] = { name = "Slash", use = ((not friendly) and (rage >= 25) and (not string.find(tbuffs,"/Bleed/"))) }
i=i+1; Skill[i] = { name = "Thunder", use = ((not friendly) and (rage >= 15) and (string.find(tbuffs,"Weakened"))) }
i=i+1; Skill[i] = { name = "Open Flank", use = ((not friendly) and (rage >= 10) and (string.find(tbuffs,"Vulnerable"))) }
i=i+1; Skill[i] = { name = "Probing Attack", use = ((not friendly) and (rage >= 20)) }
i=i+1; Skill[i] = { name = "Lightning's Touch", use = (not friendly) }
i=i+1; Skill[i] = { name = "Attack", use = ((not friendly) and (PctH("target") == 1)) }
i=i+1; Skill[i] = { name = "Slash", use = ((not friendly) and (rage >= 40)) }
i=i+1; Skill[i] = { name = "Attack", use = tDead }
MyCombat(Skill,arg1)
if tDead then
TargetNearestEnemy()
end
if (not LockedOn) then
TargetNearestEnemy()
end
end
function PriestKnight(arg1, potslot)
local Skill = {}
local i = 0
local combat = GetPlayerCombatState()
local friendly = (not UnitCanAttack("player", "target"))
local enemy = (UnitCanAttack("player","target"))
local rage = UnitMana("player")
local energy = UnitSkill("player")
local tbuffs = BuffList("target")
local pbuffs = BuffList("player")
local front = UnitIsUnit("player", "targettarget")
local tDead = UnitIsDeadOrGhost("target")
local melee = GetActionUsable(32)
local LockedOn = UnitExists("target")
local _1,potcd
if potslot ~= nil then
_1,potcd=GetActionCooldown(potslot)
end
if (PctH("player")<.70) and (potcd == 0) then
UseAction(potslot)
return
end
i=i+1; Skill[i] = { name = "Heal", use = (PctH("player") < .50) }
i=i+1; Skill[i] = { name = "Urgent Heal", use = (PctH("player") < .70) }
i=i+1; Skill[i] = { name = "Regenerate", use = ((PctH("player") < .80)and (not string.find(pbuffs, "Regenerate"))) }
i=i+1; Skill[i] = { name = "Wave Armor", use = (not string.find(pbuffs,"Wave Armor")) }
i=i+1; Skill[i] = { name = "Bone Chill", use = ((not friendly) and (not string.find(tbuffs, "Bone Chill"))) }
i=i+1; Skill[i] = { name = "Chain of Light", use = ((not friendly) and (string.find(pbuffs,"Wave Armor"))) }
i=i+1; Skill[i] = { name = "Rising Tide", use = (not friendly) }
i=i+1; Skill[i] = { name = "Attack", use = tDead }
MyCombat(Skill,arg1)
if tDead then
TargetNearestEnemy()
end
if (not LockedOn) then
TargetNearestEnemy()
end
end
function PriestWarrior(arg1, potslot)
local Skill = {}
local i = 0
local combat = GetPlayerCombatState()
local friendly = (not UnitCanAttack("player", "target"))
local enemy = (UnitCanAttack("player","target"))
local rage = UnitMana("player")
local energy = UnitSkill("player")
local tbuffs = BuffList("target")
local pbuffs = BuffList("player")
local front = UnitIsUnit("player", "targettarget")
local tDead = UnitIsDeadOrGhost("target")
local melee = GetActionUsable(32)
local LockedOn = UnitExists("target")
local _1,potcd
if potslot ~= nil then
_1,potcd=GetActionCooldown(potslot)
end
if (PctM("player")<.50) and (potcd == 0) then
UseAction(potslot)
return
end
i=i+1; Skill[i] = { name = "Holy Aura", use = (PctH("player") <= .20) }
i=i+1; Skill[i] = { name = "Soul Source", use = (PctH("player") <= .25) }
i=i+1; Skill[i] = { name = "Defensive Formation",use = ((not friendly) and (PctH("player") <= .55) and (not string.find(pbuffs,"Defensive Formation"))) }
i=i+1; Skill[i] = { name = "Berserk", use = ((not friendly) and (PctH("player") <= .60) and (not string.find(pbuffs,"Berserk"))) }
i=i+1; Skill[i] = { name = "Heal", use = (PctH("player") < .50) }
i=i+1; Skill[i] = { name = "Urgent Heal", use = (PctH("player") < .70) }
i=i+1; Skill[i] = { name = "Regenerate", use = ((PctH("player") < .80) and (not string.find(pbuffs, "Regenerate"))) }
i=i+1; Skill[i] = { name = "Wave Armor", use = ((combat) and (not string.find(pbuffs,"Wave Armor")) and (rage >= 200)) }
i=i+1; Skill[i] = { name = "Battle Monk Stance", use = ((combat) and (not string.find(pbuffs,"Battle Monk Stance"))) }
-- i=i+1; Skill[i] = { name = "Ice Fog", use = ((not friendly) and (not string.find(tbuffs, "Ice Fog I")) and (not melee)) }
i=i+1; Skill[i] = { name = "Bone Chill", use = ((not friendly) and (not string.find(tbuffs, "Bone Chill")) and (rage >= 100) and (PctH("target") > .50)) }
i=i+1; Skill[i] = { name = "Enraged", use = (energy < 50) }
-- i=i+1; Skill[i] = { name = "Chain of Light", use = ((not friendly) and (string.find(pbuffs,"Wave Armor"))) }
i=i+1; Skill[i] = { name = "Slash", use = ((not friendly) and (energy >= 25) and (not string.find(tbuffs,"/Bleed/"))) }
i=i+1; Skill[i] = { name = "Whirlwind", use = ((not friendly) and (energy >= 50)) }
i=i+1; Skill[i] = { name = "Slash", use = ((not friendly) and (energy >= 25)) }
-- i=i+1; Skill[i] = { name = "Rising Tide", use = ((not friendly) and (rage >= 40) and (not melee))}
i=i+1; Skill[i] = { name = "Fighting Spirit Combination", use = ((not friendly) and (combat)) }
i=i+1; Skill[i] = { name = "Explosion of Fighting Spirit", use = ((not friendly) and (combat)) }
i=i+1; Skill[i] = { name = "Attack", use = ((not friendly) and (PctH("target") == 1)) }
i=i+1; Skill[i] = { name = "Attack", use = tDead }
MyCombat(Skill,arg1)
if tDead then
TargetNearestEnemy()
end
if (not LockedOn) then
TargetNearestEnemy()
end
end
function RogueScout(arg1, potslot)
local Skill = {}
local i = 0
local combat = GetPlayerCombatState()
local friendly = (not UnitCanAttack("player", "target"))
local enemy = (UnitCanAttack("player","target"))
local rage = UnitMana("player")
local energy = UnitSkill("player")
local tbuffs = BuffList("target")
local pbuffs = BuffList("player")
local front = UnitIsUnit("player", "targettarget")
local tDead = UnitIsDeadOrGhost("target")
local melee = GetActionUsable(32)
local LockedOn = UnitExists("target")
local _1,potcd
if potslot ~= nil then
_1,potcd=GetActionCooldown(potslot)
end
if (PctH("player")<.70) and (potcd == 0) then
UseAction(potslot)
return
end
i=i+1; Skill[i] = { name = "Poison", use = ((not string.find(pbuffs, "Poisonous") and (not combat))) }
i=i+1; Skill[i] = { name = "Premeditation", use = ((not friendly) and (not string.find(pbuffs,"Premeditation") and (not combat))) }
i=i+1; Skill[i] = { name = "Assassins Rage", use = (not friendly) }
i=i+1; Skill[i] = { name = "Shot", use = ((not friendly) and (not melee)) }
i=i+1; Skill[i] = { name = "Vampire Arrows", use = ((not friendly) and (not string.find(tbuffs,"Vampire Arrows")) and (not melee)) }
-- i=i+1; Skill[i] = { name = "Shadow Step", use = ((not front) and (not friendly) and (not melee)) }
-- i=i+1; Skill[i] = { name = "Blind Spot", use = ((not front) and (not friendly) and (rage >=30)) }
i=i+1; Skill[i] = { name = "Wrist Attack", use = ((not friendly) and (not string.find(tbuffs,"Wrist Attack"))) }
i=i+1; Skill[i] = { name = "Blind Stab", use = (front and (not friendly) and (not string.find(tbuffs,"Blind"))) }
i=i+1; Skill[i] = { name = "Joint Blow", use = ((not friendly) and (not string.find(tbuffs,"Slow"))) }
i=i+1; Skill[i] = { 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 (rage >=35) and string.find(tbuffs,"Bleed") and string.find(tbuffs,"Grievous Wound")) }
i=i+1; Skill[i] = { name = "Low Blow", use = ((not friendly) and (rage >=35) and string.find(tbuffs,"Bleed")) }
i=i+1; Skill[i] = { name = "Shadowstab", use = ((not friendly) and (rage >=35)) }
i=i+1; Skill[i] = { name = "Shot", use = (not friendly) }
i=i+1; Skill[i] = { name = "Attack", use = ((not friendly) and (PctH("target") == 1)) }
i=i+1; Skill[i] = { name = "Shadowstab", use = (not friendly) }
i=i+1; Skill[i] = { name = "Attack", use = tDead }
MyCombat(Skill,arg1)
if tDead then
TargetNearestEnemy()
end
if (not LockedOn) then
TargetNearestEnemy()
end
end
|
Quoted
/run MageDruid("v2","")
my MageDruid.lua looks like this:
Quoted
DIYCE.lua
MageDruid.lua
Quoted
function MageDruid(arg1, arg2)
local Skill = {}
local i = 0
local health = PctH("player")
local mana = PctM("player")
local friendly = (not UnitCanAttack("player", "target"))
local combat = GetPlayerCombatState()
local interrupt_list = "/Fireball/Thunderstorm/Spell of Doom/Poison/"
local tspell,ttime,telapsed = UnitCastingTime("target")
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local isboss = (UnitSex("target") >= 2) -- tests to see if enemy is an elite or better
local LockedOn = UnitExists("target")
-- Heals
i=i+1; Skill = { ['name'] = "Action: 7", ['use'] = (health <= .50) } -- Health Potion in Slot 2
i=i+1; Skill[i] = { ['name'] = "Action: 8", ['use'] = (mana <= .50) } -- Mana Potion in Slot 3
i=i+1; Skill[i] = { ['name'] = "Recover", ['use'] = ((health <= .70) and (not string.find(pbuffs,"Recover")))
i=i+1; Skill[i] = { ['name'] = "Recover", ['use'] = (health <= .35) }
-- Buffs
i=i+1; Skill[i] = { ['name'] = "Perception", ['use'] = (not string.find(pbuffs,"Perception")) } -- Mage/Druid Elite 15
i=i+1; Skill[i] = { ['name'] = "Magic Target", ['use'] = (not combat and not string.find(pbuffs,"Magic Target")) } -- Mage/Druid Elite 20
i=i+1; Skill[i] = { ['name'] = "Savage Blessing", ['use'] = (not combat and not string.find(pbuffs,"Savage Blessing")) } -- May want to take this out since physical accuracy is mostly useless for you
i=i+1; Skill[i] = { ['name'] = "Fire Ward", ['use'] = (not string.find(pbuffs,"Fire Ward")) }
i=i+1; Skill[i] = { ['name'] = "Electrostatic Charge", ['use'] = (not string.find(pbuffs,"Electrostatic Charge")) }
i=i+1; Skill[i] = { ['name'] = "Mother Earth's Protection", ['use'] = ((health <= .40) and (not string.find(pbuffs,"Electrostatic Charge"))) } -- In case Electrostatic Charge is still on cooldown and you're getting hit hard
i=i+1; Skill[i] = { ['name'] = "Elemental Catalysis", ['use'] = (not string.find(pbuffs,"Elemental Catalysis")) }
i=i+1; Skill[i] = { ['name'] = "Intensification", ['use'] = (not string.find(pbuffs,"Intensification")) }
-- Ranged Attack
i=i+1; Skill[i] = { ['name'] = "Silence", ['use'] = ((not friendly) and (tspell ~= nil) and (ttime >= 1) and ((ttime - telapsed) > 0.5) and (mana >= .05)) }
i=i+1; Skill[i] = { ['name'] = "Flame", ['use'] = ((not friendly) and (PctH("target") >= .20)) }
i=i+1; Skill[i] = { ['name'] = "Lightning", ['use'] = (not string.find(tbuffs,"Lightning")) }
i=i+1; Skill[i] = { ['name'] = "Plasma Arrow", ['use'] = (not string.find(pbuffs,"Charged")) }
i=i+1; Skill[i] = { ['name'] = "Meteor Shower", ['use'] = (combat and string.find(tbuffs,"Lightning")) }
i=i+1; Skill[i] = { ['name'] = "Fireball", ['use'] = ((not friendly) and (PctH("target") <= .20)) }
-- Loot or interact with NPC
i=i+1; Skill[i] = { ['name'] = "Attack", ['use'] = (tDead or (not combat and not enemy)) }
MyCombat(Skill,arg1)
if tDead then
TargetNearestEnemy()
end
if (not LockedOn) then
TargetNearestEnemy()
end
end
function DebuffList(tgt)
local cnt = 1
local buffstr = "/"
local buff = UnitDebuff(tgt,cnt)
while buff ~= nil do
buffstr = buffstr..buff.."/"
cnt = cnt + 1
buff = UnitDebuff(tgt,cnt)
end
return string.gsub(buffstr, "(%()(.)(%))", "%2")
end
function NaturesBuff()
local cnt = 1
local buff, icon, power = UnitBuffInfo("player",cnt)
while buff ~= nil do
if buff == "Nature's Power" then
return power
end
cnt = cnt + 1
buff, icon, power = UnitBuffInfo("player",cnt)
end
return 0
end
function DruidMage(arg1,arg2)
local Skill = {}
local i = 0
local health = PctH("player")
local mana = PctM("player")
local friendly = (not UnitCanAttack("player", "target"))
local combat = GetPlayerCombatState()
local interrupt_list = "/Fireball/Thunderstorm/Spell of Doom/Poison/"
local tspell,ttime,telapsed = UnitCastingTime("target")
local pbuffs = BuffList("player")
local dbuffs = DebuffList("player")
local tbuffs = BuffList("target")
local isboss = (UnitSex("target") >= 2) -- tests to see if enemy is an elite or better
local npower = NaturesBuff()
local LockedOn = UnitExists("target")
-- Heals & Mana
i=i+1; Skill[i] = { ['name'] = "Mother Earth's Protection", ['use'] = (health <= .30) }
i=i+1; Skill[i] = { ['name'] = "Recover", ['use'] = (health <= .40) }
i=i+1; Skill[i] = { ['name'] = "Curing Seed", ['use'] = (health <= .50) }
i=i+1; Skill[i] = { ['name'] = "Restore Life", ['use'] = ((health <= .60) and (npower <=2))} -- use this ahead of Recover if low on Natures Power
i=i+1; Skill[i] = { ['name'] = "Action: 7", ['use'] = (health <= .50) } -- Health Potion in Slot 2
i=i+1; Skill[i] = { ['name'] = "Recover", ['use'] = ((health <= .60) and (not string.find(pbuffs,"Recover"))) }
i=i+1; Skill[i] = { ['name'] = "Action: 8", ['use'] = (mana <= .50) } -- Mana Potion in Slot 3
i=i+1; Skill[i] = { ['name'] = "Antidote", ['use'] = (string.find(dbuffs,"Poison")) }
i=i+1; Skill[i] = { ['name'] = "Purify", ['use'] = (string.find(dbuffs,"Curse")) }
i=i+1; Skill[i] = { ['name'] = "Blossoming Life", ['use'] = ((health <= .80) and (not string.find(pbuffs,"Blossoming Life"))) }
-- Buffs
i=i+1; Skill[i] = { ['name'] = "Savage Blessing", ['use'] = (not combat and not string.find(pbuffs,"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'] = "Fire Ward", ['use'] = (not string.find(pbuffs,"Fire Ward")) }
i=i+1; Skill[i] = { ['name'] = "Intensification", ['use'] = (not string.find(pbuffs,"Intensification")) }
-- Ranged Attack
i=i+1; Skill[i] = { ['name'] = "Binding Silence", ['use'] = ((not friendly) and (tspell ~= nil) and (ttime >= 1) and ((ttime - telapsed) > 0.5) and (mana >= .05)) }
i=i+1; Skill[i] = { ['name'] = "Silence", ['use'] = ((not friendly) and (tspell ~= nil) and (ttime >= 1) and ((ttime - telapsed) > 0.5) and (mana >= .05)) }
i=i+1; Skill[i] = { ['name'] = "Briar Entwinement", ['use'] = (not string.find(tbuffs,"Briar Entwinement")) }
i=i+1; Skill[i] = { ['name'] = "Weakening Seed", ['use'] = ((not string.find(tbuffs,"Weakening Seed")) and (npower >= 3)) }
i=i+1; Skill[i] = { ['name'] = "Lightning", ['use'] = (not string.find(tbuffs,"Lightning")) }
i=i+1; Skill[i] = { ['name'] = "Fireball", ['use'] = ((not friendly) and (PctH("target") <= .20)) }
i=i+1; Skill[i] = { ['name'] = "Rockslide", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Earth Arrow", ['use'] = (not friendly) }
--Loot or interact with NPC
i=i+1; Skill[i] = { ['name'] = "Attack", ['use'] = (tDead or (not combat and not enemy)) }
MyCombat(Skill,arg1)
if tDead then
TargetNearestEnemy()
end
if (not LockedOn) then
TargetNearestEnemy()
end
end
|
|
Source code |
1 |
local tDead = UnitIsDeadOrGhost("target")
|
Quoted
] tags, then the leading spaces don't get removed.
Quoted