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

is it possible

Started by Ralnick, 18 October 2012 - 02:37 PM
Ralnick #1
Posted 18 October 2012 - 04:37 PM
Hello and thank you for taking the time to read this.

Up front I am a complete noob to Lua and CC in general. but I am trying.

I wrote a simple program to place a BC quarry, (with wireless pipes for both power and Items) I understand it will require me to set the channel and to recieve or not recieve.

I am now in the process of trying to figure out if it is possible to place down a turtle. Give it the needed Mats (a few other turtles, Stone ..ect) and then for it to move to a certain place (GPS Satalites already up, clearing a way there if needed) then Place another turtle to build say a 9x9 room (the original turtle placing the needed Mats and fuel in the second Turtle, then telling the second turtle to run the program to make the 9x9 room. or a series of them. After telling the second turtle to do this… would move on to the next task and either place down another Turtle and do what is needed there (place a 2nd slave turtle, add Mats, fuel ect.. )

or would this be not possible?

I am not asking for the Code to do this.. I am very willing to try and figure it out on my own. but general ideas would be welcome.

again thank you for the time you took to read my ramblings.
Ditto8353 #2
Posted 18 October 2012 - 04:43 PM
Haha! Turtles placing turtles.
I don't have the slightest idea as to whether or not this is possible, but it sounds hilarious and I love it.
Good luck!
PixelToast #3
Posted 18 October 2012 - 04:57 PM
pipes can not be placed by turtles in CC 1.41 :3
jag #4
Posted 18 October 2012 - 04:59 PM
This is possible, just use peripherals. (Link to wiki)
To make the turtle in front run a certain program, just place a disk drive next to it that got a startup program.
The best idea is that the startup program installs a program into the new turtle.

So ideally this is how it's going to work:
  • The turtle places a disk drive.
  • It places a disk inside the drive.
  • Puts a startup program on the drive.
  • Place a turtle next to the drive.
  • Start the turtle with a peripheral.
Edit: Now to give the turtle it's items you could simply just give them via the main turtle.
ChaddJackson12 #5
Posted 18 October 2012 - 05:15 PM
Next move: Make a city using turtles, that place down other turtles…
Ditto8353 #6
Posted 18 October 2012 - 05:21 PM
1. Add fuzz.
2. Teach reproduction.
3. Star Trek.
Ralnick #7
Posted 18 October 2012 - 05:24 PM
This is possible, just use peripherals. (Link to wiki)
To make the turtle in front run a certain program, just place a disk drive next to it that got a startup program.
The best idea is that the startup program installs a program into the new turtle.

So ideally this is how it's going to work:
  • The turtle places a disk drive.
  • It places a disk inside the drive.
  • Puts a startup program on the drive.
  • Place a turtle next to the drive.
  • Start the turtle with a peripheral.
Edit: Now to give the turtle it's items you could simply just give them via the main turtle.


Thank you for the reply. I will research this information.
Ralnick #8
Posted 18 October 2012 - 05:55 PM
thanks for the replies, everyone
ChunLing #9
Posted 18 October 2012 - 07:03 PM
A bit of sample code to illustrate jag_e_nummer_ett's method:
turtle.select(2)
turtle.place()
turtle.select(3)
turtle.drop()
local strtfl = fs.open("disk/startup","w")
strtfl.writeLine("shell.run("turtleprogram","stringparameter","..1..","..2..","..3..")")
strtfl.close()
turtle.up()
turtle.select(1)
turtle.place()
peripheral.call("front","turnOn")
Looks like the comments ended up not being very readable.
–slot one contains a turtle
–slot two contains a disk drive
–slot three contains a disk
'turtle.drop()' puts the disk in the inventory in front of the turtle, which is a disk drive slot
–open the file on the disk in the disk drive next to the turtle, which it just placed
– turtleprogram is the name of the program to run at startup, it can take a stringparameter and some number parameters 1, 2, and 3
'peripheral.call("front","turnOn")' turns on the placed turtle, it will use the startup file on the disk, thus running turtleprogram with the parameters specified
Edited on 18 October 2012 - 05:10 PM