Whenever I try to specify the timeout in rednet.receive() it gives me the following error which I think is a bug:
startup.lua:38: bad argument #2 (expected number, got number)
This is the code I'm using. It's asks the turtles with ids 0,1,2,3,4 for their status.
if command == "next" then readyTurtles = 0 for i = 0, 4 do id = 5 rednet.send(i,"status") id,msg,protocol = rednet.receive(2) if id == i then print("ID " .. id .. ": ready") readyTurtles = readyTurtles + 1 else print("ID " .. i .. ": not ready") end end if readyTurtles == 5 then rednet.broadcast("1337") end else rednet.broadcast(command) end
Using ComputerCraft1.80pr1
I have no clue what I'm doing wrong here, as the wiki does the same thing.