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
Solaras
Wanderer


Joined: 11 Mar 2002
Posts: 93

PostPosted: Tue May 10, 2005 3:41 am   

%numitems and Database Variables
 
I have a database variable for my afflictions. The Value is either 1 or 0 for each affliction depending on if I have the affliction or not.

What I am trying to do is an alias that will count how many of the afflictions = 1 and if more than 3 then use my cure anything skill.

I tried:

#IF (@Afflictions.random or (%numitems( %db( @Afflictions)) > 3)) {curerandom}


That doesn't work though.


Last edited by Solaras on Tue May 10, 2005 6:36 am; edited 1 time in total
Reply with quote
DeReP
Adept


Joined: 14 Jun 2003
Posts: 222
Location: Chile

PostPosted: Tue May 10, 2005 4:10 am   
 
Maybe something like this,
#ALIAS Check {#VAR affs "";#LOOPDB @Afflictions {#IF (%val) {#VAR Affs +1}};#IF (@affs>3) {curerandom}}

I'm sure there must be another tidier way to do it, and I havent even tested this one.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Tue May 10, 2005 9:52 am   
 
Assuming your keys are words with no digits you could do this.
%eval(%subregex(%expanddb(@Afflictions,"","+"),"\a+",""))
_________________
The only good questions are the ones we have never answered before.
Search the Forums
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