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

I know this may seem like a very stupid question...

Started by Antonyvw, 15 February 2013 - 06:13 AM
Antonyvw #1
Posted 15 February 2013 - 07:13 AM
Title: I know this may seem like a very stupid question…

But I have to ask. How do I terminate a program that is running on a turtle? There I said it would be a stupid question but I cant find an answer. Or Im asking in the wrong way to find it. Please help a newbee

Antony
Cranium #2
Posted 15 February 2013 - 07:22 AM
Not a stupid question. YOu're new here.

To terminate, you can do a few things.
You can press and hold 'ctrl + t' to terminate a program.
You can press and hold 'ctrl + s' to shutdown the computer.
You can press and hold 'ctrl + r' to restart the computer.
Antonyvw #3
Posted 15 February 2013 - 07:31 AM
Thanks for the quick reply. But Im still having problems. Whether I press ctrl + r or t it appear to just restart it.
I have a startup program which when it runs starts the second program. (Ive been following the direwolf20 series). So every time I terminate the program it just restarts. Is there a way of preventing it from running?

Thanks again
Antony
Cranium #4
Posted 15 February 2013 - 07:41 AM
Yes. You want to just use ctrl t. That terminates the program running.
There are ways to prevent program termination, so if there is a line of code that says "os.pullEvent = os.pullEventRaw" then it will not terminate. You can bypass this by making a disk, and writing a file on it labeled startup, and attaching the disk drive to the computer, then restarting the computer. Computers will always boot from disk if there is a startup file.
Antonyvw #5
Posted 15 February 2013 - 07:48 AM
Ok. Thanks I think making the disc will be easy enough. But Im guessing I may have to destroy the tutle to stop it, as it just does not understand I want it to stop. (the main problem is that it is in the wrong place as I must have shut the game down while the turtle was busy and has gotten confused as to where it is).
I have made a copy of the program Im running and saved it according to the instructions given by Lettuce so Im hoping that I wont have to rewrite it all again.

Thanks again

Antony
Lyqyd #6
Posted 15 February 2013 - 07:58 AM
If you label the turtle before breaking it, it will retain its ID, and therefore its files and fuel level. Use `label set computername`.
Antonyvw #7
Posted 15 February 2013 - 08:01 AM
That sounds like a useful idea. And would be great if I could get it to kick out of the loop it appears to be locked into and drop me at the prompt. Unless there is a way to give it instructions while it is still running the program it refuses to abandon?

Antony
Lyqyd #8
Posted 15 February 2013 - 08:57 AM
Again, place a disk drive adjacent to it (you may find it useful to use other blocks to obstruct its path if it is attempting to move). Place a disk in the drive with a blank file named startup in it, then reboot the turtle with Ctrl - R.
JokerRH #9
Posted 15 February 2013 - 09:35 AM
Are you sure it really shuts down every time you press ctrl - t?
If no program is running it shuts down the computer and prints something like
"Terminated. Press any key to continue"…or so :D/>
Antonyvw #10
Posted 15 February 2013 - 10:02 AM
Yes. I got the word terminated immediately followed on the next line by it stating where it was and then its fuel level. I shall give the disk drive a go and see how it copes. Thanks guys for the help and suggestions. I can see I need to get the books out to start learning how to program in Lua properly.