Posted 09 February 2013 - 05:12 PM
Greetings,
I have two computers running a simple os.pullEvent() loop:
Then I have another computer broadcasting rednet messages:
Now, the above code doesn't fail, but only the first computer looking for the message "test" actually does anything. The second one remains idle as if it never got the message (even though it was sent). So, I tried this:
And it worked perfectly. I tried changing it to sleep(0.5) and anything below one second and it had the same issue before. Is this intended, lag, or am I simply doing something wrong? It's really frustrating to have to have a second delay between time sensitive steps.
I have two computers running a simple os.pullEvent() loop:
rednet.open("top")
while true do
event, id, msg = os.pullEvent()
if event == "rednet_message" then
if msg == "test"
doStuff()
end
end
end
Then I have another computer broadcasting rednet messages:
rednet.open("top")
rednet.broadcast("test")
rednet.broadcast("test1")
Now, the above code doesn't fail, but only the first computer looking for the message "test" actually does anything. The second one remains idle as if it never got the message (even though it was sent). So, I tried this:
rednet.open("top")
rednet.broadcast("test")
sleep(1)
rednet.broadcast("test1")
And it worked perfectly. I tried changing it to sleep(0.5) and anything below one second and it had the same issue before. Is this intended, lag, or am I simply doing something wrong? It's really frustrating to have to have a second delay between time sensitive steps.