Logic Machine Forum
Run a script from another script - 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: Run a script from another script (/showthread.php?tid=3543)



Run a script from another script - morkovka - 07.09.2021

Hi,

In certain conditions I need to run a script from another script, I can trigger it by using:
Code:
script.disable('script2')
script.enable('script2')

But is there a simpler way, such as a script.run('scriptname')?


RE: Run a script from another script - admin - 07.09.2021

Use an event script with a virtual object or place a function into common functions and execute it directly.


RE: Run a script from another script - morkovka - 07.09.2021

(07.09.2021, 06:06)admin Wrote: Use an event script with a virtual object or place a function into common functions and execute it directly.

In this case I prefer to keep using the disable/enable as it's simpler - the script I want to execute needs to be a resident script, so adding a virtual object and an event script just for this seems excessive, as is placing a function into the common functions.

Thank you