|
Solaras Wanderer
Joined: 11 Mar 2002 Posts: 93
|
Posted: 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 |
|
|
|
DeReP Adept
Joined: 14 Jun 2003 Posts: 222 Location: Chile
|
Posted: 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. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: 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 |
|
|
|
|
|