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


Joined: 18 Jul 2007
Posts: 6

PostPosted: Sun May 04, 2008 5:09 am   

Is it possible to get the color of a line?
 
I want to make a script that outputs every received line into a log file WITH its color tag attached, but I can't find a way to tell what color something is. Is this possible?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun May 04, 2008 1:33 pm   
 
Go into the preferences, check the "ANSI Log" or "Log ANSI colour" checkbox or whatever. Job done.

If your MUD's using MXP colour, there's not a lot you can do - CMUD will be able to do it, but zMUD won't log MXP without some pretty complex scripting, and since it's firing on every line, it'll slow you down.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Vunutus
Newbie


Joined: 18 Jul 2007
Posts: 6

PostPosted: Sun May 04, 2008 7:43 pm   
 
Fang Xianfu wrote:
Go into the preferences, check the "ANSI Log" or "Log ANSI colour" checkbox or whatever. Job done.

If your MUD's using MXP colour, there's not a lot you can do - CMUD will be able to do it, but zMUD won't log MXP without some pretty complex scripting, and since it's firing on every line, it'll slow you down.


That gets about half the job done, but I also need to have a timestamp for what I'm doing. In addition, several other script ideas I have would be possible if I knew how to determine a character's color.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun May 04, 2008 8:49 pm   
 
You probably don't need to do anything that way; there's probably an alternative. If you simply must have it that way, though, you can use an ansi trigger and have the script remember the latest colour code as you move through the string doing whatever it is you're doing.

Timestamps are a bit harder - in CMUD, all you need to do is check a box. In zMUD you could try

#trig {^} {#sub %time(hh:nn:ss.zzz)}

or something.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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