Posted 18 August 2012 - 05:23 PM
Currently i have this running on a few computers it used floppy disk as access cards.
The issue is by default you can type text while this program is running. I thought this would do the trick but any were i add it causes complications.
Any help?
-- Settings
side = "bottom" --location of diskdrive
pass = "4"
--PROGRAM
power(side, false)
shell.run ("clear")
print ("==========================")
print ("=Protection: Active=")
print ("==========================")
print ("ACCESS LEVEL NEEDED:"..pass)
while true do
os.pullEvent()
if disk.isPresent(side) == true then
if fs.exists("disk/level") then
file = io.open("disk/level", "r")
passt = file:read()
if passt >= pass then
shell.run ("clear")
print ("Access Granted")
disk.eject(side)
redstone.setBundledOutput("back", colors.blue)
redstone.setBundledOutput("left", colors.blue)
redstone.setBundledOutput("right", colors.blue)
sleep(4)
redstone.setBundledOutput("back", 0)
redstone.setBundledOutput("left", 0)
redstone.setBundledOutput("right", 0)
shell.run ("clear")
shell.run ("level4")
else
print ("ACCESS LEVEL NOT HIGH ENOUGH")
sleep(1)
disk.eject(side)
os.reboot()
end
end
disk.eject(side)
end
end
I would like to add the ability that when you type the word "hack" it will run a new programThe issue is by default you can type text while this program is running. I thought this would do the trick but any were i add it causes complications.
input = read()
if input == "hack" then
shell.run (hack)
I simply want it to run as it does in the code at the top and still allow text input and anytime the work hack is entered it runs that hack program.Any help?