daily pastebin goal
54%
SHARE
TWEET

rain

Xyzzy Mar 29th, 2015 (edited) 219 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top