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
MinT_T
Newbie


Joined: 06 Jul 2002
Posts: 6

PostPosted: Thu Dec 19, 2002 11:23 pm   

Using databases
 
Ok, I'm kinda new to this database thing, and the if statements for zmud so bear with me :)

Umm, what I want to do is keep track of how many times I become better at a certain skill/spell. Everytime an increase in skill/spell message appears I want an update to a database thatll keep track of how many times its been updated since the last time I checked. So this would require some kind of deleting method everytime I check the updates.

Messages for improvement:
You have become better at rescue!
You learn from your mistakes, and your rescue skill improves.

Would it also be possible to keep track of the last time I checked the update ?
Reply with quote
iljhar
GURU


Joined: 10 Oct 2000
Posts: 1116
Location: USA

PostPosted: Fri Dec 20, 2002 8:20 am   
 
Just out of curiousity, why does this have to be in a database? This can be accomplished without the database:

#trigger {You have become better at rescue!|You learn from your mistakes, and your rescue skill improves.} {#add Counter 1}

#alias Check {#say The rescue skill has increased @Counter times since you last checked.;#var Counter 0}

Now, if you're trying to play with databases just because you want to learn, then that's a different story. I'll let someone else handle that part for now, heh.

Iljhar
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Fri Dec 20, 2002 9:30 am   
 
To expand the above to react to any better, use a record variable.

#TR {You have become better at (*)!} {#ADDKEY betters "%1" %eval(%db(@betters,"%1") + 1)}

#TR {You learn from your mistakes, and your (*) skill improves.} {#ADDKEY betters "%1" %eval(%db(@betters,"%1") + 1)}

#ALIAS check_better {#SHOW You have bettered the "%-1" skill %db(@betters,"%-1") times.; #DELKEY betters "%-1"}

#ALIAS check_all_betters {#LOOPDB @betters {#SHOW You have bettered the %key skill %val times.}; #VAR betters ""}

Troubadour
(Win 98, Pentium III, 550 MHz)
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