Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
component:agent [2018/09/27 01:58]
payonel
component:agent [2019/09/07 07:46]
wischi drain and fill were missing the side argument.
Line 25: Line 25:
 - `compareFluid(side:​number):​boolean` - `compareFluid(side:​number):​boolean`
   Compares fluid in the selected tank (requires a [[item:​tank_upgrade|Tank upgrade]]) to fluid in the world or in an external tank on the specified side of the robot. ​   Compares fluid in the selected tank (requires a [[item:​tank_upgrade|Tank upgrade]]) to fluid in the world or in an external tank on the specified side of the robot. ​
-- `drain([count:​number]):​boolean` ​  +- `drain(side:number[count:​number]):​boolean` ​  
-  Extracts the specified amount of fluid from the world or a tank in front of the robot. If no amount is specified, the robot will try to drain 1000mB. If the tank is unable to store the specified amount of fluid, the operation will fail (no fluid is lost in the process). +  Extracts the specified amount of fluid from the world or a tank on the specified side of the robot. If no amount is specified, the robot will try to drain 1000mB. If the tank is unable to store the specified amount of fluid, the operation will fail (no fluid is lost in the process). 
-- `fill([count:​number]):​boolean`  ​+- `fill(side:number[count:​number]):​boolean`  ​
   Fills the specified amount of fluid from the selected tank (requires a [[item:​tank_upgrade|Tank upgrade]]) into the world or a tank in front of the robot. If no amount is specified, the robot will try to fill the target tank with 1000mB of fluid. If there is not enough fluid to fill a block, or not enough space in the target tank, the operation will fail with no fluids lost.   Fills the specified amount of fluid from the selected tank (requires a [[item:​tank_upgrade|Tank upgrade]]) into the world or a tank in front of the robot. If no amount is specified, the robot will try to fill the target tank with 1000mB of fluid. If there is not enough fluid to fill a block, or not enough space in the target tank, the operation will fail with no fluids lost.
  
Line 78: Line 78:
   Drops the specified number of items from the currently selected slot. Returns `true` if at least one item is dropped, `false` otherwise. If the block in front of the robot is an inventory, the robot will try to place the item into the inventory. If the inventory doesn'​t accept the item, the item is not dropped into the world (the operation will fail and return `false`). Robots themselves are considered blocks with an inventory, and items can be moved into them using the `drop()` function. The `drop()` function will not work on non-item inventories,​ such as fluid tanks (the `use()` function works for these cases). ​   Drops the specified number of items from the currently selected slot. Returns `true` if at least one item is dropped, `false` otherwise. If the block in front of the robot is an inventory, the robot will try to place the item into the inventory. If the inventory doesn'​t accept the item, the item is not dropped into the world (the operation will fail and return `false`). Robots themselves are considered blocks with an inventory, and items can be moved into them using the `drop()` function. The `drop()` function will not work on non-item inventories,​ such as fluid tanks (the `use()` function works for these cases). ​
 - `suck(side:​number[,​ count:​number]):​boolean`  ​ - `suck(side:​number[,​ count:​number]):​boolean`  ​
-  Tries to pick up the specified number of items and place it in the selected slot. If the selected slot is occupied, items will be placed in the first available slot. +  Tries to pick up the specified number of items and place it in the selected slot. If the selected slot is occupied, items will be placed in the first available slot. Returns the number of items sucked else false.
  
 ====Robot Component API==== ====Robot Component API====