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 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
Reply with quote
Solaras
Wanderer


Joined: 11 Mar 2002
Posts: 93

PostPosted: 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}
Reply with quote
Solaras
Wanderer


Joined: 11 Mar 2002
Posts: 93

PostPosted: 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!}
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