#Custom Trigger always returning false

22 messages · Page 1 of 1 (latest)

low marsh
#

Hey guys, having an issue with a custom trigger with regard to it always returning false or nil. The end goal is to have the weakaura trigger when someone wispers me a specific phrase that I have set in my custom options and return false if I have a certain buff active on the player (hide itself and call Untrigger so I can clear my arrays)
I have two events this trigger is listening to: UNIT_AURA and CHAT_MSG_WHISPER. The proper code runs when the events are called, and returns if the conditions are met e.g. the buff I look for in UNIT_AURA is active on the player, return false and run the Untrigger() or if the whisper message was equal to the static trigger I've set in custom options e.g. "Hello!", return true and run the Trigger1 IsActive custom condition code. My question is, if the code of the trigger doesn't return anything e.g. the buff wasn't found on the player, will the trigger return false or nil even if I haven't stated so? This is what seems to be happening. My aura will trigger on the whisper, but instantly untrigger from the UNIT_AURA event
https://i.imgur.com/6byIK41.png

deft kettle
#

please do not send pictures of code. send the aura on wago.

low marsh
deft kettle
#

you are trying to save something there in the config, you cant do that

frail sundial
#

the untrigger box doesn't work how you think it does

low marsh
#

Oh you can't do that for WotlK weakauras?

#

you can for retail

frail sundial
#

it doesn't run when you return false, it runs on the specified events

deft kettle
#

no

#

you cant do that in retail either. config is read only.

#

your custom code in conditions isnt needed either from taking a quick glance

low marsh
frail sundial
#

untrigger runs on the same event the trigger does

#

and currently it is returning true on every unit_aura event

low marsh
#

ohhh, so basically I need to move my unit_aura block of code to untrigger and return true if the buff is found

#

from what I understand

frail sundial
#

technically yes but ideally you would just use SPELL_AURA_APPLIED/SPELL_AURA_REMOVED and store if the buff is currently applied to you or not and then checking what that status is when you get a whisper

#

unit_aura fires way too often

low marsh
#

Didn't know those existed... THANKS! Its working perfectly

low marsh
#

even this aura I linked is adding players to a list that wsp me and updates them as more whispers come in (up to 3)

frigid hull
#

No error is thrown by trying to write to the config table. It just won't stick