Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Thu May 07, 2009 11:06 pm   

[2.37] Reading a database list
 
I'm trying to make a script that tracks what mobs drop particular items and how many times that mob has dropped one. So I capture the mobs name, and the item which dropped on death. Everything is organized as the item being the record, the mob its key, and the number of times that mob dropped it being the value. All items dropped are then placed in the fragmenttypes variable. Here is my script

Code:

fragment=1
fragmentname=@firstword(%1)
dbfragmentname=%replace(%1," ",_)
dbmobdropped=%replace(@mobkilled," ",_)
#if (%db(@dbfragmentname,@dbmobdropped)) {#addkey @dbfragmentname @dbmobdropped (%db(@dbfragmentname,@dbmobdropped)+1)} {#addkey @dbfragmentname @dbmobdropped 1}
#additem fragmenttypes @dbfragmentname
//Trouble atm is getting %dbitems to work
//#FORA @fragmenttypes {#show %dbitems(%i)}


Everything works except using %dbitems in #fora @fragmenttypes {#show %dbitems(%i)}. It needs the variable to be declared like @variable, and using %concat(@,%i) won't work. Any ideas?
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Fri May 08, 2009 12:07 am   
 
Try writing it this way.

Code:
#FORALL @fragmenttypes {#show %dbitems(@{%i})}
Reply with quote
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Fri May 08, 2009 1:24 am   
 
you rock
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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