Reece C. Posted September 28, 2013 Posted September 28, 2013 rednet.open("left") while true do shell.run("clear") if rs.getInput ("back") then rednet.broadcast("engines on") else rednet.broadcast("engines off") end os.pullEvent("redstone") end I want it to repeatedly send the correct message, instead of just sending it once when the red-stone is updated. Quote
Reece C. Posted September 28, 2013 Author Posted September 28, 2013 I could just use this rednet.open("left") while true do shell.run("clear") if rs.getInput ("back") then rednet.broadcast("engines on") shell.run("reboot") else rednet.broadcast("engines off") shell.run("reboot") end os.pullEvent("redstone") end But sometimes there is a large delay before the message is updated. I need something more reliable. Quote
phazeonphoenix Posted September 28, 2013 Posted September 28, 2013 it's the os.pullEvent line that's causing the trouble here, it waits for a redstone event before allowing the program to loop again. Remove it but be sure to put in a sleep() call. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.