Since the server is down and I can't test things maybe instead of pulling my hair out I can ask a few questions here.
First, in the MyFirstAddon tutorial, the xml file use an "OnUpdate" element to trigger a function
Code:
<OnUpdate>
MyFirstAddOnUpdate()
</OnUpdate>
Is there a way to trigger the "OnUpdate" using lua only? I searched the wiki but didn't see anything that stood out.
Second, been tinkering with the EVENT_PLAYER_COMBAT_STATE.
lua Code:
KrikMod:RegisterForEvent(EVENT_PLAYER_COMBAT_STATE, PlayerCombatState)
For testing I just store the boolean value in a global variable, and then a function checks the value and performs different actions based on the value returned. I guess I don't quite get how the "RegisterForEvent" works, because if I enter combat the function will output the test text I have it generating. But if I leave combat it doesn't do anything. I am not sure what to think of it yet need to do some more testing once the servers are back, but since I am waiting I'll see if someone has an answer.