Databases.

by Thorgal

Back to Mechanic's Corner.

Unknown2008-09-16 20:20:16
I'd offer some help, but I abhor anything with the letters V and B together like that. Lua > VB. (And, I don't think you get to "bumpsauce" a thread after only 14 hours, especially one you necro'd...)
Unknown2008-09-16 21:41:11
Who cares that I bumped, I need help tongue.gif

Do I need to use scripting for this? I mean I can switch over and use lua for this, but it'd just be an inconvience. Where do I start?
Unknown2008-09-17 02:04:20
I'd say that you need to use scripting, unless you want to split your "database" up into lots off variables. However, it would probably go a long way towards getting help if you gave specifics of what you're trying to do and why.
Unknown2008-09-17 04:09:59
Not sure how I wasn't specific O_O Example:

Joe went to the store and bought 45(variable) foxes.

The number is different every time for what I want to capture. Each time the trigger fires, I want to save the variable as its own specific bit of data and add it to a database. Later, I want to be able to retrieve each entry and be able to display it so I can analze the data. How can I do this using arrays in lua? Or whatever is most efficient?
Unknown2008-09-17 11:07:29
For complex data, I build Lua tables that hold what I want. Then, if it's something I want to be persistent between sessions, I serialize the Lua tables into MUSHclient variables (as strings). Nick explains how to do all that in this thread on his forums. That's as good a place as any to start.

(And, I know you said "forging data," but you didn't specify whether you wanted to store stats of every item you forge or just averages, min/max, etc. Anyway, start with that thread to get the idea and hack together something that sorta does whatever you need.)