Posted 05 December 2012 - 09:39 AM
i tried to make a coroutine to receive rednet messages but get wrong values. I tested it on wireless turtle.
function f()
while true do
coroutine.yield(rednet.receive())
end
end
rednet.open("right")
c = coroutine.create(f)
coroutine.resume© //getting "true rednet_message" here regardless of was there any messages or not
I leaned about lua just yesterday so i can do something wrong here.
Thanks.
function f()
while true do
coroutine.yield(rednet.receive())
end
end
rednet.open("right")
c = coroutine.create(f)
coroutine.resume© //getting "true rednet_message" here regardless of was there any messages or not
I leaned about lua just yesterday so i can do something wrong here.
Thanks.