View Full Version : coroutines and KillTimer

December 6th, 2009, 12:15 AM
Does anybody out there have some examples of coroutines that use the KillTimer? I found a great example from dsmes from April, and it has helped me greatly, but I seem to still be having some problems with the KillTimer actually Killing the Timer. At least that is what seems to be the problem to a Newbie who is using both coroutines and KillTimer.

On the flip side...if anyone knows of an easier way to force a screen refresh on a State Change I will take that advice as well.

Rob H
December 6th, 2009, 05:37 AM
I've never actually tried using Lua coroutines yet.

Why do you need a screen refresh?

There are a couple of (currently) undocumented methods of the element object that may help - element:UpdateState() and element:Repaint(), the UpdateState() method will force NetRemote to re-evaluate any state conditions of that element, and would typically be used when you have a Lua conditional that depends on more than one NetRemote variable, or on a Lua variable. The Repaint() method will force a repaint of that element and any children.

December 6th, 2009, 12:00 PM
Thanks Rob. I will try those out. That will make things a lot easier. I should have posted this a week ago :(

I need the screen refresh because (again) I'm working on that project for folks with disabilities. So I have a bunch of frames with a full screen button overlay because all the client can do is a single mouse click. So on a single button click I have to run a script that scans through the rows (State Change on Frames) and if a row is selected (another mouse click) scan through the columns and finally on the last click it will do an action which corresponds to the frame. So the State will change a number of times on a single button click. (Highlight RowOne, wait and poll for click, no click, Default RowOne, Hightlight RowTwo, wait and poll for click...)

So both element:UpdateState() and element:Repaint() will help a bunch. Add a busy Watcher in there and I should be good to go.