resaloli

BaseOS Sec

Jun 8th, 2014
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. sec = 0
  2. local modem = peripheral.wrap("left")
  3. modem.open(1)
  4. local _, side, freq, rfreq, message = os.pullEvent('modem_message')
  5. print(message)
  6. print("Preparing!")
  7. while true do
  8.     local _, side, freq, rfreq, message = os.pullEvent('modem_message')
  9.     if message == "SecOFF" then
  10.             print(message)
  11.             rs.setOutput("top", false)
  12.             sec = 0
  13.     end
  14.     if message == "SecON" then
  15.             print(message)
  16.             rs.setOutput("top", true)
  17.             sec = 1
  18.     end
  19.     if message == "SecState" then
  20.             print(message)
  21.             modem.transmit(1, 1, sec)
  22.     end
  23. end
Add Comment
Please, Sign In to add comment