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


Joined: 14 Jul 2003
Posts: 2
Location: Canada

PostPosted: Mon Jul 14, 2003 7:13 am   

Ansi log and trigger question
 
Can someone please tell me how to read an ansi text/log file created by zmud? I would like to read the color correctly. Is there an easy way to turn it to a html file?

Secondly, the mud I play gives some information in the following format:
+* A Skaven *+ and +* An Ogre-Magi *+ are pretty close by down from here.
or
+* An Orc *+ is immediately east from here.

The first description shows two "enemies" while the second shows one. How do I write a script/trigger to count up the numbers of "enemies" in any given direction?

The syntax for more than 2 enemies will be:
+* Something *+, +* Something *+, ... , +* Something *+ and +* Something *+ are pretty close by (direction) from here.

"Something" can have many different patterns, at least 40. I use zmud5.55 but also have registered version of 6.40 but found the new version too slow for my very outdated computer.

Thanks in advance
Nerull
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Jul 14, 2003 1:29 pm   
 
For the first problem, you can view ANSI logs in zMUD's Editor. Just open the file in there and it will display all the colors correctly. If you want to convert the log into an HTML file, try using Charbal's plugin. I think it's called HTMLLogger. Try doing a search to find it.

For the second problem, if all enemies have +* at either side, then you could count the number of enemies by counting the amount of +'s and dividing by two. Here is a trigger that should take care of that:
#TRIGGER {(*) {is|are} * %w from here.} {#VAR numEnemies {%eval((%len("%1") - %len(%replace("%1", "+", ""))) / 2)}}

If you know all of the possible messages for distances, it would be better if you put it as a stringlist in place of the second *.
Reply with quote
nerull
Newbie


Joined: 14 Jul 2003
Posts: 2
Location: Canada

PostPosted: Mon Jul 14, 2003 6:47 pm   
 
It worked. Thanks 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