mirror of
https://github.com/joe7575/techpack.git
synced 2024-08-20 21:24:05 +02:00
bugfix
This commit is contained in:
parent
a1a2a09cb8
commit
c0ac57f4b6
@ -22,7 +22,7 @@ local sHELP = [[label[0,0;SmartLine Sequencer Help
|
|||||||
Define a sequence of commands to control other machines.
|
Define a sequence of commands to control other machines.
|
||||||
Numbers(s) are the node numbers, the command shall sent to.
|
Numbers(s) are the node numbers, the command shall sent to.
|
||||||
The commands 'on'/'off' are used for machines and other nodes.
|
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.
|
If endless is set, the Sequencer restarts again and again.
|
||||||
The command ' ' does nothing, only consuming the offset time.
|
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
|
while true do -- process all rules as long as offs == 0
|
||||||
local rule = rules[index]
|
local rule = rules[index]
|
||||||
local offs = rules[index].offs
|
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)
|
tubelib.send_message(rule.num, placer_name, nil, tAction[rule.act], number)
|
||||||
index = get_next_slot(index, rules, endless)
|
index = get_next_slot(index, rules, endless)
|
||||||
if index ~= nil and offs ~= nil and running == 1 then
|
if index ~= nil and offs ~= nil and running == 1 then
|
||||||
-- after the last rule a pause with 2 or more sec is required
|
-- 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
|
offs = 2
|
||||||
end
|
end
|
||||||
meta:set_string("infotext", "Tubelib Sequencer "..number..": running ("..index.."/"..NUM_SLOTS..")")
|
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,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,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,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,5.8;If endless is set, the Sequencer\nrestarts again and again.]"..
|
||||||
"label[0,7;The command ' ' does nothing,\nonly consuming the offset time.]"..
|
"label[0,7;The command ' ' does nothing,\nonly consuming the offset time.]"..
|
||||||
"button[3,8;2,1;exit;close]"
|
"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
|
while true do -- process all rules as long as offs == 0
|
||||||
local rule = rules[index]
|
local rule = rules[index]
|
||||||
local offs = rules[index].offs
|
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)
|
tubelib.send_message(rule.num, placer_name, nil, tAction[rule.act], number)
|
||||||
index = get_next_slot(index, rules, endless)
|
index = get_next_slot(index, rules, endless)
|
||||||
if index ~= nil and offs ~= nil and running == 1 then
|
if index ~= nil and offs ~= nil and running == 1 then
|
||||||
|
Loading…
Reference in New Issue
Block a user