Advanced Turtle Lumberjack (tutorial)

From ComputerCraft Wiki
Revision as of 10:53, 27 February 2012 by 81.214.215.213 (Talk) (The Code)

Jump to: navigation, search

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!