Difference between revisions of "Turtle.compareDown"

From ComputerCraft Wiki
Jump to: navigation, search
(Re-wording, added another example)
(Fixed code block)
Line 15: Line 15:
 
|desc=Digs down until the selected block is seen.
 
|desc=Digs down until the selected block is seen.
 
|code=while not turtle.compareDown() do
 
|code=while not turtle.compareDown() do
  turtle.digDown()
+
  turtle.digDown()
  turtle.down()
+
  turtle.down()
end}}
+
end}}
 
}}
 
}}

Revision as of 00:09, 30 July 2012


Grid Redstone.png  Function turtle.compareDown
Detects if the block in below is the same as the one in the selected Slot.
Syntax turtle.compareDown()
Returns boolean true if the block below the turtle is the same as the one in the selected Slot.
Part of ComputerCraft
API turtle

Examples

Grid paper.png  Example
Detects if the block below is the same as the one in the selected Slot.
Code
turtle.compareDown()



Grid paper.png  Example
Digs down until the selected block is seen.
Code
while not turtle.compareDown() do
  turtle.digDown()
  turtle.down()
end