#Compare Crit Rating to Mastery Rating
8 messages · Page 1 of 1 (latest)
Can someone help me write a custom function that compares the two and returns true if T2 > T1?
yes, but what do you actually want?
as in, what do you want to display in the end. what do you want to do with the comparison?
I simply wanted it to display static text reminding me to equip something, if true
I THINK i figured it out, please tell me if I did anything wrong:
Required for Activation
Custom Function:
function(t) return t[1] end
Trigger 1: Custom/Status
Event(s): PLAYER_STARTED_MOVING, COMBAT_RATING_UPDATE, PLAYER_EQUIPMENT_CHANGED
Custom Trigger:
function() local a = GetCombatRating(11) <-- Spell Crit Rating local b = GetCombatRating(26) <-- Mastery Rating return b > a end
I simply wanted it to display static text reminding me to equip something, if true
then ideally open with that. describing what you want to achieve/why is always better than asking for what you think to be the solution.
please tell me if I did anything wrong
This surely works, but:
Event(s): PLAYER_STARTED_MOVING
that's senseless. why listen to an event completely unrelated to what you want to do? doing stuff on events that don't matter is subpar for performance and a crutch
And instead of a custom trigger, you could just use a default stats trigger and a custom text to display something, or a custom condition. Or use a watched trigger.
Relying on the default triggers ensures that this thing is future proof and you have no hassle. The WA devs maintain those for you, should any of the functions you use or events you listen to ever change.
here, that's three ways (watched trigger, custom condition check, custom text) to do something like this while instead relying on the default trigger: https://wago.io/znD4z4NyX