Component/transposer: Difference between revisions

From OpenComputers: Rebooted
Jump to navigation Jump to search
imported>OCDoc Import
Imported from legacy OpenComputers documentation at ocdoc.cil.li
 
Clean up Markdown artifacts from DokuWiki migration
 
Line 3: Line 3:
This component is provided by the [[Block/transposer|Transposer]].
This component is provided by the [[Block/transposer|Transposer]].


Component name: `transposer`.
Component name: <code>transposer</code>.


Callbacks:
Callbacks:


* `transferFluid(sourceSide:number, sinkSide:number, count:number):boolean, number`
* <code>transferFluid(sourceSide:number, sinkSide:number, count:number):boolean, number</code>


<pre>Transfer some fluids between two fluid handlers (pipes or tanks, etc). `sourceSide` is the side pulled from and `sinkSide` is the side transferred to. The side value is a integral value representing the cardinal directions (east, west, south, north), up, and down. The `sides` library has these values for convenience. `count` is the number of millibuckets to transfer. If not specified, it defaults to 1000. Returns true and the number of millibuckets transfered on success, or false and an error message on failure.
<pre>Transfer some fluids between two fluid handlers (pipes or tanks, etc). sourceSide is the side pulled from and sinkSide is the side transferred to. The side value is a integral value representing the cardinal directions (east, west, south, north), up, and down. The sides library has these values for convenience. count is the number of millibuckets to transfer. If not specified, it defaults to 1000. Returns true and the number of millibuckets transfered on success, or false and an error message on failure.
</pre>
</pre>
* `store(side:number, slot:number, dbAddress:string, dbSlot:number):boolean`
* <code>store(side:number, slot:number, dbAddress:string, dbSlot:number):boolean</code>


<pre>Store an item stack description in the specified slot of the database with the specified address.
<pre>Store an item stack description in the specified slot of the database with the specified address.
</pre>
</pre>
* `compareStackToDatabase(side:number, slot:number, dbAddress:string, dbSlot:number, checkNBT:boolean=false):boolean`
* <code>compareStackToDatabase(side:number, slot:number, dbAddress:string, dbSlot:number, checkNBT:boolean=false):boolean</code>


<pre>Compare an item in the specified slot in the inventory on the specified side with one in the database with the specified address.
<pre>Compare an item in the specified slot in the inventory on the specified side with one in the database with the specified address.
</pre>
</pre>
* `getSlotStackSize(side:number, slot:number):number`
* <code>getSlotStackSize(side:number, slot:number):number</code>


<pre>Get number of items in the specified slot of the inventory on the specified side of the device.
<pre>Get number of items in the specified slot of the inventory on the specified side of the device.
</pre>
</pre>
* `getSlotMaxStackSize(side:number, slot:number):number`
* <code>getSlotMaxStackSize(side:number, slot:number):number</code>


<pre>Get the maximum number of items in the specified slot of the inventory on the specified side of the device.
<pre>Get the maximum number of items in the specified slot of the inventory on the specified side of the device.
</pre>
</pre>
* `getInventoryName(side:number):string`
* <code>getInventoryName(side:number):string</code>


<pre>Get the the name of the inventory on the specified side of the device.
<pre>Get the the name of the inventory on the specified side of the device.
</pre>
</pre>
* `getInventorySize(side:number):number`
* <code>getInventorySize(side:number):number</code>


<pre>Get the number of slots in the inventory on the specified side of the device.
<pre>Get the number of slots in the inventory on the specified side of the device.
</pre>
</pre>
* `getFluidInTank(side:number , tank:number):table`
* <code>getFluidInTank(side:number , tank:number):table</code>


<pre>Get a description of the fluid in the the specified tank on the specified side.
<pre>Get a description of the fluid in the the specified tank on the specified side.
</pre>
</pre>
* `getTankLevel(side:number , tank:number):number`
* <code>getTankLevel(side:number , tank:number):number</code>


<pre>Get the amount of fluid in the specified tank on the specified side.
<pre>Get the amount of fluid in the specified tank on the specified side.
</pre>
</pre>
* `transferItem(sourceSide:number, sinkSide:number, count:number, sourceSlot:number, sinkSlot:number):number`
* <code>transferItem(sourceSide:number, sinkSide:number, count:number, sourceSlot:number, sinkSlot:number):number</code>


<pre>Transfer some items between two inventories.
<pre>Transfer some items between two inventories.
</pre>
</pre>
* `compareStacks(side:number, slotA:number, slotB:number, checkNBT:boolean=false):boolean`
* <code>compareStacks(side:number, slotA:number, slotB:number, checkNBT:boolean=false):boolean</code>


<pre>Get whether the items in the two specified slots of the inventory on the specified side of the device are of the same type.
<pre>Get whether the items in the two specified slots of the inventory on the specified side of the device are of the same type.
</pre>
</pre>
* `areStacksEquivalent(side:number, slotA:number, slotB:number):boolean`
* <code>areStacksEquivalent(side:number, slotA:number, slotB:number):boolean</code>


<pre>Get whether the items in the two specified slots of the inventory on the specified side of the device are equivalent (have shared OreDictionary IDs).
<pre>Get whether the items in the two specified slots of the inventory on the specified side of the device are equivalent (have shared OreDictionary IDs).
</pre>
</pre>
* `getTankCount(side:number):number`
* <code>getTankCount(side:number):number</code>


<pre>Get the number of tanks available on the specified side.
<pre>Get the number of tanks available on the specified side.
</pre>
</pre>
* `getStackInSlot(side:number, slot:number):table`
* <code>getStackInSlot(side:number, slot:number):table</code>


<pre>Get a description of the stack in the inventory on the specified side of the device.
<pre>Get a description of the stack in the inventory on the specified side of the device.
</pre>
</pre>
* `getTankCapacity(side:number , tank:number):number`
* <code>getTankCapacity(side:number , tank:number):number</code>


<pre>Get the capacity of the specified tank on the specified side.
<pre>Get the capacity of the specified tank on the specified side.
</pre>
</pre>
* `getAllStacks(side:number):userdata`
* <code>getAllStacks(side:number):userdata</code>
 
<pre>Get a description of all stacks in the inventory on the specified side of the device.
The return value is callable. Calling it will return a table describing the stack in the inventory or nothing if the iterator reaches end.
The return value provides the followings callbacks:
getAll():table
  Returns ALL the stack in the this.array. Memory intensive.
count():number
  Returns the number of elements in the this.array.
reset()
  Reset the iterator index so that the next call will return the first element.


<pre>Get a description of all stacks in the inventory on the specified side of the device. 
The return value is callable. Calling it will return a table describing the stack in the inventory or nothing if the iterator reaches end. 
The return value provides the followings callbacks: 
`getAll():table` 
  Returns ALL the stack in the this.array. Memory intensive. 
`count():number` 
  Returns the number of elements in the this.array. 
`reset()` 
  Reset the iterator index so that the next call will return the first element. 
 
</pre>
</pre>


Line 84: Line 84:


{{:Component/contents}}
{{:Component/contents}}

Latest revision as of 20:28, 24 August 2026

Component: Transposer

This component is provided by the Transposer.

Component name: transposer.

Callbacks:

  • transferFluid(sourceSide:number, sinkSide:number, count:number):boolean, number
Transfer some fluids between two fluid handlers (pipes or tanks, etc). sourceSide is the side pulled from and sinkSide is the side transferred to. The side value is a integral value representing the cardinal directions (east, west, south, north), up, and down. The sides library has these values for convenience. count is the number of millibuckets to transfer. If not specified, it defaults to 1000. Returns true and the number of millibuckets transfered on success, or false and an error message on failure.
  • store(side:number, slot:number, dbAddress:string, dbSlot:number):boolean
Store an item stack description in the specified slot of the database with the specified address.
  • compareStackToDatabase(side:number, slot:number, dbAddress:string, dbSlot:number, checkNBT:boolean=false):boolean
Compare an item in the specified slot in the inventory on the specified side with one in the database with the specified address.
  • getSlotStackSize(side:number, slot:number):number
Get number of items in the specified slot of the inventory on the specified side of the device.
  • getSlotMaxStackSize(side:number, slot:number):number
Get the maximum number of items in the specified slot of the inventory on the specified side of the device.
  • getInventoryName(side:number):string
Get the the name of the inventory on the specified side of the device.
  • getInventorySize(side:number):number
Get the number of slots in the inventory on the specified side of the device.
  • getFluidInTank(side:number , tank:number):table
Get a description of the fluid in the the specified tank on the specified side.
  • getTankLevel(side:number , tank:number):number
Get the amount of fluid in the specified tank on the specified side.
  • transferItem(sourceSide:number, sinkSide:number, count:number, sourceSlot:number, sinkSlot:number):number
Transfer some items between two inventories.
  • compareStacks(side:number, slotA:number, slotB:number, checkNBT:boolean=false):boolean
Get whether the items in the two specified slots of the inventory on the specified side of the device are of the same type.
  • areStacksEquivalent(side:number, slotA:number, slotB:number):boolean
Get whether the items in the two specified slots of the inventory on the specified side of the device are equivalent (have shared OreDictionary IDs).
  • getTankCount(side:number):number
Get the number of tanks available on the specified side.
  • getStackInSlot(side:number, slot:number):table
Get a description of the stack in the inventory on the specified side of the device.
  • getTankCapacity(side:number , tank:number):number
Get the capacity of the specified tank on the specified side.
  • getAllStacks(side:number):userdata
Get a description of all stacks in the inventory on the specified side of the device.
The return value is callable. Calling it will return a table describing the stack in the inventory or nothing if the iterator reaches end.
The return value provides the followings callbacks:
getAll():table
  Returns ALL the stack in the this.array. Memory intensive.
count():number
  Returns the number of elements in the this.array.
reset()
  Reset the iterator index so that the next call will return the first element.


Components
Core Components Access Point - Computer - Drone - Drive - EEPROM - Filesystem - GPU - Microcontroller - Modem - Redstone - Robot - Transposer
Others Component Access - Signals
Cross-Mod Integration Applied Energistics