Advertisement
Guest User

startup

a guest
Aug 30th, 2015
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.01 KB | None | 0 0
  1. oldPE = os.pullEvent
  2. os.pullEvent = os.pullEventRaw
  3. rednet.open("top")
  4. term.setBackgroundColor(colors.white)
  5. term.clear()
  6. term.setTextColor(colors.blue)
  7. term.setCursorPos(1,2)
  8. print("  Invincible Faction Login Domain")
  9. term.setCursorPos(1,4)
  10. write("  Username: ")
  11. user = read()
  12. term.setCursorPos(1,6)
  13. write("  Password: ")
  14. pass = read("*")
  15. rednet.send(1582,{user,pass})
  16. sleep(0.25)
  17. while true do
  18.   local id, msg = rednet.receive(2)
  19.   if id == 1582 and msg == os.getComputerID().."yes" then
  20.     term.setBackgroundColor(colors.black)
  21.     term.clear()
  22.     term.setCursorPos(1,1)
  23.     term.setTextColor(colors.yellow)
  24.     print( os.version() )
  25.     os.pullEvent = oldPE
  26.     return
  27.   elseif id == 1582 and msg == os.getComputerID().."no" then
  28.     os.reboot()
  29.   else
  30.     term.clear()
  31.     term.setCursorPos(1,1)
  32.     print("There was an error communicating with the server.")
  33.     term.setCursorPos(1,2)
  34.     print("If this happens again, contact a system administrator.")
  35.     sleep(5)
  36.     os.reboot()
  37.   end
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement