turtle.inspectUp
From ComputerCraft Wiki
Revision as of 23:16, 27 September 2014 by MKlegoman357 (Talk | contribs) (Created page with "{{lowercase}} {{Function |name=turtle.inspectUp |args=[<nowiki/>{{type|number}} slotNum] |api=turtle |returns={{type|boolean}} success, {{type|table}} data/{{type|string}} err...")
Function turtle.inspectUp | |
Returns the ID string and metadata of the block above the Turtle in a table format: { name = "modname:blockname", metadata = 0 }. | |
Syntax | turtle.inspectUp([number slotNum]) |
Returns | boolean success, table data/string error message |
Part of | ComputerCraft |
API | turtle |
Examples
Example | |
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.