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

help

Started by SpencerBeige, 16 February 2015 - 12:19 AM
SpencerBeige #1
Posted 16 February 2015 - 01:19 AM
print(parrallel.waitForAny(os.pullEvent("timer"), os.pullEvent("mouse_click")))

returns:

EXPECTED FUNCTION!!!! GOT STRING U IDIOT!
Bomb Bloke #2
Posted 16 February 2015 - 01:22 AM
os.pullEvent() does indeed return a string, among other things. You can't tell parallel.waitForAny() to run a string.

If you want parallel.waitForAny() to run functions with specific parameters, then you'll need to encapsulate your calls within other, new functions. Eg:

parallel.waitForAny(function() os.pullEvent("timer") end, function() os.pullEvent("mouse_click") end)
SpencerBeige #3
Posted 16 February 2015 - 01:47 AM
thx!