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 Goto page 1, 2  Next
PHLN
Adept


Joined: 30 Dec 2001
Posts: 220
Location: Canada

PostPosted: Thu Feb 13, 2003 7:59 pm   

zMUD experts please assist...
 
* HP:Healthy SP:Bursting MV:Fresh >
Caemlyn Central Square
You are in a large stone square, right in the middle of Caemlyn's outer
city. You see a wide boulevard to the north, and the path to the inner
city. There are a number of shops around you. The density of the population
is really quite incredible. It's almost impossible to relax as you are
being constantly bumped and jostled. From here you can really get a good
view of the outer city, and this just makes you appreciate the older inner
city all the more.
A large banner hangs nearby, depicting a map of Caemlyn's outer city.
[ obvious exits: N E S W ]
A fountain is here, offering water to all.
An oil lamp, set in a steel cage, hangs from a high wooden pole.
Norstrom the warrior of the Borderlands is standing here.
Baryn the warrior of Two Rivers is standing here.
A warhorse is here, stamping his feet impatiently, being ridden by Groost.
Groost M'Dogal, Merry Muffin Man Extraordinaire is standing here, riding a warhorse.

.....

Any experts can help me in writing a script so that the room title (seen here as Caemlyn Central Square), in the color cyan, while the room description in dark cyan. And not just this room, but it will do that to every other room that I walk into.... is it possible?


Here is another room example...

* HP:Critical SP:Bursting MV:Haggard > s
A Traveller's Shop
This small shop offers a wide array of items that would be useful to the
frequent traveller. Apparently not the most lucrative of businesses, but they
do sell some fairly important stuff. There is an odd array of junk on display
and the owner apparently has no illusions as to the value of his product.
A small sign hangs from the wall.
[ obvious exits: N ]
The corpse of Dullin is lying here.
Nalis the rogue of the Borderlands is standing here.
A stout looking guard is here, walking the streets of Caemlyn.
A merchant guard, intent on keeping order, stands guard.
A merchant guard, intent on keeping order, stands guard.
A grocer stocks some shelves.

* HP:Critical SP:Bursting MV:Haggard >
The Caemlyn cityguard has arrived from the north.

* HP:Critical SP:Bursting MV:Haggard >
The Caemlyn cityguard slashes your right leg hard.
You are dead! Sorry...
Reply with quote
PHLN
Adept


Joined: 30 Dec 2001
Posts: 220
Location: Canada

PostPosted: Thu Feb 13, 2003 8:02 pm   
 
Oh, I forgot to mention, the [ obvious exits: N E S W ] I want it in regular white texts... oh and HP: SP: and MV: in red =),
Reply with quote
Drylar
Wanderer


Joined: 04 Nov 2001
Posts: 53
Location: USA

PostPosted: Thu Feb 13, 2003 8:25 pm   
 
See if this works...

#trigger {^~* HP~:%w SP~:%w MV~:%w ~>%*$} {pos=%len(%trigger);#sub {%insert("<color cyan black>", %trigger, pos)};#temp {^%*$} {pos=%len(%trigger);#sub {%insert("</color><color darkcyan black>", %trigger, pos)}}}
#trigger {~[ obvious exits~:%*~]} {#sub {%insert("</color>", %trigger, 1)}}

What it does is looks for the prompt, adds a mxptag to make the text cyan, and a 1 time trigger to fire on a line recieved, which should fire on the room name (assuming always 1 line) that will close the color tag then create a new mxp tag that colors the text darkcyan. The second trigger looks for the exits line and adds a color close tag at the beginning of that line. If it doesn't quite work, since it's untested, feel free to toy with it a bit.


-Drylar
Reply with quote
PHLN
Adept


Joined: 30 Dec 2001
Posts: 220
Location: Canada

PostPosted: Thu Feb 13, 2003 8:33 pm   
 
Hmm, the original doesn't work, but then I change it so the it fire on prompt and it does. But one problem, it colors everything cyan, from the new prompt that was created by me moving, to the prompt that end in the new room I move in. Is there a way for it to color the room title in a lighter shade of cyan? Leave the room description the same cyan color you have now, and change it so that it stop coloring at the Obvious exits part?
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Feb 13, 2003 8:35 pm   
 
Charbal has the color from
what appears to be that mud from the above link.

#TRIGGER RoomRecolorer {%e[36m*%e[0m$} {#COLOR 11;#TEMP RoomRecolorerExit {^~[ obvious exits~: *~]} {#COLOR 15;#STATE RoomRecolorer 0}} {color}
#CONDITION RoomRecolorer {} {#COLOR 3} {loopat|param=99}

#TRIGGER {^~* (HP)~:%w (SP)~:%w (MV)~:%w ~>} {#PCOL mxpred %x1;#PCOL mxpred %x2;#PCOL mxpred %x3}


Untested but the concept should be close.

Ton Diening
Reply with quote
PHLN
Adept


Joined: 30 Dec 2001
Posts: 220
Location: Canada

PostPosted: Thu Feb 13, 2003 8:39 pm   
 
I used the one you just posted, but it just said syntax error when I go into zMUD...
Reply with quote
Drylar
Wanderer


Joined: 04 Nov 2001
Posts: 53
Location: USA

PostPosted: Thu Feb 13, 2003 8:45 pm   
 
I should point out, I just realized a major flaw in my triggers. The way I first had it is assuming you are always seeing the roomname and desc after every prompt. To fix this, you could create an alias that encapsules it as 'look', which creates the triggers, then on the second trigger, at the end, untriggers them... ie:

#alias {look} {#trigger {^~* HP~:%w SP~:%w MV~:%w ~>%*$} {pos=%len(%trigger);#sub {%insert("<color cyan black>", %trigger, pos)};#temp {^%*$} {pos=%len(%trigger);#sub {%insert("</color><color darkcyan black>", %trigger, pos)}}};#trigger {~[ obvious exits~:%*~]} {#sub {%insert("</color>", %trigger, 1)};#untrigger {^~* HP~:%w SP~:%w MV~:%w ~>%*$};#untrigger {~[ obvious exits~:%*~]}}}

This new alias would only work if you typed look, leaving auto-looking untouched. If anyone wants to expand upon my thought here, I'd be most appreciative. As per the other colors (you added while I was writing something as a response), you could look into the use of #PCOL and as per 'plain white' for the exits, the end mxptag removes all colorizing done by the triggers.

A second trigger could easily take care of your prompt, something like...
#trigger {~* (%w)~:%w (%w)~:%w (%w)~:%w ~>} {#pcol red %x1;#pcol red %x2;#pcol red %x3}
would take care of just the HP, SP, and MV whereas...

#trigger {~* (%w)~:(%w) (%w)~:(%w) (%w)~:(%w) ~>} {#pcol red %x1;#pcol red %x2;#pcol red %x3;#pcol red %x4;#pcol red %x5;#pcol red %x6}
would allow you to make a seperate color for HP, SP, MV, as well as the other words.

The page I use to get a good sample of the many colors available through mxp is at http://st-ives.net/dlv/html/colorsamples.html which allows you to hover over a color and the whole background goes to that color giving a good example. Alot more color exists than just the 16 colors on ansi.



-Drylar
Reply with quote
PHLN
Adept


Joined: 30 Dec 2001
Posts: 220
Location: Canada

PostPosted: Thu Feb 13, 2003 8:45 pm   
 
oh, I found out that sometime the room title isn't always on a new line either...


* HP:Healthy MV:Winded > Central Street
The heavy footstones are somewhat sunken into the rather soft ground and they
have been reinforced and replaced by heavy wooden logs here. The logs, laid
perpendicular to the road, are filled in between with thick grey-black gravel
which allows you ease of foot travel. The road continues along the same axis
and branches off to the west as well.
[ obvious exits: N S W ]
An oil lamp, set in a steel cage, hangs from a high wooden pole.
A stalwart guard of Baerlon patrols the streets, protecting the citizens.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Feb 13, 2003 8:46 pm   
 
Just finished cleaning it up, where does the error show?

If you edit the triggers in the settings editor what syntax error shows?

*goes back counting brackets*

Ton Diening
Reply with quote
Drylar
Wanderer


Joined: 04 Nov 2001
Posts: 53
Location: USA

PostPosted: Thu Feb 13, 2003 8:47 pm   
 
Ack I need to type faster. I go to a different screen for a minute before posting, and 3 new replies. Glad to see that more than myself is helping here.

-Drylar
Reply with quote
PHLN
Adept


Joined: 30 Dec 2001
Posts: 220
Location: Canada

PostPosted: Thu Feb 13, 2003 8:48 pm   
 
RecolorerExit {^[ obvious exits: *]} {#COLOR 15;#STATE RoomRecolorer 0}
^ syntax error

That is for one of your trig Ton, I'm gonna test out the new one Drylar post up
Reply with quote
Drylar
Wanderer


Joined: 04 Nov 2001
Posts: 53
Location: USA

PostPosted: Thu Feb 13, 2003 8:49 pm   
 
As per the room name on a new line, please see the topic at http://www.zuggsoft.com/forum/topic.asp?TOPIC_ID=10458&FORUM_ID=7&CAT_ID=1&Topic_Title=Help+with+Prompt%2FNewline+scripting%2E&Forum_Title=zMUD+General+Discussion as that's a thread i had about moving it around so that everything gets it's own line.

-Drylar
Reply with quote
PHLN
Adept


Joined: 30 Dec 2001
Posts: 220
Location: Canada

PostPosted: Thu Feb 13, 2003 8:53 pm   
 
*bow his head in shame*.. err. I don't know how to use Drylar new one.. I type look, then I see


Central Street
The heavy footstones are somewhat sunken into the rather soft ground and they
have been reinforced and replaced by heavy wooden logs here. The logs, laid
perpendicular to the road, are filled in between with thick grey-black gravel
which allows you ease of foot travel. The road continues along the same axis
and branches off to the west as well.
[ obvious exits: N S W ]
Trigger {^~* HP~:%w SP~:%w MV~:%w ~>%*$} removed.
Trigger {~[ obvious exits~:%*~]} removed.
An oil lamp, set in a steel cage, hangs from a high wooden pole.
Reply with quote
Drylar
Wanderer


Joined: 04 Nov 2001
Posts: 53
Location: USA

PostPosted: Thu Feb 13, 2003 8:57 pm   
 
Hrm it should have colorized the name and the desc... if I weren't on my way to bed i'd see if i could log on and try. If this is still unanswered by tonight, I'll see about logging on so I can get a better idea and test it out myself.

-Drylar
Reply with quote
PHLN
Adept


Joined: 30 Dec 2001
Posts: 220
Location: Canada

PostPosted: Thu Feb 13, 2003 8:58 pm   
 
alright, thanks for helping Drylar
Reply with quote
Drylar
Wanderer


Joined: 04 Nov 2001
Posts: 53
Location: USA

PostPosted: Thu Feb 13, 2003 9:20 pm   
 
Ok, had to fix something, instead of triggers/untriggers i kick myself for not switching to temps. And I forgot the all important part at the end (highlighted in red to show everyone how big a moron I am).

#alias {look} {#temp {^~* HP~:%w SP~:%w MV~:%w ~>%*$} {pos=%len(%trigger);#sub {%insert("<color cyan black>", %trigger, pos)};#temp {^%*$} {pos=%len(%trigger);#sub {%insert("</color><color darkcyan black>", %trigger, pos)}}};#temp {~[ obvious exits~:%*~]} {#sub {%insert("</color>", %trigger, 1)}};~look}

What it does is sets up the 1 time triggers, looks, colorizes as it goes, and as the triggers fire, it should remove them (without adding an extra line telling you so). If this doesn't work, what's the host/port, and I'll see if I can do better either in about 6-7 hours when I wake up, or in 16 hours when I'm off work again.


-Drylar
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Feb 13, 2003 9:22 pm   
 
What is the ip/port of this WoT mud? I'll login and make it work :P

Ton Diening
Reply with quote
Charbal
GURU


Joined: 15 Jun 2001
Posts: 654
Location: USA

PostPosted: Fri Feb 14, 2003 1:09 am   
 
Hey, PHLN. I don't play on Charbal much anymore (old warrior with subpar stats in today's WoTMUD :P) but Kalos is quite active.

Anyway, this works in zMUD 6.53 and should work fine in 6.40:

#CLASS {RoomRecolor}
#VAR TitleColor {cyan,bright}
#VAR DescriptionColor {cyan}
#TRIGGER "roomrecolor" {%e[36m(*)%e[0m$} {#IF ("%1" =~ "%w speaks from the ") {#NOOP} {#CW @TitleColor;#STATE roomrecolor 1}} "" {manual|color}
#COND "roomrecolor" {^(*)$} {#IF ("%1" =~ "~[ obvious exits: ") {#STATE roomrecolor 0} {#COLOR @DescriptionColor}} {manual}
#CLASS 0

If you are still using 6.16 (you didn't say), this should do the trick:

#CLASS {RoomRecolor}
#VAR TitleColor {cyan,bright}
#VAR DescriptionColor {cyan}
#VAR Roomname %null
#TRIGGER {%e[36m(*)%e[0m$} {#IF ("%1" =~ "%w speaks from the ") {#NOOP} {#CW @TitleColor;#VARIABLE Roomname "%1";#T+ {RoomRecolor|Description}}} "" {color}
#CLASS {RoomRecolor|Description} {disable}
#TRIGGER {^(*)$} {#IF ("%1" =~ @Roomname) {#ABORT 1};#IF ("%1" =~ "~[ obvious exits: ") {#T- {RoomRecolor|Description}} {#COLOR @DescriptionColor}}
#CLASS 0
#T- {RoomRecolor|Description}

Both scripts take into account something you didn't mention... that immortals speaking (like Aennor speaks from the Light 'blah blah blah') show up in the same color as the room name.

And if anyone is still wondering, it's www.wotmud.org, port 2222.

 - Charbal
Reply with quote
PHLN
Adept


Joined: 30 Dec 2001
Posts: 220
Location: Canada

PostPosted: Fri Feb 14, 2003 4:04 am   
 
w00t, it work, but... hehe, I was wondering why it only work when I type 'color complete' as the setting? This setting work great, but it is annoying how mobs and objects etc in the room is colors.

Anyway to have them as plain white?

(PS: but still have the enemy race in the red color that they have now?), thanks again for everyone help, Ton, Drylar and Charbal
Reply with quote
PHLN
Adept


Joined: 30 Dec 2001
Posts: 220
Location: Canada

PostPosted: Fri Feb 14, 2003 4:08 am   
 
oh, and do you know why sometime the first line of the text isn't color eventhough it is in the room description?

* HP:Healthy MV:Fresh > w
Middle of a Wide Boulevard
This is the middle of a wide boulevard that runs east and west across Caemlyn.
The boulevard is bisected by a strip of grass and a row of trees which run its
length. The sheer noise of crowded Caemlyn is overwhelming, almost a dull
roar. To the north is a paved road which leads into the Inner City. To the
south is an open square and a cluster of shops.
[ obvious exits: N E S W ]

"This is the middle of a wide boulevard that runs east and west across Caemlyn." is a room description, but rather than having the same dark cyan as the rest, it is white, white the room title is correctly cyan.


* HP:Healthy MV:Fresh > A Wide Boulevard
You are on a wide boulevard that stretches all the way across Caemlyn. The
extremely wide road is cut in the middle by a strip of grass with trees evenly
placed along the street. You see people scurrying about in a mad rush. A
stairway leads up here onto a skywalk that runs over the entire Inner City.
[ obvious exits: E W U ]
An oil lamp, set in a steel cage, hangs from a high wooden pole.
Afrim t'Aleal {Andoran Cavalry Elite} is standing here.
A worker busily earns a day's pay.

"You are on a wide boulevard that stretches all the way across Caemlyn. The" have the same problem, it is in white which it shouldn't be.

Oh, and hehe, sorry for asking for so much help, but is there a way to stop the room title from being in the same line as the prompt?
Reply with quote
PHLN
Adept


Joined: 30 Dec 2001
Posts: 220
Location: Canada

PostPosted: Fri Feb 14, 2003 4:14 am   
 
oh, for the prompt forcing new line to start anew, use this, thank you for the other people that help me on the other topic

#tr {~* HP:%w MV:%w >(*)} {
pos = %len(%trigger) - %len(%1)
#gag {%insert(%crlf, %trigger, @pos)}
}
Reply with quote
PHLN
Adept


Joined: 30 Dec 2001
Posts: 220
Location: Canada

PostPosted: Fri Feb 14, 2003 4:15 am   
 
oh poo, darn me, I rush it, it doesn't work it seem, *giggle*,


* HP:Healthy MV:Full > Caemlyn Central Square
You are in a large stone square, right in the middle of Caemlyn's outer
city. You see a wide boulevard to the north, and the path to the inner
city. There are a number of shops around you. The density of the population
is really quite incredible. It's almost impossible to relax as you are
being constantly bumped and jostled. From here you can really get a good
view of the outer city, and this just makes you appreciate the older inner
city all the more.
A large banner hangs nearby, depicting a map of Caemlyn's outer city.
[ obvious exits: N E S W ]
A key lies here, simple and unadorned.


And


* HP:Healthy MV:Fresh > No-one by that name here..

* HP:Healthy MV:Fresh >
Shivram has arrived from the north.

* HP:Healthy MV:Fresh > reply thanks
Reply with quote
PHLN
Adept


Joined: 30 Dec 2001
Posts: 220
Location: Canada

PostPosted: Fri Feb 14, 2003 4:36 am   
 
oh, it seem the white line don't just happen below the title, it sometime happen above the exits, and in the middle of the room description, is this a bug?
Reply with quote
PHLN
Adept


Joined: 30 Dec 2001
Posts: 220
Location: Canada

PostPosted: Fri Feb 14, 2003 8:28 pm   
 
*cough*. err bump... *halo*

if anyone can help me figure out why it doesn't color all the room description sometime..like it miss a line or two, that would be cool
Reply with quote
Charbal
GURU


Joined: 15 Jun 2001
Posts: 654
Location: USA

PostPosted: Sat Feb 15, 2003 9:51 pm   
 
Well, what version of zMUD and which script are you using?

As for requiring color complete, that's really the best way to distinguish a room name from other text on WoTMUD. To cause other things to not be colored, you could either use more triggers to change their colors back to the default or change the foreground mapping so their color is the same as the default. This latter option is accomplished by View, Preferences, Colors..., click the + next to Colors, Foreground Mapping and then clicking on the current color and changing it to the default color.

 - Charbal
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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