add digilines doc file and document switching station interface
partially attends to #53
This commit is contained in:
parent
12102569a7
commit
10bc3ba292
@ -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…
x
Reference in New Issue
Block a user