mirror of
https://github.com/minetest-mods/technic.git
synced 2024-11-15 23:10:41 +01:00
add digilines doc file and document switching station interface
partially attends to #53
This commit is contained in:
parent
b0e45d4012
commit
3caab20e48
|
@ -48,6 +48,7 @@ Ingame:
|
|||
* [Powered machines](./technic/doc/machines.md)
|
||||
* [Generators](./technic/doc/generators.md)
|
||||
* [Forceload anchor](./technic/doc/anchor.md)
|
||||
* [Digilines](./technic/doc/digilines.md)
|
||||
|
||||
Mod development:
|
||||
* [Api](./technic/doc/api.md)
|
||||
|
|
32
technic/doc/digilines.md
Normal file
32
technic/doc/digilines.md
Normal file
|
@ -0,0 +1,32 @@
|
|||
|
||||
# Technic digilines compatibility
|
||||
|
||||
This document describes the interaction of
|
||||
technic machines with the `digilines` mod (https://github.com/minetest-mods/digilines)
|
||||
|
||||
## Switching station
|
||||
|
||||
**NOTE**: make sure the channel is set accordingly, "switch" in this case
|
||||
|
||||
Get power and lag stats:
|
||||
```lua
|
||||
if event.type == "program" then
|
||||
-- start interrupt cycle
|
||||
interrupt(1)
|
||||
end
|
||||
|
||||
if event.type == "interrupt" then
|
||||
-- request stats
|
||||
digiline_send("switch", "GET")
|
||||
end
|
||||
|
||||
if event.type == "digiline" and event.channel == "switch" then
|
||||
--[[
|
||||
event.msg = {
|
||||
demand = 0, -- demand in EU's
|
||||
supply = 0, -- supply in EU's
|
||||
lag = 0 -- generated lag in microseconds
|
||||
}
|
||||
--]]
|
||||
end
|
||||
```
|
Loading…
Reference in New Issue
Block a user