Quoted from "goldguardian;449211"
I checked the spelling on my action bar and on the skill when i pressed "k", it was all the same.
I think i fixed it though. When I first noticed the problem I was changing classes from a P/S to a P/K. I think the system might have thought that i was still a P/S at the time and didnt let me use the skill. All it took was a restart to fix it.
I had also been having problems with the name of my classes when i changed them. For example, i would be P/K switch to K/S then switch back to P/K. I had all the skills of a P/K but when i scrolled over my portrait it said i was a S/K. A restart fixed that too.
|
|
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 |
unction 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, ID = buffcmd(tgt, i)
local timeRemaining = infocmd(tgt,i)
if buff then
-- Ad to list by name
list[buff:gsub('(%()(.)(%))', '%2')] = { stack = stackSize, time = timeRemaining, id = ID }
-- We also list by ID in case two different buffs/debuffs have the same name.
list[ID] = {stack = stackSize, time = timeRemaining, name = buff:gsub("(%()(.)(%))", "%2") }
else
break
end
end
return list
end
|
|
|
Source code |
1 |
not string.find(pbuffs,"Electric Attack") |
|
|
Source code |
1 |
not pbuffs['Electric Attack'] |
|
|
Source code |
1 2 |
timeRemaining = pbuffs['Electric Attack'].time stackSize = pbuffs['Electric Attack'].stack |
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
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,
}
|
|
|
Source code |
1 |
local silenceThis = tSpell and silenceList[tSpell] and ((tTime - tElapsed) > 0.1) |
|
|
Source code |
1 |
tbuff[buffID] |
Quoted from "Peryl;449471"
Was looking at Ghostwolf's latest DIYCE function when I realized that there is a simple optimization that could be done both to it, and DIYCE itself.
Basically, the buff/debuff list is being build into a string, then this string is searched for every buff/debuff interested in. A better way would be to build a table with all the entries named after the buff, then use that to see if the buff is present or not. As a bonus, extra info can be put into this table.
<snip>
Quoted from "Drake1132;449493"
Since it will be extremely rare for a target or character to have as many as 100 buffs or debuffs, why make the full 100 iterations for the for loop in the BuffList function? I think the old method of using a while loop checked against (buff ~= nil) would be faster to process and therefore more optimized, because the number of times the loop will iterate will never be larger than the number of buffs or debuffs on the specified unit.
Quoted from "ghostwolf82;449398"
Yeah, that does sound a bit odd. Good to know that it can potentially be an issue. Now if someone has a similar issue in the future, we can reference them to your posts. This, people, is why it is good to report odd occurrences and the solutions you find for them! Even when you think it's not important, it may save other people time in the future. So thank you goldguardian! (Also appreciate the willingness to learn on your part.)

|
|
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 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
[FONT=Courier New]function PriestScout(arg1)[/FONT]
[FONT=Courier New] local Skill = {}[/FONT]
[FONT=Courier New] local i = 0[/FONT]
[FONT=Courier New] local tgt = "player"[/FONT]
[FONT=Courier New] local friendly = false[/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 focus = UnitSkill("player")[/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'] = "Embrace of the Water Spirit", ['use'] = (not string.find(pbuffs,"Embrace of the Water Spirit")) }[/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { ['name'] = "Soul Source", ['use'] = (PctH("player") <= .20) }[/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { ['name'] = "Holy Aura", ['use'] = (PctH("player") <= .40) }[/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { ['name'] = "Regenerate", ['use'] = ((combat) and (not string.find(pbuffs,"Regenerate")) or (PctH("player")[/FONT]
[FONT=Courier New]<= .90) and (not string.find(pbuffs,"Regenerate"))) }[/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { ['name'] = "Heal", ['use'] = (PctH("player") <= .65) }[/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { ['name'] = "Urgent Heal", ['use'] = (PctH("player") <= .80) }[/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { ['name'] = "Action: 22", ['use'] = (PctM("player") [/FONT]
[FONT=Courier New]<= .55) } [/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { ['name'] = "Action: 23", ['use'] = (PctM("player")[/FONT]
[FONT=Courier New]<= .25) } [/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { ['name'] = "Action: 21", ['use'] = (PctH("player")[/FONT]
[FONT=Courier New]<= .40) }[/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { ['name'] = "Action: 24", ['use'] = (PctH("player")[/FONT]
[FONT=Courier New]<= .15) } [/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { ['name'] = "Grace of Life", ['use'] = ((not combat) and (not string.find(pbuffs,"Grace of Life"))) }[/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { ['name'] = "Amplified Attack", ['use'] = ((not combat) and (friendly and (not string.find(tbuffs,"Amplified Attack")))) }[/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'] = "Bone Chill", ['use'] = ((not friendly) and (not string.find(tbuffs,"Bone Chill"))) }[/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { ['name'] = "Vampire Arrows", ['use'] = ((not friendly) and (focus >= 20)) }[/FONT]
[FONT=Courier New] i=i+1; Skill[i] = { ['name'] = "Ice Blade", ['use'] = ((not friendly) and (PctM("player") >= .55)) }[/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;449540"
It seems to happen everytime i switch classes now. I have to relog in order for it to work. Its getting really annoying because everytime i want to go from a P/K to a P/S or P/S to P/K i have to relog. Ill post some screen shots to show the probelm.
Quoted from "Peryl;449563"
Since this is happening switching secondary and tertiary classes, I wonder if it isn't some kind of caching bug in the game where it has some old info hanging around. Do you know if it happens when swapping primary and secondary or other combinations?
Also, check if you have any add-ons that deal with class swaps in case something odd is happening there (somewhat doubtful, but you never know).
Another thing to check would be if when it does start acting up, if switching primary/secondary class then switching back again helps fix the problem.
This is all speculation of course, but if you can consistently reproduce the problem, and are fairly certain it isn't just your computer. Submit a bug report.
Quoted from "goldguardian;449571"
I havent checked up on this thread for a while so i guess im behind lol. Ill try updateing it and see if it helps
Quoted from "Peryl;449506"
Nope, it doesn't check all of them. The key is the break statement in the if-else statement. This will break out of the loop if buff is nil, which is the same as before. However, since the whole thing is in a for loop, we also guarantee that it will never go beyond 100 iterations no matter what. Its a little redundant, yes, but is also avoids having to increment a counter externally since the for loop does it for us.
Quoted from "goldguardian;449567"
If i go from P/K to P/S i get the ice blade/embrace error, but from there if i go back to P/K i dont have the enhanced error. It seems like when i log in, my primary and seecondary classes set and it doesnt work for anyother class that i had when i logged in.
As for any auto class-swapping add-on, i did have one but i removed it and i was still haveing the same problem
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
function CD(skillname)
local firstskill = GetSkillDetail(2,1)
local firstgeneralskill = GetSkillDetail(3,1)
if (g_skill[firstskill] == nil) or (g_skill[firstskill].page ~= 2) or (g_skill[firstgeneralskill].page ~= 3) then
ReadSkills()
end
if g_skill[skillname] ~= nil then
local tt,cd = GetSkillCooldown(g_skill[skillname].page,g_skill[skillname].slot)
return cd==0
elseif skillname == nil then
return false
else
Msg("Skill not available: "..skillname)
return false
end
end
|
Quoted from "missjeanny31;449594"
Anyone know if there is a way to use Deadly poison Bite after i use Vampire arrow. Everytime i put it in it messes up and only 1 or 2 skills will go off.
![]()
Source code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18function ScoutRogue(arg1) local Skill = {} local i = 0 local focus = UnitMana("player") local enemy = UnitCanAttack("player","target") i=i+1; Skill[i] = { name = "Frost Arrow", use = (not ChkBuff("player","Frost Arrow")) } i=i+1; Skill[i] = { name = "Combo Shot", use = enemy } i=i+1; Skill[i] = { name = "Shot", use = enemy } i=i+1; Skill[i] = { name = "Piercing Arrow", use = enemy } i=i+1; Skill[i] = { name = "Weak Spot", use = (enemy and (focus >= 30)) } -- i=i+1; Skill[i] = { name = "Vampire Arrows", use = (enemy and (focus >= 20)) } i=i+1; Skill[i] = { name = "Sapping Arrow", use = enemy } i=i+1; Skill[i] = { name = "Wind Arrows", use = (enemy and (focus >= 15)) } i=i+1; Skill[i] = { name = "Snipe", use = enemy } MyCombat(Skill,arg1) end
I use Six's code with a few changes in it putting shot and wind arrow near the bottom and put reflected shot in there as well but when i go to put in Deadly Poison Bite after Vamp Arrow then only a couple skills will fire off. Any help will greatly help. Thanks in advance
|
|
Source code |
1 |
[/noparse][i]Your code here[/i][noparse] |
Quoted from "ghostwolf82;449575"
Check this post for my latest upgrades to the DIYCE functionality. Included is Peryls contribution to it, and instructions on how to include his changes as well.
|
|
Source code |
1 2 3 4 5 6 7 8 9 |
local g_skills = {}
_G.g_skills = g_skills
local g_lastaction = ""
_G.g_lastaction = g_lastaction
local silenceList = {
[B][I]<insert list of spells here>[/I][/B]
}
|
Quoted from "Peryl;449699"
I'm not sure what the problem would be. Could you post your code you have with the Deadly Poison Bite included in it? Oh and please use the code tags when posting your code, it makes it much easier to read. Use [noparse][/noparse].
![]()
Source code
1 [/noparse][I]Your code here[/I][noparse]
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
function ScoutRogue(arg1)
local Skill = {}
local i = 0
local focus = UnitMana("player")
--local energy = UnitMana("player")
local enemy = UnitCanAttack("player","target")
i=i+1; Skill[i] = { name = "Frost Arrow", use = (not ChkBuff("player","Frost Arrow")) }
i=i+1; Skill[i] = { name = "Combo Shot", use = enemy }
i=i+1; Skill[i] = { name = "Vampire Arrows", use = (enemy and (focus >= 20)) }
--i=i+1; Skill[i] = { name = "Deadly Poison Bite", use = enemy and (energy >=30)) }
i=i+1; Skill[i] = { name = "Piercing Arrow", use = enemy }
i=i+1; Skill[i] = { name = "Weak Spot", use = (enemy and (focus >= 30)) }
i=i+1; Skill[i] = { name = "Sapping Arrow", use = enemy }
i=i+1; Skill[i] = { name = "Reflected Shot", use = enemy }
--i=i+1; Skill[i] = { name = "Snipe", use = enemy }
i=i+1; Skill[i] = { name = "Wind Arrows", use = (enemy and (focus >= 15)) }
i=i+1; Skill[i] = { name = "Shot", use = enemy }
MyCombat(Skill,arg1)
end
|
Quoted from "missjeanny31;449714"
hope i did this right i deactivated the energy and the skill for deadly poison bite but removed them completely i just added them in to show where i added the code
![]()
Source code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19function ScoutRogue(arg1) local Skill = {} local i = 0 local focus = UnitMana("player") --local energy = UnitMana("player") local enemy = UnitCanAttack("player","target") i=i+1; Skill[i] = { name = "Frost Arrow", use = (not ChkBuff("player","Frost Arrow")) } i=i+1; Skill[i] = { name = "Combo Shot", use = enemy } i=i+1; Skill[i] = { name = "Vampire Arrows", use = (enemy and (focus >= 20)) } --i=i+1; Skill[i] = { name = "Deadly Poison Bite", use = enemy and (energy >=30)) } i=i+1; Skill[i] = { name = "Piercing Arrow", use = enemy } i=i+1; Skill[i] = { name = "Weak Spot", use = (enemy and (focus >= 30)) } i=i+1; Skill[i] = { name = "Sapping Arrow", use = enemy } i=i+1; Skill[i] = { name = "Reflected Shot", use = enemy } --i=i+1; Skill[i] = { name = "Snipe", use = enemy } i=i+1; Skill[i] = { name = "Wind Arrows", use = (enemy and (focus >= 15)) } i=i+1; Skill[i] = { name = "Shot", use = enemy } MyCombat(Skill,arg1) end
|
|
Source code |
1 |
local energy = UnitMana("player")
|
|
|
Source code |
1 |
local energy = UnitSkill("player")
|
|
|
Source code |
1 2 |
i=i+1; Skill[i] = { name = "Vampire Arrows", use = (enemy and (focus >= 20) and not string.find(tbuffs, "Vampire Arrows")) }
--i=i+1; Skill[i] = { name = "Deadly Poison Bite", use = enemy and (energy >=30) and string.find(tbuffs, "Vampire Arrows") }
|
|
|
Source code |
1 |
local tbuffs = BuffList("target")
|