function wait(seconds, event)
local waitdelay = os.startTimer(seconds)
local chk, p1, p2, p3;
repeat chk, p1, p2, p3 = os.pullEvent() until (event ~= nil and chk == event) or (chk == "timer" and p1 == waitdelay)
return chk, p1, p2, p3
end
term.clear()
term.setCursorPos(1,1)
textutils.slowPrint("Running Startup Program...")
wait(1)
term.setCursorPos(1,1)
term.clearLine()
print("Running Startup Program..")
wait(1)
term.setCursorPos(1,1)
term.clearLine()
print("Running Startup Program...")
wait(1)
term.setCursorPos(1,1)
term.clearLine()
print("Running Startup Program..")
wait(1)
term.setCursorPos(1,1)
term.clearLine()
print("Running Startup Program...")
wait(1)
textutils.slowPrint("Processing Scripts...")
wait(1)
term.setCursorPos(1,2)
term.clearLine()
print("Processing Scripts..")
wait(1)
term.setCursorPos(1,2)
term.clearLine()
print("Processing Scripts...")
wait(1)
totalbytes = 3250187
local count = 0
repeat
count = count + 325000
print("Bytes Loaded: " .. count)
wait(0.001)
until count >= totalbytes
textutils.slowPrint("35 folders detected.")
wait(2)
textutils.slowPrint("491 initial files loaded.")
wait(2)
textutils.slowPrint("Loading user made programs.")
wait(1)
textutils.slowPrint("Loading startup screen")
wait(1)
term.clear()
pos1 = 30
term.setCursorPos(pos1, 9)
countt = 0
repeat
term.setCursorPos(pos1, 9)
print("-")
pos1 = pos1 - 1
wait(0.5)
until pos1 == 18
term.clearLine()
term.setCursorPos(1,6)
print([[
_____ _____ ____ ____
/ ___/______ _/ _/ /_/ __ \/ __/
/ /__/ __/ _ / _/ __/ /_/ /\ \
\___/_/ \_,_/_/ \__/\____/___/
/ / ___ ___ ____/ /__ ___/ /
/ /__/ _ \/ _ / _ / -_) _ /
/____/\___/\_,_/\_,_/\__/\_,_/
]])
wait(3)
Admin = "Admin"
Apass = "Password"
User = "User"
Upass = "Password"
shell.run("clear")
term.clear()
term.setCursorPos(1,1)
term.setCursorPos(1,6)
print([[
_____ _____ ____ ____
/ ___/______ _/ _/ /_/ __ \/ __/
/ /__/ __/ _ / _/ __/ /_/ /\ \
\___/_/ \_,_/_/ \__/\____/___/
]])
print ("ComputerCraft 1.4")
print("------------------------")
-- Height, 18
-- Width, 50
print("Computer Users Enter Password")
print("User:Admin")
print("User:User")
status, input = pcall (read)
if input == Admin then
print "Password:"
status, password = pcall (read,'*')
if password == Apass then
print "Access Granted!"
sleep(2)
shell.run("cd","Admin")
shell.run("clear")
wait(3)
term.clear()
term.setCursorPos(1,1)
term.setCursorPos(1,6)
print([[
_____ _____ ____ ____
/ ___/______ _/ _/ /_/ __ \/ __/
/ /__/ __/ _ / _/ __/ /_/ /\ \
\___/_/ \_,_/_/ \__/\____/___/
/ / ___ ___ ____/ /__ ___/ /
/ /__/ _ \/ _ / _ / -_) _ /
/____/\___/\_,_/\_,_/\__/\_,_/
]])
print ("ComputerCraft 1.4")
print("------------------------")
-- Height, 18
-- Width, 50
else
end
elseif input == User then
print "Password:"
status, password = pcall (read,'*')
if password == Upass then
print "Access Granted!"
sleep(2)
shell.run("cd","User")
shell.run("clear")
else
end -- needed a end here
elseif input ~= Admin and input ~= User then -- to stop people bypassing your script.
print("WrongPassword")
sleep(3)
term.clear()
term.setCursorPos(1,1)
textutils.slowPrint("ShutingDown...")
wait(1)
term.setCursorPos(1,1)
term.clearLine()
print("ShutingDown..")
wait(1)
term.setCursorPos(1,1)
term.clearLine()
print("ShutingDown...")
wait(1)
term.setCursorPos(1,1)
term.clearLine()
print("ShutingDown..")
wait(1)
term.setCursorPos(1,1)
term.clearLine()
print("ShutingDown...")
wait(1)
sleep(3)
os.shutdown()
end
Comments