|
obor Wanderer
Joined: 20 Dec 2001 Posts: 56 Location: USA
|
Posted: Fri Dec 21, 2001 7:42 am
I want to highlight my enemies |
When I type "scan" or "where", I see players around me...I'd like to have my enemies highlighted.
Either:
a) If the player is in a clan that is an enemy of mine, the name is highlighted (not sure if that's possible)
or
b) I enter names into a running list, and if I "scan" or "where", the names are highlighted that are on the list
I'm sure it's possible, but I don't know how to make it happen. |
|
|
|
undergod Wanderer
Joined: 27 Jun 2001 Posts: 82
|
Posted: Fri Dec 21, 2001 8:42 am |
Well, the second part is pretty easy. Just do this sorta thing:
Set up a variable of names you want to highlight... call it, names.
#var names
Then you add a trigger to capture the names variable and highlight the word.
#trigger {{@names}} {#CW 132} ( highlighted them in red, change the "132" value to a diff. number if you want a diff. color)
And, if you want to add a name to the list. Just do...
#alias {highlight} {#additem names %-1} (you just type "highlight joe" to have the name 'joe' added to the list of highlighted words.
You can do the same for people in enemy clans. Or perhaps set up a trigger if the clan name is in their description. |
|
|
|
Crymson4 Novice
Joined: 20 Nov 2001 Posts: 35 Location: USA
|
Posted: Fri Dec 21, 2001 4:38 pm |
quote: #alias {highlight} {#additem names %-1}
I get the #ALIAS, when he types highlight <whatever> it'll add whatevers name to the @Names variable (but wouldn't you want an array..? *shrug*) Anyway, that part I don't understand is, why are you adding %-1?
I don't understand what %-1 is... is it player input, as opposed to text received from the MUD (like %1, %2 etc?)
Always confused,
-=Crymson
Reality is the effect of alcohol deficiency |
|
|
|
obor Wanderer
Joined: 20 Dec 2001 Posts: 56 Location: USA
|
Posted: Fri Dec 21, 2001 5:16 pm |
Hi, thanks for your reply!
I typed in what you wrote, and after typing "#var names" it told me that "@names is not defined". This is probably the crux of the problem. I didn't know how to define it. So I tried defining it as "name" and "0". Neither worked.
I entered the rest of the stuff, and for the trigger got:
Pattern: names
Command: #CW 132
and for the alias, I got:
name: highlight
command: #additem names %-1
regardless, when I typed "highlight Joe", the original variables "names" wasn't updated, and it didn't highlight the player's name
So...what did I do wrong? *Whaps self*
Thanks again for your help! |
|
|
|
Crymson4 Novice
Joined: 20 Nov 2001 Posts: 35 Location: USA
|
Posted: Fri Dec 21, 2001 5:23 pm |
quote: #alias {highlight} {#additem names %-1}
I believe should be #ALIAS {highlight} {#additem @names %-1} Then it will go to the names variable.
However, like I said before, if you want to store multiple names, then you need to define names as an array, not just a variable. Instead of #VAR Names {whatever}
do #array Names {whatever,whatever,whatever}
and it'll store all the names. (If I have my syntax correct, it's been a while, and I don't have zmud installed on this computer)
-=Crymson
Reality is the effect of alcohol deficiency |
|
|
|
Acaila Apprentice
Joined: 30 Aug 2001 Posts: 187 Location: Netherlands
|
Posted: Fri Dec 21, 2001 5:23 pm |
To point to the first word input after the alias name you use %1
To point to the second word input after the alias name you use %2, etc
To point to every word following the alias name you use %-1
To point to every word after the first word following the alias name you use %-2, etc
e.g.
Input: "shout I want to leave"
#ALIAS shout {#VAR Shout "%1"}
--> @Shout = "I"
#ALIAS shout {#VAR Shout "%2"}
--> @Shout = "want"
#ALIAS shout {#VAR Shout "%-1"}
--> @Shout = "I want to leave"
#ALIAS shout {#VAR Shout "%-2"}
--> @Shout = "want to leave"
As for the array thing, to add multiple names to the list in a single command use:
#ALIAS {highlight} {#VAR Temp %replace("%-1"," ","|");#FORALL @Temp {#ADDITEM Names %i};#UNVAR Temp}
Acaila |
|
|
|
obor Wanderer
Joined: 20 Dec 2001 Posts: 56 Location: USA
|
Posted: Fri Dec 21, 2001 6:19 pm |
I used "@names" instead, and it still didn't replace anything in the variable "names" when I typed "highlight *whomever*"
I tried what Crymson said, and what Acaila said, and the variable "names" will not update
Help! Please! Thanks! |
|
|
|
obor Wanderer
Joined: 20 Dec 2001 Posts: 56 Location: USA
|
Posted: Fri Dec 21, 2001 6:21 pm |
I manually edited the 'variables' section, and stuck a specific name right into the block using the "variables" button to open up the variables, and the name still didn't highlight when I typed "where" or "scan" and saw the name.
*dumbfoggled aura* |
|
|
|
SHASCO Novice
Joined: 29 May 2001 Posts: 48 Location: USA
|
Posted: Fri Dec 21, 2001 6:53 pm |
Alias
Put the command that you want to use to add your highlighted name to your list. I have "en" so I type "en shasco" and it adds shasco to my variable names and enemies shasco.
Value
#ADDITEM names %proper( "%1")
enemy %1
Step 2
go into your variable "names" and click on string list. Hit save.
Step 3
#trigger {{@names}} {#cw color}
This will create a trigger and every time a name comes across your mud that is in your @names variable it will color it the color that you specify.
Step 4
Now you need a way to unenemy someone and take them out of your @names variable.
I use an alias. My alias name is "unen."
The value of my alias is this:
#DELITEM names %lower( "%1")
unenemy %1
#UNT {%1}
This was actually given to me when I asked for help on the same subject. Hope it works for you.
With the %proper you need to use the proper spelling of your enemy so to enemy Shasco you would type "en Shasco" NOT "en shasco." |
|
|
|
Acaila Apprentice
Joined: 30 Aug 2001 Posts: 187 Location: Netherlands
|
Posted: Fri Dec 21, 2001 7:21 pm |
quote: I used "@names" instead, and it still didn't replace anything in the variable "names" when I typed "highlight *whomever*"
Don't use @Names in the #ADDITEM function. It's build to automatically add to a variable, so you don't need to define it with a "@". If you use @Names then it will add to what the VALUE of @Names is and not to the @Names itself. Just use Names.
Why it doesn't work for you must be a settings thing, because all of the codes we have provided are valid. I even copy&pasted the trigger I wrote earlier to make sure it was correct:
#ALIAS {highlight} {#VAR Temp %replace("%-1"," ","|");#FORALL @Temp {#ADDITEM Names %i};#UNVAR Temp}
and it worked perfectly. Wether @Names already existed or not did not make any difference.
quote: I entered the rest of the stuff, and for the trigger got:
Pattern: names
Command: #CW 132
Be sure that it is in fact the following:
Pattern: {@Names}
Command: #CW 132
Otherwise it won't recognize the variable Names as a pattern, and thus never color anything.
The %proper thing brought up by Shasco might have a point. Maybe the names aren't recognized if they are lowercase in the variable and propercase in the mud output (however without the trigger set to case-sensitive this shouldn't be the case).
This could be easily fized though, just change my trigger to:
#ALIAS {highlight} {#VAR Temp %replace("%-1"," ","|");#FORALL @Temp {#ADDITEM Names %proper(%i)};#UNVAR Temp}
so whether you type "highlight Shasco", "highlight shasco", "highlight SHASCO" it will always add "Shasco" to the variable.
This is all I could come up with at the moment...good luck
Acaila |
|
|
|
obor Wanderer
Joined: 20 Dec 2001 Posts: 56 Location: USA
|
Posted: Fri Dec 21, 2001 9:53 pm |
okay, Shasco's advice works perfectly with 6.16..., along with the {@names} bit...BUT...
I can't remove names.
I am using "bad <name>" and "unbad <name>" in order to add and remove names from my list
the "bad <name>" works great, but i can't remove anyone from my list. Any idea what I did wrong? I typed it in exactly as it said to.
Also, the capitalization doesn't matter...at least it didn't for me, I didn't even need to amend Shasco's original bit. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Dec 23, 2001 1:29 am |
Depending on whether you use one-word or multi-word names, and with @names as the stringlist variable that has the names:
#AL unbad {#DELITEM names %1} // one-word names
#AL unbad {#DELITEM names {%-1}} // multi-word names
You only use one or the other, and it should match your "bad" alias regarding whether it's %1 or %-1.
LightBulb |
|
|
|
|
|