Guest User

Untitled

a guest
Jun 5th, 2017
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. local server = changeme
  2. rednet.open("back")
  3.  
  4. while true do
  5. textutils.slowPrint("please log in")
  6. textutils.slowPrint("Username:")
  7. local user = read()
  8. textutils.slowPrint("Password:")
  9. local pass = read()
  10. rednet.send(server, user.."n"..pass)
  11. textutils.slowPrint("waiting for server")
  12.  
  13. local id, access
  14. repeat
  15. id, access = rednet.receive()
  16. until id == server
  17. if access == "granted" then
  18. textutils.slowPrint("access granted for 10 seconds")
  19. redstone.setOutput("right", true)
  20. sleep(10)
  21. redstone.setOutput("right", false)
  22. term.clear()
  23. term.setCursorPos(1, 1)
  24. else
  25. textutils.slowPrint("access denied")
  26. sleep(2)
  27. term.clear()
  28. term.setCursorPos(1, 1)
  29. end
  30. end
Add Comment
Please, Sign In to add comment