Difference between revisions of "Turtle.compareDown"
From ComputerCraft Wiki
(Created page with "{{lowercase}} {{Function |name=turtle.compareDown |args= |api=turtle |returns=boolean if the block in below is the same as the one in the selected Slot. |addon=ComputerCra...") |
(Re-wording, added another example) |
||
Line 4: | Line 4: | ||
|args= | |args= | ||
|api=turtle | |api=turtle | ||
− | |returns=[[boolean]] if the block | + | |returns=[[boolean]] true if the block below the turtle is the same as the one in the selected Slot. |
|addon=ComputerCraft | |addon=ComputerCraft | ||
|desc=Detects if the block in below is the same as the one in the selected Slot. | |desc=Detects if the block in below is the same as the one in the selected Slot. | ||
Line 12: | Line 12: | ||
|code=turtle.compareDown() | |code=turtle.compareDown() | ||
}} | }} | ||
+ | {{Example | ||
+ | |desc=Digs down until the selected block is seen. | ||
+ | |code=while not turtle.compareDown() do | ||
+ | turtle.digDown() | ||
+ | turtle.down() | ||
+ | end}} | ||
}} | }} |
Revision as of 00:07, 30 July 2012
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
Example | |
Detects if the block below is the same as the one in the selected Slot. | |
Code |
turtle.compareDown() |
Example | |
Digs down until the selected block is seen. | |
Code |
while not turtle.compareDown() do turtle.digDown() turtle.down() end |