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

Help with laying program

Started by drdoom30, 05 August 2012 - 06:35 PM
drdoom30 #1
Posted 05 August 2012 - 08:35 PM

turtle.up()
while (true) do
turtle.place(1)
turtle.forward()
turtle.place(1)
turtle.forward()
turtle.place(1)
turtle.forward()
turtle.place(1)
turtle.forward()
turtle.place(1)
turtle.forward()
turtle.place(1)
turtle.forward()
turtle.select(1)
turtle.place(1)
turtle.forward()
turtle.place(1)
turtle.forward()
turtle.place(1)
turtle.forward()
turtle.place(1)
turtle.forward()
turtle.place(1)
turtle.forward()
turtle.place(1)
turtle.forward()
turtle.select(1)
end

The turtle won't go up and will lay the first item and just sit there.
Xhisor #2
Posted 05 August 2012 - 08:41 PM
The code should look like this

turtle.up()
while true do
turtle.place()
turtle.forward()
turtle.place()
turtle.forward()
turtle.place()
turtle.forward()
turtle.place()
turtle.forward()
turtle.place()
turtle.forward()
turtle.place()
turtle.forward()
turtle.select(1)
turtle.place()
turtle.forward()
turtle.place()
turtle.forward()
turtle.place()
turtle.forward()
turtle.place()
turtle.forward()
turtle.place()
turtle.forward()
turtle.place()
turtle.forward()
turtle.select(1)
end
drdoom30 #3
Posted 05 August 2012 - 08:45 PM
The same thing happens it just places one pipe and just sits there. It doesn't go up or anything.
drdoom30 #4
Posted 05 August 2012 - 08:59 PM
The turtle was moving in a previous version just not laying down pipes but when I updated the turtle would only lay 1 pipe and not move.
MysticT #5
Posted 05 August 2012 - 09:03 PM
I suppose you use CC 1.4, right? Turtles need fuel in 1.4, so you'll have to add some to it and make some checks and refuel, or disable it on the config.
drdoom30 #6
Posted 05 August 2012 - 09:04 PM
Fail I didn't know you had to fuel them haha.

I suppose you use CC 1.4, right? Turtles need fuel in 1.4, so you'll have to add some to it and make some checks and refuel, or disable it on the config.
Thank you.
DaNoobz #7
Posted 05 August 2012 - 10:56 PM
After looking at your code it seems that you are trying to make the turtle drive forward instead of going up, therefore it gets stuck on the pipe.
Swap

turtle.forward()
with

turtle.up()

Apart from that you have made the program terribly inefficient and it could easily be cut down to a few lines by adding a extra while loop repeating the

turtle.place(1)
turtle.forward()
how many times you want the height of the pipe to be.
Pharap #8
Posted 06 August 2012 - 02:48 AM
what are you trying to do? make it create a 'tower' of pipes, or a 'line' of pipes?
Noodle #9
Posted 06 August 2012 - 11:57 AM
Why are you placing then running into it?
turtle.placeDown()