26.06.2025, 07:56
Use this, fill the bits table as needed (keys are from 0 to 15 for a single register):
Add a common tag to all input group addresses and map an event script to this.
Code:
bits = {
[0] = '0/0/1',
[1] = '0/0/2',
[2] = '0/0/3',
}
res = 0
for nr, addr in pairs(bits) do
val = grp.getvalue(addr)
if val then
res = res + bit.lshift(1, nr)
end
end
grp.checkwrite('0/0/5', res)
Add a common tag to all input group addresses and map an event script to this.