|
Apollyon Wanderer
Joined: 02 Oct 2001 Posts: 76 Location: USA
|
Posted: Sun Dec 30, 2001 3:19 am
Can It Be Done? |
Just wondering but could Zmud ever have some sort of script so instead of just picking up letters and symbols for triggers it could also pick up colors? I play godwars/dystopia based MUDs, along with many others, and i just wanted to see if zmud could pick up the color on the who list that shows if you can decapitate, not decap etc, a certain person. plus having triggers that react off colors would be cool for other reasons....
Just wondering,
Apollyon
p.s. mabye its already possible, if so can you tell me how. |
|
|
|
Aennor Apprentice
Joined: 06 Dec 2001 Posts: 131 Location: USA
|
Posted: Sun Dec 30, 2001 4:37 am |
Yes it's possible. On our mud to trigger off a bold cyan line you use:
#TRIGGER {%e[36m%*%e[0m$%*$}
Where "36" is the ANSI color I'm looking for and "0" is the mud clearing that color.
You'd have to examine the raw output of the mud to see the way the color codes come down.
--
Aennor the Paragon of Gratuitous Agony
Staff on WoTMUD
wotmud.org 2222 |
|
|
|
mAdM0nK Beginner
Joined: 17 Apr 2001 Posts: 14 Location: USA
|
Posted: Sun Dec 30, 2001 5:00 am |
I've also been wondering how to do this. Ive got a script thats almost completed for a backstab reporter, and, the only thing i cant get done is capturing the room name. whenever i entered a new room, the mud will send the room name in yellow, then the room description in pink, then items and people in green, then exits in blue. how would you capture ONLY the ONE yellow line?
|
|
|
|
Charbal GURU
Joined: 15 Jun 2001 Posts: 654 Location: USA
|
Posted: Sun Dec 30, 2001 9:43 am |
In order to figure out what codes your MUD uses, you have to be able to see them.
To make it so zMUD will make them visible, go View, Preferences, General, click the plus next to General, go to Emulation, and uncheck Emulate control codes.
Then you might see something like this for the line you want to capture:
<27>[36mCaemlyn Central Square<27>[0m
Change the <27>'s to %e in your trigger pattern. So this becomes:
%e[36m*%e[0m$
Make sure that ANSI Trigger is checked in the options tab when you make the trigger or else zMUD won't pay any attention to the control codes when it parses it.
If your MUD doesn't always use the same sequences for some reason, you can also use the line color setting in the options tab to limit parsing of the trigger to lines that are that color. Probably the more elegant solution all around, I suppose.
Hope that helps.
- Charbal
PS: Don't forget to turn emulation back on if you like your sanity. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Dec 30, 2001 4:10 pm |
zMUD currently has two forms of color triggers: the ANSI trigger and the linecolor trigger. Either one can be chosen from the Options tab in the trigger editor. The linecolor option is much easier to use and would probably be ideal for picking out a yellow line.
LightBulb |
|
|
|
Blerghass Beginner
Joined: 25 Nov 2001 Posts: 26 Location: USA
|
Posted: Sun Dec 30, 2001 7:57 pm |
Is there a way to use ANSI codes to do hilighting stuff, instead of using a #cw or #color command? I fiddled around with #SHOWing and #SUBing %e[36m codes and <27>[36m codes (trying to mimic the mud output, which got highlighted). Does this not work? I couldn't get it to work.
|
|
|
|
Tolkienfan Wanderer
Joined: 07 Apr 2001 Posts: 51 Location: Denmark
|
Posted: Sun Dec 30, 2001 9:44 pm |
Messed around with the linecolor stuff....
I got stuck though...dont know what went wrong...not really a color thing i think..just came up as i was playing with colors...
I made trigger #TR {(*)} {#ECHO %1}...and set the line color option to red with black background...This worked fine...it triggerd on the red line just as it should...but only echoed the first word of the line:(
What can be done here? |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun Dec 30, 2001 11:26 pm |
quote:
Messed around with the linecolor stuff....
I got stuck though...dont know what went wrong...not really a color thing i think..just came up as i was playing with colors...
I made trigger #TR {(*)} {#ECHO %1}...and set the line color option to red with black background...This worked fine...it triggerd on the red line just as it should...but only echoed the first word of the line:(
What can be done here?
Use quotes. #ECHO "%1".
li'l shmoe of Dragon's Gate MUD |
|
|
|
Charbal GURU
Joined: 15 Jun 2001 Posts: 654 Location: USA
|
Posted: Mon Dec 31, 2001 2:37 am |
quote:
Is there a way to use ANSI codes to do hilighting stuff, instead of using a #cw or #color command? I fiddled around with #SHOWing and #SUBing %e[36m codes and <27>[36m codes (trying to mimic the mud output, which got highlighted). Does this not work? I couldn't get it to work.
Both
#show {%e[36mThis is colored%e[0mThis isn't}
and
#show %e~[36mThis is colored%e~[0mThis isn't
work for me.
More flexible than ANSI is MXP. You use HTML-like tags to change the color. So
#show ~<color blue~>This is colored~</color~>This isn't
can do coloring as well in a more readable way. MXP can do a lot of other stuff as well.
You might take a look if you want:
http://www.zuggsoft.com/zmud/mxp.htm
- Charbal |
|
|
|
Apollyon Wanderer
Joined: 02 Oct 2001 Posts: 76 Location: USA
|
Posted: Wed Jan 02, 2002 3:23 am |
Thanks, ill try it out, if it doesnt work tho you'll hear it from me...:P
Apollyon |
|
|
|
|
|