Jump to content

Computer craft. Repeat message.


Reece C.

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...