-
Notifications
You must be signed in to change notification settings - Fork 17
tubelib
Table of Contents
- Tubelib Pusher
- Tubelib Distributor
- Tubelib Button/Switch
- Tubelib Lamp
- Tubelib Forceload Block
- Tubelib Black Hole
- Tubelib Repair Kit
- Tubelib End Wrench
The Pusher is a pulling/pushing block, moving items from one inventory block to another (e.g. chests). The standard Pusher moves one item every 2 seconds. The fast Pusher moves one item every second.
The simplest arrangement with a Pusher is:
Start the Pusher with a right-click. It shows the state 'running' as infotext. The Pusher moves items from left to right (IN to OUT). If the source chest is empty, the Pusher goes into 'standby' state for some seconds. If the destination chest is full, the Pusher goes into 'blocked' state. All states can be read by means of the SmartLine and SaferLua Controllers (see following chapters)
For larger distances Tubes are used.
Tubes allow the connection of two blocks. Tube forks are not possible. You have to use chests or other inventory blocks as hubs to build more complex structures. Tubes for itself are passive. But Tubes can be used in both direction at the same time. The maximum tube length is limited to 200 blocks.
"Straight ahead tubes" can be placed with the help of the "sneak" button.
This is required to pass through chests or other blocks without being contacted.
States:
- "running", "stopped", "standby", "blocked", "defect"
Features:
- none
Supported Commands:
- "control": turn the device/block "on" or "off"
- via SmartLine Controller:
switch
- via SaferLua Controller:
$send_cmnd(num, text)
- "state": read the state of the block
- via SmartLine Controller:
state
- via SaferLua Controller:
$get_status(num)
States:
- "running", "stopped", "standby", "blocked", "defect"
Features:
- none
Supported Commands:
- "control": turn the device/block "on" or "off"
- via SmartLine Controller:
switch
- via SaferLua Controller:
$send_cmnd(num, text)
- "state": read the state of the block
- via SmartLine Controller:
state
- via SaferLua Controller:
$get_status(num)
For sorting tasks Distributors are used.
The Distributor works as filter and pusher. It allows to divide and distribute incoming items into 4 tube channels. The channels can be switched on/off and individually configured with up to 20 items per channel. The filter passes the configured items and restrains all others.
States:
- "running", "stopped", "standby", "blocked", "defect"
Features:
- none
Supported Commands:
- "control": turn the device/block "on" or "off"
- via SmartLine Controller:
switch
- via SaferLua Controller:
$send_cmnd(num, text)
- "state": read the state of the block
- via SmartLine Controller:
state
- via SaferLua Controller:
$get_status(num)
- "filter": enable/disable one of the four filters ("red"/"green"/"blue"/"yellow")
- via SmartLine Controller:
set_filter
- via SaferLua Controller:
$set_filter(num, slot, val)
- "counter": read the counter value of already processed items
- via SaferLua Controller:
$get_counter(num)
- "clear": clear the item counter (set to 0)
- via SaferLua Controller:
$clear_counter(num)
Here 3 ports for red, blue and green wool are used. The color of the port correspond to the color of the output sides. Unused output sided (here green), top and bottom sides can be used as inputs.
To increase the throughput, one item can be added several times (blue wool) to a filter. But also different items can be used to configure one filter (yellow). Unconfigured but activated filters are used for items, which do not fit to all other filters. If the Distributor can’t push an item into a block with an inventory (such as a chest) because that inventory is full, but there is one open and unconfigured output, it will use this output port.
The Button/Switch is a simple communication block to turn on/off other blocks by means of tubelib commands. All Tubelib blocks, which can be controlled, obtain a unique number which is shown as block infotext.
This number is used as destination address for commands and events. To turn the Pusher on/off, the number (here 0407) has to be entered into the Button formspec. (Don't forget the leading zeros!)
This block can be configured as button or as switch. For the button configuration, times between 2 to 16 seconds are possible. You can control several blocks by means of one button. In this case all numbers with blanks in between have to be entered.
States:
- none
Features:
- sends "on"/"off" events
Supported Commands:
- none
The Lamp can be turned on/off by means of the right-clicks or by means of messages commands from a Button/Switch or any other command sending block.
States:
Features:
- none
Supported Commands:
- "control": turn the device/block "on" or "off"
- via SmartLine Controller:
switch
- via SaferLua Controller:
$send_cmnd(num, text)
The Forceload Block keeps the corresponding area loaded and the machines operational as far as the player is logged in. If the player leaves the game, all areas will be unloaded. The maximum number of Forceload Blocks per player is configurable (default 12).
The loaded area per block is a cube with 16 m side length (according to a Minetest block). Punching the block makes the area visible and invisible again.
States:
- none
Features:
- none
Supported Commands:
- none
The Tubelib Black Hole Block let items disappear. If your machine produces to much or unneeded items, push them into the Black Hole.
States:
- number of disappeared items
Features:
- none
Supported Commands:
- "state": read the state of the block
- via SmartLine Controller:
state
- via SaferLua Controller:
$get_status(num)
Almost all machine blocks can become defective after some hours of activity. They switch into the state "defect".
This tool is used to repair defect machines. You have to left-click the block to repair the machine. But you will lose your Repair Kit instead.
States:
- none
Features:
- none
Supported Commands:
- none
Each machine supporting the "defect" state can now be set to "defect" by means of the Tubelib End Wrench tool. This is only useful for Controller program testing purposes.
- left-click (use) read machine state information
- right-click (place) set aging counter to 999999. Machine goes defect with the next operating cycle.
States:
- none
Features:
- none
Supported Commands:
- none