Posted 29 May 2012 - 10:33 PM
This following programs reads from a inserted disk to see if that person has a high enough clearance.
I wanted to know if i could have the program read from only a SPECIFIC line on the disk or a specific file on the disk so i can include additional data such as name or specific permissions. Then have the program write to its own rom, adding lines to a previous existing log.
Are there any commands that could help me do that?
Credit for this program goes to coolblockj
http://mccraftcpl.pr...play&thread=163
I wanted to know if i could have the program read from only a SPECIFIC line on the disk or a specific file on the disk so i can include additional data such as name or specific permissions. Then have the program write to its own rom, adding lines to a previous existing log.
Are there any commands that could help me do that?
Spoiler
while true do
event, param1, param2 = os.pullEvent()
if event == "disk" and param1 == "dside" or if disk.isPresent(dside) == true then
if fs.exists("disk/level") then
file = io.open("disk/level", "r")
passt = file:read()
if passt >= pass then
print("ACCESS GRANTED")
disk.eject(dside)
power(pside, colors.blue)
sleep(10)
power(pside, 0)
else
print ("ACCESS LEVEL NOT HIGH ENOUGH")
sleep(10)
disk.eject(dside)
os.reboot()
end
end
disk.eject(dside)
end
end
Credit for this program goes to coolblockj
http://mccraftcpl.pr...play&thread=163