 |
poon Beginner
Joined: 11 Oct 2001 Posts: 12 Location: USA
|
Posted: Sat Jan 12, 2002 11:09 pm
Trigger/variable for setting names to color. |
Okay, I have a "guild" trigger and variable
setup to show names (set in the variable)
in color. Here is how I have the variable
and trigger set up:
Variable:
Value: Ogg|Vraurk|Rok|Hagar
Trigger:
Pattern: {@guild}
Command: #CW green
My problem is that if a bit of text shows
up on the screen that has "broke" in it
for example, the "rok" part of broke shows
up in green, with the "b" and "e" part of
broke in the normal text color. Well, I
figured out that if I go into the variable
and set each name with a space in front
and back of it, it takes care of this
problem. However, I have an alias set up
to add names to the "guild" variable, but
I have no idea how to set it so that it
puts the name into the variable with the
space before and after the name. The
alias (addguild) that I have is set up
like this:
Alias:
Name: addguild
Value:
#IF {
%ismember(%proper(%1),@guild)
}
{
#show %proper(%1) is on the guild list already.
}
{
guild=%additem(%proper(%1),@guild)
#show Added %proper(%1) to List of guild.
}
*********************************************
I tried changing the 'false' statement to:
{
guild=%additem(%proper(%1),@guild)
#show Added %proper(" %1 ") to List of guild.
}
but this did not work. Any help with this is
greatly appreciated.
Poon - Win95 - Zmud 6.16 |
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sat Jan 12, 2002 11:15 pm |
A solution for you would be to change the alias as follows:
#IF {
%ismember(%proper(%1),@guild)
}
{
#show %proper(%1) is on the guild list already.
}
{
guild=%additem(%concat(%proper(%1)," "),@guild)
#show Added %proper(%1) to List of guild.
}
Also you should make the trigger case-sensitive. I do not reccomend putting a space before the name because lines such as "Rok tells you blah" would not be colored. |
|
|
 |
poon Beginner
Joined: 11 Oct 2001 Posts: 12 Location: USA
|
Posted: Sat Jan 12, 2002 11:54 pm |
Thanks a bunch, that worked out great!!
Poon. |
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Jan 13, 2002 1:37 am |
By using the #ADDITEM command instead of the %additem function you can ensure names won't be repeated without the need to check whether they are already included. And by making the trigger case-sensitive, you should avoid most of the unintended highlighting as long as you add them with correct capitalization.
#AL addguild {#ADDITEM guild %proper(%1)}
LightBulb
All scripts untested unless otherwise noted |
|
|
 |
|
|