Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
stormbr
Newbie


Joined: 10 Jan 2007
Posts: 2

PostPosted: 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
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: 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.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
stormbr
Newbie


Joined: 10 Jan 2007
Posts: 2

PostPosted: 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}
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: 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.
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net