Difference between revisions of "Advanced Turtle Lumberjack (tutorial)"

From ComputerCraft Wiki
Jump to: navigation, search
(The Code: fixed indentation)
(The Code)
Line 24: Line 24:
 
That's it!
 
That's it!
  
('''Helpful tip:''' Save this to your computercraft/lua/programs folder, then it will be on all turtles.)
+
('''Helpful tip:''' Save this to your computercraft/lua/rom/programs folder, then it will be on all turtles.)
  
 
== Category & Author ==
 
== Category & Author ==
 
A tutorial by [[User:TheVarmari|TheVarmari]]. Feel free to correct any mistakes!
 
A tutorial by [[User:TheVarmari|TheVarmari]]. Feel free to correct any mistakes!
 
[[Category:Tutorials]]
 
[[Category:Tutorials]]

Revision as of 23:52, 15 March 2012

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/rom/programs folder, then it will be on all turtles.)

Category & Author

A tutorial by TheVarmari. Feel free to correct any mistakes!