High-level convenience wrappers around the robot component for movement, inventory, tools, and tank operations.
- Repository:
opencomputers - System:
opencomputers - Type:
library
OpenComputers/src\main\resources\assets\opencomputers\lua\component\robot\lib\robot.lua
local robot = require("robot")- Description: Move the robot one block backward.
robot.back()- Description: Compare the selected stack with the inventory or block target in front of the robot.
- Parameters:
fuzzy
robot.compare(nil)- Description: Compare the selected stack with the target below the robot.
- Parameters:
fuzzy
robot.compareDown(nil)- Description: Compare the selected tank contents with the front-side fluid target.
robot.compareFluid()- Description: Compare the selected tank contents with the fluid target below the robot.
robot.compareFluidDown()- Description: Compare the selected tank contents with another robot tank.
- Parameters:
...
robot.compareFluidTo(nil)- Description: Compare the selected tank contents with the fluid target above the robot.
robot.compareFluidUp()- Description: Compare the selected inventory slot with another robot slot.
- Parameters:
...
robot.compareTo(nil)- Description: Compare the selected stack with the target above the robot.
- Parameters:
fuzzy
robot.compareUp(nil)- Description: Return how many items are stored in a slot.
- Parameters:
...
robot.count(nil)- Description: Check whether the front side is obstructed by a block or entity.
robot.detect()- Description: Check whether the space below the robot is occupied.
robot.detectDown()- Description: Check whether the space above the robot is occupied.
robot.detectUp()- Description: Move the robot one block downward.
robot.down()- Description: Drain fluid from the front side into the selected tank.
- Parameters:
count
robot.drain(nil)- Description: Drain fluid from below into the selected tank.
- Parameters:
count
robot.drainDown(nil)- Description: Drain fluid from above into the selected tank.
- Parameters:
count
robot.drainUp(nil)- Description: Drop items from the selected slot to the front side.
- Parameters:
count
robot.drop(nil)- Description: Drop items from the selected slot downward.
- Parameters:
count
robot.dropDown(nil)- Description: Drop items from the selected slot upward.
- Parameters:
count
robot.dropUp(nil)- Description: Return durability information for the installed robot tool upgrade.
robot.durability()- Description: Push fluid from the selected tank into the front-side target.
- Parameters:
count
robot.fill(nil)- Description: Push fluid from the selected tank into the target below the robot.
- Parameters:
count
robot.fillDown(nil)- Description: Push fluid from the selected tank into the target above the robot.
- Parameters:
count
robot.fillUp(nil)- Description: Move the robot one block forward.
robot.forward()- Description: Return the RGB light color currently configured on the robot.
robot.getLightColor()- Description: Return how many inventory slots the robot currently has.
robot.inventorySize()- Description: Return the robot experience level when an experience upgrade is present, otherwise
0.
robot.level()- Description: Return the robot's configured name.
robot.name()- Description: Place or use the selected item against the front side, optionally with sub-side targeting and sneaking.
- Parameters:
sidesneaky
robot.place(nil, nil)- Description: Place or use the selected item against the target below the robot.
- Parameters:
sidesneaky
robot.placeDown(nil, nil)- Description: Place or use the selected item against the target above the robot.
- Parameters:
sidesneaky
robot.placeUp(nil, nil)- Description: Get or set the selected inventory slot through the robot component.
- Parameters:
...
robot.select(nil)- Description: Get or set the selected tank.
- Parameters:
tank
robot.selectTank(nil)- Description: Set the robot light color and return the component call result.
- Parameters:
value
robot.setLightColor(nil)- Description: Return how many more items can still fit into a slot.
- Parameters:
...
robot.space(nil)- Description: Pull loose items or inventory contents from the front side into the selected slot.
- Parameters:
count
robot.suck(nil)- Description: Pull loose items or inventory contents from below into the selected slot.
- Parameters:
count
robot.suckDown(nil)- Description: Pull loose items or inventory contents from above into the selected slot.
- Parameters:
count
robot.suckUp(nil)- Description: Use the installed tool against the block or entity in front of the robot.
- Parameters:
sidesneaky
robot.swing(nil, nil)- Description: Use the installed tool against the target below the robot.
- Parameters:
sidesneaky
robot.swingDown(nil, nil)- Description: Use the installed tool against the target above the robot.
- Parameters:
sidesneaky
robot.swingUp(nil, nil)- Description: Return how many fluid tanks the robot currently exposes.
robot.tankCount()- Description: Return how much fluid is stored in a tank.
- Parameters:
...
robot.tankLevel(nil)- Description: Return how much additional fluid a tank can still accept.
- Parameters:
...
robot.tankSpace(nil)- Description: Move fluid from the selected tank into another robot tank.
- Parameters:
...
robot.transferFluidTo(nil)- Description: Move items from the selected slot into another robot slot.
- Parameters:
...
robot.transferTo(nil)- Description: Turn the robot 180 degrees by performing two same-direction quarter turns.
robot.turnAround()- Description: Rotate the robot 90 degrees to the left.
robot.turnLeft()- Description: Rotate the robot 90 degrees to the right.
robot.turnRight()- Description: Move the robot one block upward.
robot.up()- Description: Activate or use the selected item toward the front side, optionally sneaking or holding the action.
- Parameters:
sidesneakyduration
robot.use(nil, nil, nil)- Description: Activate or use the selected item downward.
- Parameters:
sidesneakyduration
robot.useDown(nil, nil, nil)- Description: Activate or use the selected item upward.
- Parameters:
sidesneakyduration
robot.useUp(nil, nil, nil)- These wrappers translate directional convenience calls such as
forward,swingUp, ordropDowninto the underlying component methods with fixed side constants.