|
shadow_spirit Newbie
Joined: 10 Oct 2002 Posts: 2
|
Posted: Thu Oct 10, 2002 6:04 pm
Highlight / Color Strings |
Greetings,
ZMud newbie here .....
I understand how to use triggers to change the color of or highlight certain text but I'm having trouble with the following example:
[In this room, at this city]
I can't seem to highlight anything in brackets due to the fact Zmud uses the []'s as part of the data string? Is there a way to force Zmud to recognize the [ as a character rather than structure?
Also, instead of highligting a single line is there a way to highlight the sentence instead? Right now I only get portions of what I want to hightlight because it contines on to the next line.
Thanks! |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Oct 10, 2002 8:44 pm |
Precede special characters with ~ to make zMUD treat them as normal characters.
Trigger patterns that contain line-breaks at random points are possible, but usually aren't worth bothering with. The simplest method would be multiple triggers. Since the break might come anywhere, you'd need one trigger for each possibility. It would probably make more sense to just use shorter patterns that would have less chance of containing a line-break in the first place.
#TR {~[In this room, at this city~]} {#HIGH}
#TR {~[In this room, at this$city~]} {#HIGH}
#TR {~[In this room, at$this city~]} {#HIGH}
#TR {~[In this room,$at this city~]} {#HIGH}
#TR {~[In this$room, at this city~]} {#HIGH}
#TR {~[In$this room, at this city~]} {#HIGH}
LightBulb
Senior Member |
|
|
|
AzCowboy Adept
Joined: 09 Nov 2000 Posts: 222 Location: USA
|
Posted: Fri Oct 11, 2002 12:30 am |
One more thing you might look at would be a setting for columns on your mud... On my mud I can set this to 1024, meaning that a paragraph less than 1024 characters contains NO line breaks, and the client handles all formatting. This makes it much less likely that I'll get a line break inside something that I want to trigger on.
Check it out, you may have a setting like that on your mud.
AzCowboy |
|
|
|
shadow_spirit Newbie
Joined: 10 Oct 2002 Posts: 2
|
Posted: Fri Oct 11, 2002 9:47 am |
Thank you both for your help!
Basically what I wanted to do is highlight the entire sentence detailing what items may be on the ground. It would like something like this:
You also see a treasure box, a longsword, some coins, etc.
It could be very long and random.... as you can see. I wanted to trigger off the words "You also see" and have Zmud highlight that entire sentence (stop at the next period). Not possible, eh? |
|
|
|
AzCowboy Adept
Joined: 09 Nov 2000 Posts: 222 Location: USA
|
Posted: Fri Oct 11, 2002 5:33 pm |
It's very possible... Lacking a columns setting in the mud, I would do the following (Note, I tend to do quick and dirty, but functional scripts, somebody else might come up with a much better one)
I would start off by creating an 'item' class, with it set to disable at connection.
In that class, I would put two triggers, one triggering on "*." with the commands
#CW (whatever color you want)
#CLASS item 0
and one triggering on "*" with:
#CW (whatever color)
Then a trigger on: "You also see" in the root folder with the commands:
#CW (whatever color)
#CLASS item 1
This last trigger will turn on the other class, and hopefully everything up to the next period would be colored...
I don't have zmud here to test it, and give you a finished script, but maybe this will help.... |
|
|
|
|
|
|
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
|
|