Posted 18 August 2012 - 06:37 PM
Hey guys, just another thing im working on,I have been at it for a little while now but after fixing one error im encountering another.
Take a look at my code and see if there is any way I can use this to activate a redstone output using a file on my floppy. The file and data is there and the "Maintenance" function all work its just it keeps crashing after a few seconds, All ideas welcome.
Thanks, Dan :(/>/>
Take a look at my code and see if there is any way I can use this to activate a redstone output using a file on my floppy. The file and data is there and the "Maintenance" function all work its just it keeps crashing after a few seconds, All ideas welcome.
Thanks, Dan :(/>/>
term.clear()
term.setCursorPos(1,1)
print "Card Reader Is Online"
function door()
redstone.setOutput("back",true)
sleep(5)
redstone.setOutput("back",false)
shell.run("startup")
end
function main()
term.clear()
term.setCursorPos(1,1)
print "Maintenance Mode"
print ""
print "1) Lock Reader"
print "2) Force Open"
input = read()
if input == "1" then
while true do
sleep(0)
disk.eject("top")
e, k = os.pullEvent("key")
if k == 50 then
break
end
end
print "Card Reader Lock De-activated"
read()
shell.run("startup")
end
if input == "2" then
redstone.setOutput("back",true)
print "To Re-activate Type Password"
pass = read()
if pass == "fixme" then
redstone.setOutput("back",false)
shell.run("startup")
end
end
end
while true do
sleep(0)
if fs.exists("disk/cl") then
file = io.open("disk/cl", "r")
cle = file:read()
print "File Opened"
if cle == "2" then
disk.eject("top")
door()
else if cle == "3" then
disk.eject("top")
door()
else
sleep(0)
disk.eject("top")
shell.run("startup")
end
end
else
sleep(0)
shell.run("startup")
end
end