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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Shalla
Newbie


Joined: 01 Oct 2002
Posts: 3

PostPosted: Tue Oct 01, 2002 12:58 pm   

Trailing text after prompt
 
Sometimes if I type commands too quickly, I get text after my prompt instead of on the next line:
quote:
< 613hp 127mv > status
Your current status:
You have been playing for 10 days and 19 hours.
You are standing.
You can see in the dark.
You are sensitive to the invisible.
status
< 613hp 127mv > Your current status:

You have been playing for 10 days and 19 hours.
You are standing.
You can see in the dark.
You are sensitive to the invisible.
< 613hp 127mv >
This is a bit of a problem, as it keeps me from anchoring my triggers with the ^ char, and then people can set them off. It's embarassing. :)

Now, I both imp and play this mud, and almost all the players use zMUD, so I am really interested in a good solution. If there is some setting in zMUD to fill in so it recognizes the prompt and splits up the line, it would make a lot of people happy. Or if I am posting in the wrong forum, and there is some way I can change the mud to help zMUD handle the prompts, that would be great too.

Oh, I have 6.16 now, and am slightly afraid of betas, but I'll upgrade (and tell everyone else to upgrade...) if that will help. Thanks.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Oct 01, 2002 5:39 pm   
 
First, make sure you have a problem (I seldom use anchors, so I'm not certain either way), that is test to see if zMUD does fire anchored triggers even when they happen to be on the same line as the prompt.

Assuming you do, possible fixes include:
1. End your prompt with a carriage return. Most MUDs have customizable prompts and many of them include a token for a carriage-return.

2. Use double triggers and anchor them both, one without the prompt and the other with it.
#TR {^Your current status}
#TR {^~< %dhp %dmv ~> Your current status}

LightBulb
Senior Member
Reply with quote
Charbal
GURU


Joined: 15 Jun 2001
Posts: 654
Location: USA

PostPosted: Tue Oct 01, 2002 6:21 pm   
 
Shalla is correct. The ^ anchor will cause the trigger not to be matched here. Besides those things Lightbulb has mentioned, you can also do:

#TRIGGER {^(*)Your current status:} {#IF ("%1" =~ "^< %dhp %dmv > $" or "%1" = %null) {do whatever you want here}}

Or two triggers together:

#TRIGGER {^(< %dhp %dmv > )(%*)$} {#SUB {"%1"%crlf"%2"}}
#TRIGGER {^Your current status:} {do whatever you want here}



 - Charbal
Reply with quote
Shalla
Newbie


Joined: 01 Oct 2002
Posts: 3

PostPosted: Wed Oct 02, 2002 8:51 am   
 
Thanks for the ideas so far. Putting newline chars at the end of the prompt would work, but the spam is not worth it, IMHO. I am using this right now,

#TRIGGER {^(~< %dhp %dmv ~> )(%*)$} {#IF {%2 not null} {#SUB {"%1"%cr"%2"}}}

This causes things to display just fine in the zMUD window; it splits the text trailing the prompt onto its own line. It did take all the ansi color out, but that is really minor. I have two questions regarding it, and also one problem.

My question is, I had to turn Strip " quotes on in the preferences to use the syntax above. I am a minimalist, and was wondering if there's a way to get the result way without the preference turned on.

My other question is, I tried %cr, %lr, and %crlf, and only the %cr I used above came out right. %lf indented the second line, and %crlf created a blank line, and then indented the line after.

My problem is, this doesn't solve my problem with the ^ char and anchoring triggers. Everything displays fine, but the text after the prompt will not set off triggers. I heard there is something in the Beta called "reparse", and was wondering if that will help solve the problem, and if upgrading to Beta is the only way to get it.

I can always fallback on the suggestion of making two sets of triggers, one for a line with a prompt and one without. That is just an awful lot of triggers... I'd rather have one complicated trigger than dozens and dozens of duplicated ones. Thanks.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Oct 02, 2002 11:22 am   
 
Move the SUB trigger up.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Oct 02, 2002 12:36 pm   
 
To avoid having to turn on Strip " Quotes on, strip the quotes yourself. Instead of using:
"%1"%cr"%2"

use:
%1%cr%2

Also, to expand on what Vijilante said: triggers are evaluated for a match according to the order they are listed in the Settings Editor. A trigger that is farther up than another will fire first if both fire on the same line. So, to make sure that your other triggers see the output generated by this trigger, move this trigger up in the list. To do this, make sure that View|Sort By|None is selected and the drag & drop the trigger where you want it.

Kjata
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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