This component is provided by the Robot. The functions below can be called in the Lua interpreter using
=component.robot.function(). To make robot function calls more intuitive, a Robot API exists as a wrapper around the component functions, providing additional functionality (which is summarized in the API page).
trueif successful (may take time depending on block being interacted with - e.g.. Obsidian takes time to mine). Returns
falseif the operation fails with a description of why it failed.
use(side: number[, sneaky: boolean[, duration: number]]): boolean[, string]
truethe robot will simulate a sneak-right-click (like if the player would be using shift during a right-click). Some items (like buckets) will behave differently if this is set to true.
block_activated- a block was activated (like levers, switches or doors).
item_interacted- the equipped tool interacted with the world, for example sheers when used on a sheep.
item_placed- something was placed into the world. This is not only caused by placeable blocks, but as well by items that cause blocks or entities to appear in the world (like flint and stone or mob eggs).
item_used- the equipped was activated, like a splash-potion.
air- the equipped item requires a target but there was none. Note that if your robot has an Angel upgrade, this will never be returned, however some actions might still cause no effect.
place(side: number[, sneaky: boolean]): boolean[, string]
true, the robot will simulate a sneak-placement (shift-click). Returns
trueif successfully placed. Returns
falseif the operation fails. If an unsupported value is provided as a parameter, the operation will fail with a description of why it failed.
trueif the block will prevent the robot from moving forward,
falseotherwise. Drones return
trueeven if the block is passable.
side - See the Sides API for a list of possible sides.
compareFluid(side:number):booleanCompares fluid in the selected tank (requires a Tank upgrade) to fluid in the world or in an external tank on the specified side of the robot.
compare(side:number[, fuzzy:boolean=false]):booleanCompares the block on the specified side of the robot with the item in the currently selected slot and returns whether they are the same or not. Blocks are considered identical if the type and metadata match; additional ItemStack information is not checked. Empty blocks are considered as air blocks, which cannot be compared to an empty inventory slot; the
detect()function can be used to determine if there is a block in front of the robot. For blocks that drop a different item, the
compare()method won't work (eg: Diamond block dropping diamond items); for these cases, use silk-touch to obtain a block for comparison.
trueif at least one item is dropped,
falseotherwise. If the block in front of the robot is an inventory, the robot will try to place the item into the inventory. If the inventory doesn't accept the item, the item is not dropped into the world (the operation will fail and return
false). Robots themselves are considered blocks with an inventory, and items can be moved into them using the
drop()function will not work on non-item inventories, such as fluid tanks (the
use()function works for these cases).
|Components||3D Printer - Abstract Bus - Access Point - Chunkloader - Computer - Crafting - Data Card - Database - Debug - Drone - Drive - EEPROM - Experience - Filesystem - Generator - Geolyzer - GPU - Hologram - Internet - Inventory Controller - Leash - Microcontroller - Modem - Motion Sensor - Navigation - Net Splitter - Piston - Redstone - Redstone in Motion - Robot - Screen - Sign - Tank Controller - Tractor Beam - Transposer - Tunnel - World Sensor|
|Others||Component Access - Signals|
|Cross-Mod Integration||Applied Energistics|