CodeCrafter

.boot

May 1st, 2013
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 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, 2)
  13. user = read()
  14. term.setCursorPos(test, 3)
  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. shell.run("Minedows/programs/Menu",user)
  25. break
  26. else
  27. status = tostring(_sResponse[1])
  28. end
  29. else
  30. status = ("Unable to connect to minecraft.net")
  31. end
  32.  
  33. response.close()
  34. end
  35. end
  36. connect()
Advertisement
Add Comment
Please, Sign In to add comment