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
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Thu Jan 09, 2003 8:17 pm   

Question again
 
Hey, its me again. Sorry for so many posts but they sure are helping and I am actually learning how all this stuff works. Anyway, I asked this earlier and got no response and I need this figured out because this is how I am making my MUD look presentable. Any way I was using this to color incoming text. This would use CW and color everything starting at You also see until it reached a period. Worked like a charm but....

#tr {You also see} {
#hi
#t+ hilighteverything
}
#class {hilighteverything} {disable}
#tr {*} {#hi}
#tr {.} {#t- hilighteverything}
#class 0

But the colors are limited so I wanted to use the RGB values associated with MXP. I tried just switching some parts of it to make it work but it goes into an endless loop. Quite frustrating. You have know of a different way of making this work or a way to top script please let me know. I would use this ALOT in my mud because I want to make one that colors You also see to the period, You see to the period, Also in the room to the period, Also here to the period, etc. And it would color all this everytime I typed look. Heres hoping.

-Rob-
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Thu Jan 09, 2003 8:49 pm   
 
What colors exactly do you want? If you want random coloers for the word or do you want random colors for each letter or do you want a predefined color that you set?

Take a look at this script I modified and see if it can be used to help you in your problem

http://www.zuggsoft.com/forum/topic.asp?TOPIC_ID=9847&FORUM_ID=29&CAT_ID=1&Topic_Title=color+what+you+say+or+tell&Forum_Title=Finished+MUD+Scripts
Reply with quote
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Thu Jan 09, 2003 9:36 pm   
 
I dont want set colors for each. I want to be able to change them when I want. If I use a color and don't like it I could just go and change it. The way the script works now is if I just change the #CW Red to #CW Yellow then whatever was highlighted red becomes yellow. Like I said it works nice. I am just trying to make it work better
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu Jan 09, 2003 9:40 pm   
 
#tr {You also see (*)} {#sub ~<font color=#FF0000~>You also see %1~</font~>;#t+ hilighteverything}
#class {hilighteverything} {disable}
#tr {(*)} {#sub ~<font color=#FF0000~>%1~</font~>}
#tr {.} {#t- hilighteverything}
#class 0

This is untested.

Kjata
Reply with quote
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Thu Jan 09, 2003 11:33 pm   
 
This doesn't work at all, not quite sure why
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Fri Jan 10, 2003 12:35 am   
 
I also wouldn't be sure why if I don't know how exactly it ails and what causes it to fail.

Kjata
Reply with quote
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Fri Jan 10, 2003 1:53 am   
 
It fails because it fails to color anything at all.
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Fri Jan 10, 2003 2:45 am   
 
Lets start with your color problem I see what you mean I pluged it in and it does nothing, you wrote you could change the color by manually changing it. I don't know about the mxp but maybe you could just make an alias or macro with the YESNO command add the color to the list, give them a set of instructions and give it a #ver to work with, along side of a (%W) or (*) ,.

This sounds worse than it is but it may solve you problem

megamog75
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Fri Jan 10, 2003 1:56 pm   
 
If what you want is to color everythign from "You also see" until a period is found at the end of the line, then a state trigger works perfectly:
#TRIGGER "colortrig" {You also see (*)} {#SUBSTITUTE {~<font color=#FF0000~>You also see %1~</font~>};#IF (!%ends( "%1", ".")) {#STATE colortrig 1}} "" {manual}
#COND "colortrig" {(*)} {#SUBSTITUTE {~<font color=#FF0000~>%1~</font~>};#IF (%ends( "%1", ".")) {#STATE colortrig 0}} {manual}

Kjata
Reply with quote
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Sat Jan 11, 2003 12:14 am   
 
Ok, one last problem....
The coloring works and looks wonderful but I tried copying and pasting it into a new trigger and changing some stuff.

#TRIGGER "colortrig" {You also see (*)} {#SUBSTITUTE {~<font color=#FF0000~>You also see %1~</font~>};#IF (!%ends( "%1", ".")) {#STATE colortrig 1}} "" {manual}
#COND "colortrig" {(*)} {#SUBSTITUTE {~<font color=#FF0000~>%1~</font~>};#IF (%ends( "%1", ".")) {#STATE colortrig 0}} {manual}

To This

#TRIGGER "colortrig" {Also in the room: (*)} {#SUBSTITUTE {~<font color=#CCCC44~>Also in the room: %1~</font~>};#IF (!%ends( "%1", ".")) {#STATE colortrig 1}} "" {manual}
#COND "colortrig" {(*)} {#SUBSTITUTE {~<font color=#CCCC44~>%1~</font~>};#IF (%ends( "%1", ".")) {#STATE colortrig 0}} {manual}

in hopes that it would also color Also in the room and everything after that until it reached a period but once I made this the first one stopped working. If I disable this then the first one works again.
Reply with quote
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Sat Jan 11, 2003 12:18 am   
 
WOW! I fixed it. I saw COLORTRIG was an ID so on the second one I changed it to COLORTRIG1.....IT WORKS!!!!!
Talk about wonderful!
Thank you so much. I have bantered with you for quite a few days and it is now one nice looking mud! Thanks again!!!!!!
Reply with quote
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Sat Jan 11, 2003 12:22 am   
 
One last thing though. I wanted to see if it was possible to use variables for the color so I did this:

#TRIGGER "colortrig" {You also see (*)} {#SUBSTITUTE {~<font color=&See~>You also see %1~</font~>};#IF (!%ends( "%1", ".")) {#STATE colortrig 1}} "" {manual}
#COND "colortrig" {(*)} {#SUBSTITUTE {~<font color=&See~>%1~</font~>};#IF (%ends( "%1", ".")) {#STATE colortrig 0}} {manual}

And then I did this in the mud input:
#VAR See #CCCC66


It saved the variable right but then it doesn't work in the trigger.
Reply with quote
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Sat Jan 11, 2003 12:41 am   
 
Boy I feel stupid. Sure would help if I used @ instead of &!
It works now.....100%

If anyone else wants a script that checks for things then use this.

#TRIGGER "colortrig" {You also see (*)} {#SUBSTITUTE {~<font color=@See~>You also see %1~</font~>};#IF (!%ends( "%1", ".")) {#STATE colortrig 1}} "" {manual}
#COND "colortrig" {(*)} {#SUBSTITUTE {~<font color=@See~>%1~</font~>};#IF (%ends( "%1", ".")) {#STATE colortrig 0}} {manual}

Change the You also see (both of em) to what you want it to color. You can also rename colortrig to what you want. I changed mine to colortrigsee (remember to change all 3 of these)
Then you can also change the @See variable to what you want.

Now what this script as it is right now does is highlights everything from You also see until it reaches a period. Doesn't matter if it is 10 lines down it will color it all. You can also change that period so it stops when you want. To change the color of this easily just type #VAR @See #666600 (or whatever RGB color you want)

here is a good web page with alot of colors.
http://www.billmurphy.com/Art/colors.html

Hope someone else will get as much out of this as I did. If you come up with better uses or variations of this let me know.
Reply with quote
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Sat Jan 11, 2003 1:02 am   
 
I just had a thought.....usually bad things happen when I do this but lets see what we come up with......

<b>If i am using this trigger:</b>

Is there anyway I can input anything such as at the mud input:
nh colortagsee see #CCCC44 You also see

nh would be the alias
colortagsee turns into the colortag section
see would be the color variable
#CCCC44 would be the color
You also see would be the trigger

It would store all of this as variables then make a trigger out of it.

nh would be the alias
@tagname=colortagsee
@colorvar=see would be the color variable name that stores the color
@color=#CCCC44 would be the color that is then stored in @colorvar
@colortrigger=You also see would be the trigger

So all of that would make this

#TRIGGER "@tagname" {@colortrigger (*)} {#SUBSTITUTE {~<font color=@colorvar~>@colortrigger %1~</font~>};#IF (!%ends( "%1", ".")) {#STATE @tagname 1}} "" {manual}
#COND "@tagname" {(*)} {#SUBSTITUTE {~<font color=@colorvar~>%1~</font~>};#IF (%ends( "%1", ".")) {#STATE @tagname 0}} {manual}


which after all the variables where equated would equal this:

#TRIGGER "colortagsee" {@You also see (*)} {#SUBSTITUTE {~<font color=@see~>You also see %1~</font~>};#IF (!%ends( "%1", ".")) {#STATE colortagsee 1}} "" {manual}
#COND "colortagsee" {(*)} {#SUBSTITUTE {~<font color=@see~>%1~</font~>};#IF (%ends( "%1", ".")) {#STATE colortagsee 0}} {manual}

This way if I want to make some quick I could just type in:
nh colortagsee see #CCCC44 You also see
nh colortaghere here #FF0000 Also in the room:

etc


Is this possible???
Reply with quote
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Sat Jan 11, 2003 2:06 am   
 
I came up with an idea to get all the info but there is one small snag. I have decided an alias might work and so far it sorta does. I have this alias
Alias name: NH
Value:
#VAR tagname %1
#VAR colorvar %2
#VAR color %3
#VAR ct %4

The thing is the var CT I want to capture more then just one word. I tried * but it didn't work either. The first %1, %2, %3 worked great
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sat Jan 11, 2003 2:48 am   
 
Use %-4 instead of %4. This one gets everything passed to the alias starting from the fourth parameter.

Kjata
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