|
Hroomha Beginner
Joined: 03 Sep 2004 Posts: 11
|
Posted: Fri Sep 03, 2004 3:25 am
HIlightiing multiple variables? |
I'm trying to take a string like
{dalan|Grogg|sultan}
and color each word yellow
we play team games, and i need a trigger to hilight multiple names.
Thanx for any help
H. |
|
_________________ Hroom's Hand |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Fri Sep 03, 2004 12:33 pm |
I am gonna pretend the pattern matching help file doesn't exist and Im also gonna pretend examples in the help file don't exist and on top of that Im gonna pretend searching this forum won't turn up anything :P
#TR {(%q)({name|other|again})(%q)} {#Sub %1%ansi(hi,yellow)%2%3}
or
#TR {(%q)({@string_list_containing_names})(%q)} {#Sub %1%ansi(hi,yellow)%2%3} |
|
|
|
Hroomha Beginner
Joined: 03 Sep 2004 Posts: 11
|
Posted: Sat Sep 04, 2004 5:38 am trig |
Many thanks.
I read the help files and tried,
but couldn't get it to work.
kind of sad, but i took me a long time
and still couldn't get it.
Thanks again, this is alot different from what i was doing
..should have posted..I have zmud 6.16 and the %q and %i stuff
is not listed in the help files.
thanx again,
H. |
|
_________________ Hroom's Hand |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Sat Sep 04, 2004 5:43 am |
I don't know if %q is supported in 6.16 and I didn't use %i anywhere so your best bet is to upgrade to 7.05 there is no reason not to and 7.05 fixes MANY bugs within Zmud the mapper module and the db module.
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat Sep 04, 2004 8:32 pm |
%q is not recognized in v6.16. Just use a #CW trigger.
#ADDI team dalan
#ADDI team Grogg
#ADDI team sultan
#CW {{@team}} {yellow}
NOTE: You might have to add another set of braces around @team. |
|
_________________ LightBulb
Senior member
Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious. |
|
|
|
Hroomha Beginner
Joined: 03 Sep 2004 Posts: 11
|
Posted: Sat Sep 04, 2004 9:07 pm |
sorry folks,
nothing is working.
I have this allready:
alias:team
value: #trigger {%1} {#CW 14} team
#echo {%1} teamed!
this works for single names, and can be used one by one.
I am trying to be able to take a list of names
and put them into a variable
...then color all the names in the variable.
what i tried was this...
alias: teamz
Value:
teamz=%1
#cw {@teamz} {14}
#echo @teamz
I've tried changing the alias to teamz (%X)
but it still wont work.
..also tried adding the extra brackets..still no go.
Thanx again for any ideas...
H. |
|
_________________ Hroom's Hand |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat Sep 04, 2004 9:18 pm |
The example I gave works in v7.05 (tested today) and should also work in v6.16 (used similar triggers for several years), provided the number of braces is correct.
I already have two sets of braces around @team and suggested you might need a third in v6.16. It's certain that you'll need more than the one set you used.
I used a colorname, yellow, rather than a colornumber, 14.
I used #ADDITEM rather than =.
Try it my way before you say it doesn't work. |
|
_________________ LightBulb
Senior member
Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious. |
|
|
|
Hroomha Beginner
Joined: 03 Sep 2004 Posts: 11
|
Posted: Sat Sep 04, 2004 10:42 pm |
Thanks for the responses,
the extra brackets didn't work tho.
I've gotten close but still need a lil help.
Alias: teamz
Value: #var teamz %1
#forall @teamz {#trigger {(%i)} {#CW 14} {test2}}
****also tried brackets around %i**********
#forall @teamz {#echo %i}
this stores all the names in the variable properly,
and even changes the echo color to yellow,
but still wont catch the names to color
when i check doing a "who all"
mebbe variables as strings need " " somewhere?
do I #sub the brackets in {dalan|Grogg|sultan}
so it ends up like "dalan|Grogg|sultan"
if so, what is the way to do it?
sorry to be a pain, thought it would be a simple thing,
lots of folks seem to use this.
Thanx again
H. |
|
_________________ Hroom's Hand |
|
|
|
Hroomha Beginner
Joined: 03 Sep 2004 Posts: 11
|
Posted: Sun Sep 05, 2004 5:23 am |
found a kind of work-around.
alias: tm
value: #var tm %1 {tm}
#forall @tm {teamz {%1}}
#forall @tm {#echo {%i}}
alias: teamz
value: #trigger {%1} {#CW 14} tm
#echo {%1} teamed!
This will capture a list enclosed in brackets,
and hilite it, but it creates a trigger that
has to be erased when hilites are no longer needed.
anyone know if #forall creates a temporary trigger?
Thanx again,
H. |
|
_________________ Hroom's Hand |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Sep 05, 2004 6:20 am |
#ADDI team dalan
#ADDI team Grogg
#ADDI team sultan
#CW {{@team}} {yellow}
Tested today using v6.16. It works!!!
NOTE: The above is not the script of an alias or a trigger! It's intended, like almost everything I write, for direct entry to the command line! It simply creates a variable and a trigger. The trigger never needs to be created again, once is enough! The variable only needs to be changed when people are added or removed from the team.
#AL team {#ADDI team %1;#ECHO %1 teamed}
#AL unteam {#DELI team %1;#ECHO %1 removed from team}
#AL noteam {#VAR team {};#ECHO Team variable cleared} |
|
_________________ LightBulb
Senior member
Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious. |
|
|
|
Hroomha Beginner
Joined: 03 Sep 2004 Posts: 11
|
Posted: Mon Sep 06, 2004 12:13 am got it |
Mnay thanx,
sorry I didn't pick up on the command line entry bit.
your way works perfect.
Thanx again for all the help,
and also the aliases to go with it. :}
H, |
|
_________________ Hroom's Hand |
|
|
|
|
|