Logic Machine Forum
get part of address - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: get part of address (/showthread.php?tid=4618)



get part of address - Frank68 - 01.03.2023

Hi

How can I get a part of the group address inside a script using event.dst

Thank you


RE: get part of address - Daniel - 01.03.2023

What are you trying to do?
See this https://forum.logicmachine.net/showthread.php?tid=4484&pid=28967#pid28967


RE: get part of address - Frank68 - 03.03.2023

(01.03.2023, 16:09)Daniel Wrote: What are you trying to do?
See this https://forum.logicmachine.net/showthread.php?tid=4484&pid=28967#pid28967

automatically I would like to read the last part of the group address, for example /20 and then write, depending on the case, in another virtual tag that always ends with /20 if I could break down the script to be able to read the last part of the group address it would be perfect.

Thank you


RE: get part of address - admin - 03.03.2023

Use this:
Code:
parts = event.dst:split('/')

main = tonumber(parts[ 1 ])
middle = tonumber(parts[ 2 ])
sub = tonumber(parts[ 3 ])

log(main, middle, sub)