08.04.2024, 14:07
Try this:
Code:
tags = {
{ tag = 'tag1', output = '1/1/1' },
{ tag = 'tag2', output = '2/1/1' },
}
function tag_max(tag)
local objects = grp.tag(tag)
local result = -math.huge
for _, object in ipairs(objects) do
result = math.max(result, object.value)
end
return result
end
for _, t in ipairs(tags) do
max = tag_max(t.tag)
grp.checkwrite(t.output, max)
os.sleep(0.1)
end