Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function blockKeys()
- local blockedKeys = {
- [keys.t] = true, -- Ctrl + T
- [keys.s] = true, -- Ctrl + S
- [keys.r] = true, -- Ctrl + R
- }
- while true do
- local event, key = os.pullEvent("key")
- -- Check if the pressed key is part of the blockedKeys table
- if key == keys.leftCtrl and blockedKeys[io.read(1):byte()] then
- -- Do nothing (block the key)
- else
- -- Allow the key to proceed
- os.queueEvent(event, key)
- end
- end
- end
- local function runProgram()
- local unblockFile = "/path/to/unblock.lua" -- Replace with the actual path
- term.clear()
- term.setCursorPos(1, 1)
- print("This device has been disabled due to suspicious activity in the system.")
- print("Press Enter to enable and run the program.")
- local _, key = os.pullEvent("key")
- if key == keys.enter then
- if fs.exists(unblockFile) then
- shell.run("/disk/os/gui")
- else
- term.clear()
- term.setCursorPos(1, 1)
- print("Error: 'unblock.lua' not found.")
- print("Running default program...")
- sleep(2)
- shell.run("default_program_name") -- Replace with the actual program name
- end
- end
- end
- parallel.waitForAny(blockKeys, runProgram)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement