Posted 17 July 2012 - 11:37 AM
HI i have been working on a admin lock to lock users consols
here is my code
when inserting floppy in to the drive it works but when i remove the floppy and rebooting the computer it says startup:2: no such file
when it should have copyed the startup from the floppy to the computer
am i doing somthing wrong?
maybe with the fs.delete & fs.copy?
Note:most of this code came from
KillerOfPie,s multi-password door lock+admin
Any help is greatly appreciated thanks
-Angel
Come take a look at it for your self on my server
ip:craftreborn.mchost.org
here is my code
Spoiler
fs.delete("startup")
fs.copy("disk/startup", "startup")
os.pullEvent = os.pullEventRaw
local side = "right"
local password1 = "********"
local password2 = "********"
local password3 = "********"
local password4 = "********"
local passwordadmin = "********"
term.clear()
sleep(1)
print("Admin console Lock Loading...")
sleep(2)
print("Your console has been locked by an admin")
sleep(1)
print("Please contact an admin to have it unlocked.")
sleep(2)
print("Admin please enter the unlock code.")
write("Code: ")
local input = read("*")
if input == password1 then
term.clear()
term.setCursorPos(1,1)
print("Password correct!")
print("Computer unlocking...")
print("To remove this lock please edit startup and delete the code")
os.pullEvent(terminate)
end
if input == password2 then
term.clear()
term.setCursorPos(1,1)
print("Password correct!")
print("Computer unlocking...")
print("To remove this lock please edit startup and delete the code")
os.pullEvent(terminate)
end
if input == password3 then
term.clear()
term.setCursorPos(1,1)
print("Password correct!")
print("Computer unlocking...")
print("To remove this lock please edit startup and delete the code")
os.pullEvent(terminate)
end
if input == password4 then
term.clear()
term.setCursorPos(1,1)
print("Password correct!")
print("Computer unlocking...")
print("To remove this lock please edit startup and delete the code")
os.pullEvent(terminate)
end
if input == passwordadmin then
term.clear()
term.setCursorPos(1,1)
print("Password correct!")
print("Computer unlocking...")
print("To remove this lock please edit startup and delete the code")
os.pullEvent(terminate)
else
term.clear()
term.setCursorPos(1,1)
print("Password incorrect User please donot try to bypass this Block!")
sleep(2)
os.shutdown()
end
when it should have copyed the startup from the floppy to the computer
am i doing somthing wrong?
maybe with the fs.delete & fs.copy?
Note:most of this code came from
KillerOfPie,s multi-password door lock+admin
Any help is greatly appreciated thanks
-Angel
Come take a look at it for your self on my server
ip:craftreborn.mchost.org