demortes Newbie
Joined: 20 May 2005 Posts: 2 Location: Sioux City, IA
|
Posted: 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 |
|