Advertisement
Guest User

startup

a guest
Nov 18th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.44 KB | None | 0 0
  1. local chanrec = 0
  2. modem = peripheral.wrap("bottom")
  3. sg = peripheral.wrap("top")
  4.  
  5. while true do
  6.   term.write("Ecoute sur le channel : "..chanrec)
  7.   modem.open(chanrec)
  8.   local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
  9.   if message == "open" then
  10.     sg.openIris()
  11.     sleep(2)
  12.   elseif message == "close" then
  13.   sg.closeIris()
  14.   sleep(2)
  15.   else
  16.     sleep(0.5)
  17.   end
  18. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement