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

Multitasking

Started by Haskell, 01 January 2013 - 12:09 AM
Haskell #1
Posted 01 January 2013 - 01:09 AM
Hi there,

i wanted to write program, but got problem.
I have two functions:


function startRednet()
-- just receive data from rednet in while loop and set variable
open="open"
end

function doorControl()
while true do
if open=="open" then
-- doing something
end
end

parallel.waitForAny(startRednet(),doorControl())

This actually doesn't work. Seems that function doorControl isn't called even once.
Thanks.
remiX #2
Posted 01 January 2013 - 01:19 AM
Remove the () within the parallel.waitForAny

parallel.waitForAny(startRednet, doorControl)
Haskell #3
Posted 01 January 2013 - 01:24 AM
God, im so stupid.
Thanks, mate!