Page 1 of 1

Keep functions running after script?

Posted: Sat Jan 24, 2015 8:57 pm
by The Geek Kid
Hi! I am trying to create a script to flash our house lights during intermission (we currently have the interface setup as a busking type interface - so the script stops the house light functions, then starts a flashing chase). I have everything working, except that I need the house lights to come back up after running the script. If I put a start function at the end of the script, it dies as soon as the script is ended. Is there a way to avoid this?

Here is my script:
stopfunction:9 // House Full
stopfunction:8 // House - No Front
startfunction:26 // Flash House Lights 1
wait:06s.50
// Here is where I would like to add:
// startfunction:8 // House - No Front
// but even if I put a wait timer in so it gets to full fade before the script ends, it kills the house lights as soon as the wait timer is up.

Thanks in advance for the help!

Re: Keep functions running after script?

Posted: Wed Jul 08, 2015 10:14 pm
by mobaer
Bump!
From my point of view this is still an issue.
I expect a function called by a script to run until it is stopped. Situation at the moment is that a function is stopped at the moment a script is finished. Is there some kind of workaround like an everlasting script?

Best regards,
Jochen

Re: Keep functions running after script?

Posted: Thu Jul 09, 2015 12:12 am
by mcallegari
A chaser where the first step is the script and the second step is "House - No Front" with infinite duration ?

Re: Keep functions running after script?

Posted: Thu Jul 09, 2015 12:01 pm
by mobaer
Thank you for the feedback Massimo!
I'll keep that in mind.
My working solution at the moment is to set

Code: Select all

wait:12h0m0s.00
as last row of the script.

It's a bit confusing when you have start and stop functions but everything that was started in the script is automatically stopped, once the script is finished.

I really enjoy the script feature. It would be great to have additional functions/methods, variables, statements and loops. But I know that would end in a very complex interpreter very fast.
Maybe a task for someone who has too much sparetime and doesn't know what to do :P

Re: Keep functions running after script?

Posted: Thu Jul 09, 2015 12:01 pm
by mcallegari
mobaer wrote:It's a bit confusing when you have start and stop functions but everything that was started in the script is automatically stopped, once the script is finished.
A Script is a QLC+ Function like all the others, and, like every QLC+ Function, when it's stopped, it stops all the "children" functions it started. (like what happens in a Collection if you like)
mobaer wrote:It would be great to have additional functions/methods, variables, statements and loops. But I know that would end in a very complex interpreter very fast.
Indeed, but Scripts are potentially dangerous and can make your PC explode ( :D ), so we need to evaluate carefully every new command we add.
A while ago someone asked for a "stopall" command. I asked them a question about the feature and they didn't even reply.
If this is the interest around Scripts, then they can stay as they are now :)
mobaer wrote:Maybe a task for someone who has too much sparetime and doesn't know what to do :P
Not me then :D

Re: Keep functions running after script?

Posted: Sat Nov 30, 2019 7:05 pm
by hydrus
Any chance that this would change?

I need to start a few functions (scenes) when booting my raspberry, but I can only add one startup function.

So I tried starting the scenes I want thru a startup script but found out they release as soon as the script stops, as mentioned in this thread.

Another solution for me would be if it would be possible to add multiple functions to the startup functions.

Re: Keep functions running after script?

Posted: Tue Dec 03, 2019 8:32 am
by janosvitok
Did you try to put the scenes in a Collection?

Re: Keep functions running after script?

Posted: Fri Jan 03, 2020 2:10 am
by tubaguy
Continuing the thread necromancy, I too found that a behavior like this would be useful. I added a new script step that will run a function after the script has killed all its child functions. I can find a spot to upload the code changes if there is interest.

Re: Keep functions running after script?

Posted: Thu Sep 09, 2021 7:57 pm
by johnyzpodoli
tubaguy wrote: Fri Jan 03, 2020 2:10 am Continuing the thread necromancy, I too found that a behavior like this would be useful. I added a new script step that will run a function after the script has killed all its child functions. I can find a spot to upload the code changes if there is interest.
Hi, is there any progress? I need this feature a lot! Thank you.

Re: Keep functions running after script?

Posted: Wed Oct 06, 2021 1:39 am
by tubaguy
Yea. Let me find the code I added to make it happen

Re: Keep functions running after script?

Posted: Wed Oct 06, 2021 2:10 am
by tubaguy
And the files I tweaked. This was in the 4.12.2 code chain. Added Final Function to the UI and engine.
I tagged my edits with //hack.