Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- function login(username, password)
- request = http.post("http://www.retroservices.16mb.com/verify.php", "username="..textutils.urlEncode(tostring(username)).."&password="..textutils.urlEncode(tostring(password)))
- if request.readAll() == "true" then
- return true
- else
- return false
- end
- end
- function centered(str, height)
- term.setCursorPos(51 / 2 - #str / 2, height)
- term.write(str)
- end
- function indented(str, indent, height)
- term.setCursorPos(indent, height)
- term.write(str)
- end
- function layout()
- while true do
- term.setBackgroundColour(colours.cyan)
- term.clear()
- term.setTextColour(colours.blue)
- centered("smiggerLock", 1)
- indented("Username: ", 2, 6)
- indented("Password: ", 2, 8)
- term.setCursorPos(13, 6)
- username = read()
- if username:len() > 0 then
- term.setCursorPos(13, 8)
- password = read("*")
- if password:len() > 0 then
- if login(username, password) == true then
- rs.setOutput("bottom", true)
- sleep(2)
- rs.setOutput("bottom", false)
- end
- end
- end
- end
- end
- layout()
Advertisement
Add Comment
Please, Sign In to add comment