This commit is contained in:
Joachim Stolberg 2018-03-19 21:45:08 +01:00
parent a1a2a09cb8
commit c0ac57f4b6
2 changed files with 9 additions and 3 deletions

@ -22,7 +22,7 @@ local sHELP = [[label[0,0;SmartLine Sequencer Help
Define a sequence of commands to control other machines.
Numbers(s) are the node numbers, the command shall sent to.
The commands 'on'/'off' are used for machines and other nodes.
Offset is the time to the next line in seconds (0..999).
Offset is the time to the next line in seconds (1..999).
If endless is set, the Sequencer restarts again and again.
The command ' ' does nothing, only consuming the offset time.
]
@ -109,11 +109,14 @@ local function check_rules(pos, elapsed)
while true do -- process all rules as long as offs == 0
local rule = rules[index]
local offs = rules[index].offs
if type(offs) == "string" then
offs = 0
end
tubelib.send_message(rule.num, placer_name, nil, tAction[rule.act], number)
index = get_next_slot(index, rules, endless)
if index ~= nil and offs ~= nil and running == 1 then
-- after the last rule a pause with 2 or more sec is required
if index == 1 and offs < 2 then
if index == 1 and offs < 1 then
offs = 2
end
meta:set_string("infotext", "Tubelib Sequencer "..number..": running ("..index.."/"..NUM_SLOTS..")")

@ -49,7 +49,7 @@ local function formspec_help()
"label[0,1;Define a sequence of commands\nto control other machines.]"..
"label[0,2.2;Numbers(s) are the node numbers,\nthe command shall sent to.]"..
"label[0,3.4;The commands 'on'/'off' are used\n for machines and other nodes.]"..
"label[0,4.6;Offset is the time to the\nnext line in seconds (0..999).]"..
"label[0,4.6;Offset is the time to the\nnext line in seconds (1..999).]"..
"label[0,5.8;If endless is set, the Sequencer\nrestarts again and again.]"..
"label[0,7;The command ' ' does nothing,\nonly consuming the offset time.]"..
"button[3,8;2,1;exit;close]"
@ -100,6 +100,9 @@ local function check_rules(pos, elapsed)
while true do -- process all rules as long as offs == 0
local rule = rules[index]
local offs = rules[index].offs
if type(offs) == "string" then
offs = 0
end
tubelib.send_message(rule.num, placer_name, nil, tAction[rule.act], number)
index = get_next_slot(index, rules, endless)
if index ~= nil and offs ~= nil and running == 1 then