Advertisement
meuced

Porte3x3_computerGauche

Jun 17th, 2013
360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.43 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. modem = peripheral.wrap("right")
  12. open()
  13. sleep(0.1)
  14. close()
  15. while true do
  16.     modem.open(idChannel)
  17.     event, modemSide, senderChannel, replyChannel, text, senderDistance = os.pullEvent("modem_message")
  18.     if text == "open" then
  19.         open()
  20.     elseif text == "close" then
  21.         close()
  22.     end
  23.     modem.close(idChannel)
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement