Hi all,
I am wanting to match a players name and see if that player is in my 'players' table. I can do this so far with a simple if statement:
So if 'Garrion' tells me something it will check the name 'garrion' is valid in the players table (eg. players.garrion).
But I am finding that there are way to many variables to try to match with my trigger so it only works some of the time.
The trigger and example text that sends to this function is below:
These are just a few of the possible matches.
So with the above example my wildcard could be:
the ghost of garrion d'chaser
garrion d'chaser
garrion
My thinking was to somehow do a string.find on my wildcard to see if any of the words are in my table. Is this even possible and if so could someone point me in the right dirrection please?
Thanks,
Garrion.
I am wanting to match a players name and see if that player is in my 'players' table. I can do this so far with a simple if statement:
Char_Name = string.lower(wildcards[1])
if players [Char_Name] then
So if 'Garrion' tells me something it will check the name 'garrion' is valid in the players table (eg. players.garrion).
But I am finding that there are way to many variables to try to match with my trigger so it only works some of the time.
The trigger and example text that sends to this function is below:
<trigger
enabled="y"
match="^(.*) (tells|asks|chats|exclaims )(.*)(to you|you|and you)(\:)(.*)"
name="tell_hit"
script="pshow"
regexp="y"
send_to="12"
sequence="100"
>
</trigger>
The ghost of Garrion D'Chaser tells you: blah blah
Garrion D'Chaser tells you: blah blah
Garrion tells you: blah blah -- matches table
These are just a few of the possible matches.
So with the above example my wildcard could be:
the ghost of garrion d'chaser
garrion d'chaser
garrion
My thinking was to somehow do a string.find on my wildcard to see if any of the words are in my table. Is this even possible and if so could someone point me in the right dirrection please?
Thanks,
Garrion.