224 posts
Posted 27 July 2015 - 10:33 AM
so, I was wondering if there was a way to prevent a program from doing os.reboot() or os.shutdown(), or have a confirmation dialog, also, os.pullEvent = os.pullEventRaw doesnt seem to block terminate for me
656 posts
Posted 27 July 2015 - 10:47 AM
You can overwrite a function like os.shutdow
n:
local oldShutdown = os.shutdown
os.shutdown = function ()
print ("are you sure?")
if read () == "yes" then
oldShutdown ()
end
end
The pullRaw trick may not work when you're doing it inside an api, try it in your maun program. Make sure it's at the top of your program too.
224 posts
Posted 27 July 2015 - 02:04 PM
nice! thanks