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

Shell.run problem.

Started by Fiixii52, 22 August 2015 - 10:31 PM
Fiixii52 #1
Posted 23 August 2015 - 12:31 AM
Hello,

At first I'd like to apologize if my English isn't good, because I'm French. I'll try to be as precise as possible with my situation right now.

I'm actually writing a program for some kind of quarry turtle that only mines ores and stuff, leaving all "junk" blocks you choose by putting one of them in the turtle's inventory.
The only thing that if have to finish is the program itself because I only wrote the functions. I want the program to create an interface where you can choose the size of the quarry and all the trash items the turtle will leave.
Because I'm very lazy and I don't want to relaunch my program after a server reboot for example, I really want to make the program constantly working. I mean, by saying that, that the turtle will itself find its position and go back to work after a server restart.

At first, I was thinking about creating another startup program which will launch itself the quarry program with the command shell.run. The big problem is that when the program is launched, it will only show the interface I was talking about earlier and it won't go back mining.

I'm wondering if there is a way to use the shell.run command as a startup so that the turtle directly goes mining with the same quarry size, without showing the interface. Any help would be appreciated ! :)/>

Link to the program : http://pastebin.com/5wcV8rBN
Bomb Bloke #2
Posted 23 August 2015 - 05:15 AM
There are a few ways to have a turtle figure out where it is after a server restart. I prefer to build a GPS system.

In terms of getting a turtle to figure out whether it should show your interface or not, have it write a file to its drive with information about tasks it needs to do, then read that file when it starts up (based on whether it's there).

http://www.computercraft.info/forums2/index.php?/topic/3923-basic-file-io-learn-how-to-save-data/