Difference between revisions of "Advanced Turtle Lumberjack (tutorial)"
From ComputerCraft Wiki
TheVarmari (Talk | contribs) (Created page with " == Advanced Turtle Lumberjack == === Introduction === Welcome to this tutorial about Advanced Turtle Lumberjacks. See the [[Turtle_Lumberjack_(tutoria...") |
(→The Code) |
||
Line 9: | Line 9: | ||
== The Code == | == The Code == | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<code> | <code> | ||
− | + | while turtle.detect() do | |
− | + | turtle.dig() | |
− | + | if turtle.detectUp() then | |
− | + | turtle.digUp() | |
− | turtle.up() | + | end |
− | + | turtle.up() | |
− | + | end | |
− | + | while not turtle.detectUp() and not turtle.detect() and not turtle.detectDown() do | |
− | + | turtle.down() | |
− | + | end | |
</code> | </code> | ||
Revision as of 10:52, 27 February 2012
Contents
Advanced Turtle Lumberjack
Introduction
Welcome to this tutorial about Advanced Turtle Lumberjacks. See the Turtle Lumberjack Tutorial first.
What are Advanced Turtle Lumberjacks?
Advanced Turtle Lumberjacks are basically Turtle Lumberjacks that can dig blocks above them.
The Code
while turtle.detect() do
turtle.dig() if turtle.detectUp() then turtle.digUp() end turtle.up() end
while not turtle.detectUp() and not turtle.detect() and not turtle.detectDown() do turtle.down() end
This makes us check if there are no blocks to be digged, then we go down until we can't. That's it!
(Helpful tip: Save this to your computercraft/lua/programs folder, then it will be on all turtles.)
Category & Author
A tutorial by TheVarmari. Feel free to correct any mistakes!