Difference between revisions of "Turtle.inspectUp"
From ComputerCraft Wiki
(Adding "see also".) |
Magiczocker (Talk | contribs) |
||
| Line 23: | Line 23: | ||
*[[turtle.inspect]] | *[[turtle.inspect]] | ||
*[[turtle.inspectDown]] | *[[turtle.inspectDown]] | ||
| + | [[Category:API Functions]] | ||
Latest revision as of 07:59, 4 August 2020
| Returns the ID string and metadata of the block above the Turtle in a table format: { name = "modname:blockname", metadata = 0 }. | |
| Syntax | turtle.inspectUp() |
| Returns | boolean success, table data/string error message |
| Part of | ComputerCraft |
| API | turtle |
Examples
| If there is a block above the turtle, prints it's name and metadata. | |
| Code |
local success, data = turtle.inspectUp() if success then print("Block name: ", data.name) print("Block metadata: ", data.metadata) end |
Additional Notes
- Returns false when there is nothing (air) above the Turtle.