|
Solaras Wanderer
Joined: 11 Mar 2002 Posts: 93
|
Posted: Tue May 31, 2005 4:02 am
%val position in a database variable |
Is it possible to create a database variable with a value that would look like
Database Record Name: HealCentral
Key Name: Affliction
Value: 0|1|0|0|0
Then each position would correlate to an affliction and be changed to signify you have the affliction or not.
i.e:
You are stupid
#addkey HealCentral Affliction.(%val.2) 1
You are no longer stupid
#addkey HealCentral Affliction.(%val.2) 0
Then the heal script would look like
#if (@HealCentral.Affliction(%val.2)) {CureStupid}
I tried it this way, and it doesn't seem to work, so I don't know if it is even possible to work |
|
|
|
Solaras Wanderer
Joined: 11 Mar 2002 Posts: 93
|
Posted: Tue May 31, 2005 4:27 am |
Ok I figured out the replace part
Code: |
#VARIABLE HealCentral.Affliction %replaceitem( 1, 2, @HealCentral.Affliction)
|
I can't figure out though how to do the #if portion though. So if someone could help with that I would greatly appreciate it.
My latest failed attempt was to try
Code: |
#IF (%db( @HealCentral.Affliction, %val.2)) {#say Test worked}
|
|
|
|
|
Solaras Wanderer
Joined: 11 Mar 2002 Posts: 93
|
Posted: Tue May 31, 2005 4:37 am |
Ok ok.. so after asking.. and fiddling and scouring the helps for related functions I think I solved the problem.
Code: |
#IF (%item( @HealCentral.Affliction, 2)) {#SAY This worked!} {#SAY This didn't work!}
|
|
|
|
|
|
|