Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Qaiia
Wanderer


Joined: 06 Apr 2007
Posts: 59

PostPosted: 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 &amp;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?
_________________
Citrus: The Juicy Alternative
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: 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
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: 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.
Reply with quote
Qaiia
Wanderer


Joined: 06 Apr 2007
Posts: 59

PostPosted: 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.
_________________
Citrus: The Juicy Alternative
Reply with quote
Qaiia
Wanderer


Joined: 06 Apr 2007
Posts: 59

PostPosted: 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!
_________________
Citrus: The Juicy Alternative
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net