Since it occurrs in 25-mans but not in 10-mans (at least not that I notice), and it occurrs with only self and target frames showing, I am going to guess it has to do with the auras. I wasn't able to do much testing tonight (want to run with auras off and see what happens), but will try and test it tomorrow. Has anyone else experienced similar issue/behavior?
A lot of this is what Shefki has been working to eliminate.
Are you still using DogTags?
edit:
I just notice you say it works when you have only two frames showing. Have you set up *any* other frames for the other people in your group/raid?
Btw would this code be able to handle Rare Elites, or will it just stop at the first "match" ?
Please consider looking up how "if...then...else" conditionals work. A grasp of that will help you get a better idea of how to make some of the things you're looking at.
(Of course also determine the difference between "else" and "elseif".)
While looking through the API page for WoW at wowwiki.com, I noticed that there is a function UnitPower(unit,[type]) that seems to be identical to the function Power(unit,[type]) offered by Lua Text.
Given the context of much of Shefki's admonitions ("zomg! redundant calls!"), I'm clearly missing something.
What gives?
(BTW, pqee, I was looking over there to find the pet owner name function, and couldn't see one.)
Edit: I just went back to look at my version and edit it to be correct lest someone tried to use it and it didn't have this in there. Looks like a transcribing error on your part.
I never copy anything exactly. :) I try to learn stuff.
In my defense, I wasn't trying to use "nil" as the rank of the spell, but rather as the spell name. I didn't realize that the second argument was EITHER an index OR a spell name.
sfan27,
part of what lua text is trying to get people to do is avoid making multiple calls to the same function for the same piece of information.
You could edit your "health: (Current health | %health)" code to read
local s = Status(unit)
local cr,cg,cb = ClassColor(unit)
local currenthealth, maxhealth = HP(unit), MaxHP(unit)
if s then
return s
end
return "|cff%02x%02x%02x%s || %s%%|r",r,g,b,currenthealth,Percent(currenthealth,maxhealth)
which would save a function call.
Without the change, what you have is basically identical to how it would have been done in DogTags.
Granted, saving one function call isn't a lot, but if you're in a 25-man, that's 25 calls saved.
However, it's a good habit to be in, for when you start doing more elaborate calls.
(Oh, you also forgot a comma. I'm sure it was a transcription error on your part, but I wouldn't want someone else to cut-and-paste your stuff and then QQ about it not working.)
Ahh yeah the dtype shouldn't be in all caps. It should be:
Poison
Magic
Curse
...
Just change the tests. Sorry. I'll update my previous post to make it correct. I didn't bother to pay attention to that or test it in game. Trying to get through these forum posts quickly.
Okay... I've messed with it in a group, and Abolish detection seems lovely.
Debuff detection fails. Everyone (PCs; not mobs or NPCs) always has a Magic debuff. No matter what.
No one ever gets any other kind of debuff.
The only thing I can think of is that perhaps the "HARMFUL" filter is acting badly?
I've tried cutting out the Abolish detection and some other things (which didn't work). I'm not sure what else to change.
I cut out a few of the comments, and some spaces (to make things tidier).
local i = 1
local found = false
local pois,dise,curs,magi,abop,abod = "","","","","",""
while true do
local n,_,_,_,dtype = UnitAura(unit,i,nil,"HARMFUL")
if not n then
break
elseif dtype == "Poison" then
pois = "|cff5dfc0aP|r"
found = true
elseif dtype == "Disease" then
dise = "|cff7b3f00D|r"
found = true
elseif dtype == "Magic" then
magi = "|cffccffffM|r"
found = true
elseif dtype == "Curse" then
curs = "|cffff00ffC|r"
found = true
end
i=i+1
end
local n = UnitAura(unit,"Abolish Poison",nil,"HELPFUL")
if n then
abop = "|cffff0033AP|r"
found = true
end
n = UnitAura(unit,"Abolish Disease",nil,"HELPFUL")
if n then
abod = "|cffff0033AD|r"
found = true
end
if found then
return "%s%s%s%s%s%s",pois,abop,dise,abod,magi,curs
end
The text in post 940 is not working as intended, it seems. It will display when abolish poison is up (the only abolish I've managed to test) but does not indicate when something is poisoned, etc.
my attempt at luatext to do the same thing: epic fail
(Note, most of my lua coding is fumbling; I suck.)
if event == "UNIT_AURA" then
local i = 1
local found = false
local pois,dise,curs,magi,abop, abod = "","","","","",""
while true do
local n,_,_,_,dtype = UnitAura(unit,i,"HARMFUL")
--"bright red" FF0033
if not n then
break
elseif dtype == "POISON" then
pois = "|cff5DFC0A P|r"
found = true
--"green LED"
elseif dtype == "DISEASE" then
dise = "|cff7B3F00 D|r"
found = true
--"cinnamon"
elseif dtype == "MAGIC" then
magi = "|cffCCFFFF M|r"
found = true
--"aqua"
elseif dtype == "CURSE" then
curs = "|cffFF00FF C|r"
found = true
--"fuschia"
end
i=i+1
end
local _,_,_,_,_,_,exp = UnitAura(unit,"Abolish Poison",nil,"HELPFUL")
if exp ~= 0 then
abop = "|cffFF0033 AP|r"
found = true
end
local _,_,_,_,_,_,exp = UnitAura(unit,"Abolish Disease",nil,"HELPFUL")
if exp ~= 0 then
abop = "|cffFF0033 AD|r"
found = true
end
if found then
return "%s%s%s%s%s%s",pois,abop,dise,abod,magi,curs
end
I tried putting together stuff I found in posts 812, 875 and 876 (so, yes, I noticed 874.)
That's what I've got after a day of attempts.
I'd really like to get this down, as it's the last of my dogtags I have to convert. I had to enable Dogtags in PB4 last night *just* for this one tag. :) (Also, I'm apparently unable to find where to turn on border coloring based on debuffs.)
I've an idea for a healer assistant addon, but i'm not sure if it's possible to do any more. (I stopped coding stuff pre-BC.)
The basic idea is that the same set of keys would function as both spell selection and then targetting.
For example, Spells1..5 are mapped to keys x1..x5, a subsequent press would target party member 1..5.
So like if I wanted to cast Heal1 on Party3 I could hit `x1' followed by `x3'. But then if I wanted to cast Heal3 on Party1 I could hit `x3' followed by `x1'.
Yes, I know I can just hit [1] and then [F3], and then [3] then [F1], but that's not the point.
I'm also aware that this would be untenable for raids larger than 10 or any kind of pet love.
0
0
A lot of this is what Shefki has been working to eliminate.
Are you still using DogTags?
edit:
I just notice you say it works when you have only two frames showing. Have you set up *any* other frames for the other people in your group/raid?
Do you have a solid state drive?
0
I looked through the Lua reference manual, the LuaText page, the api page at wowprogramming, and the wowwiki.com/api page.
I call shenanigans.
(i.e., what are other resources I can use to figure out more stuff on my own?)
0
Please consider looking up how "if...then...else" conditionals work. A grasp of that will help you get a better idea of how to make some of the things you're looking at.
(Of course also determine the difference between "else" and "elseif".)
0
Tack "then" to the end of that line, and it should be okay.
Id est:
elseif fact=="Horde" then
Edit:
I looked more at that.
Make sure all the "elseif" lines end with "then".
0
Given the context of much of Shefki's admonitions ("zomg! redundant calls!"), I'm clearly missing something.
What gives?
(BTW, pqee, I was looking over there to find the pet owner name function, and couldn't see one.)
0
I never copy anything exactly. :) I try to learn stuff.
In my defense, I wasn't trying to use "nil" as the rank of the spell, but rather as the spell name. I didn't realize that the second argument was EITHER an index OR a spell name.
I blame xor.
Stupid xor.
(Thank you, btw. :)
0
part of what lua text is trying to get people to do is avoid making multiple calls to the same function for the same piece of information.
You could edit your "health: (Current health | %health)" code to read
which would save a function call.
Without the change, what you have is basically identical to how it would have been done in DogTags.
Granted, saving one function call isn't a lot, but if you're in a 25-man, that's 25 calls saved.
However, it's a good habit to be in, for when you start doing more elaborate calls.
(Oh, you also forgot a comma. I'm sure it was a transcription error on your part, but I wouldn't want someone else to cut-and-paste your stuff and then QQ about it not working.)
0
Okay... I've messed with it in a group, and Abolish detection seems lovely.
Debuff detection fails. Everyone (PCs; not mobs or NPCs) always has a Magic debuff. No matter what.
No one ever gets any other kind of debuff.
The only thing I can think of is that perhaps the "HARMFUL" filter is acting badly?
I've tried cutting out the Abolish detection and some other things (which didn't work). I'm not sure what else to change.
I cut out a few of the comments, and some spaces (to make things tidier).
0
0
Thanks. *blush*
Now... what's it going to take to harangue you guys into doing something like this for Cowtip. :)
Also, talk was made about doing a dedicated "Lua Texts" sampler thread or page. Is there one around I haven't been able to find?
0
my attempt at luatext to do the same thing: epic fail
(Note, most of my lua coding is fumbling; I suck.)
I tried putting together stuff I found in posts 812, 875 and 876 (so, yes, I noticed 874.)
That's what I've got after a day of attempts.
I'd really like to get this down, as it's the last of my dogtags I have to convert. I had to enable Dogtags in PB4 last night *just* for this one tag. :) (Also, I'm apparently unable to find where to turn on border coloring based on debuffs.)
0
Turn off (maybe turn on and then off again) clickthrough on auras.
0
Why would it be complicated to code?
0
The basic idea is that the same set of keys would function as both spell selection and then targetting.
For example, Spells1..5 are mapped to keys x1..x5, a subsequent press would target party member 1..5.
So like if I wanted to cast Heal1 on Party3 I could hit `x1' followed by `x3'. But then if I wanted to cast Heal3 on Party1 I could hit `x3' followed by `x1'.
Yes, I know I can just hit [1] and then [F3], and then [3] then [F1], but that's not the point.
I'm also aware that this would be untenable for raids larger than 10 or any kind of pet love.