 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: 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? |
|
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
Posted: Fri May 09, 2008 10:13 pm |
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 |
|
|
 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: 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. |
|
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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. |
|
|
|
 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Fri May 09, 2008 11:56 pm |
And how does it work?
Edit:
Ack! And how do I remove the highlight? |
|
|
|
 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: 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
|
|
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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" |
|
|
|
 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: 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? |
|
|
|
 |
|
|
|