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
iluvnumbers1234
Newbie


Joined: 03 Dec 2002
Posts: 2

PostPosted: Tue Dec 03, 2002 6:50 am   

I need help with colors in substitution
 
I need help making a substitution trigger for scanning.

Example of what the mud sends when I type scan:

Looking around you see:
green mob , right here.

<100hp 100m 100mv>




This is what I want it to show:

Looking around you see:
right here - green mob.

<100hp 100m 100mv>


I this trigger to try to do this (I'm not very good at making triggers, so there's probably loads wrong with them even though they're pretty simple):

#TR {(%*) , right here.} {#sub {right here - %1.}}


They work without color, but when I turn ansi color on for them, weird things happen.

Here is what I see using those two substitutions:

Looking around you see:
right here - green mob.
<100hp 100m 100mv>


Notice that the green part starts from the beginning, and the blank line before my prompt is skipped. I'm not sure what's going on, but those two things are wrong.

Here is another example of stuff that happens:

Before:

Looking around you see:
a mob , right here.
green mob , right here.
brown mob , right here.

<100hp 100m 100mv>


After:

Looking around you see:
right here - a mob.
right here - right here - green mob.brown mob.
<100hp 100m 100mv>


I have no idea what is going on with the rearranging of words.

What I know:
If a line has no color in it, it works perfectly. If a line begins with a color, the "Right here -" part is colored and line spacing becomes wacky. If a line contains a color but doesn't begin with it, it's colors work, but the line spacing is still messed up. Any suggestions?


Also, I have another thing I want to do that seems pretty simple, so I don't want to spam the board with another post about it. When I enter something that consists only of directions, I want zmud to make me go in those directions. For example, if I type in "dwn", I want zmud to input d, then w, then n. Is there any simple way I can do this? My mud doesn't have diagnol directions, so things such as ne and sw shouldn't be too confusing.
Reply with quote
Schu
Newbie


Joined: 05 Nov 2002
Posts: 2
Location: Poland

PostPosted: Tue Dec 03, 2002 3:27 pm   
 
Try something like that:
#TR {^(*) , right here.} {#sub {right here - %1.}}

and make sure that you have only one triger for {^(*) , right here.}
Schu

Schu
Reply with quote
iluvnumbers1234
Newbie


Joined: 03 Dec 2002
Posts: 2

PostPosted: Wed Dec 04, 2002 9:35 am   
 
I just tried that trigger, but it doesn't work. The same thing still happens. It doesn't skip lines correctly after the substitute, and if the line begins with a colored word, the colors starts at the beginning of the line instead of at the beginning of the word. I'd really appreciate help on this.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Dec 04, 2002 10:09 am   
 
#SUB doesn't handle multi-color lines well.

You will probably have to choose between having the colors but leaving the text the way it is (no #SUBs) or using #SUB (non-ANSI) to make the text look the way you want, but without the colors.

To enter a string of directions, precede them with the movement char, . by default. For your example, that would be
.dwn

LightBulb
Senior Member
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