|
Droid Novice
Joined: 28 Aug 2003 Posts: 49
|
Posted: Tue Sep 23, 2003 8:16 pm
Shouldnt this work perfectly!?!? |
Hi,i got a trigger such like:
#trigger {Someone tells you '%1'} {#if ('%1'='*hello*') {say hello}}
Shouldnt trigger say hello whenever someone tells me hello between other things? |
|
|
|
Talahaski Enchanter
Joined: 10 Oct 2000 Posts: 656 Location: USA
|
Posted: Tue Sep 23, 2003 8:39 pm |
What does the text the mud sends you look like. does it include the single quote around the message?
try this:
#trigger {Someone tells you ~'(*)~'} {#if ("%1"=hello) {say hello}}
Hmm, I may not be fully understanding what you are trying to do. What do you mean by
Shouldnt trigger say hello whenever someone tells me hello between other things?
Give examples of what you would see from the mud.
I think the below trigger is what you really want
#trigger {Someone tells you*hello} {say hello} |
|
|
|
Droid Novice
Joined: 28 Aug 2003 Posts: 49
|
Posted: Tue Sep 23, 2003 9:02 pm |
ok,actually,I want to use this this way:
I got a variable,which contains the text which was told to me:
@words
with trigger #tr {Someone tells you '(*)'} {#var words %1}
then,i analyze it (some later) and id like my script to be able to do things depending on which words did the text contain.
So,if @words contains word Snake between al of them,id like to get an if something like...
#if (@words="*snake*") {say I hate snakes}
Did i explan myself better? :| |
|
|
|
Talahaski Enchanter
Joined: 10 Oct 2000 Posts: 656 Location: USA
|
Posted: Tue Sep 23, 2003 9:26 pm |
Ok, I understand now.
What happens if the person says two things at once.
Someone say 'Hello Mr, did you see that snake!'
Both Hello and Snake
Anyway, here is what I would do. I would create a variable string list of all the keywords you want to trigger off of.
So words would contain
Hello
Snake
...
Then create your trigger like so.
#trigger {Someone tells you*(@words)} {#if (%lower(%1)='snake') {say I hate snakes!} {#if (%lower(%1)='hello') {say Hello}}
I think there are a number of methods of doing this. Some people would just create many individual triggers for each work you want to key on, but that might give problems if they hit more than 1 word. Notice the %lower is used in case the person says Hello, instead of hello. |
|
|
|
Droid Novice
Joined: 28 Aug 2003 Posts: 49
|
Posted: Tue Sep 23, 2003 11:03 pm |
Ok,ill ask for only the thing which gives me problems,not the full script =|
Lets say I got this: @words="A big Snake Bag"
I want to get an #if clause so,if on @words variable,there is the word snake,do something.
I thought about #if (@words="*snake*") {#echo Works!}
but doesnt work.
Sorry for my english,hard to me to explain it well,though im spanish. |
|
|
|
user0101 Apprentice
Joined: 01 Aug 2003 Posts: 100 Location: USA
|
Posted: Wed Sep 24, 2003 1:24 am |
#TRIGGER {Someone tells you '(*)'} {#if (@words=~ "snake") {#echo Works!}}
And/Or..
#TRIGGER {Someone tells you '(*)'} {#if (%1=~ "hello") {say hello}} |
|
|
|
Droid Novice
Joined: 28 Aug 2003 Posts: 49
|
Posted: Wed Sep 24, 2003 1:30 am |
W-O-W thats exactly what I was searching, Thankyou,and,thank you Talahaski too for your help =)
|
|
|
|
|
|