Jump to content




Adding Lines for Fully Automated Tree Turtle


4 replies to this topic

#1 theempirebuilder

  • Members
  • 6 posts

Posted 08 November 2013 - 12:01 AM

Title:Adding Lines for Fully Automated Tree Turtle
OK, so NOW I have a question. I could probably figure it out myself if I put enough time into it, but I'm not that good of a programmer.

So, I just finished programming up a turtle with the Advanced Turtle Lumberjack code http://computercraft...jack_(tutorial) <--here. the second code piece, the one that auto replants the trees and all.

I want to make it even more automated. So, when it stops at the first stop location (the one at the end of the first run), it will discharge all items but one in the 4th slot out the left side to be picked up by a hopper, suck up as many as available into slot 1 from a chest above, and suck up as many as possible into slot 3 from a bottom chest. Slot 1 is my fuel slot; slot 3 is my sapling slot; slot 4 is the wood slot.

What lines and where would I need to add to make this work?

Edited by theempirebuilder, 08 November 2013 - 12:08 AM.


#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 08 November 2013 - 01:13 AM

Split into new topic.

We don't generally just give you all the answers. The point is to help you along the journey so that you can learn how to do it yourself (and thereby become able to answer questions for other people too). Do you have more specific questions about the code, as far as what you don't understand in it? What parts of the implementation of your further ideas are you struggling with?

#3 theempirebuilder

  • Members
  • 6 posts

Posted 08 November 2013 - 01:47 PM

OK, so I understand that. You don't want a bunch of freeloaders on your forums constantly asking (Please code this for me topics :-\)

What I'm asking, is where do I put the turtle.drop() and turtle.suck() lines? I don't entirely understand the code's looping yet.

#4 spdkils

  • Members
  • 49 posts

Posted 08 November 2013 - 02:27 PM

Well from the looks of it...

The tree chopper goes around in a circle, end to end, and chops trees.... Every 30 seconds it sweeps past, and chops any trees.


So really, at the pause, at the start of the loop, every time that runs, it will be on each end of the loop its making...

1st pause it at one end, then it moves to the other end, and pauses, then it moves back. So, you have to double chest. (One at each end.) Or only drop/suck at one end... every other pause.

#5 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 08 November 2013 - 04:26 PM

The line that states "os.sleep(30)" causes it to pause for thirty seconds (see os.sleep()).

Hence if you want the turtle to drop something directly before that happens, put your "drop" statement directly above that line.

You'll also want to read up on turtle.select(), and maybe turtle.getItemCount().





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users