 |
Carpesimia Beginner
Joined: 06 Feb 2025 Posts: 24
|
Posted: Wed Feb 11, 2026 9:59 pm
Lockups with triggers and scripts |
So first, when i say lockups, i mean the screen freezes while stuff happens behind the scenes and eventually, it unlocks and things scroll by super fast. And, i might know why.
So, lets say I have a trigger and i want to do some things on that trigger. Instead of just encoding the actions inside the trigger, i make an alias. This way, it can be called by either the trigger or manually.
But, inside that trigger i run more aliases for different things, and those aliases sometimes do other things. In the meantime, im executing all of these things and they're sort of keeping the trigger from finishing.
Eventually, ill run so many commands that the command stack or something gets filled and everything pauses. Sometimes this pause lasts as long as 30-40 seconds, which can be a lifetime sometimes.
Im thinking of a couple solutions, but figured maybe I'd ask if anyone has seen this. Im mostly doing this for code-reuse and modularity.
One direct question i have, is there a way you can execute an alias without waiting for it to return? So, a trigger can execute an alias but not wait for it to return?
The rest i think I know how to fix. But knowing that would be helpful. |
|
|
|
 |
Carpesimia Beginner
Joined: 06 Feb 2025 Posts: 24
|
Posted: Wed Feb 11, 2026 10:26 pm |
Ok, maybe i dont know how to fix the other things. Doc says functions are like aliases that return a value. So much for that idea.
|
|
|
|
 |
Tarn GURU
Joined: 10 Oct 2000 Posts: 875 Location: USA
|
Posted: Wed Feb 11, 2026 10:39 pm Re: Lockups with triggers and scripts |
| Carpesimia wrote: |
One direct question i have, is there a way you can execute an alias without waiting for it to return? So, a trigger can execute an alias but not wait for it to return?
|
It sounds like you're looking for threading.
https://forums.zuggsoft.com/modules/mx_kb/kb.php?mode=doc&page=3&refpage=3&a=cmud_threads
#THREAD can create one.
I haven't used this feature in quite some time because even simply-written scripting seems to be instant, such as looking through long string lists frequently when better programming approaches would be better if it weren't already fast enough.
[/img] |
|
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4790 Location: Pensacola, FL, USA
|
Posted: Sun Feb 15, 2026 3:33 am |
A shortcut to force any script to be threaded is to insert a
#WAIT 0
at the start. Not near as powerful as proper threading, but if you just need to do a %mapquerry, or most anything involving database manipulation, or will otherwhise cause the system to hang for processing, it will do the trick. |
|
|
|
 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|