05.10.2022, 06:35
The calculation was wrong in the previous example.
Add a common tag to input objects (2/3/10, 2/3/11, 2/3/12 etc) and map an event script to this tag (no need to add anything to Common functions).
Add a common tag to input objects (2/3/10, 2/3/11, 2/3/12 etc) and map an event script to this tag (no need to add anything to Common functions).
Code:
basein = buslib.encodega('2/3/10')
baseout = buslib.encodega('2/3/200')
dst = baseout + 2 * (event.dstraw - basein)
if event.getvalue() then
dst = dst + 1
end
grp.write(dst, true)
os.sleep(1)
grp.write(dst, false)