Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/himbeerserverde/digilines
Digiline mod for Dragonblocks
https://github.com/himbeerserverde/digilines
Last synced: 5 days ago
JSON representation
Digiline mod for Dragonblocks
- Host: GitHub
- URL: https://github.com/himbeerserverde/digilines
- Owner: HimbeerserverDE
- License: gpl-3.0
- Created: 2020-06-03T10:53:16.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-06-03T17:32:32.000Z (over 4 years ago)
- Last Synced: 2024-11-08T06:19:47.665Z (about 2 months ago)
- Language: JavaScript
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# digilines
Digiline mod for Dragonblocks# Features
This mod is inspired by the digiline mod for Minetest. It allows you to send messages on channels through wires. The system can be used by external mods.
## The new nodes provided are:
- Digiline wire
- Digiline screen (not added yet)
## Planned nodes are:
- Digiline RTC/real-time clock ()
- Digiline light sensor (daylight cycle is not in the game yet)
I'll probably make some digiline extensions adding more nodes and items.# API
## Sending
To send something via digilines, you can use digilines.receptor_send():
digilines.receptor_send(x : int, y : int, side : Object, chan : String, msg : mixed) : void
- x is the x coordinate of the node sending the message
- y is the y coordinate of the node sending the message
- side should (but does not need to) include the following entries:
-- left : bool
-- right : bool
-- top : bool
-- bottom : bool
If a value is unset, it counts as false.
This object determines where to send the message (on which sides the message will be sent).
- chan is the channel on which the message should be sent, typically a string
- msg is the message to send, the variable type doesn't matter at all
## Receiving
Receiving messages works by adding a special property to a MapNode, the digiline property. It has to be a function. It only has one argument, a digilines.Event. A digilines.Event contains the following information:
- x : int ; the x coordinate of the sender
- y : int ; the y coordinate of the sender
- type : String ; the event type, only used value is "digiline"
- channel : String ; the channel on which the message was sent
- msg : mixed ; the message that was sent
- side : Object ; contains information about from which side of the receiver the data could possibly come from
You can then use this data to make decisions and/or take actions.