Quoted from "ItIsFinished22;446926"
I was wondering about the cd==0.4 change. I know that for some it increased the DPS for scouts. I've been using it for about a year now and it works great. Was that minor tweak only meant for a scouts DIYCE script because of the ability to pull shot off before the actual CD is truly up?
I have a Wd/W and am wondering if I should put it back to cd==0 when playing Wd/W?
Location: Dominating in 3vs3, 6vs6 and siege.
Occupation: Network Administrator for a local NBC T.V. station.
Quoted from "Drake1132;446993"
First, please note that that should be "cd <= 0.4", not "cd == 0.4". You want it to return true for any cd value of 0.4 or less, including 0.0, rather than only returning true for 0.4 exactly and false for all other values.
Other than that, in my experience, there is no reason to change it back. While classes other than Scout may not see a great improvement by keeping the change, they may see at least some minor improvement, and it shouldn't cause any problems at all, so why switch back and forth?
Basically the change allows you to anticipate the end of the cooldown period and take advantage of differences between the cooldown on the server vs. that on the client (differences largely present due to net lag).
Drake
. As for my question, thank you for clearing that up. I was testing out my Wd/W combo last night and it seemed as if I was hitting slower than if I was clicking the skills manually.
Quoted from "ItIsFinished22;447007"
Oops. I'm not sure why I typed "cd == 0.4" instead of "cd <= 0.4". I was up late last night taking advantage of the double xp event and am tired today. As for my question, thank you for clearing that up. I was testing out my Wd/W combo last night and it seemed as if I was hitting slower than if I was clicking the skills manually.
|
|
Source code |
1 |
/run TargetUnit("")
|
|
|
Source code |
1 2 3 |
if (tdead) then
TargetUnit("")
end
|
Quoted from "Drake1132;446993"
First, please note that that should be "cd <= 0.4", not "cd == 0.4". You want it to return true for any cd value of 0.4 or less, including 0.0, rather than only returning true for 0.4 exactly and false for all other values.
Other than that, in my experience, there is no reason to change it back. While classes other than Scout may not see a great improvement by keeping the change, they may see at least some minor improvement, and it shouldn't cause any problems at all, so why switch back and forth?
Basically the change allows you to anticipate the end of the cooldown period and take advantage of differences between the cooldown on the server vs. that on the client (differences largely present due to net lag).
Drake
Quoted from "Vaeliorin;448406"
The only reason I've found to change it is for my S/M. I have it set up so that whenever an enemy gets within range for lightning, it will use lightning, and without having cd == 0 lightning never goes off, as the game never considers it ready for use (I use GetActionUsable() to determine if the enemy is in range for lightning.)
Granted, I never play my S/M in instances, where the increase in DPS is actually relevant.
Quoted from "ghostwolf82;448377"
Ok, so for some reason using this in-game works just fine to de-select your target
However, this does nothing
![]()
Source code
1/run TargetUnit("")
By now, most of you know/use the tdead variable, so no puns about not declaring that please. So the question is: why does this do nothing and yet the macro works fine?
![]()
Source code
1 2 3if (tdead) then TargetUnit("") end
|
|
Source code |
1 2 3 4 5 |
if (tdead) then
Msg("Now attempting to clear your target.")
TargetUnit("")
Msg("You should now have no target.")
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 |
function RSCombo(arg1, arg2)
local Skill = {}
local i = 0
local energy = UnitMana("player")
local focus = UnitSkill("player")
local enemy = (UnitCanAttack("player", "target"))
local combat = GetPlayerCombatState()
local tspell,ttime,telapsed = UnitCastingTime("target")
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local melee
if(string.find(arg2, "ranged"))then
melee = false
else
melee = true
end
local tclass = UnitClass("target");
i=i+1; Skill[i] = { name = "Wound Attack", use = (melee and enemy and (energy >= 35) and string.find(tbuffs, "Bleed") and string.find(tbuffs, "Grievous Wound")) }
i=i+1; Skill[i] = { name = "Sneak Attack", use = (melee and enemy and (energy >= 30) and string.find(arg2, "behind") and (not combat)) }
i=i+1; Skill[i] = { name = "Throat Attack", use = (melee and enemy and (energy >= 15) and (not string.find(tbuffs, "Silenced")) and (not string.find(tbuffs, "Sneak Attack Stun")) }
i=i+1; Skill[i] = { name = "Blind Spot", use = (melee and enemy and (energy >= 25) and (not string.find(tbuffs, "Bleed")) and string.find(arg2, "behind")) }
i=i+1; Skill[i] = { name = "Low Blow", use = (melee and enemy and (energy >= 25) and string.find(tbuffs, "Bleed")) }
i=i+1; Skill[i] = { name = "Shadowstab", use = (melee and enemy and (energy >= 20) and (not string.find(tbuffs, "Bleed"))) }
i=i+1; Skill[i] = { name = "Vampire Arrows", use = (enemy and (focus >= 20)) }
i=i+1; Skill[i] = { name = "Shot", use = enemy }
i=i+1; Skill[i] = { name = "Attack", use = enemy }
MyCombat(Skill,arg1)
end
|
Quoted from "GunnyDuke;448721"
hey guys, i'm trying my best to learn this but i'm a little slow. This is what i am using but get an error message,can you look it over and see whats wrong. Thanks.
Quoted from "Fir3Storm;448727"
ghostwolf82 is that the full file for Scout/knight in ur post #1218
Quoted from "GunnyDuke;448721"
hey guys, i'm trying my best to learn this but i'm a little slow. This is what i am using but get an error message,can you look it over and see whats wrong. Thanks.
Quoted from "ghostwolf82;448748"
For starters, you need to define your variable "melee", you have extra variable you are not using (doesn't really cause problems, just clutters things up unnecessarily). Fix that, and then give it a try, and report what happens.![]()
|
|
Source code |
1 |
i=i+1; Skill[i] = { name = "Throat Attack", use = (melee and enemy and (energy >= 15) and (not string.find(tbuffs, "Silenced")) and (not string.find(tbuffs, "Sneak Attack Stun"))) }
|
|
|
Source code |
1 2 3 4 5 |
local tspell,ttime,telapsed = UnitCastingTime("target")
local tremaining = 0
if ((ttime ~= nil) and (telapsed > 0)) then
tremaining = (ttime - telapsed)
end
|
|
|
Source code |
1 |
i=i+1; Skill[i] = { name = "Throat Attack", use = (melee and enemy and (energy >= 15) and (not string.find(tbuffs, "Silenced")) and (not string.find(tbuffs, "Sneak Attack Stun")) and (tremaining >= 0.5)) }
|
Quoted from "Drake1132;448581"
That's seriously weird. There's no reason at all why it should work in the macro but not in the function. I would say, verify that the function is even trying to use the command by adding in some feedback...
If it sends the messages to your chat window, then you know it's something screwy with TargetUnit("") and should probably be submitted as a bug report, but if you don't get the messages then it would suggest a problem with the tdead check. I can't imagine you having trouble with tdead, considering how long you've been using it, but at least it would give more information and documentation for a bug report.
![]()
Source code
1 2 3 4 5if (tdead) then Msg("Now attempting to clear your target.") TargetUnit("") Msg("You should now have no target.") end
|
|
Source code |
1 2 3 4 5 6 7 8 9 |
--Select Next Enemy
if tDead then
TargetUnit("")
return
end
if (not LockedOn) or (not enemy) then
TargetNearestEnemy()
return
end
|
Quoted from "ghostwolf82;448764"
tDead, not tdead
Honestly, even if you had posted your entire function, such that I could see your declaration and definition for tDead, I probably would have missed it anyways. I sometimes really hate that Lua is case-sensitive (it's actually useful, but it can also cause problems... like that one). |
|
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 |
[FONT=Courier New]function PriestKnight(arg1)[/FONT]
[FONT=Courier New] local Skill = {}[/FONT]
[FONT=Courier New] local i = 0[/FONT]
[FONT=Courier New] local friendly = (not UnitCanAttack("player", "target"))[/FONT]
[FONT=Courier New] local combat = GetPlayerCombatState()[/FONT]
[FONT=Courier New] local pbuffs = BuffList("player")[/FONT]
[FONT=Courier New] local tbuffs = BuffList("target")[/FONT]
[FONT=Courier New] local health, buffs[/FONT]
[FONT=Courier New] if friendly then[/FONT]
[FONT=Courier New] health = PctH("target")[/FONT]
[FONT=Courier New] buffs = tbuffs[/FONT]
[FONT=Courier New] else[/FONT]
[FONT=Courier New] health = PctH("player")[/FONT]
[FONT=Courier New] buffs = pbuffs[/FONT]
[FONT=Courier New] end[/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { name = "Magic Barrier", use = ((not combat) and (not string.find(pbuffs, "Magic Barrier"))) }[/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { name = "Blessed Spring Water", use = ((not combat) and (not string.find(pbuffs, "Blessed Spring Water"))) }[/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { name = "Soul Bond", use = (not string.find(pbuffs, "Soul Bond")) }[/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { name = "Soul Source", use = (health <= .25) }[/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { name = "Holy Aura", use = (PctH("player") <= .35) }[/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { name = "Action: 21", ['use'] = (PctH("player") <= .40) }[/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { name = "Action: 22", ['use'] = (PctM("player") <= .40) }[/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { name = "Heal", use = (health <= .60) }[/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { name = "Urgent Heal", use = (health <= .80) }[/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { name = "Regenerate", use = ((health <= .90) and (not string.find(buffs, "Regenerate"))) }[/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { name = "Grace of Life", use = (not string.find(pbuffs, "Grace of Life")) }[/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { name = "Amplified Attack", use = (not string.find(pbuffs, "Amplified Attack")) }[/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { name = "Enhanced Armor", use = (not string.find(pbuffs, "Enhanced Armor")) }[/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { name = "Bone Chill", use = ((not friendly) and (not string.find(tbuffs, "Bone Chill"))) }[/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { name = "Rising Tide", use = (not friendly) }[/FONT]
[FONT=Courier New] MyCombat(Skill,arg1)[/FONT]
[FONT=Courier New]end[/FONT]
|
Quoted from "goldguardian;448905"
Ive been having a problem with a enhanced armor. When i use this function in game, it buffs me with all the buffs listed but when it gets to enhanced armor, i get a message in my chat window saying, "Skill not availible: Enhanced armor". I didnt have this problem until i got my 3rd class (scout). I dont know what the problem is because i am a P/K when i use it and i can manually use the skill.
![]()
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[FONT=Courier New]function PriestKnight(arg1)[/FONT] [FONT=Courier New] local Skill = {}[/FONT] [FONT=Courier New] local i = 0[/FONT] [FONT=Courier New] local friendly = (not UnitCanAttack("player", "target"))[/FONT] [FONT=Courier New] local combat = GetPlayerCombatState()[/FONT] [FONT=Courier New] local pbuffs = BuffList("player")[/FONT] [FONT=Courier New] local tbuffs = BuffList("target")[/FONT] [FONT=Courier New] local health, buffs[/FONT] [FONT=Courier New] if friendly then[/FONT] [FONT=Courier New] health = PctH("target")[/FONT] [FONT=Courier New] buffs = tbuffs[/FONT] [FONT=Courier New] else[/FONT] [FONT=Courier New] health = PctH("player")[/FONT] [FONT=Courier New] buffs = pbuffs[/FONT] [FONT=Courier New] end[/FONT] [FONT=Courier New] i=i+1; Skill[i] = { name = "Magic Barrier", use = ((not combat) and (not string.find(pbuffs, "Magic Barrier"))) }[/FONT] [FONT=Courier New] i=i+1; Skill[i] = { name = "Blessed Spring Water", use = ((not combat) and (not string.find(pbuffs, "Blessed Spring Water"))) }[/FONT] [FONT=Courier New] i=i+1; Skill[i] = { name = "Soul Bond", use = (not string.find(pbuffs, "Soul Bond")) }[/FONT] [FONT=Courier New] i=i+1; Skill[i] = { name = "Soul Source", use = (health <= .25) }[/FONT] [FONT=Courier New] i=i+1; Skill[i] = { name = "Holy Aura", use = (PctH("player") <= .35) }[/FONT] [FONT=Courier New] i=i+1; Skill[i] = { name = "Action: 21", ['use'] = (PctH("player") <= .40) }[/FONT] [FONT=Courier New] i=i+1; Skill[i] = { name = "Action: 22", ['use'] = (PctM("player") <= .40) }[/FONT] [FONT=Courier New] i=i+1; Skill[i] = { name = "Heal", use = (health <= .60) }[/FONT] [FONT=Courier New] i=i+1; Skill[i] = { name = "Urgent Heal", use = (health <= .80) }[/FONT] [FONT=Courier New] i=i+1; Skill[i] = { name = "Regenerate", use = ((health <= .90) and (not string.find(buffs, "Regenerate"))) }[/FONT] [FONT=Courier New] i=i+1; Skill[i] = { name = "Grace of Life", use = (not string.find(pbuffs, "Grace of Life")) }[/FONT] [FONT=Courier New] i=i+1; Skill[i] = { name = "Amplified Attack", use = (not string.find(pbuffs, "Amplified Attack")) }[/FONT] [FONT=Courier New] i=i+1; Skill[i] = { name = "Enhanced Armor", use = (not string.find(pbuffs, "Enhanced Armor")) }[/FONT] [FONT=Courier New] i=i+1; Skill[i] = { name = "Bone Chill", use = ((not friendly) and (not string.find(tbuffs, "Bone Chill"))) }[/FONT] [FONT=Courier New] i=i+1; Skill[i] = { name = "Rising Tide", use = (not friendly) }[/FONT] [FONT=Courier New] MyCombat(Skill,arg1)[/FONT] [FONT=Courier New]end[/FONT]
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
[FONT=Courier New]function CD(skillname)[/FONT]
[FONT=Courier New] local firstskill = GetSkillDetail(2,1)[/FONT]
[FONT=Courier New] if (g_skill[firstskill] == nil) or (g_skill[firstskill].page ~= 2) then[/FONT]
[FONT=Courier New] ReadSkills()[/FONT]
[FONT=Courier New] end[/FONT]
[FONT=Courier New] if g_skill[skillname] ~= nil then[/FONT]
[FONT=Courier New] local tt,cd = GetSkillCooldown(g_skill[skillname].page,g_skill[skillname].slot)[/FONT]
[FONT=Courier New] return cd==0[/FONT]
[FONT=Courier New] elseif skillname == nil then[/FONT]
[FONT=Courier New] return false[/FONT]
[FONT=Courier New] else[/FONT]
[FONT=Courier New] Msg("Skill not available: "..skillname)[/FONT]
[FONT=Courier New] return false[/FONT]
[FONT=Courier New] end[/FONT]
[FONT=Courier New]end[/FONT]
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
[FONT=Courier New]function ReadSkills()[/FONT]
[FONT=Courier New] g_skill = {}[/FONT]
[FONT=Courier New] local skillname,slot[/FONT]
[FONT=Courier New] Msg("- Reading Class Skills")[/FONT]
[FONT=Courier New] for page = 1,4 do[/FONT]
[FONT=Courier New] slot = 1[/FONT]
[FONT=Courier New] skillname = GetSkillDetail(page,slot)[/FONT]
[FONT=Courier New] repeat[/FONT]
[FONT=Courier New] local a1,a2,a3,a4,a5,a6,a7,a8,skillusable = GetSkillDetail(page,slot)[/FONT]
[FONT=Courier New] if skillusable then[/FONT]
[FONT=Courier New] g_skill[skillname] = { ['page'] = page, ['slot'] = slot }[/FONT]
[FONT=Courier New] end[/FONT]
[FONT=Courier New] slot = slot + 1[/FONT]
[FONT=Courier New] skillname = GetSkillDetail(page,slot)[/FONT]
[FONT=Courier New] until skillname == nil[/FONT]
[FONT=Courier New] end[/FONT]
[FONT=Courier New]end[/FONT]
[FONT=Courier New]ReadSkills() -- Read skills into g_skill table at login[/FONT]
|
|
|
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 |
function KillSequence(arg1, healthpot, manapot)
local Skill = {}
local i = 0
-- Player and target status.
local combat = GetPlayerCombatState()
local enemy = UnitCanAttack("player","target")
local EnergyBar1 = UnitMana("player")
local EnergyBar2 = UnitSkill("player")
local pctEB1 = PctM("player")
local pctEB2 = PctS("player")
local tbuffs = BuffList("target")
local pbuffs = BuffList("player")
local tDead = UnitIsDeadOrGhost("target")
local melee = GetActionUsable(13) -- # is your melee range spell slot number
local phealth = PctH("player")
local thealth = PctH("target")
local LockedOn = UnitExists("target")
local boss = UnitSex("target") > 2
local party = GetNumPartyMembers() >= 2
--Determine Class-Combo
mainClass, subClass = UnitClassToken( "player" )
--Silence Logic
local tSpell,tTime,tElapsed = UnitCastingTime("target")
local silenceThis = tSpell and silenceList[tSpell] and ((tTime - tElapsed) > 0.1)
--Potion Checks
healthpot = healthpot or 0
manapot = manapot or 0
--Equipment and Pet Protection
if phealth <= .04 then
SwapEquipmentItem()
for i=1,3 do
if (IsPetSummoned(i) == true) then
ReturnPet(i);
end
end
end
--Health Potion Use
i=i+1; Skill[i] = { name = "Action: "..healthpot, use = (phealth <= .70) }
--Check for level one mobs before doing combat
if (LockedOn and (UnitLevel("target") < 2)) then
TargetNearestEnemy()
return
end
--Begin Player Skill Sequences
-- Class: Warrior/Mage
if mainClass == "WARRIOR" and subClass == "MAGE" then
local SurpriseAttack = GetActionUsable(14)
--Potions and Buffs
i=i+1; Skill[i] = { name = "Action: "..manapot, use = (pctEB2 <= .40) }
i=i+1; Skill[i] = { name = "Intensification", use = (pctEB2 >= .05) and (not pbuffs['Intensification']) and boss }
i=i+1; Skill[i] = { name = "Electric Attack", use = (pctEB2 >= .05) and (not pbuffs['Electric Attack'] or (pbuffs['Electric Attack'].time <= 45)) }
--Combat
if enemy then
if (not melee) then
i=i+1; Skill[i] = { name = "Silence", use = (silenceThis) }
i=i+1; Skill[i] = { name = "Fireball", use = (pctEB2 >= .05) }
i=i+1; Skill[i] = { name = "Thunder Sword", use = (pctEB2 >= .05) }
i=i+1; Skill[i] = { name = "Lightning", use = (pctEB2 >= .05) }
if (not CD("Thunder Sword")) then
if (CD("Surprise Attack")) then
i=i+1; Skill[i] = { name = "Surprise Attack", use = SurpriseAttack }
else
i=i+1; Skill[i] = { name = "Attack", use = (thealth == 1) }
end
end
else
i=i+1; Skill[i] = { name = "Silence", use = (silenceThis) }
i=i+1; Skill[i] = { name = "Electrical Rage", use = (EnergyBar1 >= 15) and (pctEB2 >=.05) and (not pbuffs['High Voltage III']) }
i=i+1; Skill[i] = { name = "Thunder Sword", use = (pctEB2 >= .05) }
i=i+1; Skill[i] = { name = "Lightning's Touch", use = (pctEB2 >= .05) }
i=i+1; Skill[i] = { name = "Attack", use = (thealth == 1) }
end
end
--Class: Druid/Mage
elseif mainClass == "DRUID" and subClass == "MAGE" then
--Potions and buffs
i=i+1; Skill[i] = { name = "Action: "..manapot, use = (pctEB1 <= .40) }
i=i+1; Skill[i] = { name = "Savage Blessing", use = (pctEB1 >= .05) and ((not pbuffs['Savage Blessing']) or (pbuffs['Savage Blessing'].time <= 45)) }
i=i+1; Skill[i] = { name = "Concentration Prayer", use = (pctEB1 >= .05) and ((not pbuffs['Concentration Prayer']) or (pbuffs ['Concentration Prayer'].time <= 45)) }
i=i+1; Skill[i] = { name = "Intensification", use = (pctEB1 >= .05) and (not pbuffs['Intensification']) and boss }
--Combat
if enemy then
i=i+1; Skill[i] = { name = "Binding Silence", use = (silenceThis) }
i=i+1; Skill[i] = { name = "Silence", use = (silenceThis) }
i=i+1; Skill[i] = { name = "Weakening Seed", use = (pctEB1 >= .05) and boss and ((not tbuffs['Weakening Seed']) or (tbuffs['Weakening Seed'].time < 4)) }
i=i+1; Skill[i] = { name = "Mother Nature's Wrath", use = (pctEB1 >= .05) }
i=i+1; Skill[i] = { name = "Briar Entwinement", use = (pctEB1 >= .05) and ((not tbuffs['Briar Entwinement']) or (tbuffs['Briar Entwinement'].time < 4)) }
i=i+1; Skill[i] = { name = "Lightning", use = (pctEB1 >= .05) }
i=i+1; Skill[i] = { name = "Fireball", use = (pctEB1 >= .05) }
i=i+1; Skill[i] = { name = "Earth Arrow", use = (pctEB1 >= .05) }
end
--Class: Mage/Warrior
elseif mainClass == "MAGE" and subClass == "WARRIOR" then
--Potions and buffs
i=i+1; Skill[i] = { name = "Action: "..manapot, use = (pctEB1 <= .40) }
i=i+1; Skill[i] = { name = "Intensification", use = (pctEB1 >= .05) and (not pbuffs['Intensification']) and boss }
i=i+1; Skill[i] = { name = "Magical Talent", use = (EnergyBar2 >= 20) and (not pbuffs['Magical Talent']) }
i=i+1; Skill[i] = { name = "Magical Enlightenment", use = (EnergyBar2 >= 35) and (not pbuffs['Magical Enlightenment']) }
i=i+1; Skill[i] = { name = "Elemental Explosion", use = (EnergyBar2 >= 35) and (not pbuffs['Elemental Explosion']) }
i=i+1; Skill[i] = { name = "Activate Mana", use = (EnergyBar2 <= 90) and (not pbuffs['Magical Talent']) or (not pbuffs['Magical Enlightenment']) or (not pbuffs['Elemental Explosion']) }
i=i+1; Skill[i] = { name = "Enraged", use = ((EnergyBar2 >= 15) and (EnergyBar2 <= 35)) and (not pbuffs['Magical Talent']) or (not pbuffs['Magical Enlightenment']) or (not pbuffs['Elemental Explosion']) }
--Combat
if enemy then
i=i+1; Skill[i] = { name = "Silence", use = (silenceThis) }
i=i+1; Skill[i] = { name = "Fireball", use = (pctEB1 >= .05) }
i=i+1; Skill[i] = { name = "Lightning", use = (pctEB1 >= .05) }
end
--Class: Knight/Mage
elseif mainClass == "KNIGHT" and subClass == "MAGE" then
local LKBR = GetActionUsable(20) -- # is Lion King Battle Roar spell slot number
--Potions and buffs
i=i+1; Skill[i] = { name = "Action: "..manapot, use = (pctEB1 <= .40) }
i=i+1; Skill[i] = { name = "Enhanced Armor", use = (pctEB1 >= .05) and ((not pbuffs['Enhanced Armor']) or (pbuffs['Enhanced Armor'].time <= 45)) }
i=i+1; Skill[i] = { name = "Holy Seal", use = (pctEB1 >= .05) and ((not pbuffs['Holy Seal']) or (pbuffs['Holy Seal'].time <= 45)) }
i=i+1; Skill[i] = { name = "Lightning Armor", use = (pctEB1 >= .05) and ((not pbuffs['Lightning Armor']) or (pbuffs['Lightning Armor'].time <= 45)) }
--Mana Shield
if IsShiftKeyDown() and (pbuffs['Mana Shield']) then
CancelBuff("Mana Shield")
end
i=i+1; Skill[i] = { name = "Mana Shield", use = (pctEB1 <= .25) }
--Combat
if enemy then
i=i+1; Skill[i] = { name = "Silence", use = (silenceThis) }
i=i+1; Skill[i] = { name = "Resolution", use = party and boss }
i=i+1; Skill[i] = { name = "Shield of Discipline", use = party and boss }
i=i+1; Skill[i] = { name = "Intensification", use = party and boss }
i=i+1; Skill[i] = { name = "Shield of Valor", use = party and boss }
i=i+1; Skill[i] = { name = "Hatred Strike", use = (pctEB1 >= .05) and party and boss }
i=i+1; Skill[i] = { name = "Threaten", use = (pctEB1 >= .05) and party and boss and (tbuffs['Holy Seals 3']) }
i=i+1; Skill[i] = { name = "Action: 20", use = (pctEB1 >= .07) and LKBR and party and boss }
i=i+1; Skill[i] = { name = "Custom: Holy Light Domain", use = (pctEB1 >= .05) and (not tbuffs['Holy Illumination']) and ((tbuffs['Light Seal I']) or (tbuffs['Light Seal II']) or (tbuffs['Light Seal III'])) and (g_lastaction ~= "Holy Light Domain") }
i=i+1; Skill[i] = { name = "Mana Return", use = (pctEB1 <= .80) and (tbuffs['Holy Seals 3']) }
i=i+1; Skill[i] = { name = "Whirlwind Shield", use = (pctEB1 >= .05) and (tbuffs['Holy Illumination']) }
i=i+1; Skill[i] = { name = "Custom: Holy Strike", use = (pctEB1 >= .05) and (not tbuffs['Light Seal III']) }
i=i+1; Skill[i] = { name = "Disarmament", use = (pctEB1 >= .05) and (not tbuffs['Disarmament IV']) and (tbuffs['Holy Illumination']) and party and boss }
i=i+1; Skill[i] = { name = "Custom: Holy Strike", use = (pctEB1 >= .05) }
i=i+1; Skill[i] = { name = "Attack", use = (thealth == 1) }
end
--Class: Mage/Druid
elseif mainClass == "MAGE" and subClass == "DRUID" then
--Potions and buffs
i=i+1; Skill[i] = { name = "Action: "..manapot, use = (pctEB1 <= .40) }
i=i+1; Skill[i] = { name = "Intensification", use = (pctEB1 >= .05) and (not pbuffs['Intensification']) and boss }
i=i+1; Skill[i] = { name = "Savage Blessing", use = (pctEB1 >= .05) and ((not pbuffs['Savage Blessing']) or (pbuffs['Savage Blessing'].time <= 45)) }
i=i+1; Skill[i] = { name = "Perception", use = (pctEB1 >= .05) and ((not pbuffs['Perception']) or (pbuffs['Perception'].time <= 45)) }
i=i+1; Skill[i] = { name = "Magic Target", use = (pctEB1 >= .05) and ((not pbuffs['Magic Target']) or (pbuffs['Magic Target'].time <= 45)) }
--Combat
if enemy then
i=i+1; Skill[i] = { name = "Silence", use = (silenceThis) }
i=i+1; Skill[i] = { name = "Fireball", use = (pctEB1 >= .05) }
i=i+1; Skill[i] = { name = "Magma Blade", use = (pctEB1 >= .05) }
i=i+1; Skill[i] = { name = "Lightning", use = (pctEB1 >= .05) }
end
end
--End Player Skill Sequences
--Interact with NPC.
i=i+1; Skill[i] = { name = "Attack", use = (not combat and not enemy) }
MyCombat(Skill,arg1)
--Select Next Enemy
if (tDead) then
TargetUnit("")
return
end
if (not LockedOn) or (not enemy) then
TargetNearestEnemy()
return
end
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 |
function BuffList(tgt)
local list = {}
local buffcmd = UnitBuff
local infocmd = UnitBuffLeftTime
if UnitCanAttack("player",tgt) then
buffcmd = UnitDebuff
infocmd = UnitDebuffLeftTime
end
-- There is a max of 100 buffs/debuffs per unit apparently
for i = 1,100 do
local buff, _, stackSize = buffcmd(tgt, i)
local timeRemaining = infocmd(tgt,i)
if buff then
list[buff:gsub('(%()(.)(%))', '%2')] = { stack = stackSize, time = timeRemaining }
else
break
end
end
return list
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 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 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 |
-- DIYCE Original Author: Sixpax
-- DIYCE: GhostWolf Modified version 1.0
local g_skill = {}
local g_lastaction = ""
local silenceList = {
['Annihilation'] = true,
['King Bug Shock'] = true,
['Mana Rift'] = true,
['Dream of Gold'] = true,
['Flame'] = true,
['Flame Spell'] = true,
['Wave Bomb'] = true,
['Silence'] = true,
['Recover'] = true,
['Restore Life'] = true,
['Heal'] = true,
['Curing Shot'] = true,
['Leaves of Fire'] = true,
['Urgent Heal'] = true,
}
function Msg(outstr,a1,a2,a3)
DEFAULT_CHAT_FRAME:AddMessage(tostring(outstr),a1,a2,a3)
end
function ReadSkills()
g_skill = {}
local skillname,slot
Msg("- DIYCE Reading Class Skills")
for page = 1,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 PctM(tgt)
return (UnitMana(tgt)/UnitMaxMana(tgt))
end
function PctS(tgt)
return (UnitSkill(tgt)/UnitMaxSkill(tgt))
end
function CancelBuff(buffname)
local i = 1
local buff = UnitBuff("player",i)
while buff ~= nil do
if buff == buffname then
CancelPlayerBuff(i)
return true
end
i = i + 1
buff = UnitBuff("player",i)
end
return false
end
function BuffList(tgt)
local list = {}
local buffcmd = UnitBuff
local infocmd = UnitBuffLeftTime
if UnitCanAttack("player",tgt) then
buffcmd = UnitDebuff
infocmd = UnitDebuffLeftTime
end
-- There is a max of 100 buffs/debuffs per unit apparently
for i = 1,100 do
local buff, _, stackSize = buffcmd(tgt, i)
local timeRemaining = infocmd(tgt,i)
if buff then
list[buff:gsub('(%()(.)(%))', '%2')] = { stack = stackSize, time = timeRemaining }
else
break
end
end
return list
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.4
elseif skillname == nil then
return false
else
Msg("Skill not available: "..skillname)
return false
end
end
function MyCombat(Skill, arg1)
local spell_name = UnitCastingTime("player")
local talktome = ((arg1 == "v1") or (arg1 == "v2"))
local action,actioncd,actiondef,actioncnt
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 Skill[x].use then
if string.find(Skill[x].name, "Action:") then
action = tonumber((string.gsub(Skill[x].name, "(Action:)( *)(%d+)(.*)", "%3")))
_1,actioncd = GetActionCooldown(action)
actiondef,_1,actioncnt = GetActionInfo(action)
if GetActionUsable(action) and (actioncd == 0) and (actiondef ~= nil) and (actioncnt > 0) then
if talktome then Msg("- "..Skill[x].name) end
UseAction(action)
return true
end
elseif string.find(Skill[x].name, "Custom:") then
action = string.gsub(Skill[x].name, "(Custom:)( *)(.*)", "%3")
if CustomAction(action) then
return true
end
elseif string.find(Skill[x].name, "Item:") then
action = string.gsub(Skill[x].name, "(Item:)( *)(.*)", "%3")
if talktome then Msg("- "..Skill[x].name) end
UseItemByName(action)
return true
elseif CD(Skill[x].name) then
if talktome then Msg("- "..Skill[x].name) end
CastSpellByName(Skill[x].name)
return true
end
end
end
if (arg1 == "v2") then Msg("- [IDLE]", 0, 1, 1) end
return false
end
function CustomAction(action)
if CD(action) then
if IsShiftKeyDown() then Msg("- "..action) end
g_lastaction = action
CastSpellByName(action)
return true
else
return false
end
end
-->> Custom Function Below This Line <<--
function KillSequence(arg1, healthpot, manapot)
local Skill = {}
local i = 0
-- Player and target status.
local combat = GetPlayerCombatState()
local enemy = UnitCanAttack("player","target")
local EnergyBar1 = UnitMana("player")
local EnergyBar2 = UnitSkill("player")
local pctEB1 = PctM("player")
local pctEB2 = PctS("player")
local tbuffs = BuffList("target")
local pbuffs = BuffList("player")
local tDead = UnitIsDeadOrGhost("target")
local melee = GetActionUsable(13) -- # is your melee range spell slot number
local phealth = PctH("player")
local thealth = PctH("target")
local LockedOn = UnitExists("target")
local boss = UnitSex("target") > 2
local elite = UnitSex("target") == 2
local party = GetNumPartyMembers() >= 2
--Determine Class-Combo
mainClass, subClass = UnitClassToken( "player" )
--Silence Logic
local tSpell,tTime,tElapsed = UnitCastingTime("target")
local silenceThis = tSpell and silenceList[tSpell] and ((tTime - tElapsed) > 0.1)
--Potion Checks
healthpot = healthpot or 0
manapot = manapot or 0
--Equipment and Pet Protection
if phealth <= .04 then
SwapEquipmentItem()
for i=1,3 do
if (IsPetSummoned(i) == true) then
ReturnPet(i);
end
end
end
--Health Potion Use
i=i+1; Skill[i] = { name = "Action: "..healthpot, use = (phealth <= .70) }
--Check for level one mobs before doing combat
if (LockedOn and (UnitLevel("target") < 2)) then
TargetNearestEnemy()
return
end
--If target is dead, drop target
if (tDead) then
TargetUnit("")
return
end
--Begin Player Skill Sequences
-- Class: Warrior/Mage
if mainClass == "WARRIOR" and subClass == "MAGE" then
local SurpriseAttack = GetActionUsable(14)
--Potions and Buffs
i=i+1; Skill[i] = { name = "Survival Instinct", use = (phealth <= .30) }
i=i+1; Skill[i] = { name = "Sense of Danger", use = (phealth <= .30) }
i=i+1; Skill[i] = { name = "Action: "..manapot, use = (pctEB2 <= .40) }
i=i+1; Skill[i] = { name = "Intensification", use = (pctEB2 >= .05) and (not pbuffs['Intensification']) and boss }
i=i+1; Skill[i] = { name = "Aggresiveness", use = boss }
i=i+1; Skill[i] = { name = "Electric Attack", use = (pctEB2 >= .05) and ((not pbuffs['Electric Attack']) or (pbuffs['Electric Attack'].time <= 45)) }
--Combat
if enemy then
i=i+1; Skill[i] = { name = "Silence", use = (silenceThis) }
i=i+1; Skill[i] = { name = "Surprise Attack", use = SurpriseAttack }
i=i+1; Skill[i] = { name = "Attack", use = (thealth == 1) }
i=i+1; Skill[i] = { name = "Enraged", use = (EnergyBar1 <= 30) and (boss or elite) }
i=i+1; Skill[i] = { name = "Electrical Rage", use = (EnergyBar1 >= 15) and (pctEB2 >=.05) and ((not pbuffs['High Voltage III']) or (pbuffs['High Voltage III'].time <= 2)) }
i=i+1; Skill[i] = { name = "Thunder Sword", use = (pctEB2 >= .05) }
i=i+1; Skill[i] = { name = "Fireball", use = (pctEB2 >= .05) }
i=i+1; Skill[i] = { name = "Lightning's Touch", use = (pctEB2 >= .05) }
end
--Class: Druid/Mage
elseif mainClass == "DRUID" and subClass == "MAGE" then
--Potions and buffs
i=i+1; Skill[i] = { name = "Action: "..manapot, use = (pctEB1 <= .40) }
i=i+1; Skill[i] = { name = "Savage Blessing", use = (pctEB1 >= .05) and ((not pbuffs['Savage Blessing']) or (pbuffs['Savage Blessing'].time <= 45)) }
i=i+1; Skill[i] = { name = "Concentration Prayer", use = (pctEB1 >= .05) and ((not pbuffs['Concentration Prayer']) or (pbuffs ['Concentration Prayer'].time <= 45)) }
i=i+1; Skill[i] = { name = "Intensification", use = (pctEB1 >= .05) and (not pbuffs['Intensification']) and boss }
--Combat
if enemy then
i=i+1; Skill[i] = { name = "Binding Silence", use = (silenceThis) }
i=i+1; Skill[i] = { name = "Silence", use = (silenceThis) }
i=i+1; Skill[i] = { name = "Weakening Seed", use = (pctEB1 >= .05) and boss and ((not tbuffs['Weakening Seed']) or (tbuffs['Weakening Seed'].time < 4)) }
i=i+1; Skill[i] = { name = "Mother Nature's Wrath", use = (pctEB1 >= .05) }
i=i+1; Skill[i] = { name = "Briar Entwinement", use = (pctEB1 >= .05) and ((not tbuffs['Briar Entwinement']) or (tbuffs['Briar Entwinement'].time < 4)) }
i=i+1; Skill[i] = { name = "Lightning", use = (pctEB1 >= .05) }
i=i+1; Skill[i] = { name = "Fireball", use = (pctEB1 >= .05) }
i=i+1; Skill[i] = { name = "Earth Arrow", use = (pctEB1 >= .05) }
end
--Class: Mage/Warrior
elseif mainClass == "MAGE" and subClass == "WARRIOR" then
--Potions and buffs
i=i+1; Skill[i] = { name = "Action: "..manapot, use = (pctEB1 <= .40) }
i=i+1; Skill[i] = { name = "Intensification", use = (pctEB1 >= .05) and (not pbuffs['Intensification']) and boss }
i=i+1; Skill[i] = { name = "Magical Talent", use = (EnergyBar2 >= 20) and (not pbuffs['Magical Talent']) }
i=i+1; Skill[i] = { name = "Magical Enlightenment", use = (EnergyBar2 >= 35) and (not pbuffs['Magical Enlightenment']) }
i=i+1; Skill[i] = { name = "Elemental Explosion", use = (EnergyBar2 >= 35) and (not pbuffs['Elemental Explosion']) }
i=i+1; Skill[i] = { name = "Activate Mana", use = (EnergyBar2 <= 90) and ((not pbuffs['Magical Talent']) or (not pbuffs['Magical Enlightenment']) or (not pbuffs['Elemental Explosion'])) }
i=i+1; Skill[i] = { name = "Enraged", use = ((EnergyBar2 >= 15) and (EnergyBar2 <= 35)) and ((not pbuffs['Magical Talent']) or (not pbuffs['Magical Enlightenment']) or (not pbuffs['Elemental Explosion'])) }
--Combat
if enemy then
i=i+1; Skill[i] = { name = "Silence", use = (silenceThis) }
i=i+1; Skill[i] = { name = "Fireball", use = (pctEB1 >= .05) }
i=i+1; Skill[i] = { name = "Lightning", use = (pctEB1 >= .05) }
end
--Class: Knight/Mage
elseif mainClass == "KNIGHT" and subClass == "MAGE" then
local LKBR = GetActionUsable(20) -- # is Lion King Battle Roar spell slot number
--Potions and buffs
i=i+1; Skill[i] = { name = "Action: "..manapot, use = (pctEB1 <= .40) }
i=i+1; Skill[i] = { name = "Enhanced Armor", use = (pctEB1 >= .05) and ((not pbuffs['Enhanced Armor']) or (pbuffs['Enhanced Armor'].time <= 45)) }
i=i+1; Skill[i] = { name = "Holy Seal", use = (pctEB1 >= .05) and ((not pbuffs['Holy Seal']) or (pbuffs['Holy Seal'].time <= 45)) }
i=i+1; Skill[i] = { name = "Lightning Armor", use = (pctEB1 >= .05) and ((not pbuffs['Lightning Armor']) or (pbuffs['Lightning Armor'].time <= 45)) }
--Mana Shield
if IsShiftKeyDown() and (pbuffs['Mana Shield']) then
CancelBuff("Mana Shield")
end
i=i+1; Skill[i] = { name = "Mana Shield", use = (pctEB1 <= .25) }
--Combat
if enemy then
i=i+1; Skill[i] = { name = "Silence", use = (silenceThis) }
i=i+1; Skill[i] = { name = "Resolution", use = party and boss }
i=i+1; Skill[i] = { name = "Shield of Discipline", use = party and boss }
i=i+1; Skill[i] = { name = "Intensification", use = party and boss }
i=i+1; Skill[i] = { name = "Shield of Valor", use = party and boss }
i=i+1; Skill[i] = { name = "Hatred Strike", use = (pctEB1 >= .05) and party and boss }
i=i+1; Skill[i] = { name = "Threaten", use = (pctEB1 >= .05) and party and boss and (tbuffs['Holy Seals 3']) }
i=i+1; Skill[i] = { name = "Action: 20", use = (pctEB1 >= .07) and LKBR and party and boss }
i=i+1; Skill[i] = { name = "Custom: Holy Light Domain", use = (pctEB1 >= .05) and (not tbuffs['Holy Illumination']) and ((tbuffs['Light Seal I']) or (tbuffs['Light Seal II']) or (tbuffs['Light Seal III'])) and (g_lastaction ~= "Holy Light Domain") }
i=i+1; Skill[i] = { name = "Mana Return", use = (pctEB1 <= .80) and (tbuffs['Holy Seals 3']) }
i=i+1; Skill[i] = { name = "Whirlwind Shield", use = (pctEB1 >= .05) and (tbuffs['Holy Illumination']) }
i=i+1; Skill[i] = { name = "Custom: Holy Strike", use = (pctEB1 >= .05) and (not tbuffs['Light Seal III']) }
i=i+1; Skill[i] = { name = "Disarmament", use = (pctEB1 >= .05) and (not tbuffs['Disarmament IV']) and (tbuffs['Holy Illumination']) and party and boss }
i=i+1; Skill[i] = { name = "Custom: Holy Strike", use = (pctEB1 >= .05) }
i=i+1; Skill[i] = { name = "Attack", use = (thealth == 1) }
end
--Class: Mage/Druid
elseif mainClass == "MAGE" and subClass == "DRUID" then
--Potions and buffs
i=i+1; Skill[i] = { name = "Action: "..manapot, use = (pctEB1 <= .40) }
i=i+1; Skill[i] = { name = "Intensification", use = (pctEB1 >= .05) and (not pbuffs['Intensification']) and boss }
i=i+1; Skill[i] = { name = "Savage Blessing", use = (pctEB1 >= .05) and ((not pbuffs['Savage Blessing']) or (pbuffs['Savage Blessing'].time <= 45)) }
i=i+1; Skill[i] = { name = "Perception", use = (pctEB1 >= .05) and ((not pbuffs['Perception']) or (pbuffs['Perception'].time <= 45)) }
i=i+1; Skill[i] = { name = "Magic Target", use = (pctEB1 >= .05) and ((not pbuffs['Magic Target']) or (pbuffs['Magic Target'].time <= 45)) }
--Combat
if enemy then
i=i+1; Skill[i] = { name = "Silence", use = (silenceThis) }
i=i+1; Skill[i] = { name = "Fireball", use = (pctEB1 >= .05) }
i=i+1; Skill[i] = { name = "Magma Blade", use = (pctEB1 >= .05) }
i=i+1; Skill[i] = { name = "Lightning", use = (pctEB1 >= .05) }
end
end
--End Player Skill Sequences
--Interact with NPC.
i=i+1; Skill[i] = { name = "Attack", use = (not combat and not enemy) }
MyCombat(Skill,arg1)
--Select Next Enemy
if (not LockedOn) or (not enemy) then
TargetNearestEnemy()
return
end
end
|
Quoted from "goldguardian;448997"
I dont think i have made any changes to them unless I accidently deleted something while adding a new function
Quoted from "Drake1132;449076"
You definitely didn't change anything with the CD and ReadSkills functions. So the only thing I can think of is the spelling and case sensitivity issues I mentioned before. I don't see any other reason why it wouldn't work.