Advertisement
Guest User

transmit

a guest
Aug 22nd, 2014
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.72 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2.  
  3. local modem = peripheral.wrap("back")
  4. local access = false
  5. local password = "patata"
  6. local input
  7. function clear()
  8.   term.clear()
  9.   term.setCursorPos(1,1)
  10. end
  11.  
  12. while access == false do
  13.   clear()
  14.   print("Enter Password")
  15.   input = read()
  16.   if input == password then
  17.     access = true
  18.   end
  19. end
  20.  
  21. clear()
  22. print("Select Mode")
  23. input = read()
  24. if input == "admin" then
  25.   modem.transmit(35353,1,"terminate")
  26.   os.reboot()
  27. elseif  input == "terminate" then
  28.   return
  29. else
  30.   clear()
  31.   print("Active")
  32.   while true do
  33.     os.startTimer(0.2)
  34.     modem.transmit(35353,1,"access")
  35.     event = os.pullEventRaw()
  36.     if event ~= "timer" then
  37.       os.reboot()
  38.     end
  39.   end
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement