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

multiple os.PullEventRaw() handling going at the same time?

Started by CCNerd a.k.a CCNoob, 15 July 2014 - 12:54 PM
CCNerd a.k.a CCNoob #1
Posted 15 July 2014 - 02:54 PM
I want to get multiple os.PullEventRaw() going on the same time, is that possible? if yes, how?
theoriginalbit #2
Posted 15 July 2014 - 03:06 PM
Simple answer yes. Better answer, yes but you shouldn't need it.

If you call os.pullEvent/pullEventRaw without any arguments it will capture any event, you can then use if statements to check if the event is what you wanted, and run based off that. Be aware that when using event loops you should not use any function that yields, including, but not limited to; read, sleep, any rednet.receive, gps.locate, any turtle api function, etc.

If however your question was more aimed at having say a loop that is running 'at the same time' as a program, then you'll want to take a look at the Parallel API