Tank Upgrade

From OpenComputers: Rebooted
Jump to navigation Jump to search

Tank Upgrade

This upgrade provides an internal fluid tank to the robot, one per upgrade. Each tank can only store a single type of liquid at a time. When there are multiple tanks installed, one of the tanks can be selected (similar to slots in the robots inventory), and will then be used for a large number of operations.

For example, fluids are piped into / out of the selected tank when the robot is accessed externally (by pipes, such as the fluid pipes provided by BuildCraft, or Fluiducts in Thermal Expansion).

There are a number of methods provided in the Robot API that allow manipulating the fluid tanks in a similar fashion to the robot's inventory. Fluids can be sucked from or filled into tanks or the world, and can be transferred inbetween tanks, and compared against each other.

Fluids stored in a tank upgrade are kept there when the upgrade is removed. Tank upgrades therefore act as persistent fluid storage. They do not yet act as generic fluid container items, meaning they cannot be filled/drained directly by other mods. This will be added in OC 1.4.

The Tank Upgrade is crafted using the following recipe:

Component API

Component name: tank_controller Callbacks:

getTankCapacity

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.

getTankLevel

getTankLevel(side:number):number or nil[,string]

Gets amount of fluid in tank on specified side.

getFluidInTank

getFluidInTank(side:number):table

Get a description of the fluid in the the tank on the specified side of the robot. **Note:** sides.back deprecated, use getFluidInInternalTank()

getFluidInInternalTank

getFluidInInternalTank(slot):table

Get a description of fluid in the specified or selected slot of robot inventory.

drain

drain([amount:number]):boolean

Transfers fluid from a tank in the selected inventory slot to the selected tank. If the amount of fluid that would be generated from the item is too large to fit into the tank (for example buckets will usually generate 1000) nothing will happen, that is no fluid is lost.

fill

fill([amount:number]):boolean

Transfers fluid from the selected tank to a tank in the selected inventory slot. If the specified amount is too low (for example for buckets the minimum amount will usually be 1000) nothing will happen, that is no fluid is lost.

getTankCapacityInSlot

getTankCapacityInSlot(slot:number):number

Gets capacity of tank in specified or selected slot of the robot inventory.

getTankLevelInSlot

getTankLevelInSlot(slot:number):number

Gets amount of fluid tank item in specified or selected slot of the robot inventory.

getFluidInTankInSlot

getFluidInTankInSlot(slot:number):table

Gets description of fluid in tank item in the specified or selected slot of the robot inventory.

Contents

Items
Components Data Card - Debug Card - Graphics Card - Internet Card - Linked Card - Network Card - Redstone Card - Wireless Network Card
Storage Devices Floppy Disk - EEPROM - Hard Disk Drive - Memory
Upgrades Angel Upgrade - Battery Upgrade - Chunkloader Upgrade - Database Upgrade - Experience Upgrade - Generator Upgrade - Hover Upgrade - Inventory Controller Upgrade - Inventory Upgrade - Leash Upgrade - Navigation Upgrade - Piston Upgrade - Sign I/O Upgrade - Solar Generator Upgrade - Tank Upgrade - Tank Controller Upgrade - Tractor Beam Upgrade
Containers Card Container - Upgrade Container - Disk Drive
Others Analyzer - Texture Picker - Component Bus - CPU - APU - Drone Case - Manual - Microcontroller Case - Nanomachines - Remote Terminal - Terminal Server - Server - Tablet Case - Tablet - Crafting Materials - Ink Cartridge - Scrench - Hover Boots - Grog - Loot Disks