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


Joined: 20 May 2005
Posts: 2
Location: Sioux City, IA

PostPosted: Thu Dec 24, 2009 6:02 am   

DB addition/modification
 
Greetings,

I am trying to get it so that I can record sales of one of my shops on a MUD. The output of the sales log triggers it, but evidently my script text is very very wrong.

Example MUD output:
Quote:
Bendetto -> yellow potion of cure critical wounds : 1(50) (Sun Nov 22 22:38:21 2009)


Trigger:
Code:
* -> &sitem ~: &%dsqty~(&%dstotal~) *


Script Text:
Code:
#GAG
#MATH sprice @stotal/@sqty
#show ~( @sqty x @sprice ~) @sitem
#DBLOAD sales
#DBFIRST;#WHILE (!%null(%rec)) {#SHOW &Name;#DBNEXT}
#DBSAVE sales
#DBCLOSE sales


I'm only tryino get the DB opened and recognized properly. Which this trigger already, I have caused an error within cMUD to generate an error report. Not sure why, but I sent it anyway.

Regardless, my original intention is that I compare to any existing data in the DB that has the same item and price, and if there is one there increase the quantity (qty) by the qty mentioned in the trigger. If no such item and price combo is found, create a new one to record those sales at that price.

This allows me to track what sells and and what price to help me determine the best price to sell specific items.

Any help you can give me, the appreciation is the same.

Thanks,
Kevin 'Demortes' Dethlefs-Moreno
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Dec 24, 2009 7:51 am   
 
The DB module window has to be open. If it's not, this could be what's generating the error.
_________________
EDIT: I didn't like my old signature
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