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

Simple Harvesting Program

Started by pamiller3, 24 July 2013 - 12:01 PM
pamiller3 #1
Posted 24 July 2013 - 02:01 PM
I am looking for a very simple program and I am getting hung up on a few things. First I just need to issue a command to have the turtle dig in one direction in a static number (34). From there I will have it dig up and around some more and then finally, and this is the second problem, is drop all its findings in a chest.

Any help would be tremendous!!
Apfeldstrudel #2
Posted 24 July 2013 - 02:08 PM
Cant really see what you mean.. have i got it right here?

1:digs for example 34 blocks up,forward and down

2: returns and drops inventory
Joe3000 #3
Posted 24 July 2013 - 02:30 PM
To have a turtle drop items in a chest, use turtle.drop() or turtle.dropDown() or turtle.dropUp(), but the chest has to be in the appropriate position ( if you use dropUp the chest has to be above the turtle, ext)
pamiller3 #4
Posted 24 July 2013 - 03:29 PM
Well what I am looking for in the 34 blocks is the program would be extremely linear. I want to dig 34 blocks straight, dig down 1, then some turns, then 34 blocks straight. Then some turns and then 34…. Mainly I just want it to be a script of commands to harvest my crops.

Clueless: Thanks that clears up that command.
LBPHacker #5
Posted 24 July 2013 - 04:05 PM
some turns
How many exactly? Lua can do stuff, but it can't do magic - it can't read your mind.

And once again…
Clueless: -snip-
For the record, the name is not "Clueless". Look at your comments in the topic - is your name "Clueless" as well? That would be a funny coincidence. Mine is not "Pro Coder" either. The name is in the darker blue line above the comment.
Apfeldstrudel #6
Posted 24 July 2013 - 04:40 PM
Do you want us to WRITE the programs or just give you tips?
pamiller3 #7
Posted 24 July 2013 - 04:45 PM
I was just looking for tips. I of course did not think you or LUA could read minds.
MR_nesquick #8
Posted 24 July 2013 - 06:54 PM

for i = 1,34 do
turtle.forward()
turtle.digDown()
end

turtle.turnRight()
turtle.forward()
turtle.turnRight()

for i2 = 1,34 do
turtle.forward()
turtle.digDown()
end

turtle.forward()
turtle.turnRight()
turtle.forward()
turtle.turnLeft()
turtle.drop()
turtle.turnRight()
turtle.turnRight()
this will move 34 block forward and dig every block under it, then dig the line right of that when it goes home. Then drop everything in a 'chest' behind the starting point.
pamiller3 #9
Posted 25 July 2013 - 10:17 AM
Thank you so much, that was exactly what I needed.
Apfeldstrudel #10
Posted 25 July 2013 - 10:27 AM
I dont think so, use

for i = 1,16 do
    turtle.select(i)
    turtle.drop()
end
This makes it drop the whole inventory