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.
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.
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.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now