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

Termination

Started by Astrophylite, 12 July 2015 - 08:58 AM
Astrophylite #1
Posted 12 July 2015 - 10:58 AM
I have been trying to create a startup unlock program thing but when I disable termination in this startup, I cannot terminate anything afterwards?
So my question is: how do I stop termination for that program, then re-allow termination afterwards?

Thanks in advance,
ZiR
MKlegoman357 #2
Posted 12 July 2015 - 11:20 AM
Next time, please provide the code you're having issues with, it might help solve your problem a lot faster. Anyway, you're probably doing something like this:


os.pullEvent = os.pullEventRaw

But what you should be doing is saving the original os.pullEvent function into a variable and then restoring it when your program exits:


local os_pullEvent = os.pullEvent
os.pullEvent = os.pullEventRaw

...

os.pullEvent = os_pullEvent
Astrophylite #3
Posted 12 July 2015 - 01:19 PM
Thank you for your help! Next time, I will include the code.

ZiR