|
sponge-bob Beginner
Joined: 10 Nov 2001 Posts: 18
|
Posted: Wed Nov 28, 2001 7:04 am
substitution help |
is there a way to make the output of #sub command output the same ansi color as the input, im trying to make like a enemy and friend list for clans; i can get it to work easily with:
Pattern: ^~[Clan (%n)~] (*)
Value: #if (%1="17") {~(friend)~[Clan %1~] %2} {~(enemy)~[Clan %1~] %2}
but people have titles like
[Clan 17] ***blah the god of gods is here.
and most of that stuff is in different colors but when you use #sub it makes it all yellow, can you get it to get it to display the original colors? |
|
|
|
sponge-bob Beginner
Joined: 10 Nov 2001 Posts: 18
|
Posted: Thu Nov 29, 2001 1:01 am |
anyone know, please help? :(
|
|
|
|
iljhar GURU
Joined: 10 Oct 2000 Posts: 1116 Location: USA
|
Posted: Thu Nov 29, 2001 9:09 am |
Have you tried making the trigger an ansi trigger? I don't usually play with ansi stuff but I'll take a look at it if no one has any suggestions.
Iljhar |
|
|
|
sponge-bob Beginner
Joined: 10 Nov 2001 Posts: 18
|
Posted: Thu Nov 29, 2001 8:17 pm |
settng it as an ansi trigger dont work that just makes it so the trigger has to be the same color code as the input.
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Nov 30, 2001 7:47 am |
quote:
settng it as an ansi trigger dont work that just makes it so the trigger has to be the same color code as the input.
I see where Iljhar is coming from, but I have even less (or equal to) experience with ansi triggers than he does. Is it even possible to capture ansi sequences into a variable or does ZMud handle ansi color before the text gets ground up in the parser?
li'l shmoe of Dragon's Gate MUD |
|
|
|
Acaila Apprentice
Joined: 30 Aug 2001 Posts: 187 Location: Netherlands
|
Posted: Fri Nov 30, 2001 3:58 pm |
I gave it a try and tested a few things. I haven't solved it, but maybe you can get it to work with this start.
Check "ansi trigger", and uncheck the rest on your trigger's options page.
As a pattern put (%*) instead of %n, that way every char will get stored in the variable.
The only way for it to recognize the colors is if you fill out the color schemes your mud uses on Preferences|Colors|Color Syntax.
Now when the trigger fires on a colored line, with me it returned the colors except the first and last letter.
When I checked the option to show triggers on prefences it showed the entire word colored (including first and last letter), but it didn't send it intact back to the mud when I used a #SHOW or #SAY.
Anyway, I hope this can get other people's ideas jumpstarted :)
Acaila |
|
|
|
Acaila Apprentice
Joined: 30 Aug 2001 Posts: 187 Location: Netherlands
|
Posted: Fri Nov 30, 2001 7:54 pm |
Well, it seems that if you put the %1 between {} then the problem is solved. I tried "", (), {}, [], and only {} works correctly.
Let me know how it turns out for you?
Acaila |
|
|
|
sponge-bob Beginner
Joined: 10 Nov 2001 Posts: 18
|
Posted: Sat Dec 01, 2001 12:31 am |
ya lost me =
|
|
|
|
Acaila Apprentice
Joined: 30 Aug 2001 Posts: 187 Location: Netherlands
|
Posted: Sat Dec 01, 2001 4:13 pm |
Okay, I guess that did sound a bit scriptic :)
Let me try to clarify step by step:
1) Change your trigger to
#TRIGGER {^~[Clan (%n)~] (%*)} {#IF (%1="17") {#SUB ~(friend)~[Clan %1~] "%2"} {#SUB ~(enemy)~[Clan %1~] "%2"}}
The %* is there to capture the color as well, the "%2" to output the color correctly.
2) On the options page of above trigger disable "trigger on trigger" and enable "ansi color".
3) On Preferences|Colors, make sure the used color scheme is "Ansi"
4) On Preferences|Colors|Color Syntax, fill in the codes your mud uses for colors.
"Syntax Enable" doesn't do anything with me, but you might need to check that as well.
I think that's about it, disregard my previous post about {}, it still doesn't work 100% since there's still a few characters/colors it won't output correctly. But this'll get your started I hope.
One more thing, the line you're using fire the trigger on ([Clan (%n)]) can't of itself contain colors, only the part in wildcards is allowed to contain colors, otherwise it's will never fire.
Acaila |
|
|
|
sponge-bob Beginner
Joined: 10 Nov 2001 Posts: 18
|
Posted: Sat Dec 01, 2001 6:52 pm |
the [clan 17] part is in color, this is what it looks like on the mud
[clan 17] ****(name) (users title) is here.
all the colors are preset except the title which the user makes can be anything he wants, the *'s depend on if he has a certain spell casted on him. the mud uses |r for dim red |R for high red |b dim blue |B for high blue |m |M |w |W |c |C |g |G |d and so on, so for the color syntax would i put r next to the dim red or |r? |
|
|
|
Acaila Apprentice
Joined: 30 Aug 2001 Posts: 187 Location: Netherlands
|
Posted: Sat Dec 01, 2001 7:22 pm |
Okay, in that case you've got a problem. In order to get the trigger to fire in the first place, you need to find the correct ansi code for a yellow word, which I don't know.
A possible way to find it is to make a trigger for a know line which contains a yellow word surrounded by normal colored words, and save that word in a variable, but otherwise I have no idea.
To answer your second question, put |r for dim red.
Acaila |
|
|
|
|
|