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).
Component name: robot.
durability():numbermove(direction:number):booleanturn(clockwise:boolean):booleanname():stringswing(side:number):boolean[, string]true if successful (may take time depending on block being interacted with - e.g.. Obsidian takes time to mine). Returns false if the operation fails with a description of why it failed.use(side: number[, sneaky: boolean[, duration: number]]): boolean[, string]true the 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 true if successfully placed. Returns false if the operation fails. If an unsupported value is provided as a parameter, the operation will fail with a description of why it failed. getLightColor():numbersetLightColor(value:number):numberinventorySize():numberselect([slot:number]):numbercount([slot:number]):numberspace([slot:number]):numbercompareTo(otherSlot:number):booleantransferTo(toSlot:number[, amount:number]):booleantankCount():numberselectTank(tank:number)tankLevel([tank:number]):numberselectTank()).tankSpace([tank:number]):numbercompareFluidTo(tank:number):booleantransferFluidTo(tank:number[, count:number]):booleandetect(side:number):booleantrue if the block will prevent the robot from moving forward, false otherwise. Drones return true even if the block is passable.
side - See the Sides API for a list of possible sides.
compareFluid(side:number):boolean
Compares 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. drain(side:number[, count:number]):booleanfill(side:number[, count:number]):booleancompare(side:number[, fuzzy:boolean=false]):boolean
Compares 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. drop(side:number[, count:number]):booleantrue if at least one item is dropped, false otherwise. 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. The drop() function will not work on non-item inventories, such as fluid tanks (the use() function works for these cases). suck(side:number[, count:number]):boolean| 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 |