Posted 12 March 2013 - 05:14 PM
On a previous script I wrote for a door lock, I was able to negate the user from activating 'Terminate' and getting past my password. I haven't ued CC in close to a year possibly (I might be exagerating but it really had been a while, maybe like 4 to 6 months)
Anywho this was the original script:
This section in specific allowed me to stop a user from terminating my 'startup' program.
Have there been changes to the terminate event? My script use to work like a charm, is there some new way to block the user from terminating my program?
Anywho this was the original script:
function clear()
term.clear()
term.setCursorPos(1,1)
end
function lock()
local PASSWORD = "PASSWORD GOES HERE"
local temp = os.pullEvent
local function dkeys(swap)
disable = {
[0] = function() os.pullEvent = temp end,
[1] = function() os.pullEvent = os.pullEventRaw end
}
disable[swap]()
end
clear()
dkeys(0)
print("Enter password:")
write("> ")
local input = read("*")
if input == PASSWORD then
clear()
dkeys(0)
print("Access granted!")
sleep(1)
clear()
textutils.slowPrint("Unlocking...")
print("Welcome!")
redstone.setOutput("back", true)
sleep(4)
redstone.setOutput("back", false)
os.reboot()
else
clear()
print("Access denied!")
textutils.slowPrint("Logging username...")
sleep(1)
os.reboot()
end
end
lock()
This section in specific allowed me to stop a user from terminating my 'startup' program.
local function dkeys(swap)
disable = {
[0] = function() os.pullEvent = temp end,
[1] = function() os.pullEvent = os.pullEventRaw end
}
disable[swap]()
Have there been changes to the terminate event? My script use to work like a charm, is there some new way to block the user from terminating my program?