--PASSWORD VARIABLE function
local user, userCorrect = "", "admin"
local pass, passCorrect = "", "admin"
i1 = 0
--PASSWORD FUNCTION
function os.pullEvent()
local event, p1, p2, p3, p4, p5 = os.pullEventRaw()
if event == "terminate" then
term.clear()
term.setCursorPos(12, 9)
print("Sorry Ctrl+t is disabled")
sleep(2)
denied()
end
return event, p1, p2, p3, p4, p5
end
function granted()
term.clear()
term.setCursorPos(17, 9)
textutils.slowPrint("Access Granted")
sleep(1)
term.clear()
term.setCursorPos(17, 9)
for i = 1, 2 do
textutils.slowPrint("Initializing...")
sleep(0.5)
term.setCursorPos(17, 9)
term.clearLine()
end
textutils.slowPrint("Program is loaded")
sleep(1)
term.setCursorPos(1, 3)
term.clearLine()
term.setCursorPos(1, 3)
term.clear()
end
function denied()
term.clear()
term.setCursorPos(18, 9)
textutils.slowPrint("Access Denied")
term.setCursorPos(5, 10)
textutils.slowPrint("System in PROTECTION MODE for 600 seconds")
term.setCursorBlink(false)
sleep(60)
os.reboot()
end
function passCall()
term.setCursorPos(12, 5)
while pass ~= "admin" or i1 == 3 do
pass = read("*")
if pass == "admin" then
granted()
shell.run("disk/reactor")
elseif i1 == 3 then
denied()
else
term.setCursorPos(4, 6)
print("Wrong Password")
i1 = i1 + 1
sleep(1)
term.setCursorPos(1, 5)
term.clearLine()
print("Password :")
term.setCursorPos(1, 6)
term.clearLine()
term.setCursorPos(12, 5)
end
end
end
function userCall()
while user ~= "admin" do
user = read()
if user == "admin" then
passCall()
else
term.setCursorPos(5, 6)
print("Username Invalid")
sleep(1)
term.setCursorPos(11, 4)
term.clearLine()
term.setCursorPos(1, 4)
print("Username :")
term.setCursorPos(1, 6)
term.clearLine()
term.setCursorPos(12, 4)
end
end
end
--LOADING SCREEN
term.clear()
term.setCursorPos(12, 1)
textutils.slowPrint("Welcome to the server") --Change it for what you like
term.setCursorPos(13, 2)
textutils.slowPrint("maintenance room")
term.setCursorPos(1, 4)
print("Username :")
term.setCursorPos(1, 5)
print("Password :")
term.setCursorPos(12, 4)
userCall()
It's been a while i made it so i don't recall where to change the password and the name. It is set to admin.