Upload files to "lwcomponents/docs"

This commit is contained in:
Mavori 2025-06-27 18:09:11 +02:00
commit 19b6279455
26 changed files with 1571 additions and 0 deletions

51
lwcomponents/docs/api.txt Normal file
View file

@ -0,0 +1,51 @@
lwcomponents.version ()
Returns this mod version as a string. eg. "0.1.5".
lwcomponents.register_spawner (itemname, spawn_func)
itemname:
Registered string name of the spawner item
spawn_func:
The function to call to spawn the mob of the form -
spawn_func (spawn_pos, itemstack, owner, spawner_pos, spawner_dir, force)
spawn_pos:
The position the entity should be spawned at.
itemstack:
The spawner ItemStack, of the name itemname.
owner:
As string of the player's name that will own the spawned entity,
if applicable. This may be "" for no owner.
spawner_pos:
The position of the block calling this function.
spawner_dir:
A single unit vector of the direction the spawner block is facing.
eg. { x = -1, y = 0, z = 0 }
force:
Recommended force (for velocity) of spawned entity.
Can use vector.multiply (spawner_dir, force).
This function should return the ObjectRef of the spawned entity or
nil. If this function returns nil for ObjectRef a second boolean
value should be returned for whether to cancel the action.
eg. If too many mobs:
return nil, true
eg. If only chance of spawn and out of luck:
return nil, false
The register function return true on success, or false on failure
(parameter type check failed or the spawn item has already been
registered).

View file

@ -0,0 +1,56 @@
Breaker
-------
* This block is only available if digilines and/or mesecons are loaded.
Breakers dig the node up to 5 nodes directly in front of them and drop
the item at the back of them, or into a pipeworks tube if one is placed
behind it. The node is only dug if the breaker has a tool that can dig it
or if it can be dug by hand, and there are no nodes before of it. ie.
cannot dig 2nd node if 1st node has something in it. The tool is worn if
used. Also acts as a digilines conductor. If the hopper mod is loaded,
will take tools from the top and sides. Pipeworks tubes can push items
into and pull items from the inventory.
Only the owner can dig or access the form of the locked version. To break
nodes in a protected area, the locked version must be used and the owner
must be able to dig in the area.
UI
Channel - digilines channel of breaker.
Top 1 slot inventory - tool to use.
Bottom 32 slot inventory - player's inventory.
Mesecons
Digs the node in front (always the 1st node position) when power is
turned on, if it can.
Digilines messages
"break n"
Digs the node at n nodes in front when power is turned on, if it can.
n should be a number between 1 and 5. If omitted 1 is assumed.
"eject side"
Drop the tool in the tool slot at the given side. Valid sides are "left",
"right", "back", "front". If side is omitted or invalid "front" is used.
When a breaker digs a node or wears out the tool a digilines message is
sent with the breaker's channel. The message is a table with the following
keys:
{
action = "<action>",
name = "<name>",
range = <number>
}
action
Will be "break" or "tool".
name
For "break" action the registered node name of what was dug.
For "tool" action the registered tool name of the tool that wore out.
range
For "break" action the nodes forward that was dug.
For "tool" action always nil.

View file

@ -0,0 +1,41 @@
Camera
------
* This block is only available if digilines is loaded.
Cameras take an image in the direction they are facing. The colors in the
image represent what is being viewed. Nodes are gray, entities are blue and
players are green. The closer they are to the camera the brighter the color.
The viewing distance of the camera is 1 to 16 nodes. Also acts as a
digilines conductor.
Only the owner can dig or access the form of the locked version.
UI
Channel - digilines channel of camera.
Distance - the viewing distance forward from the camera (1 to 16).
Resolution - the image resolution (for both width and height, 1 to 128).
Digilines messages
"scan"
Sends a digilines message with the camera's channel and a table of the
image as the message (see below).
"distance n"
Sets the viewing distance of the camera. Will be clipped between 1 and
16.
"resolution n"
Sets the image resolution of the camera.
The image is an indexed table of indexed tables. Each inner table is one
line of the image ordered top to bottom. There are resolution number of
lines. Each line has a string value for each pixel of that line left to
right. The string is a hex color string eg. "00FF00". There are resolution
number of pixels per line.
The image format is compatible with digistuff's digiscreens and lwcomputers'
digiscreens and digipanels. It is best to set the resolution of the camera
to the resolution of the display, then the image from the camera can be sent
straight to the display device.

View file

@ -0,0 +1,104 @@
Cannon
------
This item is available without digilines or mesecons as it can be used
manually.
Contains a single inventory slot and shoots an item on command.
If the hopper mod is loaded, will take items from the top and sides, and
release them from the bottom. Pipeworks tubes can push items into and pull
items from the inventory.
Cannon rotation range:
side to side - +/-60 degrees (- = left, + = right)
down to up: -20 to 70 degrees (- = down, + = up)
To spawn entities from cannons include the lwcomponents_spawners mod.
Only the owner can dig or access the form of the locked version.
UI
Channel - digilines channel of cannon.
Hide - hides the form so the cannon can be used manually, double right click
any other face besides the rear to bring up the form.
Controller - digistuff game controller digilines channel.
Sensitive - if checked game controller movements have a x3 sensitivity.
Top 1 slot inventory - storage of items to shoot.
Bottom 32 slot inventory - player's inventory.
Manual control
Place some items in the single slot, and click the Hide button. On the
rear panel their are 4 gray buttons. Right clicking them turns the barrel
in that direction 10 degrees. aux + right click turns 1 degree. Clicking
the red button fires an item. To bring up the form again double right click
any other face besides the rear.
Digistuff game controller
Connect a game controller to the cannon with digilines cable. Enter the
game controller's channel in the Controller field of the cannon's form
(click Set). Your turning movements turn the cannon's barrel in the
direction the cannon is facing. If Sensitive is checked the movements
have an increased sensitivity (x3) to try and keep the target in your view,
otherwise x1. Punching shoots an item. The game controller updates every
0.2 seconds, so a quick punch may not register. A locked cannon can only
be controlled by it's owner with a game controller.
Mesecons
Shoots an item when power is turned on.
Digilines messages
"pitch <n>"
Sets the pitch of the barrel. n should be between -20 to 70, and will
be clipped to this range.
eg. "pitch 22"
"rotation <n>"
Sets the rotation of the barrel. n should be between -60 to 60, and will
be clipped to this range.
eg. "rotation 45"
table - aim position
{
action = "aim",
aim = { x, y, z }
}
x is the horizontal left (negative) to right. 0 is straight ahead.
y is the vertical down (negative) to up. 0 is straight ahead.
z is the depth. Must be > 0 or ignored. 1 is the position directly in
front of the cannon.
* The cannon barrel's height is 0.65 above the cannon's placed position.
When aiming for height, if the cannon's base height is taken as -0.5,
and consider height from there. This allows for the barrel height
and a little drop in the projectile at close range.
"fire"
Shoots an item.
* Note: turning the barrel is animated and takes 0.1 seconds per 10
degrees of movement. A fire command while moving is ignored.
Three shells are provided for cannons.
Shell
This shell has a 70% chance of destroying a node within a radius of 2 from
the impact, a 5% chance a flammable node will be set on fire within a
radius of 2 (if fire is installed), and damages players and entities within
a radius of 4 with a maximum of 20 damage points.
Soft Shell
This shell has a 50% chance of destroying only soft (buildable_to) nodes,
such as grass, within a radius of 2 from the impact, a 5% chance a flammable
node will be set on fire within a radius of 2 (if fire is installed), and
damages players and entities within a radius of 4 with a maximum of 20
damage points.
Fire Shell
* This item is only available if fire is installed.
This shell does not destroying nodes, has a 70% chance of setting a node
on fire, whether its flammable or not within a radius of 2, and damages
players and entities within a radius of 4 with a maximum of 20 damage
points.

View file

@ -0,0 +1,34 @@
Collector
---------
* This block is only available if digilines is loaded.
Picks up dropped items in adjacent block, with optional filtering. Also
acts as a digilines conductor. If the hopper mod is loaded, will take items
from the top and sides, and release them from the bottom. Pipeworks tubes
can push items into and pull items from the inventory.
Only the owner can dig or access the form of the locked version.
UI
Channel - digilines channel of collector.
Left 16 slot inventory - storage of picked up items.
Right 8 slot inventory - Filter list. Place what items should be picked
up in this list. Leave empty to pick up all.
Bottom 32 slot inventory - player's inventory.
Digilines messages
"start"
Start the collector.
"stop"
Stop the collector.
When items are picked up a digilines message is sent with the collector's
channel. The message is a table with the following keys:
{
action = "collect",
name = "<itemname>", -- name of picked up items.
count = <count> -- number of the item picked up.
}

View file

@ -0,0 +1,109 @@
Conduit
-------
Conduits are connected in a circuit, and can move items from their
inventory to another conduit in the same circuit.
When a conduit node is placed it has a simple form that asks for a channel.
This channel is both the digilines' channel and the target id of this
conduit within the circuit. A conduit does not have to be given a channel.
Most of them are just used to connect other conduits together.
Transfer of items takes 0.1 seconds per conduit node moved, and will work
in unloaded blocks.
Filtering of items can be done by placing an item into a filter slot and
setting a target for that item. If an item is not filtered it is sent to
the main target. Filtering can also be implemented through digilines.
Conduits also act as a digilines conductor. If the hopper mod is loaded,
the conduit will take items from the top and sides, and release them from
the bottom. Be aware that hoppers from the hopper mod have some deficits
that can cause some nodes from this mod to not function correctly in
multi-player environments. The hoppers from this mod are more compatible.
Pipeworks tubes can push items into and pull items from the inventory.
Note that if a sending conduit is moved (as with a piston) while in the
process of sending items, when the conduit is moved back into a circuit
a duplicate of the last sent item/s can be resent.
Only the owner can dig or access the form of the locked version.
UI
Channel - digilines channel/target id of conduit.
Target - target id/channel of conduit this conduit will transfer to.
Automatic - if checked transfers next item every second without command.
Top center 16 slot inventory - storage of items.
Bottom 32 slot inventory - player's inventory.
Filter - 8 vertical slot inventory on the right, each with their accompanying
target field.
Mesecons
Transfers the next item when power is turned on to the target conduit.
Digilines messages
"target <id>"
Set the target of the conduit. id should be the channel of another
conduit on the same circiut. This takes a moment to take effect, so
delay any transfers.
"targets"
Conduit will send a digilines message with its own channel in the form:
{
action = "targets",
targets = { ... } -- list of string channels of all other conduits
-- with a channel on the same circuit.
}
"transfer"
Simple transfer. Transfers the next item in the inventory to the target
conduit (same as mesecons power).
table message
{
action = "transfer",
target = "<channel>",
slot = <number>,
item = "<itemname>"
}
If target is not given, the conduit determines the target from it's
own settings.
slot should be a number between 1 to 16. If the slot is empty nothing
is transferred.
item should be the registered item name. If the conduit's inventory
does not contain any nothing is transferred.
Only slot or item should be given. If both are given slot is used. If
neither are given the next item in the inventory is transferred.
"inventory"
Sends a digilines message with it's own channel in the following form:
{
action = "inventory",
inventory = {
<items>
}
}
The inventory key is an indexed list of items in the conduit in slot
order. Each item entry is a table with the following keys:
{
name -- string, the name of the item, as <mod>:<name>
description -- string, description of the item, same as in UI
count -- number, the total number of this item in storage
custom -- true if a custom item (has metadata), false if not
pallet_index -- string if the item has a pallet index, otherwise nil
}
The description is derived from the short description, if none
then the description, and if none then the item's name, as
<mod>:<name>.
Note: When sending transfer messages the simple item name, as <mod>:<name>,
will work for most items, but not for custom items. With custom items, or
to play it safe, use the table form of the transfer message and use the
index for the item from an inventory message as the slot for the transfer
message.

View file

@ -0,0 +1,166 @@
Crafter
-------
Crafters can craft items by recipe or desired output item. Crafted items
are placed in the Output inventory, along with any replacement items (for
example if a bucket of milk is used in the craft the bucket is placed in
the Output inventory as well). Source items for the craft must be in the
Input inventory. If the crafter is adjoined to a storage unit the crafter
will also use source items from it as well.
Only the owner can dig or access the form of the locked version.
Unowned crafters can only access unowned units. Owned crafters can access
units of the same owner or unowned units.
UI
Input inventory - top left, source items for crafting.
Player inventory - lower left.
Channel - digilines channel of crafter, press enter or click Set to set.
Crafting grid - center top, enter a recipe to craft.
Automatic - if checked a craft of the recipe is performed every second (if possible).
Preview - this is a preview of the item crafted from the recipe.
Craft - perform 1 craft from the recipe (if possible).
Output inventory - center bottom, where crafted and replacement items are placed.
Search - top right.
Craftable list - right, list of all items that are possible to craft from
the input items. clicking an item crafts it (if possible).
The form does not update while open. A craft from source items no longer
available will not craft. If an attempt is made to craft by item when the
source materials have run out, the form does update.
Terms can be entered into the search field, and when enter is pressed or
the Search button is pressed, only items whose name or description contains
these terms are shown in the list. That is if they match any of the space
separated terms.
When items are placed into the crafting grid a copy is used and the item
returns to where it was taken from. When items are removed from the crafting
grid they are disposed of.
The preview displays the craft preformed by the recipe. Items cannot be
pulled from here.
The automatic crafting is only operable when the crafter is in an active
block. Mesecons and digilines operations operate in unloaded blocks.
When crafting by item, if more than one recipe is satisfied by the input
items, the crafting grid is replaced with the available crafts for that
item. Clicking the < and > buttons walks through the recipes. Clicking
Craft performs one craft with the displayed recipe. Clicking Close displays
the crafting grid. If only one recipe is satisfied by the input items one
craft is immediately performed without displaying the recipe.
Hoppers placed to the top or sides of a crafter will feed items into the
input. Hoppers placed below a crafter will take items from the output.
Pipeworks tubes can push items into the input, and pull items from the
output.
Mesecons
Perform 1 craft from the recipe when power is turned on (if possible).
Digilines messages
"craft [qty]"
Craft from the recipe if possible. qty is optional, if given must be an
integer between 1 to 10. If not given defaults to 1. A return message
is sent with it's own channel in the following format:
{
action = "crafted",
qty = number, -- craft qty requested
crafted = number -- crafts successfully performed
}
"craftitem itemname [qty]"
Craft the given item if possible. itemname must be a valid item name
(eg. "default:wood"). qty is optional, if given must be an integer
between 1 to 10. If not given defaults to 1. A return message is sent
with it's own channel in the following format:
{
action = "crafted",
itemname = string, -- the name of the item requested to craft
qty = number, -- craft qty requested
crafted = number -- crafts successfully performed
}
"can_craft [itemname]"
Test whether a single craft can be performed for the item. itemname is
optional, if given will test craft by item. If not given will test if
the recipe in the crafting grid can be performed. A return message is
sent with it's own channel in the following format:
{
action = "can_craft",
itemname = string, -- the name of the item requested, nil for recipe
result = boolean -- true if craft can be performed, false if not
}
"automatic state"
Sets the automatic running state of the crafter. state must be true or
false.
"craftable"
Sends a digilines message with it's own channel of the possible craftable
items in the following form:
{
action = "craftable",
items = {
<items>
}
}
The items key is an indexed list of items. Each item entry is
a table with the following keys:
{
name -- string, the name of the item, as <mod>:<name>
description -- string, short description of item
}
"inventory"
Sends a digilines message with it's own channel of the source items,
including any attached storage, in the following form:
{
action = "inventory",
inventory = {
<items>
}
}
The inventory key is an indexed list of items. Each item entry is
a table with the following keys:
{
name -- string, the name of the item, as <mod>:<name>
description -- string, short description of item
count -- number, the total number of this item in storage
}
Set recipe grid:
{
action = "recipe",
items = { ... }
}
items must be a string list of item names as <mod>:<name>. The grid is
filled left to right, top to bottom. Up to the first 9 items are used.
* When crafting by item the output may not be as expected. For the digilines
"craftitem" message, the first found recipe for the craft which is
satisfied by the available items is used. So if you have saplings and
wood in the input and try to craft sticks, if the first recipe found
uses the saplings 1 stick will be output, if wood then 4 sticks.
Also, sometimes the same recipe is registered for more than 1 item.
In this case, what item will actually be crafted is ambiguous.
* The file 'crafting_mods.lua' in the mod folder contains a list of
crafting modifications. Modify this file as necessary. The field name
is the item being crafted. Each item in the add list is added to the
output inventory. Each item in the remove list is removed from the
replacements or source storage.
* Gaining the list of craftable items is an exponential process, based
on the number of unique source items and the total number of items
available. As a guide, 320 source items and 795 total items that resulted
623 craftable items took approx. 200ms (1st gen i5 processor). The
list is obtained in a granular function to minimise server burden, but
may take a moment to update. This list is only gained: when the form is
opened; when the Search button is clicked; and when the digilines
"craftable" message is sent.

View file

@ -0,0 +1,61 @@
Deployer
--------
* This block is only available if digilines and/or mesecons are loaded.
Deployers place the node up to 5 nodes directly in front of them. The
node is only placed if there are no nodes before of it which are not
replaceable. ie. cannot place 2nd node if 1st node has something in it.
Also acts as a digilines conductor. If the hopper mod is loaded, will
take items from the top and sides, and release them from the bottom.
Pipeworks tubes can push items into and pull items from the inventory.
Only the owner can dig or access the form of the locked version. To place
nodes in a protected area the 'Use player when placing' setting must be
enabled, the deployer must be the locked version and the owner must be able
to place in the area.
UI
Channel - digilines channel of breaker.
Top 16 slot inventory - storage of items to place.
Bottom 32 slot inventory - player's inventory.
Mesecons
Places the node in front (always the 1st node position) when power is
turned on, if it can.
Digilines messages
"deploy <slot or itemname> <n>"
Places the node at n nodes in front when power is turned on, if it can.
n should be a number between 1 and 5. If omitted 1 is assumed.
If slot is a number, places an item from that slot. No placement if
slot is empty.
eg. "deploy 7"
If itemname is given, places the item of the name given. No placement
if deployer does not contain the item.
eg. "deploy default:stone"
If n is given with no slot/itemname use "nil".
eg. "deploy nil 3"
When a deployer places a node a digilines message is sent with the
deployer's channel. The message is a table with the following
keys:
{
action = "deploy",
name = "<name>",
slot = <slot>,
range = <number>
}
action
Will be "deploy".
name
The registered node name of what was placed.
range
The nodes forward that was placed.

View file

@ -0,0 +1,11 @@
Destroyer
---------
Destroyers dispose of items placed in their single slot inventory (basically
a trash). Items can be push into destroyers with tubes from pipeworks or
hoppers attached to the top or sides, so they are suitable for automation.
Items cannot be pulled out of destroyers.
Note that destroyers act when an item is placed in their inventory, as with
storage indexers it is best to use the hopper from this mod to feed them
in multi-player games.

View file

@ -0,0 +1,112 @@
Detector
--------
* This block is only available if digilines and/or mesecons are loaded.
Detects items or entities within a given radius. Also acts as a
digilines conductor.
Only the owner can dig or access the form of the locked version.
UI
Channel - digilines channel of detector.
Radius - block distance from detector to detect.
Entities - if checked detects entities.
Players - if checked detects players.
Drops - if checked detects drops.
Nodes - if checked detects nodes.
mode:
All - detects to radius in all directions, including diagonal.
Forward - detects to radius directly in front of the detector (one block high).
Up - detects to radius directly above the detector (one block wide).
Down - detects to radius directly below the detector (one block wide).
Mesecons
Mesecons power is turned on when something is detected, and turned off
when nothing is detected.
Digilines messages
"start"
Start the detector.
"stop"
Stop the detector.
"radius <n>"
Set radius of the detector. <n> should be a number from 1 to 5, and is
trimmed to this range.
"entities <true|false>"
Set detection of entities on or off.
"players <true|false>"
Set detection of players on or off.
"drops <true|false>"
Set detection of drops on or off.
"nodes <true|false>"
Set detection of nodes on or off.
"mode all"
"mode forward"
"mode up"
"mode down"
Set the detector's mode.
When items or entities are detected a digilines message is sent with the
detector's channel. A message is sent for each found item/entity. The
message is a table with the following keys:
{
action = "detect",
detected = table
}
The detected field is a list of detected items. Each entry is of the form:
{
type = "<type>", -- will be "entity", "player", "drop" or "node"
name = "<name>",
label = "<label>",
pos = { x = n, y = n, z = n },
count = <count>,
hp = <number>,
height = <number>
}
type
Will be "entity", "player", "drop" or "node".
name
For "entity" the registered entity name.
For "player" the player's name.
For "drop" the registered item name.
For "node" the registered item name.
label
For "entity" the name tag text.
For "player" the player's name.
For "drop" the registered item name.
For "node" the registered item name.
pos
The relative position of the detected item/entity from the detector,
facing the direction of the detector.
+x = right
-x = left
+z = forward
-z = behind
+y = above
-y = below
count
The count of items for a "drop", or 1 for everything else.
hp
Health points for players and entities. Zero for everything else.
height
Height for players and entities. Zero for everything else. This is simply
the top position of the object's collision box.

View file

@ -0,0 +1,160 @@
1st right click - set channel, can't be changed after that.
Following right clicks displays touchscreen form.
Sent message as a table. Each command can be sent individually or as
indexes of a table to run as batch.
Clears the current form.
{
command = "clear"
}
Adds elements to the form. The form is size[10,8]. The parameters are as
for formspec (see api docs). No version is specified.
{
command = "realcoordinates",
enabled = true or false
}
{
command = "addimage",
X = n,
Y = n,
W = n,
H = n,
texture_name = string
}
{
command = "addfield",
X = n,
Y = n,
W = n,
H = n,
name = string,
label = string,
default = string
}
{
command = "addpwdfield",
X = n,
Y = n,
W = n,
H = n,
name = string,
label = string
}
{
command = "addtextarea",
X = n,
Y = n,
W = n,
H = n,
name = string,
label = string,
default = string
}
{
command = "addlabel",
X = n,
Y = n,
label = string
}
{
command = "addvertlabel",
X = n,
Y = n,
label = string
}
{
command = "addbutton",
X = n,
Y = n,
W = n,
H = n,
name = string,
label = string
}
{
command = "addbutton_exit",
X = n,
Y = n,
W = n,
H = n,
name = string,
label = string
}
{
command = "addimage_button",
X = n,
Y = n,
W = n,
H = n,
image = string,
name = string,
label = string
}
{
command = "addimage_button_exit",
X = n,
Y = n,
W = n,
H = n,
image = string,
name = string,
label = string
}
{
command = "adddropdown",
X = n,
Y = n,
W = n,
H = n,
name = string,
selected_id = n,
choices = { string [, string ... ] }
}
{
command = "addtextlist",
X = n,
Y = n,
W = n,
H = n,
transparent = true/false,
name = string,
selected_id = n,
listelements = { string [, string ... ] }
}
If unlocked ignores protection.
{
command = "lock"
}
{
command = "locked"
}
When the touchscreen form is accessed a message is sent with the
touchscreen's channel with the 'fields' parameter from the on_receive_fields
handler, with an additional field 'clicker' with the name of the player
that accessed the form.

View file

@ -0,0 +1,31 @@
Digilines Switch
----------------
* This block is only available if both digilines and mesecons are loaded.
Digilines switches act as both a digilines message target and a digilines
cable, as well as a mesecons power source. They can be placed beside each
other to form a bank, horizontally or vertically.
Right click the digilines switch to give it a channel.
Mesecon power can be delivered at 6 sides of the digilines switch, the
adjacent 4 in the (x, z), above and below. Around the connector on these
sides are a colored border indicating the side. The sides are named "red",
"green", "blue", "yellow", "white" and "black".
The digilines message sent to the digilines switch dictates the action,
"on" or "off". The action can be followed with the side to act upon,
separated by a space. eg. "on white". If a side is stated only that side
is acted upon. If the side is omitted (or is invalid) all 6 sides are
acted upon. If the side name "switch" is given the power is supplied the
same as a mesecons switch (all horizontal sides, one below, this height
and one above).
A note on connecting mesecons wires. Mesecons does not appear to allow
for some sides to be on and some off on receptors (power sources). When
any side is on the state of the digilines switch is on, but only rules for
the powered sides are defined. This means if wires are placed while in
this state only the sides that are powered will connect. When no side is
powered the state of the digilines switch is off with rules defined for
all potentially connected sides. In this state (as when first placed)
mesecons wires will connect correctly.

View file

@ -0,0 +1,44 @@
Dispenser
---------
* This block is only available if digilines and/or mesecons are loaded.
Contains an inventory and dispenses (with velocity) an item on command.
Also acts as a digilines conductor. If the hopper mod is loaded, will take
items from the top and sides, and release them from the bottom. Pipeworks
tubes can push items into and pull items from the inventory.
To spawn entities from dispensers include the lwcomponents_spawners mod.
Only the owner can dig or access the form of the locked version.
UI
Channel - digilines channel of dispenser.
Top 16 slot inventory - storage of items to dispense.
Bottom 32 slot inventory - player's inventory.
Mesecons
Dispenses the next item when power is turned on.
Digilines messages
"dispense"
Dispenses the next item. No dispense if dispenser is empty.
"dispense <slot>"
Dispenses 1 item from the given slot (1 to 16). No dispense if slot is
empty.
eg. "dispense 7"
"dispense <itemname>"
Dispenses 1 item of the given name. No dispense if dispenser does not
contain the item.
eg. "dispense default:stone"
When an item is dropped a digilines message is sent with the dropper's
channel. The message is a table with the following keys:
{
action = "dispense",
name = "<itemname>", -- name of dropped item
slot = <slot> -- slot number the item was taken from (1 to 16).
}

View file

@ -0,0 +1,64 @@
Dropper
-------
* This block is only available if digilines and/or mesecons are loaded.
Contains an inventory and drops item/s on command. Also acts as a
digilines conductor. If the hopper mod is loaded, will take items from the
top and sides, and release them from the bottom. Pipeworks tubes can push
items into and pull items from the inventory.
Only the owner can dig or access the form of the locked version.
UI
Channel - digilines channel of dropper.
Top 16 slot inventory - storage of items to drop.
Qty - the number of items dropped on an action.
Bottom 32 slot inventory - player's inventory.
Mesecons
Drops the next item/s when power is turned on, to the given quantity.
Digilines messages
"drop [<slot>|<itemname>] [qty]"
slot or itemname are optional. If given slot must be the number of
the dropper slot to drop from (1 to 16). itemname must be the name of
the item from the dropper to drop (eg. default:stone).
qty is optional. If given must be the number of items to drop. If
omitted the quantity set on the dropper's form is dropped.
examples:
"drop"
Drops the first found item with the quantity from the dropper's form.
"drop 7"
Drops items from slot 7 with the quantity from the dropper's form.
"drop default:stone"
Drops the item "default:stone" with the quantity from the dropper's form.
"drop 7 5"
Drops items from slot 7 with the quantity of 5.
"drop default:stone 5"
Drops the item "default:stone" with the quantity of 5.
"drop nil 5"
Drops the first found item with the quantity of 5.
If there are not enough items in the dropper (of a name or in a slot) to
fulfil the quantity, only the amount available is dropped. If no slot or
name is given the first found item is used (multiple items are not dropped
to fulfil the quantity).
When items are dropped a digilines message is sent with the dropper's
channel. The message is a table with the following keys:
{
action = "drop",
name = "<itemname>", -- name of dropped item/s
slot = <slot>, -- slot number the item/s were taken from (1 to 16). If
-- more than one slot was taken from this will be -1
qty = <number> -- the number of items dropped
}

24
lwcomponents/docs/fan.txt Normal file
View file

@ -0,0 +1,24 @@
Fan
---
* This block is only available if digilines and/or mesecons are loaded.
Fans blow any entity, player or drop in front of the fan for 5 node
spaces in the direction of the fan. A node placed in these 5 spaces blocks
the fan's action beyond the placed node. Also acts as a digilines conductor.
Only the owner can dig or access the form of the locked version.
UI
Channel - digilines channel of fan.
Mesecons
Fan runs while power is turned on.
Digilines messages
"start"
Starts the fan.
"stop"
Stops the fan.

View file

@ -0,0 +1,67 @@
Force Field Generator
---------------------
Force field generators repel players and mobs within a given radius from
the generator. The radius can be 5 to 25 and is in all directions. An
'electric dome' appears marking the field. The generator consumes fuel
relative to the radius. A radius of 25 uses 1 coal in 10 seconds, 5 uses
1 coal in 50 seconds. Each time an entity is repelled it cost 1 fuel value
(1/40 of a coal). Any players or mobs permitted inside the field can be
added to the Permit list. Each entry must be on a new line with no extra
spaces. Empty lines (not even a space) are ignored. The mob's registered
name or tag can be used. The owner of a locked generator will not be
repelled. When something is repelled it takes a small amount of damage.
Only the owner can dig or access the form of the locked version.
UI
Channel - digilines channel of generator.
Radius - the node radius to repel, in every direction. 5 to 25.
Permit - list of players or mobs to allow within field. Mobs can be registered
entity name or tag.
Start/Stop button - starts and stops the field.
Fuel - single slot inventory.
Player inventor - 32 slot inventory at bottom.
Mesecons
Turns the generator on and off.
Digilines messages
"start"
Start the generator.
"stop"
Stop the generator.
"radius n"
Set the radius to n, where n is a number between 5 to 25.
"add <name>"
Add a name to the permit list.
"remove <name>"
Remove a name from the permit list.
"status"
Query the status of the generator. The generator will send a digilines
message with its own channel as the following table:
{
action = "status",
state = "on" | "off",
radius = n, -- radius as number
permit =
{
<list of names>
},
fuel =
{
name = name, -- eg. "default:coal_lump", will be "" if empty
count = n, -- count of fuel
}
}
Hoppers and pipeworks tubes can be used to push or pull the fuel.

View file

@ -0,0 +1,107 @@
Hologram
--------
* This block is only available if digilines is loaded.
Projects a hologram above the hologram node. Also acts as a digilines
conductor.
The hologram occupies a space 15x15x15. The lower level of the hologram
is 2 blocks above the hologram node (so the hologram node can be hidden
beneath a floor). The hologram node is in the x, z horizontal center, ie.
the hologram can extend 7 blocks in each direction from the node.
Colored blocks cannot be interacted with, but will be replaced if built
into. If a block already exists where the hologram requires a color, it
is not placed unless the block is a color block from this hologram block.
If an existing block is dug while a holograms is displayed it is not
filled in, the hologram has to be re-displayed.
Only the owner can dig or access the form of the locked version.
UI
Channel - digilines channel of hologram.
Digilines messages
"clear"
Removes any hologram currently projected.
table
To display a hologram a table of dimensions holo[15][15][15] is sent as
the message. The table structure is holo[layer][line][block]. In the
direction the hologram block is facing, the layers run from bottom to
top, the lines run from back to front, and the blocks run from right to
left. Each block value can be nil for no display, or a string with the
color. Valid colors are:
"black"
"gray"
"silver"
"white"
"sky"
"blue"
"cyan"
"lime"
"green"
"magenta"
"purple"
"pink"
"red"
"yellow"
"orange"
"brown"
If anything else no color block is placed.
For example:
{
{
{ "black", nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, "green" },
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{ "blue", nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, "red" }
},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{
{ "orange", nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, "lime" },
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{ "purple", nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, "yellow" }
},
}
will display a hologram with a black and green block at the back of
the bottom layer, and orange and lime at the back of the top layer.

View file

@ -0,0 +1,12 @@
Hopper
------
* This block is only available if the hopper mod is loaded.
This version of a hopper will transfer items from a drop or inventory in
the node at the wide end of the hopper to the inventory in the node at the
narrow end of the hopper. The hopper has no inventory itself, and always
moves items one at a time, every second. These hoppers cannot be chained
to transfer items, but work in unloaded blocks. This hopper uses the
hopper mod's registered list of nodes, and should work with nodes with
hopper support. These hoppers can be rotated with a screwdriver, but
function as their typical placement when rotated.

View file

@ -0,0 +1,17 @@
MoveFloor
---------
* This block is only available if mesecons is loaded.
The MoveFloor block responds to a mesecons power source in the 4 horizontal
directions. If the power source is one higher the MoveFloor moves up to
that height. If the power source is one lower the MoveFloor moves down to
that height. Powering an adjacent block has no effect. The power source
should be turned off before another move or the MoveFloor will oscillate.
Any horizontally adjoining MoveFloor acts as a single block (only one
needs to be powered).
The MoveFloor will move up to 3 blocks stacked on it.
If using a DigiSwitch as the power source use the side name "switch" or
the MoveFloor will not move.

View file

@ -0,0 +1,43 @@
Pistons and sticky pistons
--------------------------
* These blocks are only available if digilines and/or mesecons are loaded.
Pistons push up to the setting Maximum piston nodes (default 15) in front
of the pusher when extended. Sticky piston draw back a single node in
front of the pusher when retracted. Piston also act as a digilines
conductor.
Sticky blocks are also supported. Any sticky block structure attached to
the pusher will also be pushed, up to the maximum setting. Any free blocks
(not attached to the sticky blocks) in front will be pushed up to the
maximum setting. This limit is from the pusher, not the sticky block. When
retracting a maximum of one free block depth will be pulled. Any sticky
block structure extending laterally by more than half the maximum limit
will not be pushed.
Any entities in front of or standing on a moving node are pushed/pulled,
if nothing is in the way of their base position. Any entities against a
sticky face are not pulled.
UI
Channel - digilines channel of piston.
Single move - pusher extends 1 node if checked, otherwise 2 nodes.
Mesecons
Piston extends while power is turned on.
Digilines messages
"extend n"
Extends the piston pusher to extent n (0, 1 or 2). If n is not given
pusher extends to maximum extent. 0 is retracted.
"retract"
Same as 'extend 0'.
"single"
Sets piston to single move mode.
"double"
Sets piston to double move mode.

View file

@ -0,0 +1,21 @@
Player Button
-------------
* This block is only available if both digilines and digistuff are loaded.
When pressed sends a digilines message with the name of the player that
pressed the button.
The first time the button is right clicked a form opens to set the
digilines channel. After that right click presses the button. The
digilines cannot be changed after its set.
UI
Channel - digilines channel of button.
When the button is pressed a digilines message is sent with the button's
channel in the form:
{
action = "player",
name = <player name>
}

View file

@ -0,0 +1,69 @@
Puncher
-------
* This block is only available if digilines and/or mesecons are loaded.
Punches players or entities within a given reach. Also acts as a
digilines conductor.
Only the owner can dig or access the form of the locked version.
UI
Channel - digilines channel of puncher.
Reach - block distance from puncher to punch.
Entities - if checked punches entities.
Players - if checked punches players.
mode:
Forward - punches to reach extent directly in front of the puncher (one block high).
Up - detects to reach extent directly above the puncher (one block wide).
Down - detects to reach extent directly below the puncher (one block wide).
Mesecons
Punches the next item when power is turned on.
Digilines messages
"start"
Start the puncher.
"stop"
Stop the puncher.
"reach <n>"
Set reach of the puncher. <n> should be a number from 1 to 5, and is
trimmed to this range.
"entities <true|false>"
Set punching of entities on or off.
"players <true|false>"
Set punching of players on or off.
"mode forward"
"mode up"
"mode down"
Set the puncher's mode.
"punch"
Action a single punch if the puncher is turned on.
When a player or entity is punched a digilines message is sent with the
puncher's channel. The message is a table with the following keys:
{
action = "punch",
type = "<type>", -- will be "entity" or "player"
name = "<name>",
label = "<label>"
}
type
Will be "entity" or "player".
name
For "entity" the registered entity name.
For "player" the player's name.
label
For "entity" the name tag text.
For "player" the player's name.

View file

@ -0,0 +1,46 @@
Siren
-----
* This block is only available if digilines and/or mesecons are loaded.
Plays a sound repeatedly while active. Also acts as a digilines conductor.
digilines conductor.
Only the owner can dig or access the form of the locked version.
UI
Channel - digilines channel of siren.
Distance - block distance the sound can be heard (range 0 to 100).
Volume - volume the sound is played.
Sound - select Buzzer, Horn, Raid or Siren.
Mesecons
Sound plays while mesecons power is applied.
Digilines messages
"start"
Start the siren (turn on).
"stop"
Stop the siren (turn off).
"distance <n>"
Set block distance the sound can be heard. <n> should be a number
from 1 to 100, and is trimmed to this range.
"volume <n>"
Set the sound volume. <n> should be a number from 1 to 100, and is
trimmed to this range.
"sound buzzer"
"sound horn"
"sound raid"
"sound siren"
Set the sound of the siren.
"siren on"
Activate the siren, if its on.
"siren off"
deactivate the siren.

View file

@ -0,0 +1,9 @@
Solid Color Conductors
----------------------
* These blocks are only defined if mesecons and unifieddyes are loaded.
Provides 2 blocks that can be colored the same as Solid Color Block (with
the air brush) and is both a mesecons and digilines conductor.
The Solid Color Conductor block conducts in the 'default' directions and
the Solid Color Horizontal Conductor only conducts horizontally.

View file

@ -0,0 +1,105 @@
Storage
-------
Storage is accommodated with two nodes, Storage Unit and Storage Indexer.
Storage units can be interacted with like a basic chest, each with 32 slots,
and visually join together when placed adjacent to each other. Units are
generally accessed via indexers, which action all adjoining units as a
single storage block. Multiple indexers can action a single storage block.
Only the owner can dig or access the form of the locked versions.
Unowned indexers can only access unowned units. Owned indexers can access
units of the same owner or unowned units.
UI
Search - top left.
List - left.
Channel - digilines channel of indexer.
Input - middle.
Output - top right.
Filter - center right.
Player inventory - lower right.
When the UI is accessed the storage is scanned, and its contents are
displayed in the list. The list contains the following columns:
Item button - pressing will place one of these items from storage into the
output.
10 button - pressing will place 10 of the item.
<stack> button - pressing places a full stack.
Count - the total number of this item in storage.
Description - description of the item.
Note that the 10 and stack buttons may vary in number or not appear
depending on the requirements of that item.
The form does not update while open. A request for more items than in
storage will only deliver the amount in storage.
Terms can be entered into the search field, and when enter is pressed or
the Search button is pressed, only items whose description contains these
terms are shown in the list. That is if they match any of the space
separated terms.
Any items placed into the input are placed into storage. If the filter
is clear all items are accepted. If the filter contains items only these
items will be accepted. Any items not accepted or that do not fit into
storage are placed into the output.
When items are placed into the filter a copy is used and the item returns
to where it was taken from. When items are removed from the filter they
are disposed of.
Hoppers placed to the top or sides of an indexer will feed items into the
input. Hoppers placed below an indexer will take items from the output.
Note, when a hopper from the hopper mod is used to place items into the
input, if the player that placed the hopper leaves the game the input will
not be pulled into storage.
Pipeworks tubes can push items into the input, and pull items from the
output.
Every 20 inputs the storage is consolidated to minimize fragmentation.
Digilines messages
"output <item> <count>"
or
{
action = "output",
item = "<item>",
count = <count>
}
Moves the item/s to the output. If count is omitted defaults to 1. If
the requested amount is greater than in storage, only the stored amount
is moved. If the requested amount is greater than a full stack of the
item a full stack is moved.
"inventory"
Sends a digilines message with it's own channel in the following form:
{
action = "inventory",
inventory = {
<items>
}
}
The inventory key is an indexed list of items in storage. Each item
entry is a table with the following keys:
{
name -- string, the name of the item, as <mod>:<name>
description -- string, description of the item, same as in UI
count -- number, the total number of this item in storage
custom -- true if a custom item (has metadata), false if not
pallet_index -- string if the item has a pallet index, otherwise nil
id -- string, unique id of the item in storage
}
The description is derived from the short description, if none
then the description, and if none then the item's name, as
<mod>:<name>.
Note: When sending output messages the simple item name, as <mod>:<name>,
will work for most items, but not for custom items. With custom items, or
to play it safe, use the table form of the output message and set the item
field with the id field for the item from a returned inventory.

View file

@ -0,0 +1,7 @@
Mesecons Through Wire
---------------------
* This block is only available if mesecons is loaded.
Will transmit mesecons power when placed one to two blocks apart opposing
each other, through solid blocks or open space. Can also be used as a mesecons
crossover.