Advertisement
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
- --parallel.waitForAny(tabs, load)
- tabs()
- 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
- print("Please login first.")
- term.setCursorPos(1,y)
- write("NeXuS | Logged out")
- repeat
- local event, a = os.pullEvent("key")
- until a == 2
- connect()
- end
- function tabs()
- term.clear()
- load()
- term.setCursorPos(1,1)
- write("Minebook")
- lPrint("1; Home | 2; Test | v; Logout")
- for i = 1,x-1 do
- term.setCursorPos(i, 2)
- write("-")
- end
- term.setCursorPos(1,y)
- write("NeXuS | " ..user)
- local event, a = os.pullEvent("char")
- if tonumber(a) == 1 then
- page = "Home"
- elseif tonumber(a) == 2 then
- page = "Secret"
- elseif a == "v" or a == "V" then
- homepage()
- end
- tabs()
- end
- function load()
- term.setCursorPos(1,3)
- if page == "Home" then
- print("Under construction.")
- else
- print("Hi :3")
- end
- end
- homepage()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement