Skip to content

Universal Interface

RSDuck edited this page Aug 10, 2015 · 2 revisions

The Universally Interface in an Computer controlled proxy for item, fluids and energy. All sides are reconfigurable. Note: The Universal Side allows fluid input and output, the fluid input side only allows input. The sides that allow fluid output(Universal and fluid output) output automaticly into adjecent fluid container.

API

table help(string)

Get Help about an function

Arguments

  1. string the name of the function you need help with

Returns

  1. table an help like this

table getMethods()

Lists all function of this peripheral

Arguments

Returns

  1. table An table filled with the names of all function

string getDescription()

Returns an description of the peripheral

Arguments

Returns

  1. string An description what the peripheral does

setMaxEnergyOutput(number, string)

Sets the maximum amount of energy that goes out on the specified side

Arguments

  1. number The new amount of maximum energy output
  2. string The side where the maximum energy output should be changed(valid inputs: bottom, top, left, right, back, front)

Returns

setMaxEnergyInput(number, string)

Sets the maximum amount of energy that goes in

Arguments

  1. number The new amount of maximum energy input
  2. string The side where the maximum energy input should be changed(valid inputs: bottom, top, left, right, back, front)

Returns

number getMaxEnergyOutput(string)

Returns the maximum amount of energy that goes out

Arguments

  1. string The side where you want to get the maximum energy output(valid inputs: bottom, top, left, right, back, front)

Returns

  1. number The current maximum amount of energy that goes out

number getMaxEnergyInput(string)

Returns the maximum amount of energy that will goes in

Arguments

  1. string The side where you want to get the maximum energy input(valid inputs: bottom, top, left, right, back front)

Returns

  1. number The current maximum amount of energy that comes in

number getEnergyStored()

Returns the current amount of stored energy

Arguments

Returns

  1. number The current amount of stored energy

number getMaxEnergyStored()

Return the maximum amount of energy that can be stored

Arguments

Returns

  1. number The maximum amount of energy that can be stored

table getHeldStack()

Returns the current hold stack

Arguments

Returns

  1. table An table which holds informations about the item, or nil if no item is in inventory

bool pushStack(string, string, number)

Pushs the currently holded stack into an external inventory. This function works inpendently from the side config

Arguments

  1. string The direction, where the items should be pushed(valid inputs: front, back, left, right, top, bottom)
  2. string Only used if you want to simulate that the item was push from an specific direction, if you don’t simply insert in this argument a empty string then it will use the real direction from where the items come(valid inputs: [a empty string], bottom, top, east, west, south, north)
  3. number The maximum amount of items you want to tranfer. If you give 0 or less it will simply take the current stack size

Returns

  1. bool True if items where transfered, otherwise false

bool, table suckStack(string, string, number)

Pulls the first stack it gets from an inventory which stands on the given side into it’s own inventory. This function works inpendently from the side config

Arguments

  1. string The direction from where the items should be sucked(valid inputs: front, back, left, right, top, bottom)
  2. string Only used if you want to simulate that the item was pulled from an specific direction, if you don’t simply insert in this argument a empty string then it will use the real direction from where the items come(valid inputs: [a empty string], bottom, top, east, west, south, north
  3. number The maximum amount of items that will be sucked from the inventory. If you give 0 or less it will pulls one stack of the first item it finds

Returns

  1. bool True if items where transfered, otherwise false
  2. table The pulled stack, or nil if nothing could be pulled

setAllowAutoInput(bool)

Sets if the Universal Interface allows that other blocks insert items

Arguments

  1. bool The new value

Returns

bool isAutoInputAllowed()

Returns if the Universal Interface allows that other blocks insert items

Arguments

Returns

  1. bool True if it is allowed

setSideConfiguration(string, string)

Sets the IO configuration on a specific side

Arguments

  1. string The side where the configuration should be changed(valid inputs: front, back, right, left, top, bottom)
  2. string The new configuration (valid inputs: neutral, universal, items, energy, fluidInput, fluidOutput)

Returns

table getSideConfiguration()

Returns an table which contains the IO configuration

Arguments

Returns

  1. table A table which is in the format { “side” : “configuration” }

table getTankInfo()

Returns information about the current held fluid and it’s amount

Arguments

Returns

  1. table An table which contains informations about the internal fluid tank or nil, if the tank is empty

bool fillFluid(string, string, number, bool)

Fills the specified amount of fluid into an container on the given side. This function works inpendently from the side config

Arguments

  1. string The side where the fluid container is standing(valid inputs: front, back, right, left, top, bottom)
  2. string If the inventory requires that the fluid should enter from an specific side you can use this argument. Leafe a empty string to just take the direction where the UI is located. Valid inputs: [empty string], bottom, top, east, west, south, north
  3. number The amount of fluid in milibuckets(1000 mb = 1 Bucket). Has to be more than 0 and 4000 or less
  4. bool If true, no fluid will be inserted if there is not enough place in the target or not enogh fluid there. Usefull to prevent that half of the fluid is already inserted while the other half is still in the UI

Returns

  1. bool True, if some fluid was sucessfull transfered or if cancelOnError true is if the whole specified amount of fluid was sucessfully transferred

bool, table drainFluid(string, string, number, bool)

Drains fluid of a fluid container on the specified side. This function works inpendently from the side config

Arguments

  1. string The side where the fluid container is standing(valid inputs: front, back, right, left, top, bottom)
  2. string If the inventory requires that the fluid should enter from an specific side you can use this argument. Leafe a empty string to just take the direction where the UI is located. Valid inputs: [empty string], bottom, top, east, west, south, north
  3. number The amount of fluid in milibuckets(1000 mb = 1 Bucket). Has to be more than 0 and 4000 or less
  4. bool If true, no fluid will be drained if there is not enough place in the UI or not enough fluid there. Usefull to prevent that half of the fluid is already drained while the other half is still in the other container

Returns

  1. bool True, if some fluid was sucessfull transfered or if cancelOnError true is if the whole specified amount of fluid was sucessfully transferred
  2. table The Informations about what fluid was drained and it’s amount

table wrapPeripheral(string)

Works exactly like peripheral.wrap(side), the only different is that it works based of the Unversal Interface position and rotation

Arguments

  1. string The side where the peripheral is located

Returns

  1. table The wrapped peripheral