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
Risca
Beginner


Joined: 19 Nov 2003
Posts: 16
Location: USA

PostPosted: Mon Jun 11, 2007 2:20 am   

Using Information from Databases
 
I decided to make a new topic as what I'm asking seems to be fairly complicated from my perspective. I play on an IRE game (Achaea, Imperian, etc.) if that helps any.

I want to be able to restock my shop easier by typing 'wares' where it displays the information below.

Shop Output

satchel49889: a sunny yellow hunter's satchel 2 400gp
socks152560: a pair of sky blue socks 2 400gp
blanket194902: a soft blanket of forest green 1 700gp

Since the blanket has only 1 item, I want to be able to take that information and put it into a variable that will tell me to 'sew pattern249343' because pattern249343 is the pattern for the blanket. This probably means I have to already have a variable that has a list of all my pattern items.


"pattern10234" a pattern for a sunny yellow hunter's satchel
"pattern118104" a pattern for a pair of sky blue socks
"pattern249343" a pattern for a soft blanket of forest green

After sewing the pattern, I have to price the item but the item has its own unique item number again like the example below.

"blanket3124" a soft blanket of forest green

To price this blanket at 700, I have to use the command 'price blanket3124 700.' However, I also want to have a presaved variable of the price for each item as well. So another database variable that has 'a sunny yellow hunter's satchel' priced at 700.

I'm a little lost at where to even begin, let alone actually making it work so any help is appreciated. If there's a forum post I didn't see that's similar to what I want to do, then that will help too. Thanks again.
[/b]
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Mon Jun 11, 2007 3:10 pm   
 
Well, you could use a database variable with string lists as the values.

a sunny yellow hunter's satchel=pattern10234|400|2|2
a pair of sky blue socks=pattern118104|400|2|2
a soft blanket of forest green=pattern249343|700|1|2

This amounts to a database variable you can name it anything. Let's call it ShopDB.

Key=pattern|price|stock level|max stock level

So to get the pattern for "a sunny yellow hunter's satchel".

#show %item(%db(@ShopDB,"a sunny yellow hunter's satchel"),1)

I don't have time to look it up but there are several posts about string lists inside of database variables. One or two of them by me.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
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