This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
SNWLeader's profile picture

How to make a reject message for cntrl + "T"

Started by SNWLeader, 17 December 2012 - 05:11 AM
SNWLeader #1
Posted 17 December 2012 - 06:11 AM
I am trying to figure out how to make a message that pops up at anytime when someone trys to terminate the program using the CTRL + T keys.
How would I do that?
Alekso56 #2
Posted 17 December 2012 - 06:18 AM
Like this:



function os.pullEvent()
local event, p1, p2, p3, p4, p5 = os.pullEventRaw()
if event == "terminate" then
print ("Sorry Ctrl+t is disabled")
sleep(2)
end
return event, p1, p2, p3, p4, p5
end
SNWLeader #3
Posted 17 December 2012 - 06:46 AM
Thanks that works just nicely. :D/>