Difference between revisions of "Turtle.inspect"
From ComputerCraft Wiki
MKlegoman357 (Talk | contribs) ([facepalm] derp, this function doesn't take any arguments) |
(Adding "see also".) |
||
Line 19: | Line 19: | ||
* Returns false when there is nothing (air) in front of the Turtle. | * Returns false when there is nothing (air) in front of the Turtle. | ||
}} | }} | ||
+ | |||
+ | ==See also== | ||
+ | *[[turtle.inspectDown]] | ||
+ | *[[turtle.inspectUp]] |
Revision as of 17:56, 22 April 2015
Function turtle.inspect | |
Returns the ID string and metadata of the block in front of the Turtle in a table format: { name = "modname:blockname", metadata = 0 }. | |
Syntax | turtle.inspect() |
Returns | boolean success, table data/string error message |
Part of | ComputerCraft |
API | turtle |
Examples
Example | |
If there is a block in front of the turtle, prints it's name and metadata. | |
Code |
local success, data = turtle.inspect() if success then print("Block name: ", data.name) print("Block metadata: ", data.metadata) end |
Additional Notes
- Returns false when there is nothing (air) in front of the Turtle.