|
Nibbles Beginner
Joined: 01 Aug 2004 Posts: 15
|
Posted: Sun May 22, 2005 8:03 pm
Alias won't function from inside trigger |
Heyo, I've got a problem with an alias not working from inside a trigger. I know the alias name is correct, because not only is it being highlighted in blue by the command editor, it is also not being sent as text to the MUD. It's as if the engine is just skipping over it.
I confirmed it by doing this:
Relevant Portion of Trigger:
Code: |
#SHOW Preparing to exec alias.
_WizardScripts_ParseLoop
#SHOW Alias should have fired.
|
The Alias _WizardScripts_ParseLoop:
Code: |
#SHOW Alias executing.
#VAR _WizardScripts__Running {1}
#WHILE (@_WizardScripts__Running} {_WizardScripts_ParseLine}
|
When the trigger executes, all that shows up on the screen is:
Code: |
Preparing to exec alias.
Alias should have fired.
|
Would anyone happen to know why this insanity happens? I have no clue, and my head is really starting to hurt here. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun May 22, 2005 8:33 pm |
Not enough info. What does _WizardScripts_Parseloop do? If it currently is empty, then of course nothing will happen.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Nibbles Beginner
Joined: 01 Aug 2004 Posts: 15
|
Posted: Sun May 22, 2005 9:05 pm |
I included the code for _WizardScripts_ParseLoop. Here it is again:
Code: |
#SHOW Alias executing.
#VAR _WizardScripts__Running {1}
#WHILE (@_WizardScripts__Running} {_WizardScripts_ParseLine}
|
First, I added a #SHOW to display the fact that it is executing. This #SHOW doesn't trigger, so I assume it is not executing. Then, I set a variable, then I parse a line of script. _WizardScripts_ParseLine is rather complex so I won't post it here, but that doesn't matter since the alias isn't even being entered as evidenced by the lack of "Alias executing." being displayed. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun May 22, 2005 11:38 pm |
Oops, should have noticed this before now. Your #WHILE condition has a closing curly brace instead of a closing parentheses. Assuming it's not a board typo, that's probably your problem.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Private Adept
Joined: 10 Jan 2002 Posts: 264 Location: USA
|
Posted: Mon May 23, 2005 12:00 am |
the closing curly brace wouldn't stop the alias from at least executing the #SHOW on it's 1st line (i tested it).
try changing _WizardScripts_ParseLine alias name to something more simple? like WisScrPL in both alias name and trigger... maybe you have something interfering with _WizardScripts_ParseLine.
P.S. Unless you just have tons of spare memory (even if you do) you should shorten your naming conventions since zmud keeps all this stuff in memory, I've noticed that shorter alias, variable, class names have significantly sped up my scripts. That's with Triggers: 1563 Aliases: 627 Variables: 508 Paths: 341 Macros: 48, and 1024MB of memory. Just as you shortened #VAR(IABLE), #SH would work as well... every little bit seems to help when your using a lot of complex triggers/aliases/etc. I've also noticed less "skipping" of commands on intense triggers. |
|
|
|
Nibbles Beginner
Joined: 01 Aug 2004 Posts: 15
|
Posted: Mon May 23, 2005 1:05 am |
The curly brace was a typo, not in the actual code. Sorry.
I changed all the names from _WizardScripts_ to WS_ and it works fine now. I guess skipping over long names occasionally is just one of ZMud's undocumented "features". |
|
|
|
|
|