Add your class specific function below all that code (in the DIYCE.lua file). If there isn't a function already posted for your class combo, start with one that someone else posted and modify it to suit your class, or ask for one and we'll get you started.
).|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
function ScoutDruid(arg1)
local Skill = {}
local i = 0
local focus = UnitMana("player")
local mana = UnitSkill("player")
local friendly = (not UnitCanAttack("player","target"))
i=i+1; Skill[i] = { ['name'] = "Savage Blessing", ['use'] = (not ChkBuff("player","Savage Blessing")) }
i=i+1; Skill[i] = { ['name'] = "Frost Arrow", ['use'] = (not ChkBuff("player","Frost Arrow")) }
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 >= 50)) }
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
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
function RogueScout(arg1,arg2)
local Skill = {}
local i = 0
local energy = UnitMana("player")
local friendly = (not UnitCanAttack("player","target"))
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
i=i+1; Skill[i] = { ['name'] = "Combat Master", ['use'] = (not string.find(pbuffs,"Combat Master")) }
i=i+1; Skill[i] = { ['name'] = "Poison", ['use'] = ((not combat) and (not string.find(pbuffs,"Poison"))) }
i=i+1; Skill[i] = { ['name'] = "Disarmament", ['use'] = (not string.find(tbuffs,"Disarmament IV") and (energy <=35)) }
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)) }
i=i+1; Skill[i] = { ['name'] = "Vampire Arrows", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Shot", ['use'] = (not friendly) }
MyCombat(Skill,arg1)
end
|
|
|
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 |
g_skill = {}
function PctH(tgt)
local num=(UnitHealth(tgt)/UnitMaxHealth(tgt))
return num
end
function AbsHP(tgt)
local num=(UnitMaxHealth(tgt)-UnitHealth(tgt))
return num
end
function CancelBuff(buffname)
local counter=0
local currentbuff="none"
repeat
if currentbuff == buffname then
CancelPlayerBuff(counter)
return true
else
counter=counter+1
end
currentbuff=UnitBuff("player",counter)
until currentbuff == nil
return false
end
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 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 buff == 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 buffstr
end
function DebuffList(tgt)
local cnt = 1
local buffcmd = UnitDeBuff
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 buffstr
end
function CD(skillname)
if g_skill[skillname] ~= nil then
if skillname ~= GetSkillDetail(g_skill[skillname].page,g_skill[skillname].slot) then
ReadSkills()
end
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 ScoutDruid(arg1)
local a1,a2,a3,a4,a5,a6=GetActionInfo(2)
if not a6 then
CastSpellByName("Autoshot")
end
local Skill = {}
local i = 0
local focus = UnitMana("player")
local friendly = (not UnitCanAttack("player","target"))
local combat = GetPlayerCombatState()
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
-- i=i+1; Skill[i] = { ['name'] = "Antidote", ['use'] = (string.find(pbuffs,"Snake Poison")) }
-- i=i+1; Skill[i] = { ['name'] = "Curse Breaker", ['use'] = (string.find(pbuffs,"")) }
-- i=i+1; Skill[i] = { ['name'] = "Unbinding Magic", ['use'] = (string.find(pbuffs,"Cold","")) }
i=i+1; Skill[i] = { ['name'] = "Focus", ['use'] = ((not combat) and (not string.find(pbuffs,"Focus"))) }
i=i+1; Skill[i] = { ['name'] = "Savage Blessing", ['use'] = ((not combat) and (not string.find(pbuffs,"Savage Blessing"))) }
i=i+1; Skill[i] = { ['name'] = "Frost Arrow", ['use'] = ((not combat) and (not string.find(pbuffs,"Frost Arrow"))) }
-- i=i+1; Skill[i] = { ['name'] = "Recover", ['use'] = (AbsHP("player") > 2000) }
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'] = "Vampire Arrows", ['use'] = ((not friendly) and (focus >= 20)) }
i=i+1; Skill[i] = { ['name'] = "Snake Poison Arrow", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Wind Arrows", ['use'] = ((not friendly) and (focus >= 15)) }
-- i=i+1; Skill[i] = { ['name'] = "Snipe", ['use'] = (not friendly) }
MyCombat(Skill,arg1)
end
function ScoutKnight(arg1)
local a1,a2,a3,a4,a5,a6=GetActionInfo(2)
if not a6 then
CastSpellByName("Autoshot")
end
local Skill = {}
local i = 0
local focus = UnitMana("player")
local friendly = (not UnitCanAttack("player","target"))
local combat = GetPlayerCombatState()
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
i=i+1; Skill[i] = { ['name'] = "Enhanced Armor", ['use'] = ((not combat) and (not string.find(pbuffs,"Enhanced Armor"))) }
i=i+1; Skill[i] = { ['name'] = "Frost Arrow", ['use'] = ((not combat) and (not string.find(pbuffs,"Frost Arrow"))) }
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'] = "Vampire Arrows", ['use'] = ((not friendly) and (focus >= 20)) }
-- i=i+1; Skill[i] = { ['name'] = "Disarmament", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Wind Arrows", ['use'] = ((not friendly) and (focus >= 15)) }
-- i=i+1; Skill[i] = { ['name'] = "Snipe", ['use'] = (not friendly) }
MyCombat(Skill,arg1)
end
function DruidScout(tgt,arg1)
local Skill = {}
local i = 0
local focus = UnitSkill("player")
local friendly = (not UnitCanAttack("player","target"))
local combat = GetPlayerCombatState()
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
i=i+1; Skill[i] = { ['name'] = "Blossoming Life", ['use'] = (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 ((AbsHP(tgt) > 2000) and (not string.find(tbuffs,"Recover"))) }
i=i+1; Skill[i] = { ['name'] = "Restore Life", ['use'] = ((AbsHP(tgt) > 3000) }
i=i+1; Skill[i] = { ['name'] = "Camellia Flower", ['use'] = (friendly) }
MyCombat(Skill,arg1)
end
|
|
|
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 DruidScout(tgt,arg1)
local Skill = {}
local i = 0
local focus = UnitSkill("player")
local friendly = (not UnitCanAttack("player","target"))
local combat = GetPlayerCombatState()
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
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 (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'] = "Curing Seed", ['use'] = ((friendly) and (not string.find(tbuffs,"Curing Seed"))) }
i=i+1; Skill[i] = { ['name'] = "Camellia Flower", ['use'] = ((friendly) and (not string.find(tbuffs,"Camellia Flower"))) }
i=i+1; Skill[i] = { ['name'] = "Blossoming Life", ['use'] = ((friendly) 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 ((AbsHP(tgt)) > 2000) and (not string.find(tbuffs,"Recover")))) }
i=i+1; Skill[i] = { ['name'] = "Restore Life", ['use'] = ((friendly) and ((AbsHP(tgt)) > 3000)) }
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
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
function MagePriest(arg1)
local Skill = {}
local i = 0
local mana = UnitMana("player")
local friendly = (not UnitCanAttack("player","target"))
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
i=i+1; Skill[i] = { ['name'] = "Holy Aura", ['use'] = (PctH("player") <= .30) }
i=i+1; Skill[i] = { ['name'] = "Elemental Weakness", ['use'] = (not string.find(tbuffs,"Elemental Weakness")) }
i=i+1; Skill[i] = { ['name'] = "Magic Drain", ['use'] = (not string.find(tbuffs,"Drain")) }
i=i+1; Skill[i] = { ['name'] = "Electric Bolt", ['use'] = (not string.find(tbuffs,"Electric Flux")) }
i=i+1; Skill[i] = { ['name'] = "Fireball", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Rising Tide", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Flame", ['use'] = (not friendly) }
MyCombat(Skill,arg1)
end
|
|
|
Source code |
1 |
lastEBCast = 0; |
|
|
Source code |
1 |
lastEBCast = os.time(); |
|
|
Source code |
1 |
((os.difftime(os.time(), lastEBCast) > 12) || (not ChkBuff("target", "Electric Bolt")))
|
Quoted from "manekineko;230339"
Has anyone had luck with a W/S or S/W macro? I've tried to alter the code from the S/R post without a ton of luck. I'd like a W/S primary macro that cycles through the important stuff:
Vampire Arrow
Aim for the Wound
Surprise Attack
Skull Breaker
Slash
Tactical Attack
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
[FONT=Courier New]function WarriorScout(arg1)
local Skill = {}
local i = 0
local friendly = (not UnitCanAttack("player", "target"))
local rage = UnitMana("player")
local focus = UnitSkill("player")
local tbuffs = BuffList("target")
local tspell,ttime,telapsed = UnitCastingTime("target")
i=i+1; Skill[i] = { name = "Throat Attack", use = ((not friendly) and (tspell ~= nil) and (ttime >= 1) and ((ttime - telapsed) > 0.5)) }
i=i+1; Skill[i] = { name = "Enraged", use = (rage <= 50) }
i=i+1; Skill[i] = { name = "Survival Instinct", use = (PctH("player") < .25) }
i=i+1; Skill[i] = { name = "Vampire Arrows", use = ((not friendly) and (focus >= 20)) }
i=i+1; Skill[i] = { name = "Aim for the Wound", use = ((not friendly) and (focus >= 30) and (rage < 25)) }
i=i+1; Skill[i] = { name = "Skull Breaker", use = ((not friendly) and (focus >= 30) and (rage < 25)) }
i=i+1; Skill[i] = { name = "Tactical Attack", use = ((not friendly) and (rage >= 15) and string.find(tbuffs,"Bleed")) }
i=i+1; Skill[i] = { name = "Slash", use = ((not friendly) and (rage >= 25)) }
i=i+1; Skill[i] = { name = "Shot", use = (not friendly) }
MyCombat(Skill,arg1)
end[/FONT]
|
Quoted from "manekineko;230339"
and maybe even one that throws the two AOE skills (Moon Cleave, Blasting Cyclone) into the mix.
Quoted from "manekineko;230339"
Also, any advice for a macro that is helpful for scout secondaries? I don't think I'll have the TP to boost too many scout primary skills.
A lot of people, especially those who only use Scout as their secondary, don't realize how important Shot is. They look at it as just another ranged attack. It's sooo much more than that, primarily because it does not trigger the GCD, meaning Shot doesn't replace other attacks that (might) do more damage. It delays them slightly, but does not replace them. It's my belief that to maximize DPS when you have Scout as your secondary, you should use Shot as often as it's ready. You'll obviously want a decent bow, especially one with a fast speed (2.0s preferably), and to max out Speed Shooting Mastery. The faster you make Shot happen, the higher your DPS will be. Of course, you'll also want to max out Shot itself. So I would highly suggest you move Shot up to near the top of that order once you're happy with the damage that it does. 
Quoted from "manekineko;230410"
Perhaps there's a way to put a rage check on aftw and sb so slash will supercede them if there is enough rage built up already?
|
|
Source code |
1 2 3 |
i=i+1; Skill[i] = { ['name'] = "Aim for the Wound", ['use'] = ((not friendly) and (focus >= 30) and (rage < 25)) }
i=i+1; Skill[i] = { ['name'] = "Skull Breaker", ['use'] = ((not friendly) and (focus >= 30) and (rage < 25)) }
i=i+1; Skill[i] = { ['name'] = "Slash", ['use'] = ((not friendly) and (rage >= 25)) }
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
[FONT=Courier New]function WarriorScout(arg1)
local Skill = {}
local i = 0
local friendly = (not UnitCanAttack("player","target"))
local rage = UnitMana("player")
local focus = UnitSkill("player")
local tbuffs = BuffList("target")
local tspell = UnitCastingTime("target")
i=i+1; Skill[i] = { ['name'] = "Throat Attack", ['use'] = ((not friendly) and (tspell ~= nil)) }
i=i+1; Skill[i] = { ['name'] = "Enraged", ['use'] = (rage <= 50) }
i=i+1; Skill[i] = { ['name'] = "Vampire Arrows", ['use'] = ((not friendly) and (focus >= 20)) }
i=i+1; Skill[i] = { ['name'] = "Shot", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Aim for the Wound", ['use'] = ((not friendly) and (focus >= 30) and (rage < 25)) }
i=i+1; Skill[i] = { ['name'] = "Skull Breaker", ['use'] = ((not friendly) and (focus >= 30) and (rage < 25)) }
i=i+1; Skill[i] = { ['name'] = "Tactical Attack", ['use'] = ((not friendly) and (rage >= 15) and string.find(tbuffs,"Bleed")) }
i=i+1; Skill[i] = { ['name'] = "Slash", ['use'] = ((not friendly) and (rage >= 25)) }
MyCombat(Skill,arg1)
end[/FONT]
|
Quoted from "Tigsman;219239"
thank you.
I havent tested my code for functionality yet, but this is what I'll give a go tomorrow.
T
![]()
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 34function KWCombat(arg1,arg2) local Skill = {} local i = 0 local tgt = "player" local rage = UnitSkill("player") local friendly = (not UnitCanAttack("player","target")) local shield = true local health = PctH("player") local tgtcast = UnitCastingTime("target") if GetEquipSlotInfo(17) == nil then shield = false end local pbuffs = BuffList("player") local tbuffs = BuffList("target") i=i+1; Skill[i] = { ['name'] = "Holy Shield", ['use'] = (health <= .20) } i=i+1; Skill[i] = { ['name'] = "Resolution", ['use'] = (health <= .33) } -- i=i+1; Skill[i] = { ['name'] = "Shield of Atonement", ['use'] = ((not friendly) and (health <= .40) and shield) } -- i=i+1; Skill[i] = { ['name'] = "Shield of Valor", ['use'] = ((not friendly) and (health <= .50) and shield) } -- i=i+1; Skill[i] = { ['name'] = "Shield of Discipline", ['use'] = ((not friendly) and (tgtcast ~= nil) 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 Seal III") and (not string.find(pbuffs,"Threaten")) and (arg2 == "threaten")) } i=i+1; Skill[i] = { ['name'] = "Mana Return", ['use'] = (string.find(tbuffs,"Holy Seal III")) } i=i+1; Skill[i] = { ['name'] = "Whirlwind Shield", ['use'] = ((not friendly) and shield) } i=i+1; Skill[i] = { ['name'] = "Punishment", ['use'] = (string.find(tbuffs,"Light Seal III")) } i=i+1; Skill[i] = { ['name'] = "Disarmament", ['use'] = (not string.find(tbuffs,"Disarmament IV") and (arg2 == "disarm")) } i=i+1; Skill[i] = { ['name'] = "Slash", ['use'] = ((not friendly) and (rage >=75)) } i=i+1; Skill[i] = { ['name'] = "Holy Strike", ['use'] = (not friendly) } MyCombat(Skill,arg1) end
Quoted from "Durelsh;234651"
Also anyone know how i could pop Hatred strike at beginning in threaten mode or should i just go manual with that?
Quoted from "Durelsh;234651"
i must say , im a bit confused on the coding you guys throwing around for Threaten or mana return , threaten no longer consumes holy seals , so you can threaten and then mana return , by the time threaten cd comes back you should have 3 Holy seals back on. Tigs function seems to work exactly like that as is.....