Closed ghost closed 4 years ago
You seem to run in an endless send() loop there. Messages should be checked in an event-handler:
-- click on "execute"
if event.type == "program" then
digiline_send("mv", "get")
end
-- event from switching station
if event.type == "digiline" then
print(event.msg)
end
Thanks, I think I can work with this. So it’s just a misunderstanding … Any idea how I can get this into a loop querying multiple switching stations and do something with the return values?
Any idea how I can get this into a loop querying multiple switching stations and do something with the return values?
Do you mean something like:
local ss_channels = {"ss1", "ss2", "mvss"}
-- click on "execute"
if event.type == "program" then
for i = 1, #ss_channels do
digiline_send(ss_channels[i], "get")
end
end
-- event from switching station
if event.type == "digiline" then
-- event.channel is the channel with that the digiline message came, eg. "ss1"
-- event.msg is the "return value" of the switching station
-- I do not know what you want to do exactly here…
print(event.msg)
end
Also see https://github.com/minetest-mods/technic/wiki/Digilines#switching-station.
@SmallJoker this can be closed too (sorry for the pings)
I’m not sure where to place this but since the Lua controller does not behave like this on other events or on other Digiline events but only in conjunction with the switching station I’m putting this here.
I have a switching station providing 10.8 kEU MV energy, I connected the switching station to a Lua controller with a digiline (the switching stations channel is
mv
). The following super simple program is set up in the controller:I expect something like …
… when hitting "Execute". But the message gets repeated multiple times and the Lua controller overheats. See log file of the result.
Minetest on 0.4.17.1 and Digilines, Mesecons, and Technic on latest versions available.