|
Turantula Newbie
Joined: 20 Mar 2003 Posts: 4 Location: USA
|
Posted: Thu Mar 20, 2003 6:11 am
Help with a specific trigger problem on Achaea` |
Please bear with me. I'm not really a computer guy at all, so I will attempt to explain my problem as fully as possible and I would appreciate any responses given in laymen's terms, as much as possible.
I've been playing with the triggers on Achaea, and for most purposes I can do things all right. But I'm attempting to make a certain alias that will do the command WHO HERE, compare each name that appears to my own VARIABLE list of Allies and Enemies, and ALLY (Name) each person who is on my personal Allies list, and ENEMY (Name) each person on my Enemies list.
What I have so far is an alias that turns on a class, called ChangingAllies (I'm doing one set at a time. If I can get the allies to work I'll just rinse and repeat for the enemies), executes the command WHO HERE, then turns off the ChangingAllies class. The ChangingAllies class has a trigger set to the pattern, "(%w)," because the WHO HERE list is given in the format, "(Name), (Name), (Name), ... (Name), (Name)". The last name in the list is always my own name.
With each word captured, it's supposed to:
#VAR thisone %1 (setting the variable thisone to the current name)
#IF {@thisone IN @Allylist} {Ally @thisone} (allying the name if the name is in my own list of allies)
I've tested this IF statement, and it worked. The problem that I'm having is that ZMUD refuses to accept the list of names after WHO HERE as valid input. I've tried the patterns, "(%w),", "(%w), ?", simply "(%w)", and none of it did anything. Then I tried having multiple triggers, with 2, 3, 4, 5, 6, and 7 "(%w)"'s separated by commas (except the last one) respectively, thinking that maybe I needed the exact number of words represented. I even chose the name of someone in the room (so the pattern was, "Name,", with the triggered command being just, "Ally Name"...no wildcards at all, and it simply refused to accept that "Name," was showing up, even though it was right there in blue and black. I was thinking it might possibly be an ANSI problem of some sort, so I turned ANSI off entirely, and it still didn't work. I'm desperate for help, so if you have any ideas, please tell me. Thank you.
~ZMud Noob |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Thu Mar 20, 2003 6:32 am |
Show a sample of real mud output?
From what you wrote I'd suggest, would be able to make it better with real mud out put:
#ALIAS WHOHERE {#SEND {Who Here};#T+ CaptureWhoHere}
#TRIGGER CaptureWhoHere {^(*), (*).} {#VAR VarWhoHere %replace(%concat(%1,", ",%2),", ","|");#T- CaptureWhoHere;#FORALL @VarWhoHere {#IF (%ismember(%lower(%i),%lower(@AllyList))) {ally %i} {#NOOP Not to get Ally}}}
Idea is to target that entire "who here" list, make a string list from it, process the string list and those being members of your Ally list, ally them.
Ton Diening |
|
|
|
Turantula Newbie
Joined: 20 Mar 2003 Posts: 4 Location: USA
|
Posted: Thu Mar 20, 2003 6:47 am |
Here is the text Taken from the MUD when I did a WHO HERE:
2224h, 2848m ex-who here
(this is the prompt, where I typed in the "who here")
You see the following people here:
Kariana, Cahir, Volaris
(there happened to be three people in the room, including me)
2224h, 2848m ex-
As for that code, I'm not sure what most of it meant, but when I copied and pasted it into the command line, it didn't seem to do anything. No class was created, no trigger was created, and I'm not sure if I did it right or not...Please assume I know NOTHING. You won't be far off.
~~E. T. |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Thu Mar 20, 2003 7:02 am |
Delete the old stuff:
#UNALIAS WHOHERE
#UNTRIGGER CaptureWhoHere {^(*), (*).}
And try this:
#ALIAS WHOHERE {#SEND {Who Here};#T+ CaptureWhoHere} AllyCapture
#TRIGGER CaptureWhoHere {^You see the following people here~:$(*)$} {#VAR VarWhoHere %replace("%1",", ","|");#T- CaptureWhoHere;#FORALL @VarWhoHere {#IF (%ismember(%lower(%i),%lower(@AllyList))) {ally %i} {#NOOP Not to get Ally}}} AllyCapture
Ton Diening |
|
|
|
Turantula Newbie
Joined: 20 Mar 2003 Posts: 4 Location: USA
|
Posted: Thu Mar 20, 2003 7:42 am |
Thank you SOOOOO much, Tom. It's working, even if I have no idea *how* it's working. I want to know, but until I'm able to piece out the commands and what they mean I guess I'll just have to burn with curiosity. I only made minor changes (copied a line and changed allylist to enemylist and changed ally person to enemy person) so that it handles both lists, and I added in commands to unally all and unenemy all at the *beginning* of the whohere alias. That way, I have clear lists to start each time and won't risk running over when only two or three people being in the room.
Now if only I had a trigger/alias (something to be done quickly after that alias you gave me) to set another alias that would allow me to DIAG everyone on my list of allies. That would be MOST helpful. I'll post specifics tomorrow, as it is far past bedtime now. Or maybe, just maybe, I'll be able to figure something out on my own. I'll try that first before wasting everyone's time here. Thanks again, Tom.
~Eric T. |
|
|
|
Turantula Newbie
Joined: 20 Mar 2003 Posts: 4 Location: USA
|
Posted: Fri Mar 21, 2003 2:02 am |
Yaaaaaaaay! And stuff.
I was able to figure it out. Well, I was able to make it work anyway. I still don't understand how it works. But now I've got my flexible ally and enemy list, and fullheal queues. Thanks again!!
~Eric T. |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|