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
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sun Jul 14, 2002 5:05 am   

Stringlists and If statements
 
ok Since Im totaly out of my head here....
Is there a way to pull a single item from a stringlist in an If statement

#if (@heal=%1 or @heal=ALL) {Then} {Else}

It works OK If @heal contains just one item but not if its a stringlist

hope this is enough info for you guys to through around some fancy {([ :P Its prolly easy to figure out :P
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Sun Jul 14, 2002 7:03 am   
 
#IF (%numitems(@heal) > 1) {heal %item(@Heal,1)}

So if there are more than 1 item in the
list then heal the first one.

You can improve that concept by checking
to see if the tank is in that list, then
if people taking successive damage are in
that list. Sort of a triage by priority
concept.

#IF (%numitems(@heal) > 1) {#IF (%ismember(@Tank,@Heal)) {heal @Tank} {heal %item(@Heal,1)}}

Be wary of charmies, doppelgangers, tanks
with no valuable hitpoints, tanks which
have been rescued out etc.

Ton Diening
Providing untested answers that tend to be
more complicated than others.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Jul 14, 2002 4:06 pm   
 
To check if %1 is anywhere in the list
#IF (%ismember("%1",@heal) OR "@heal"="ALL") {then} {else}

LightBulb
Senior Member
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