Advertisement
Xyzzy

rain

Mar 29th, 2015
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.49 KB | None | 0 0
  1. rednet.open("top")
  2. rsSide = "right"
  3.  
  4. while true do
  5.   local id, msg = rednet.receive()
  6.   print(msg)
  7.   if msg == "rainoff" then
  8.     if rs.getInput("back", true) then
  9.       print("received command")
  10.       rs.setOutput(rsSide, true)
  11.       sleep(1)
  12.       rs.setOutput(rsSide, false)
  13.       rednet.send(id, "done")
  14.       print("done")
  15.     else
  16.       print("received command")
  17.       print("not raining")
  18.       rednet.send(id, "norain")
  19.       print("done")
  20.     end
  21.   end
  22.   sleep(0.1)
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement