Originally Posted by Phanx
You can use UnitIsAFK to see if the event was triggered by AFK, though you do have to keep track of the previous state outside of the event handler.
|
ok you're right... *cough* I must have been drunk the night when I programmed this...
hazukashi desu ^^
Code:
if event == "PLAYER_FLAGS_CHANGED" then
local isAFK = UnitIsAFK("player")
if not prevAFKState and isAFK then
prevAFKState = true
SetAwayMode(true)
elseif prevAFKState and not isAFK then
prevAFKState = false
SetAwayMode(false)
end
end