Difference between revisions of "Turtle.compareTo"

From ComputerCraft Wiki
Jump to: navigation, search
m
Line 10: Line 10:
 
{{Example
 
{{Example
 
|desc=Detects if the item in the selected slot is the same as the one in the specified slot.
 
|desc=Detects if the item in the selected slot is the same as the one in the specified slot.
|code=turtle.compareTo()
+
|code=turtle.compareTo(2)
 
}}
 
}}
 
}}
 
}}

Revision as of 01:39, 25 September 2012


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

Examples

Grid paper.png  Example
Detects if the item in the selected slot is the same as the one in the specified slot.
Code
turtle.compareTo(2)