Logic Machine Forum
LM master-slave script name constructor - 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: LM master-slave script name constructor (/showthread.php?tid=79)



LM master-slave script name constructor - Peter - 23.09.2015

Hello,
I would like to know if there is a way how to get a list of script names that we need if we want to use the functionality of two Logicmachines in master-slave mode. We have ~60 scripts and need to enable/disable them via command script.enable('scriptname'). So rather than typing it, I would like to get a list of them so we can work with it faster&more reliable.
Thank you in advance.


RE: LM master-slave script name constructor - admin - 23.09.2015

You can add all required scripts to the same category and enable/disable them all like this:
http://openrb.com/docs/lua.htm#script.categoryenable


RE: LM master-slave script name constructor - Peter - 23.09.2015

Thanks for quick reply, but what if we already use categories for other script control? Could you in future firmwares implement multiple category names above scripts like multiple tags above objects?

A little follow up:

I wanted to make my task easier, so I did the following: erased all the category names, and tried this:

script.categoryset('', false)

Worked ok, every script with no category was disabled this way, BUT (!!) if you have also nothing in description field, such script would be ignored and would not be enabled/disabled.


RE: LM master-slave script name constructor - admin - 24.09.2015

Description field should not affect category. Can you send us your backup via e-mail for further inspection?


RE: LM master-slave script name constructor - Peter - 24.09.2015

backup file sent


RE: LM master-slave script name constructor - admin - 25.09.2015

Thanks for you backup, it turns out that in some cases category can be either an empty string or NULL. That's why script.categoryset was not working correctly for all scripts for you. This will be fixed in next firmware release. As a work-around for now you can edit/save each script parameters (not the script source), this will set category to an empty string.