Can i use SQLite in a mod ?

User avatar
aldobr
Member
 
Posts: 316
Joined: Sun Nov 25, 2012 05:46

Can i use SQLite in a mod ?

by aldobr » Tue Dec 18, 2012 14:54

Can i use SQLite in a mod ?

It would simplify a lot my mod (Mint & Automatic Selling Machine),

because i need to calculate the stack exchange prices of all items, so i need a log of all transactions.
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Tue Dec 18, 2012 17:06

You can create your own format annd save/load using Lua's I/O routines.
If you really intend to use SQLite, you may be able to load a native lib wrapper, but that requires a bit more work, and users must compile the library for their particular system. This is how my IRC mod (look at my sig) works.
Last edited by kaeza on Tue Dec 18, 2012 17:12, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
aldobr
Member
 
Posts: 316
Joined: Sun Nov 25, 2012 05:46

by aldobr » Thu Dec 20, 2012 22:33

I believe lua:io wont cut.

Thats because everytime a player uses a machine, a log entry should be added to a database.

Then it should (once a day) sum all sells/buts per item kind.

then write the result to another table.

in order to build a monthly graph (png) of the medium sell/buy price of items.

I believe thats too heavy for lua. You can do that efficiently using sqlite3. Thats why i want to use lua:sqlite3...
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 9 guests