Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local status = "Please login first."
- local user = "Login";
- local x,y = term.getSize()
- local page = "Home";
- local lPrint = function(text)
- local x2,y2 = term.getCursorPos()
- term.setCursorPos(math.ceil(x - text:len()), y2)
- write(text)
- end
- function connect()
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print(status.. "\n")
- print("Minecraft Username: ")
- write("Minecraft Password: ")
- test = string.len("Minecraft Password: *")
- term.setCursorPos(test, 3)
- user = read()
- term.setCursorPos(test, 4)
- pass = read("*")
- http.request("http://login.minecraft.net/?user=" ..user.. "&password=" ..pass.. "&version=12")
- local event, url, response = os.pullEvent()
- if event == "http_success" then
- _sResponse = { response.readAll() }
- if string.find(tostring(_sResponse[1]), "deprecated") then
- term.setCursorPos(1, y-1)
- textutils.slowPrint("Logging in...")
- sleep(0.5)
- break
- else
- status = tostring(_sResponse[1])
- end
- else
- status = ("Unable to connect to minecraft.net")
- end
- response.close()
- end
- load()
- end
- function homepage()
- term.clear()
- term.setCursorPos(1,1)
- write("Minebook")
- lPrint("1; Login")
- for i = 1,x-1 do
- term.setCursorPos(i, 2)
- write("-")
- end
- term.setCursorPos(1,y)
- write("English (US)")
- repeat
- local event, a = os.pullEvent("key")
- until a == 2
- connect()
- end
- function tabs()
- term.clear()
- term.setCursorPos(1,1)
- write("Minebook")
- lPrint(user.. " | 1; Home | v; Logout")
- for i = 1,x-1 do
- term.setCursorPos(i, 2)
- write("-")
- end
- term.setCursorPos(1,y)
- write("English (US)")
- repeat
- local event, a = os.pullEvent("char")
- until a == "v" or a == "V"
- homepage()
- end
- function load()
- tabs()
- end
- homepage()
Advertisement
Add Comment
Please, Sign In to add comment