This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
balfire's profile picture

poll for events while other stuff works

Started by balfire, 06 March 2016 - 04:39 PM
balfire #1
Posted 06 March 2016 - 05:39 PM
I have tryed to figure out how can i poll for either nil event or how can i bybass the yield. I want my program to constantly update reactor information, but i also have a button, and if i press the button i want it to on/off the reactor. But the problem is i cant seem to bypass poll event if there are no events. How could i do it ?
Lyqyd #2
Posted 06 March 2016 - 05:44 PM
Your program probably doesn't need to update more often than once per second, so you should use a timer event to trigger the updates. Then it's a simple matter of handling other events in the same place you handle the timer event.
balfire #3
Posted 06 March 2016 - 06:39 PM
Yep that worked. But now i have another problem. I have monitor_touch event, and single click calls this event twise.
Bomb Bloke #4
Posted 06 March 2016 - 10:42 PM
Post your code to pastebin and provide a link back here.