|
Qaiia Wanderer
Joined: 06 Apr 2007 Posts: 59
|
Posted: Wed Dec 10, 2008 9:43 am
:window:#SHOW issues for conditional trigger |
I'm having an issue with a script I converted from zMud to CMUD... the scripts intent is to catch a two-line output, gag it, load variables, and send a one-line output to another window.
Code: |
<trigger priority="4140" id="414">
<pattern>You hear the {faint|quiet} thoughts of &ThoughtSender echo in your mind:</pattern>
<value>#GAG
#GAG -1</value>
<trigger type="Within Lines" param="1">
<pattern>~[%1~]~:%2</pattern>
<value>#GAG
:thoughts:#SHOW ~[%time( hh:nn:ss)~] ~[%1~] @ThoughtSender~:%2
:thoughts:#SHOW ~[%time( hh:nn:ss)~] ~[%1~] %expand(@ThoughtSender)~:%2
#EXEC %expand(:thoughts:#SHOW ~[%time( hh:nn:ss)~] ~[%1~] @ThoughtSender~:%2) </value>
</trigger>
</trigger> |
It *almost* works. I found this thread that seemed to offer a solution but it didn't work. All three of my output lines output the same exact data to the :thoughts: window. However, in both cases, the @ThoughtSender variable isn't expanding, even though the variable is instantiated with the correct value (the message sender's name). The output for all three output lines currently looks like this:
[04:37:04] [General] : "Is there a locksmith available for some Rift boxes?"
[04:37:04] [General] : "Is there a locksmith available for some Rift boxes?"
[04:37:04] [General] : "Is there a locksmith available for some Rift boxes?"
How do I get the name in the variable to expand? |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Wed Dec 10, 2008 4:32 pm |
ninja'd
|
|
Last edited by Rahab on Wed Dec 10, 2008 4:33 pm; edited 1 time in total |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Dec 10, 2008 4:32 pm |
Instead of using :window:#SHOW, just use the #WINDOW command directly:
#WINDOW thoughts {[%time( "hh:nn:ss")] [%1] @ThoughtSender:%2}
If @ThoughtSender isn't expanded, then check to make sure it is visible to your script. I wasn't able to reproduce any problem with this when I set the @ThoughtSender variable myself, but your script above doesn't show us where this variable is defined. It needs to be defined in the same window that the trigger is defined in (or be located in a global module).
Note that in CMUD you don't need to escape the brackets with ~, but you should put quotes around the argument in the %time function. |
|
|
|
Qaiia Wanderer
Joined: 06 Apr 2007 Posts: 59
|
Posted: Wed Dec 10, 2008 9:31 pm |
The @ThoughtSender variable is created directly in the trigger pattern - "You hear the {faint|quiet} thoughts of &ThoughtSender echo in your mind:"
I *just* started converting my package to CMUD so there's still a lot of stuff that's new to me... thanks for your patience and assistance. |
|
|
|
Qaiia Wanderer
Joined: 06 Apr 2007 Posts: 59
|
Posted: Wed Dec 10, 2008 9:38 pm |
Okay, the new code works though I'm baffled that my deaths window works with a similar format. Thanks!
|
|
|
|
|
|