|
Jacknam Newbie
Joined: 15 Feb 2002 Posts: 8 Location: USA
|
Posted: Sat Feb 16, 2002 5:12 pm
Trigger Question |
Im trying to basicly color a list of words a certain color....like a friends list...
i have a string var @friends = fr1|fr2|fr3
then i want a trigger that anytime one of those names appears it gets colored...
the pattern to the trigger is where im having my problems...anyone have any idea how i would do this? |
|
|
|
Toetag Magician
Joined: 10 Oct 2000 Posts: 356 Location: USA
|
Posted: Sat Feb 16, 2002 5:15 pm |
Trigger pattern:
{@friends}
Trigger command:
#CW red
Killing a fly on a friends forhead may not be overkill, use a hatchet to make sure the job is done. |
|
|
|
Jacknam Newbie
Joined: 15 Feb 2002 Posts: 8 Location: USA
|
Posted: Sat Feb 16, 2002 5:19 pm |
Actually that doesnt work with the {} around the var in the pattern of the trigger or without it....theres another way to do it cause that way doesnt work.
|
|
|
|
Toetag Magician
Joined: 10 Oct 2000 Posts: 356 Location: USA
|
Posted: Sat Feb 16, 2002 5:21 pm |
Aye that ya do.
FYI:
I've got this running for about 6 variable lists some small, some a few hundred items. I've never seen a great difference in screen updates. From what I understand the pattern runs against any screen updates and process the #CW if stringlist memeber found. I thought it would slow it down, but it hasn't yet.
Killing a fly on a friends forhead may not be overkill, use a hatchet to make sure the job is done. |
|
|
|
Jacknam Newbie
Joined: 15 Feb 2002 Posts: 8 Location: USA
|
Posted: Sat Feb 16, 2002 5:24 pm |
Hmm didnt work for me but ill try it again
|
|
|
|
Toetag Magician
Joined: 10 Oct 2000 Posts: 356 Location: USA
|
Posted: Sat Feb 16, 2002 5:25 pm |
Then i'm not sure what to tell you. I've used this Pattern for triggers for years.
Below is taken straight from an export of my settings.
#CLASS {color}
#TRIGGER {{@armor}} {#CW green}
#VAR armor {scaly sleeves|scaly leggings|scaly boots|scaly armor|drake scale armor|thief's cloak|bronze bracer|crimson targe|scaly gauntlets|protector's glovesscaly sleeves|scaly leggings|scaly boots|scaly armor|drake scale armor|thief's cloak|bronze bracer|crimson targe|scaly gauntlets|protector's gloves|aerial ring chausses|aerial ring mail|archer's glove|balaccan helm|boots of stalking|brigandine bracer|broad belt|bronze bracer|circlet|cloak of fur|crimson targe|dented breastplate|field plate gauntlets|field plate mail|field plate vambraces|fiery belt|flying carpet|folded wing|fur-lined shackle|gloves|hunter's cloak|ivory nose ring|jade bracer|knight's armour|knight's gauntlets|knight's greaves|knight's helm|knight's vambraces|leather targe|padded leather gloves|padded leather shirt|protector's breastplate|protector's gloves|protector's helm|protector's leggings|protector's sleeves|protector's sollerets|rings of mooring|rings of Tarawn|shadow shield|silver cuffs|snakescale hood|snowshoes|softskin leggings|sterling star earrings|targe|tinted paste|trapper's fur cloak|warrior helm|warrior's belt|dragon shield|scale mail leggings|lamellar shirt|lamellar cloak|snakescale cloak|fur earmuffs|rogue's mask|gloves of bone}
Killing a fly on a friends forhead may not be overkill, use a hatchet to make sure the job is done. |
|
|
|
Toetag Magician
Joined: 10 Oct 2000 Posts: 356 Location: USA
|
Posted: Sat Feb 16, 2002 5:27 pm |
var @friends = fr1|fr2|fr3
is fr1, fr2 and fr3 variables?
Killing a fly on a friends forhead may not be overkill, use a hatchet to make sure the job is done. |
|
|
|
Jacknam Newbie
Joined: 15 Feb 2002 Posts: 8 Location: USA
|
Posted: Sat Feb 16, 2002 5:28 pm |
Ok Ok it worked was something I did, but a twist...what if i only want it colored if its the whole word, for instance, say a friends name was Ron but then Sauron apprears and it colors the 'ron' in sauron and i dont want it to.
|
|
|
|
Toetag Magician
Joined: 10 Oct 2000 Posts: 356 Location: USA
|
Posted: Sat Feb 16, 2002 5:32 pm |
thats the toughie. Perhaps Kjata or one of the gurus can figure that one out. some how you'd have to figure out the string length and test for it it in the trigger.
I'm not quite as fluent on string manipulation. But the professional coders probably have better suggestions.
Killing a fly on a friends forhead may not be overkill, use a hatchet to make sure the job is done. |
|
|
|
Jacknam Newbie
Joined: 15 Feb 2002 Posts: 8 Location: USA
|
Posted: Sat Feb 16, 2002 5:37 pm |
Hmm yes maybe a Guru could help with this?
|
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sat Feb 16, 2002 6:10 pm |
#TR { {@friends} } {#CW mycolor}
See the spaces in the pattern. If what you are looking to color is always at the start of the line then you would use:
#TR {^{@friends} } {#CW mycolor}
and finally if you know that proper case will be followed then you can get both situations at once by turning on case-sensitive for the trigger:
friends=Fr1|Fr2|Fr3
#TR {{@friends} } {#CW mycolor} |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sun Feb 17, 2002 1:41 pm |
Yeah, what Vijilante said. There basically is no "correct" way of doing this. There are just some work arounds like those Vijilante mentioned.
Kjata |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Mon Feb 18, 2002 5:12 am |
Try
#TR {%s{@friends}%s} {#CW mycolor}
as %s matches blank space or something like that :P |
|
|
|
|
|