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


Joined: 27 Jun 2001
Posts: 82

PostPosted: Fri Sep 20, 2002 1:49 am   

A kill counter?
 
I want to keep a record of all the mobs I kill, and how many I kill of each one. So, increment a counter if I have killed a mob of that type before, or create one if I haven't.

I've tried to get this to work, but I am not sure how to get the database set up, or how to add entries to it.

The syntax I get when I kill a mob is - "You have killed Orc!".

Another problem I have is: sometimes my MUD sends a > character before a line.. so I need to filter out all the >'s before I add them to the database.

Also, I'm looking for a quick way to check to see how many of a mob I've killed with the quickmenu. That'd be great!
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Fri Sep 20, 2002 6:34 am   
 
The quick and dirty method would be to use a record variable, although in the long term you will benefit by setting up a database.

#TR {You have killed (*)!} {#ADDKEY mobkills "%1" %eval(%db(@mobkills,"%1")+1)}

Since the pattern isn't anchored at its beginning, the existence of extraneous ">"s won't impede the trigger.

To check how many of a mob you've killed. You can use this quickmenu:

#MENU {Mob Count} {#ECHO You have killed %db(@mobkills,%selected) %selected~.}

Highlight the short name of the mob then right-click to open the quickmenu.

Troubadour
(Win 98, Pentium III, 550 MHz)
Reply with quote
undergod
Wanderer


Joined: 27 Jun 2001
Posts: 82

PostPosted: Sun Sep 22, 2002 3:04 am   
 
Okay... one last question. I've tried to do it, and I can't get it to work. (everything else works perfectly, by the way, thanks!)

How can I loop through the database and just list all the mobs I've killed with the number I've killed right beside it?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Sep 22, 2002 3:38 am   
 
#LOOPDB @mobkills {#SHOW %key%val}
Reply with quote
DaraisDarkwave
Beginner


Joined: 09 Nov 2007
Posts: 28
Location: Fairbanks, Alaska

PostPosted: Wed Nov 28, 2007 12:19 am   
 
Is there a way to get this stuff to show up in like a Status Window?
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