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

[Solved] os.pullEventRaw not working with parallel

Started by darkrising, 11 May 2013 - 04:15 AM
darkrising #1
Posted 11 May 2013 - 06:15 AM
Hi all I've noticed on CC 1.5+ that os.pullEventRaw or pcall don't work when calling the parallel api functions, a few of my programs are using pcall but I've had to implement a loop that listens for the control key to stop people [Ctrl] + T out of the program. Its not the most elegant way of doing things but it works.

Is there a better way of doing this? and also is the [Ctrl] like key on a mac a different id? (I don't use mac)
remiX #2
Posted 11 May 2013 - 07:08 AM
Small exampe?
darkrising #3
Posted 11 May 2013 - 09:31 AM

function one()
while true do
--does stuff
end
end

function two()
while true do
--also does stuff
-- maybe login stuff too
end
end

pcall(parallel.waitForAll(one, two))

Quick example
LBPHacker #4
Posted 11 May 2013 - 12:24 PM
That pcall will try to run the function returned by .waitForAll. Try
pcall(parallel.waitForAll, one, two)
darkrising #5
Posted 11 May 2013 - 12:54 PM
Oh I see what I've done wrong now, I forgot to pass them as arguments… *derp*

Thanks for your help!