monsteonaleash

sad

Nov 5th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. local status = "Please login first."
  2. local x,y = term.getSize()
  3. function connect()
  4. while true do
  5. term.clear()
  6. term.setCursorPos(1,1)
  7. print(status.. "n")
  8. print("Minecraft Username: ")
  9. write("Minecraft Password: ")
  10. test = string.len("Minecraft Password: *")
  11.  
  12. term.setCursorPos(test, 3)
  13. user = read()
  14. term.setCursorPos(test, 4)
  15. pass = read()
  16. http.request("http://login.minecraft.net/?user=" ..user.. "&password=" ..pass.. "&version=12")
  17. local event, url, response = os.pullEvent()
  18. if event == "http_success" then
  19. _sResponse = { response.readAll() }
  20. if string.find(tostring(_sResponse[1]), "deprecated") then
  21. term.setCursorPos(1, y-1)
  22. textutils.slowPrint("Logging in...")
  23. sleep(0.5)
  24. break
  25. else
  26. status = tostring(_sResponse[1])
  27. end
  28. else
  29. status = ("Unable to connect to minecraft.net")
  30. end
  31.  
  32. response.close()
  33. end
  34. end
  35. connect()
Add Comment
Please, Sign In to add comment