I was wondering if its possible to write an aura to trigger based on a glyph, aka I would like an aura to trigger if I'm in ToT but have a Pvp glyph active.
I was wondering if its possible to write an aura to trigger based on a glyph, aka I would like an aura to trigger if I'm in ToT but have a Pvp glyph active.
Sure, it's possible.
It seems like you'd make one with appropriate load/spec conditions for being in a raid then add a trigger that fires on events like player_entering_world and zone_changed_* . it would call GetGlyphSocketInfo and look for spell IDs that are 'bad' and return true. You'd make the 'hide' trigger timed for some amount of time (say 10 seconds) so that if you want to ignore the aura then you can but it'll be obvious for a short while after you change zones
There will be some leg work for you (ie: determining counts as a "pvp glyph", what their spell id is, what events to fire on, what zones need checking, etc. but the basic idea is sound.Code:function() -- this is the basic idea - i'm writing this on a phone so it probably needs cleaning up. local badGlyphId = 12345 -- spell-id goes here local hasBadGlyph = false for i,1, NUM_GLYPH_SLOTS do if (select(4, GetGlpyhSocketInfo) == badGlpyhId)) { hasBadGlpyh = true end end return hasBadGlyph end
Fixed some typos.
And to be clear, you should be able to use that to check for the presence of any glyph (whether the goal is to have the glyph active or not). It will return true if you have the glyph, false if you don't. If you want to invert that behavior you can change the 2nd to last line to "return not hasBadGlyph".
Last edited by aggixx; 2013-05-31 at 03:09 AM.
Hi there!
I know this post is old, but maybe anybody can help me.
I actually tried to use this trigger to check if i have the Glyph for Chainlightning in a slot, so i changed your code in that way:
I used the GlyphID i saw on wowhead from the Glyphitem itself, i hope that is right.Code:function() local badGlyphId = 41518 local hasBadGlyph = false for i=1, NUM_GLYPH_SLOTS do if (select(4, GetGlyphSocketInfo(i)) == badGlyphId)) { hasBadGlyph = true break end end return hasBadGlyph end
Everytime i get this error:
[string "return function()..."]:5: 'then' expected near ')'
I have to say, that i use the german client and the latest WeakAura2 Addon.
I don't know how to fix this problem, maybe anybody can help me a bit?
Thanks a lot,
Zalasta
There was an error in the original post that I didn't catch, the left curly bracket on the if line should be a "then" instead, like so:
Code:function() local badGlyphId = 41518 local hasBadGlyph = false for i=1, NUM_GLYPH_SLOTS do if (select(4, GetGlyphSocketInfo(i)) == badGlyphId)) then hasBadGlyph = true break end end return hasBadGlyph end
Sorry for the late bump, but this is the top result in google. Line 5 of your post has an extra closing bracket and still returns the error of missing 'then'. Fixed below...
Code:function() local badGlyphId = 1 local hasBadGlyph = false for i=1, NUM_GLYPH_SLOTS do if (select(4, GetGlyphSocketInfo(i)) == badGlyphId) then hasBadGlyph = true break end end return hasBadGlyph end
Oops! Guess I didn't catch what evn meant for that right parenthesis after the function name. I blame him! :P
Fixed this today for wotlk classic, took me an hour to get it right.
1st: The spellID is not needed here, it is a special glyph id, that you can find out by
2nd: the iteration will stop if you have empty glyph slots. fill them up - also the minor glyphs!Code:for i=1, (NUM_GLYPH_SLOTS) do DEFAULT_CHAT_FRAME:AddMessage("Glyph Socket "..i.." contains GlyphID"..select(4, GetGlyphSocketInfo(i))); end end