|
stormbr Newbie
Joined: 10 Jan 2007 Posts: 2
|
Posted: Wed Jan 10, 2007 9:01 pm
In string function? |
Hi
Im trying to find some way to simulate the 'in string' function like in vb
Im making a trigger to calculate damage done in battle.
This is an example message
Arkane's slash maims a bulette's protective shell! [ mostly dead ]
So id like to make a trigger as simple as possible, something like
Arkane's*
then a function to determine if {mauls|hurts|scratches} is contained in the *, and calculate from there |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Wed Jan 10, 2007 9:42 pm |
The simpler the trigger, the more often it'll fire and the more times the script will run, which will make your processing slower. If you still want to do it that way, though, you can use %replace to change the spaces in the line to pipes | and use %ismember to find the match. You could also just use ({mauls|hurts|scratches}) in the trigger pattern, though.
|
|
|
|
stormbr Newbie
Joined: 10 Jan 2007 Posts: 2
|
Posted: Wed Jan 10, 2007 9:55 pm |
i was wondering how to do it using ({mauls|hurts|scratches}) . i dont know how to select a case from there.
say, a trigger like
Arkane's* {mauls|hurts|scratches} a*
how would i code the value to
#if (xxx = mauls) {do this}
#if (xxx = hurts) {do this} |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Wed Jan 10, 2007 10:03 pm |
example one
#TRIGGER {Arkane's* ({mauls|hurts|scratches})} {
#IF (%1="mauls") {do this}
#IF (%1="hurts") {do this}
}
Also the string manipulation functions in zmud are alot better then the default string manipulations in VB, I would suggest reading the function refrence help file most of them have examples. |
|
|
|
|
|