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
PHLN
Adept


Joined: 30 Dec 2001
Posts: 220
Location: Canada

PostPosted: Sat Apr 19, 2003 6:40 am   

Coloring Rooms..... Again...
 
Hi,

I was wondering if some expert in making colors triggers could help me with this little problem?

The mud I'm currently on does not have colors in room, room description, or exits. This, is hard for myself, due to the fact that everything is white and make it extremely difficult to tell which is which.

If someone could perhap help me in coloring the room title in bright cyan, the room description in dark cyan, and the room exits in bright white text?

The pattern is as follow...

<89/105/83>l
"The Sun King's Sanctuary" - Tavern [NEWUD]
The Northlands bulletin board is here propped up on a stand.
The slim, golden-haired woman is here moving about the room.
The strapping, sable-braided woman is sitting at a black-painted bar.
The long-haired, middle-aged man stands behind the counter.
The gaunt, black-haired man is here, leaning on the bar.
The tall, well-groomed man sits here on a plush couch.
The short haired, heavy-set man stands here mug in-hand.
The short-haired, female Tuluki soldier is standing here.

<89/105/83>
The strapping, sable-braided woman looks at you with a passing glance.

<89/105/83>
The slim, golden-haired woman walks east.

<89/105/83>st
You stop resting, and stand up.

<89/105/83>u
"The Sun King's Sanctuary" - Sleeping Commons [D]

<89/105/83>d
"The Sun King's Sanctuary" - Tavern [NEWUD]
The Northlands bulletin board is here propped up on a stand.
The strapping, sable-braided woman is sitting at a black-painted bar.
The long-haired, middle-aged man stands behind the counter.
The gaunt, black-haired man is here, leaning on the bar.
The tall, well-groomed man sits here on a plush couch.
The short haired, heavy-set man stands here mug in-hand.
The short-haired, female Tuluki soldier is standing here.

<89/105/83>


The room exit is in the [bracket] next to the room title.

Oh, and the room description show when I type in look room, like this...

<89/105/83>look room
"The Sun King's Sanctuary" - Tavern [NEWUD]
A polished, white marble floor covers the ground of this expansive
room, gleaming under the light of a large glass chandelier that hangs
overhead. A semi-circular bar, made of hard-grained wood painted a deep
black, extends from the eastern wall, several high-backed barstools sitting
around it. The walls of this room are brightly decorated, with several
elaborate paintings placed carefully for unobstructed view, and shelves
holding many exotic potted plants, blooming with bright red and white
flowers. Two large stained-glass windows, decorated with elaborate sun
symbols, adorn the northwest and southeast corners of the room.
Several decoratively carved tables fill this room, while a polished
leather couch nearly twenty cords in length sprawls along the northern wall.
A stately spiral staircase sits in the center of the room, winding upwards
toward the common rooms of the second floor. The sounds of laughter and
music can be heard from a doorway along the western wall, while the scents
of cooked meat waft in from the east. A small, straight stairway sits along
the northern wall, ending at a slightly raised loft and a carven baobab door
sits in the southern wall.

<89/105/83>

So is it possible to color the room title bright cyan when I just walk around and use look room? And when I use look room, the room description are shown in dark cyan? And umm, room exits is always in bright white?

Anyway, if someone could help me, it would make thing alot easier. Oh, and I'm using the latest public version of zMUD

zMUD General Discussion: All the power you'll ever need.
Reply with quote
Davos
Adept


Joined: 30 Jan 2003
Posts: 228
Location: USA

PostPosted: Sat Apr 19, 2003 2:01 pm   
 
Hmm Im assuming something like this might work for you, I dont have the exact colors but youll understand

"The Sun King's Sanctuary" - Tavern [NEWUD]
The Northlands bulletin board is here propped up on a stand.
The slim, golden-haired woman is here moving about the room.
The strapping, sable-braided woman is sitting at a black-painted bar.
The long-haired, middle-aged man stands behind the counter.
The gaunt, black-haired man is here, leaning on the bar.
The tall, well-groomed man sits here on a plush couch.
The short haired, heavy-set man stands here mug in-hand.
The short-haired, female Tuluki soldier is standing here.

<89/105/83>

#TR {"(%*)" - (%*) ~[(%w)~]} {

#CW %1 Cyan
#CW %2 Cyan
#CW %3 White
#T+ color
}

#CLASS color
#TR {(*)} {#CO DarkCyan}
#CLASS 0


#TR {~<%d~/%d~/%d~>} {#T- color}


This should work, or if it doesn't its a start
Not sure if you need a ~ before a / or not, not at my computer to test.

The Seaworthy
Reply with quote
PHLN
Adept


Joined: 30 Dec 2001
Posts: 220
Location: Canada

PostPosted: Sat Apr 19, 2003 2:34 pm   
 
It doesn't work. Cause now, everything is in Cyan color, except the exit, however, if the room description has the letter of the exit, then that letter is now white while everything is cyan. Also, the colors bleed on to my prompt. Oh, and the room and room description is the same.

Sorry, I'm looking at the codes but have no clue how to modify them to make it work...

Thank you for trying btw

zMUD General Discussion: All the power you'll ever need.
Reply with quote
Davos
Adept


Joined: 30 Jan 2003
Posts: 228
Location: USA

PostPosted: Sat Apr 19, 2003 2:58 pm   
 
Im not sure and couldnt tell you without testing it
main thing is making sure the last trigger matches your prompt pattern
Like i said not sure about the ~ in front of / or not
that would cause everything to turn cyan
also since i captured your exits as a word
it should only color white in the description if you have the same lineup of letters so it thinks its the same word, which seems unlikely but I guess it could happen.

The Seaworthy
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Apr 19, 2003 3:43 pm   
 
This trigger should do it for you.

#TRIGGER "ColorRoom" {^("*" - *) ~[(%w)~]$} {#CW {%1} {high,cyan};#CW {%2} {high,white}}
#COND {} {#IF (%line!=%null) {#CO cyan} {#STATE ColorRoom 0}} {looplines|param=99}
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Apr 19, 2003 3:59 pm   
 
There should be no need for the %* wildcard in this application. The MUD might occasionally use a special character which * doesn't match, but it's safer to leave a few lines uncolored than to open a door to trigger abuse.

PHLN, your first step will be to go through your triggers and delete all the new #CW triggers Davos's script created (one or more per room). They should all be at the bottom if your trigger list isn't sorted and you haven't made any others recently.

This should take care of the titles/directions.
#TR {~"(*)~" - %w* ~[([NESWUD])~]} {#PCOL 11 %x1;#PCOL 15 %x2}

The description is just the usual multi-line script:
Enable class containing general trigger
Wait for next prompt
Disable class
#AL look {#IF ("%1" = "room") {#T+ Description;~look room} {~look %-1}}
#CLA Description disable
#TR {~<%d/%d/%d~>} {#T- Description} {} {prompt}
#TR {*} {#CO 3}
#CLA 0

LightBulb
Advanced Member
NOTE: Vijilante's script will also make new triggers in every room
Reply with quote
Davos
Adept


Joined: 30 Jan 2003
Posts: 228
Location: USA

PostPosted: Sat Apr 19, 2003 4:56 pm   
 
how exactly would either one of our triggers make new triggers for each room?

Not that I doubt you or anything, you obviously know far more of the language than me, but just for my sake so I understand

The Seaworthy
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Apr 19, 2003 7:20 pm   
 
You both used the alternate #CW syntax which creates a trigger rather than coloring the trigger phrase. These new triggers, being permanent, will continue to highlight anything that matches their phrases, whether it's in a room-title or not.
#CW {pattern} {color}
is the same as
#TR {pattern} {#CW color}
They both create a trigger.

So, Davos's
#CW %1 Cyan
creates a new trigger with the pattern being the first word in %1. Also, there's no {} around %1, so only the first word of the title will be used for the pattern. When the title is more than one word the second word will be used for the color. Of course, it usually won't be a recognized color.

With the sample line
"The Sun King's Sanctuary" - Tavern [NEWUD]
Davos's trigger creates these triggers:
#TR {The} {#cw sun}
#TR {Tavern} {#cw Cyan}
#TR {NEWUD} {#cw White}

Vijilante's trigger is better since he's used delimiters to ensure that all of %1 will be used as the pattern. However, it still creates a new trigger with the pattern being whatever the room title is.

With the same sample line, it creates these triggers:
#TR {"The Sun King's Sanctuary" - Tavern} {#cw high,cyan}
#TR {NEWUD} {#cw high,white}

LightBulb
Advanced Member
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Apr 20, 2003 3:23 am   
 
Yep, I forgot about that little piece of syntax. I so rarely use coloring that I just plain forget.

Using The "#PCOL 11 %x1;#PCOL 15 %x2" that Lightbulb suggested in the trigger I provided will color everything, in close to the most efficient fashion possible.
Reply with quote
PHLN
Adept


Joined: 30 Dec 2001
Posts: 220
Location: Canada

PostPosted: Sun Apr 20, 2003 8:50 am   
 
Something is wrong, but I don't know where the error is coming from. Here take a look of what it look like after I enter Lightbuld's triggers...

PS - I change my prompt and update the trigger using my prompt so that it will work. And that teal is the regular cyan that I wanted, and the red is the bright white.

Health:89 Stamina:105 Stun:83 standingl
"The Sun King's Sanctuary" - Sleeping Commons [D]

Health:89 Stamina:105 Stun:83 standingd
"The Sun King's Sanctuary" - Tavern [NEWUD]
The Northlands bulletin board is here propped up on a stand.
The athletic, crimson-locked man is sitting at a black-painted bar.
The long-haired, middle-aged man stands behind the counter.
The gaunt, black-haired man is here, leaning on the bar.
The tall, well-groomed man sits here on a plush couch.
The short haired, heavy-set man stands here mug in-hand.
The short-haired, female Tuluki soldier is standing here.

Health:89 Stamina:105 Stun:83 standing

As you can see, it work fine in the walking around mode. But the problem is when I use look room...

Health:89 Stamina:105 Stun:83 standinglook room
"The Sun King's Sanctuary" - Tavern [NEWUD]
A polished, white marble floor covers the ground of this expansive
room, gleaming under the light of a large glass chandelier that hangs
overhead. A semi-circular bar, made of hard-grained wood painted a deep
black, extends from the eastern wall, several high-backed barstools sitting
around it. The walls of this room are brightly decorated, with several
elaborate paintings placed carefully for unobstructed view, and shelves
holding many exotic potted plants, blooming with bright red and white
flowers. Two large stained-glass windows, decorated with elaborate sun
symbols, adorn the northwest and southeast corners of the room.
Several decoratively carved tables fill this room, while a polished
leather couch nearly twenty cords in length sprawls along the northern wall.
A stately spiral staircase sits in the center of the room, winding upwards
toward the common rooms of the second floor. The sounds of laughter and
music can be heard from a doorway along the western wall, while the scents
of cooked meat waft in from the east. A small, straight stairway sits along
the northern wall, ending at a slightly raised loft and a carven baobab door
sits in the southern wall.

Health:89 Stamina:105 Stun:83 standing

The room description has no color what so ever. I'm not sure if Lighbuld didn't put in a thing for it, or that it doesn't work. But it suppose to have a dark cyan colors in the room description.

Could someone, or Lightbuld (smile), help me fine tune this triggers set? To have the room coloring working so that it output dark cyan? Oh, and also, the room title coloring, is there a way to modify it so that it also color the part after the -? Like so..?

"The Sun King's Sanctuary" - Tavern [NEWUD]

Oh, and of course, teal is regular cyan, while red is actually bright white..

Thank you for everyone that had posted and trying to help me out... hopefull someone can complete it. Gosh, so excited to see the finish triggers...





zMUD General Discussion: All the power you'll ever need.
Reply with quote
PHLN
Adept


Joined: 30 Dec 2001
Posts: 220
Location: Canada

PostPosted: Sun Apr 20, 2003 12:05 pm   
 
Oh, hmm, I just found out something about Lightbulb triggers... When I type look room normally, as I state above, it doesn't show the colors in the room description... However, if I spam look room twice, it does colors, but everything is in cyan... Here is my output...

PS - teal is bright cyan, while blue is the dark cyan (room description color), and red is the bright white...


Health:89 Stamina:105 Stun:83 standingl
"The Sun King's Sanctuary" - Sleeping Commons [D]

Health:89 Stamina:105 Stun:83 standinglook room
look room
"
The Sun King's Sanctuary" - Sleeping Commons [D]
This is a large hallway that ends in an even larger, open room. Along
the dark-wood walls are several doors that lead to private rooms for the
higher-paying individuals. In the open room at the end of the hall are
a number of comfortable-looking cots sprawled out to provide sleeping areas
for the less-wealthy guests. Each cot is made from a grey, wooden frame
with a cotton-lined mattress and a thin, simple cotton cover. A few,
random personal items lie next to individual cots and various low-burning
lanterns line the walls to provide enough light to see by, but not enough
to hamper sleep.



Here is the output I would like the finish triggers to be...

Note - teal is Cyan, while red is bright white, and blue is dark cyan

Health:89 Stamina:105 Stun:83 standingl
"The Sun King's Sanctuary" - Sleeping Commons [D]

Health:89 Stamina:105 Stun:83 standinglook room
look room
"The Sun King's Sanctuary" - Sleeping Commons [D]
This is a large hallway that ends in an even larger, open room. Along
the dark-wood walls are several doors that lead to private rooms for the
higher-paying individuals. In the open room at the end of the hall are
a number of comfortable-looking cots sprawled out to provide sleeping areas
for the less-wealthy guests. Each cot is made from a grey, wooden frame
with a cotton-lined mattress and a thin, simple cotton cover. A few,
random personal items lie next to individual cots and various low-burning
lanterns line the walls to provide enough light to see by, but not enough
to hamper sleep.



Hope that help in debugging Lightbulb's triggers..


zMUD General Discussion: All the power you'll ever need.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Apr 20, 2003 2:29 pm   
 
I took a guess at what the NEW pattern for your prompt trigger would be. If I guessed wrong, change it.
#UNTR {~"(*)~" - %w* ~[([NESWUD])~]}
#TR {~"(*)~" - (%w*) ~[([NESWUD])~]} {#PCOL 11 %x1;#PCOL 11 %x2;#PCOL 15 %x3}
#TR {Health:%d Stamina:%d Stun:%d %w
} {#T- Description} {Description} {nocr|prompt}

LightBulb
Advanced Member
Reply with quote
PHLN
Adept


Joined: 30 Dec 2001
Posts: 220
Location: Canada

PostPosted: Sun Apr 20, 2003 2:45 pm   
 
Thanks Lightbulb, it fix the problem of where the word Tavern wasn't being highlighted, and I don't need to spam look room twice for the room to be colored, however, the colors seem to be coloring the wrong thing still when using look room, here is what I get when I type look room

Note - red is the bright white, blue is the dark cyan and teal is the bright cyan

Health:89 Stamina:105 Stun:83 standinglook room
"
The Sun King's Sanctuary" - Tavern [NEWUD]
A polished, white marble floor covers the ground of this expansive
room, gleaming under the light of a large glass chandelier that hangs
overhead. A semi-circular bar, made of hard-grained wood painted a deep
black, extends from the eastern wall, several high-backed barstools sitting
around it. The walls of this room are brightly decorated, with several
elaborate paintings placed carefully for unobstructed view, and shelves
holding many exotic potted plants, blooming with bright red and white
flowers. Two large stained-glass windows, decorated with elaborate sun
symbols, adorn the northwest and southeast corners of the room.
Several decoratively carved tables fill this room, while a polished
leather couch nearly twenty cords in length sprawls along the northern wall.
A stately spiral staircase sits in the center of the room, winding upwards
toward the common rooms of the second floor. The sounds of laughter and
music can be heard from a doorway along the western wall, while the scents
of cooked meat waft in from the east. A small, straight stairway sits along
the northern wall, ending at a slightly raised loft and a carven baobab door
sits in the southern wall.


Health:89 Stamina:105 Stun:83 standing

Look at my above posts to see what it suppose to be. Hmm, this is a bug for sure, just no clue how to fix it, thanks for the help so far btw, appreciate it



zMUD General Discussion: All the power you'll ever need.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Apr 20, 2003 3:11 pm   
 
It looks to me like it's close enough. It's really not worth the effort it would take to prevent the prompt line from changing colors.

LightBulb
Advanced Member
Reply with quote
PHLN
Adept


Joined: 30 Dec 2001
Posts: 220
Location: Canada

PostPosted: Sun Apr 20, 2003 3:51 pm   
 
Well, is there a way to make it color the room description only however? I was thinking, since when I type look room, it doesn't show the items or people in it, so umm, is there a way to make a trigger to do it after the exits? Well, not like I know how to do it, but...

zMUD General Discussion: All the power you'll ever need.
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