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

Automating gps tower building

Started by Adreden, 31 March 2014 - 05:07 AM
Adreden #1
Posted 31 March 2014 - 07:07 AM
Hi everyone!

So I have been playing in a multiplayer server over a few game season.
I have been building sky scrapers with turtles.
Due to the uneven bedrock I have been using a gps based system to figure out the placement of floors for the building.

I have a program that can place compters, wireless modems and activate the computers.
One thing I still have to do is manually enter the coordinates for this - gps host <x> <y> <z> -
I may have missed the line of code that I need but what I would like is for someway for the turtle to enter in the x y z.
The turtle to having been given its start location should be able to calculate the position of the gps host computer, should be fairly trival for me to do this.

I have seen code for a disk drive uploading files onto a second computer, but not entering variables.
Is there some peripheral command for something like " edit <programName>". I could then see about entering any text I would like to the computer.

Other then that the only way I can think of is having a dynamic system with pastebin involved and this would be more work then it would be worth I think.

Any way thanks in advance! Any thoughts or insights would be greatly appricated, Cheers!
CometWolf #2
Posted 31 March 2014 - 02:52 PM
The way this is done is the turtle tailors the disk program itself to the gps computer. Usually it's just something like

shell.run"gps host x y z"
using shell run is the same as inputting something into the shell terminal and hitting enter.

This can easily be achieved using the fs api to edit the file on the disk pior to moving it onto the computer.
http://computercraft.info/wiki/Fs_%28API%29
kornichen #3
Posted 31 March 2014 - 03:23 PM
Hello,

take a look at this application: http://www.computercraft.info/forums2/index.php?/topic/9528-gps-deploy-10/
It may help you. It builds a computer, attaches a disk drive to it, copies the program to the computer and everything is done.