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


Joined: 25 Sep 2003
Posts: 1
Location: New Zealand

PostPosted: Thu Sep 25, 2003 9:32 am   

Please help with my color trigger
 
I'm currently using zmudv4.62. Pretty old version but i get used to the inteface and was too lazy to move it to the newer ones..

I wonder if this version of zmud (or any other versions) can capture the line recevied from mud with the color code (%e[1m etc) attached? The predefined variable %line only captures the characters.

Another question is, is there a method to trigger a specific pattern in a line one by one?
eg. I've got a pattern: "aaabbab"
What I want to do is, whenever i see "a" or "b", i replace it with a character. eg. the variable @line1 is originally empty. When i see "a" in the line, i attach "1" to the end of @line1; when i see "b" i attach "2" etc. So in the example above, attaching "1" will be executed 4 times in total.
Ofcoz my real problem is not that simple. It involes color stuff.. so I cannot store the whole line first and replace characters afterwards. Instead I have to do it at run time Sad. Unless I have a way to solve my first problem...

Thanks for reading =)
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Mon Sep 29, 2003 7:16 pm   
 
I think you need to be more specific with your exampls.
Trying to trigger of every 'a' would take up alot of cpu usage and make the screen scrol really slow.
However if your detrmined to do it here is just ONE way of doing it.

#trig {({a|A})} {#sub a1}
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Sep 29, 2003 10:16 pm   
 
quote:
I wonder if this version of zmud (or any other versions) can capture the line recevied from mud with the color code (%e[1m etc) attached? The predefined variable %line only captures the characters.

This is certainly possible with version 5.55 and later. It was probably possible with at least some of the earlier versions also, quite possibly including version 4.62, but I'm too lazy to check the version history to find out when the ANSI trigger option was added. You can check for yourself easier than I can do it for you.

quote:
Another question is, is there a method to trigger a specific pattern in a line one by one?...my real problem is not that simple. It involes color stuff...

Both #CW and #SUB do this, possibly others. Some of them might be available in version 4.62, others might not. You'll have to check for yourself. Megamog already gave you about as good an answer as you're likely to get without letting us know the "real problem".

Since you've decided to remain with an outdated version for several years past its replacement, you need to accept that you are now the expert on what's available in your version. Most of us probably don't know and don't have any way to check.
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Tue Sep 30, 2003 12:45 am   
 
See I love helping people, the more I get involved the faster people get help,took you 4 days of waiting to get my post but only 3 hours for SOMEONE to come along and help even more.
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