xXm0dzXx

Untitled

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