Posted 29 March 2014 - 02:13 AM
Here is is, pulled from computercraft.
-- The error I am getting is bios:366: [string “startup”]:4: ‘then’ expected, which really makes no sense there to me.
term.clear()
term.setCursorPos(1,1)
if firstpassrun = " "
then
firstpassrun = "y"
end
if
firstpassrun == y
then
term.setBackroundColor(colors.blue)
print("Welcome to PEX password protection.")
print("Please enter a password!")
systpassword1 = " "
systpassword1 = read()
term.clear()
term.setCursorPos(1,1)
term.setBackroundColor(colors.green)
print("Is this your password:")
print(systpassword1)
print("If this is your password, enter y.")
print("If this is not your password, enter anything else.")
local passconfirm = " "
local passconfirm = read()
if
passconfirm == y
then
term.clear()
term.setCursorPos(1,1)
term.setBackroundColor(colors.blue)
print("Now rebooting to set up password protection, please wait...")
firstpassrun = "n"
os.reboot
else
term.clear()
term.setCursorPos(1,1)
term.setBackroundColor(colors.red)
print("Rebooting. Put in the correct password after reboot, please")
os.reboot
end
else
term.clear()
term.setCursorPos(1,1)
term.setBackroundColor(colors.blue)
print("Protected By PEX. Enter the password, please")
local passrelay = " "
if passrelay ~= systpassword1
then
term.clear()
term.setCursorPos(1,1)
term.setBackroundColor(colors.red)
print("WRONG! REBOOTING!")
os.reboot
else
term.clear()
term.setCursorPos(1,1)
term.setTextColor(colors.cyan)
print("PEXPROTECT-console Version 1")
end
end