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

how to protect a textutils.slowPrint against termination

Started by Ashtoruin, 04 June 2012 - 02:54 AM
Ashtoruin #1
Posted 04 June 2012 - 04:54 AM
Is it possible to protect this against termination? I've tried using pcall a few ways and they didnt work.

textutils.slowPrint ("::::::::",5)
Lolgast #2
Posted 04 June 2012 - 08:31 AM
If you put this at the start of you program:

local oldPullEvent = os.pullEvent
os.pullEvent = os.pullEventRaw
And this at the end:

os.pullEvent = oldPullEvent
It won't throw a terminate error. However, ctrl+s and ctrl+r will still work. There's no way to prevent this, except by putting your program in the startup file, so that the program will run when the computer is started up again.
Ashtoruin #3
Posted 04 June 2012 - 01:49 PM
I already knew that as computers shutdown when the server restarts so i was going to have to do that anyways, but thanks for the os.Pull event stuff
Pinkishu #4
Posted 04 June 2012 - 02:06 PM
or just pcall() it :)/>/>
Ashtoruin #5
Posted 05 June 2012 - 03:10 AM
I tried pcall()ing it but i must have been doing it wrong