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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Thu May 20, 2010 3:28 am   

3.17 Some triggers no longer fire with #show
 
I sat down infront of the PC tonight ready to continue working on a script in order to get a little more info for another post I have open. I've been working on the package this script is in off line so i use #show to get my triggers to fire as if text was coming from the mud. My triggers wouldn't fire. Scratched my head for a bit and looked around for what could be the cause but found nothing. Everything was working fine when I closed CMUD and shutdown my pc this morning. I Shut down CMUD rebooted the PC and connected to one of the MUDs I play. I then added #show works to a trigger I have that fires off the info from the report command. I typed report and hit enter and the trigger fired fine... I then copied the text right off the screen that just fired the trigger and pasted it into a #show on the command line and hit enter. Nothing. I tested this with #echo as well and nothing happened. I put the text I was using with #show in the pattern checker and get a nice green Pattern Matches!. From here I uninstalled CMUD rebooted PC and reinstalled CMUD. Did the same as above with the same results the trigger fires when the text comes from the MUD but not when sent with #show. At this point I open a blank untitled session and created the following trigger and copied the other one from the MUD I was just on.

Code:

<trigger priority="20" id="2">
  <pattern>^Test</pattern>
  <value>#show works</value>
</trigger>


Code:

<trigger priority="180" id="1">
  <pattern>^You report (%d)/(%d) hp. Need: (%d). (%d)/(%d) ma.  (%d)/(%d) mv.</pattern>
  <value>#var MaxHP %2
#var MaxMA %4
#var MaxMV %6
#show works</value>
</trigger>


I open the script debugger and on the command line of the blank session type #show Test . That trigger fires fine.

I then typed #show You report 423/423 hp. Need: 0. 241/241 ma. 169/169 mv. on the command line which i double check in the pattern wizard and it matches but the trigger does not fire.

Settings for both triggers are exactly the same.

Here is the output from the Script Debugger of the untitled session.


Code:

       | ---
0.0005 | c  untitled |  [1] untitled Comline : start :
0.0008 | a  untitled |test
0.0002 | f  untitled |    Pattern: ^Test
0.0005 | c  untitled |    exec : Pattern "^Test" : #show works
0.0001 | n  untitled |    Exec Trigger "^Test"
0.0002 | a  untitled |works
0.0009 | d  untitled |  [1] untitled Comline : stopped
6.2201 | a  untitled |
0.2573 | a  untitled |
0.2545 | a  untitled |
3.6803 | ---
0.0005 | c  untitled |  [1] untitled Comline : start :
0.0008 | a  untitled |You report 423/423 hp. Need: 0. 241/241 ma. 169/169 mv.
0.0009 | d  untitled |  [1] untitled Comline : stopped
0.0000 |


Any idea as to what is going on?
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Thu May 20, 2010 3:51 am   
 
I think I see why the report trigger isn't firing.

This on the command line.
Code:

#show You report 423/423 hp. Need: 0. 241/241 ma.  169/169 mv.


Returns this
Code:

You report 423/423 hp. Need: 0. 241/241 ma. 169/169 mv.


Notice how the two spaces after ma. gets shortened to just one when returned by #show. I can fix this in the pattern I guess but this just became an issue tonight. Still not sure what has changed to cause this.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Thu May 20, 2010 4:09 am   
 
When using #ECHO, #SAY, #SHOW, or even #PRINT, you want to enclose it in {} to maintain any formatting (including spacing). Therefore, you should be doing:

#show {You report 423/423 hp. Need: 0. 241/241 ma. 169/169 mv.}

instead. Otherwise, it just strips any additional spaces.

Charneus
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Thu May 20, 2010 6:10 am   
 
Thanks Charneus I never thought about enclosing the #show message in brackets. That made the report trigger fire just fine. I still have no clue why the original trigger I noticed this on would not fire. It works fine now with just #show and no brackets and it is all single spaced. I guess that will remain one of the great mysteries of life.
_________________
Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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