Tank Upgrade: Difference between revisions
imported>OCDoc Import Imported from legacy OpenComputers documentation at ocdoc.cil.li |
m SoraFirestorm moved page Item/tank upgrade to Tank Upgrade without leaving a redirect: Page has been unified |
||
| (One intermediate revision by the same user not shown) | |||
| Line 22: | Line 22: | ||
[[File:tank.png|200px]] | [[File:tank.png|200px]] | ||
== Contents | = Component API = | ||
'''Component name:''' <code>tank_controller</code> | |||
Callbacks: | |||
{{APICallback|name=getTankCapacity|signature=(side:number):number or nil[, string]|description= | |||
Get the capacity of the tank on the specified side of the robot. Back refers to the robot's own selected tank. | |||
}} | |||
{{APICallback|name=getTankLevel|signature=(side:number):number or nil[,string]|description= | |||
Gets amount of fluid in tank on specified side. | |||
}} | |||
{{APICallback|name=getFluidInTank|signature=(side:number):table|description= | |||
Get a description of the fluid in the the tank on the specified side of the robot. **Note:** sides.back deprecated, use getFluidInInternalTank() | |||
}} | |||
{{APICallback|name=getFluidInInternalTank|signature=(slot):table|description= | |||
Get a description of fluid in the specified or selected slot of robot inventory. | |||
}} | |||
{{APICallback|name=drain|signature=([amount:number]):boolean|description= | |||
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. | |||
}} | |||
{{APICallback|name=fill|signature=([amount:number]):boolean|description= | |||
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. | |||
}} | |||
{{APICallback|name=getTankCapacityInSlot|signature=(slot:number):number|description= | |||
Gets capacity of tank in specified or selected slot of the robot inventory. | |||
}} | |||
{{APICallback|name=getTankLevelInSlot|signature=(slot:number):number|description= | |||
Gets amount of fluid tank item in specified or selected slot of the robot inventory. | |||
}} | |||
{{APICallback|name=getFluidInTankInSlot|signature=(slot:number):table|description= | |||
Gets description of fluid in tank item in the specified or selected slot of the robot inventory. | |||
}} | |||
= Contents = | |||
{{:Item/contents}} | {{:Item/contents}} | ||
Latest revision as of 21:16, 15 September 2026
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:
- 4 x Wood Plank
- 1 x Cauldron
- 1 x Iron bars
- 1 x Dispensor
- 1 x Piston
- 1 x Microchip (Tier 1)
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 |
