Thanks for the tip. I think that will prove quite handy and it gives me additional insight to other parts of the API.
I got to thinking, after posting, the "OnUpdate" runs far to often for good performance. So while it may not be the best I have it set to run my code every 250 milliseconds.
lua Code:
function OnUpdate()
if (GetGameTimeMilliseconds() - KM.vars.prevruntime > 250) then
KCT.vars.prevruntime = GetGameTimeMilliseconds()
-- code to run every 250 milliseconds
end
end
Now to the second question in my post. I did some testing and found the problem. The wiki say
EVENT_PLAYER_COMBAT_STATE (bool inCombat)
|
its actually should say something like
EVENT_PLAYER_COMBAT_STATE (integer eventCode, bool inCombat)
|
In fact now that I am looking some of the other events in the wiki are missing that first integer. I would maybe even assume all events would have an event code as the first variable??? For anyone learning the API that's going to cause huge amounts of confusion.