|
Drakmorden Novice
Joined: 14 Dec 2000 Posts: 34 Location: USA
|
Posted: Fri Jun 07, 2002 11:14 pm
Wildcard matching |
Ok, I now know I am trigger stupid.
For the trigger I am trying to make, I want it to match name strings. However, names can be changed as the player wishes.
For example: Jub'ae the wanderer
could change to: master Jub'ae of the wilderness
or <<<<-=Jub'ae=->>>>
in a matter of moments.. How can I match that so that the name "Jub'ae" is what I am triggering off of?
Drakmorden
|
|
|
|
iljhar GURU
Joined: 10 Oct 2000 Posts: 1116 Location: USA
|
Posted: Fri Jun 07, 2002 11:41 pm |
You can't just create the trigger Jub'ae? #trigger {Jub'ae} {blah}?
Iljhar |
|
|
|
Drakmorden Novice
Joined: 14 Dec 2000 Posts: 34 Location: USA
|
Posted: Fri Jun 07, 2002 11:44 pm |
If I do that.. every time I recieve a tell, see a global, if anyone even says Jub'ae or anything of the like... I am going to have my trigger going off... I jsut need to know how to match a changable name. I plan to incorporate it with an enemy list and set individial triggers for when tehy arrive, are in the room, portal in etc...
Drakmorden.
|
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Sat Jun 08, 2002 12:54 am |
Try and find things that indicate a person then.
ie:
(%*) enters from the west.$
(%*) joins the game.$
(%*) is standing here.$
it'll never stop someone who can change their name to
Master fool not Jub'ae the wanderer
TonDiening
Beta Upgrading to 6.26 |
|
|
|
horks Apprentice
Joined: 20 Jul 2001 Posts: 127 Location: USA
|
Posted: Sat Jun 08, 2002 1:55 am |
The mud I play on, has this same problem. And it stinks. I haven't tried to screw with it, because I don't care enough to, but you'd need something like this:
#TRIG {^(*){@enemies}(*)$} {#IF (%1 <does not contain> tell) {blah}}
I don't know what function you'd use to check if %1 contains a word (sorry). Maybe someone else does?
you can then replace "tell" with a list of words that begin tells/shouts/chatlines/whatever else may start a line that you would not want to trigger.
If no one else can come up with a way to find if a wildcard contains a word, here's a horrible work around.
#TRIG {^(*){@enemies}(*)$} {#VAR pretitle %replace(%1 , " ", "|";#IF !%ismember(@chatwords, @pretitle) {blah}}
where pretitles == words before the name and
chatwords == words that you do not want to match (i.e. tells,shouts,etc)
On the mud I play on, players have control of thier enter/exit emotes to. and the only rule is, thier name has to be the first word, and the exit has to be the last word. example:
Horks leaves west.
Horks bounces west.
Horks sees some money to the west.
All of these are possible exits. Enterances only need the players name in the front. Example:
Horks enters the room.
Horks feels you up the dashes to the corner.
Horks isn't feeling so hot today.
Are all possible enterance emotes. Because of this, it is not any easier to determine if it's a person by thier enter/exit emotes.
I've wanted to do something like this for a long time, but never have. If somone could tell me how to better match the 'chatwords' i'd appreciate it. |
|
|
|
Drakmorden Novice
Joined: 14 Dec 2000 Posts: 34 Location: USA
|
Posted: Sat Jun 08, 2002 2:09 am |
Well, here is what I have so far...
#Trig { don't know what to put here (%w) is clueless has arrived} {#if %ismember( %lower( %1), @enemylist) {ff %1}}
Where enemy list is created with an alias of:
#alias {#var enemylist {@enemylist|%lower( %1)}}
and ff is an alias to fireball.
All I need help on is how to ignore the part of the enemy trigger recognition which is the 'don't know what to put here' and the 'is clueless' parts. If I run it with just the (%w) has arrived, and the person doesn't have an altered name it works like a well greased wheel.
Drakmorden.
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat Jun 08, 2002 9:45 am |
#TR {(%w) * arrived}
I chose "arrived" instead of "has arrived" so there would always be something for the wildcard.
LightBulb
Vague questions get vague answers |
|
|
|
Drakmorden Novice
Joined: 14 Dec 2000 Posts: 34 Location: USA
|
Posted: Sat Jun 08, 2002 4:53 pm |
Well, that sort of works....
But what I am getting is if:
little jub'ae nematode has arrived
It is setting the compare variable (%w) as little. I tried setting an * prior to the (%w) and then it is keying off of the nematode portion of the name.
Drakmorden. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat Jun 08, 2002 5:23 pm |
You will need to use the enemylist itself, rather than %w, as your wildcard. I know you complained earlier that this may result in the trigger firing when people merely talk about your enemies, in addition to when they actually appear on the scene. You'll have to decide for yourself if it's more important a) that the trigger fire whenever they are present, or b) not fire whenever they aren't. But there's no foolproof trigger that will absolutely prevent any possibility of a spoof.
You may have to experiment with the trigger to find the right number of {}'s to use around the variable.
#TR {({@enemylist}) * arrived}
LightBulb
Vague questions get vague answers |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Sun Jun 09, 2002 9:14 pm |
Another idea is to find a social that works for people and not objects.
Take the time loss hit when you first run into that enemy and auto probe with
that social. If the social works then fireball him and have that auto social triggers
turn off for awhile. After that have your combat scripts take over.
The idea of the social probe is to determine that you indeed have the enemy in your
grasp
TonDiening
Beta Upgrading to 6.26 |
|
|
|
HariKari Wanderer
Joined: 16 Feb 2001 Posts: 57
|
Posted: Mon Jun 10, 2002 9:36 am |
About the (%w) or ({@enemylist}) for the pattern...
It might be more efficient/faster to go with the (%w).
The variable list causes the triggers to be remade on the fly because zMUD does not know if the variable has been changed or not.
Hehe I figured that out when zMUD began to go really really slowly after I had a bunch of ({@}) blah ({@}) stuffs.
---
Oh yeah.. Need to stick in the IF check
#IF (%ismember(etc...
-HariKari |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Mon Jun 10, 2002 11:00 am |
In later versions of zMUD (current beta included), this will not be the case. For later version, Zugg has optimized stringlist patterns by having it create a hash table to look up possible matches. The trigger will take slightly longer to fire the first time because it has to create the table, but afterwards, it should be faster.
Kjata |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Jun 10, 2002 4:30 pm |
Besides which, Drakmorden already said that %w is unworkable, since he can't predict how many words will come before the name nor how many will come after it.
LightBulb
Vague questions get vague answers |
|
|
|
|
|