Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- colored = true
- if term.isColour() then
- print("Terminal is colored.")
- sleep(.1)
- colored = true
- else
- error("Terminal not colored.")
- end
- password = {
- username = "Guest";
- password = "1234";
- }
- function SPixel(x,y,color)
- term.setCursorPos(x,y); term.setTextColour(color)
- term.setBackgroundColour(color); term.write("d")
- term.setTextColour(colours.white); term.setBackgroundColour(colours.black)
- end
- function SPixelText(x,y,color,textcol,b)
- term.setCursorPos(x,y); term.setTextColour(textcol)
- term.setBackgroundColour(color); term.write(b)
- term.setTextColour(colours.white); term.setBackgroundColour(colours.black)
- end
- term.clear()
- term.setCursorPos(1,1)
- function login_colored()
- term.clear()
- term.setCursorPos(1,1)
- for i=1, 51 do
- SPixel(i,1,colours.grey)
- end
- SPixelText(1,1,colours.grey,colours.white,"Login System Made By ntnick")
- term.setCursorPos(1,2)
- io.write("Username: ")
- local uName = read()
- io.write("Password: ")
- local pWord = read("*")
- if(uName == password.username and pWord == password.password) then
- term.clear()
- term.setCursorPos(1,1)
- return
- elseif(uName ~= password.username and pWord ~= password.password) then
- term.setCursorPos(1,19)
- SPixelText(1,19,colours.black,colours.red,"Wrong password. Redirecting...")
- sleep(2)
- login_colored()
- end
- end
- login_colored()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement