Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Fri May 09, 2008 9:41 pm   

Some problems with Color
 
Trying to make an on-the-spot highlighter, but when the trigger is enabled, everything is black. The alises just return blank

Code:


#al sethighlight {highlight=%param;#say Highlight set to: @highlight} {General Aliases}

#al sethighlightcolor {highlightcolor=%param;#say Highlight color set to: "<color @highlightcolor>"@highlightcolor"</color>"} {General Aliases}


#var highlight " " _nodef {General Variables}

#var highlightcolor " " "#FF0000" {General Variables}

#TRIGGER {@highlight} {#COLOR @highlightcolor} {General Triggers}


What am I doing wrong?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Fri May 09, 2008 10:13 pm   
 
Quote:
highlight=%param
The %param function returns only the specified parameter. I think the function you actually want to use is %params, which returns the specified parameter and all those that follow it.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Fri May 09, 2008 11:30 pm   
 
Awesome, thank you.

I was wondering also, can I make dynamic arrays? To say... have an "unlimited" number of highlights?

The alias would have two params

sethighlight # <text to highlight>

so you could do

sethighlight 5 under the bridge
sethighlight 1 over the colors

and...

sethighlightcolor 1 "#FF0000"
sethighlightcolor 5 "#00FF00"

and those colors would match to corresponding highlights.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri May 09, 2008 11:53 pm   
 
#alias sethighlight {#addkey Highlights %-2 %1}
#trig {({@Highlights})} {#color %db(@Highlights,%1)}

should work. The syntax is sethighlight colour phrase, like sethighlight "$FF0000" under the bridge.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Fri May 09, 2008 11:56 pm   
 
And how does it work?

Edit:

Ack! And how do I remove the highlight?
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Sat May 10, 2008 12:07 am   
 
Also of note. I deleted the Highlight key in order to set it to normal. Then used the alias again which created a new key, but now none of the highlights are changing color
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sat May 10, 2008 12:54 am   
 
Delete it all and start over. It's working fine for me.

To delete one, use #delkey Highlights "phrase"
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Sat May 10, 2008 1:04 am   
 
Just because I insist on aliases...

Code:

#alias remhighlight {#delkey Highlights %-2
#say %-2 removed.} {General Aliases}


Should work, no?
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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