Posted 04 August 2013 - 08:30 PM
Emergancy Shutdown Floppy disks, Are they possible to make? If so that may be pretty useful.
function turnOff()
while true do
local event, side = os.pullEvent()
if event == "disk" then
os.shutdown()
end
sleep(1)
end
end
sleep(1) might cause you to miss a disk event if it happens in that one second after a different event.Firstly, I don't know.
Secondly, some advice before a pro gets on and gives you better info. You would need a function like:function turnOff() while true do local event, side = os.pullEvent() if event == "disk" then os.shutdown() end sleep(1) end end
Which runs parallel to whatever your program is doing in the meantime. This might work?