Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Draw Boarder function
- function DrawBoarder()
- paintutils.drawLine(1, 1, 51, 1, colors.green)
- paintutils.drawLine(1, 2, 1, 18, colours.green)
- paintutils.drawLine(1, 18, 51, 18, colours.green)
- paintutils.drawLine(51, 2, 51, 18, colors.green)
- CheckIfLoggedIn()
- end
- function CS()
- term.clear()
- term.setTextColor(colors.white)
- DrawBoarder()
- end
- -- Login stuff
- Nitrosis = {"Nitrosis", "Rain"}
- Rain = {"Rain", "Nitro"}
- -- Vars
- IsLoggedIn = false
- -- Check is logged in
- function CheckIfLoggedIn()
- if IsLoggedIn == false then
- term.setCursorPos(20, 3)
- term.setBackgroundColor(colors.black)
- print("Please login.")
- Login()
- end
- end
- function Login()
- term.setTextColor(colours.white)
- term.setCursorPos(3, 5)
- print("Username: ")
- term.setCursorPos(3, 6)
- Username = read()
- term.setCursorPos(3, 7)
- print("Password: ")
- term.setCursorPos(3, 8)
- Password = read("*")
- CheckLogin()
- end
- function CheckLogin()
- if Username == Nitrosis[1] and Password == Nitrosis[2] then
- term.setCursorPos(18, 8)
- term.setTextColor(colors.green)
- print("Login successful")
- IsLoggedIn = true
- sleep(1)
- GUI()
- elseif Username == Rain[1] and Password == Rain[2] then
- term.setCursorPos(18, 8)
- term.setTextColor(colors.green)
- print("Login successful")
- IsLoggedIn = true
- sleep(1)
- GUI()
- else
- term.setCursorPos(20, 8)
- term.setTextColor(colors.red)
- print("Login failed")
- sleep(1)
- CS()
- end
- end
- function GUI()
- term.clear()
- paintutils.drawLine(1, 1, 51, 1, colors.green)
- paintutils.drawLine(1, 2, 1, 18, colours.green)
- paintutils.drawLine(1, 18, 51, 18, colours.green)
- paintutils.drawLine(51, 2, 51, 18, colors.green)
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- term.setCursorPos(15, 3)
- print("Welcome back, ", Username)
- term.setCursorPos(43, 16)
- term.setBackgroundColor(colors.gray)
- print("Logout")
- CheckCursor()
- end
- function CheckCursor()
- while true do
- end
- end
- -- Exec functions
- CS()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement