**This is an old revision of the document!**

Component: Tank Controller

Component name: tank_controller

This component is provided by the tank controller upgrade.

With this API the robot can store fluids, “suck” fluids, and “drop” fluids to and from tanks and the world. It also allows the robot to receive additional information about fluid containers in the robot's inventory, as well as inspecting fluid stacks.

Callbacks:

  • getTankCapacity(side:number):number or nil[, string]
    Get the capacity of the tank on the specified side of the robot. Back refers to the robot's own selected tank.
  • getFluidInTank(side:number):table
    Get a description of the fluid in the the tank on the specified side of the robot. Back refers to the robot's own selected tank.
  • drain([amount:number]):boolean
    Transfers fluid from a tank in the selected inventory slot to the selected tank.
  • fill([amount:number]):boolean
    Transfers fluid from the selected tank to a tank in the selected inventory slot.