Advertisement
meuced

Porte3x3_computerDroite

Jun 17th, 2013
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. local idChannel = 125
  2.  
  3. function close()
  4.     rs.setOutput("top", false)
  5. end
  6.  
  7. function open()
  8.     rs.setOutput("top", true)
  9. end
  10.  
  11. function side()
  12.     rs.setOutput("left", true)
  13.     sleep(0.2)
  14.     rs.setOutput("left", false)
  15. end
  16.  
  17. modem = peripheral.wrap("bottom")
  18. open()
  19. sleep(0.1)
  20. close()
  21. while true do
  22.     modem.open(idChannel)
  23.     event, modemSide, senderChannel, replyChannel, text, senderDistance = os.pullEvent("modem_message")
  24.     if text == "open" then
  25.         open()
  26.     elseif text == "close" then
  27.         close()
  28.     elseif text == "side" then
  29.         side()
  30.     end
  31.     modem.close(idChannel)
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement