I forgot it's not a good idea to require another plugin directly. But you can still share functions between them if you use them from another lua file used similar as a header file.
If you want to know how to use SQLite with lua and have Lua 5.1 installed on your PC there should be a luasql folder in the lua/5.1/clibs folder. Place the folder luasql with the sqlite3.dll into the main directory of MCServer. I attached an example (sqlite-test.lua) on how to use sqlite3. You can test it with SciTE included with Lua or some similar lua compiler.
There are some issues though. Such as crashing when reloading plugins and an issue with passing a table to Fetch to retrieve an entire row. It would be awesome if FakeTruth includes a wrapper for SQlite in API because the lua version lacks a lot of things like virtual tables and R*Tree implementation (The best way to do area indexing for a cuboid plugin!) And it's a hell of a lot faster then using ini files.
I've also included an example of how to make your plugin using SQLite. With a link containing the sqlite3.dll incase you dont' have it in your lua library.
Just download attached files (TestEconomy1,TestEconomy2 and economy_data_manipulation) and place them in the Plugins folder. Add TestEconomy1 and TestEconomy2 into settings. Put luasql folder into the main MCServer.
Basic use:
TestEconomy2 creates a new database and table that adds a default balance of 300 when a player joins. use /money command to check balance. The check balance function is in economy_data_manipulation
TestEconomy1 is a separate plugin. Does not require sqlite3.dll. But It does need to require economy_data_manipluation. with /addmoney you can add money to your balance and displays the new balance.
The whole point of this example is if another plugin does not use SQlite3 it can require economy_data_manipulation.lua and be able to alter the balance or manipulate the database created by TestEconomy1 without the need to rewrite code or use sqlite3.dll.
This was all tested. If you run into an Issue while testing this, tell me.
Oh and I recommend using SQLite Browser to easily view database files:
http://sqlitebrowser.sourceforge.net/
I suppose you can all do this Flatfile too if you don't use SQLite. Just read from an INI.
Soo....if this isn't what you want to do then I have no idea how you intend on making your plugin. Just trying to help you.
If you want to know how to use SQLite with lua and have Lua 5.1 installed on your PC there should be a luasql folder in the lua/5.1/clibs folder. Place the folder luasql with the sqlite3.dll into the main directory of MCServer. I attached an example (sqlite-test.lua) on how to use sqlite3. You can test it with SciTE included with Lua or some similar lua compiler.
There are some issues though. Such as crashing when reloading plugins and an issue with passing a table to Fetch to retrieve an entire row. It would be awesome if FakeTruth includes a wrapper for SQlite in API because the lua version lacks a lot of things like virtual tables and R*Tree implementation (The best way to do area indexing for a cuboid plugin!) And it's a hell of a lot faster then using ini files.
I've also included an example of how to make your plugin using SQLite. With a link containing the sqlite3.dll incase you dont' have it in your lua library.
Just download attached files (TestEconomy1,TestEconomy2 and economy_data_manipulation) and place them in the Plugins folder. Add TestEconomy1 and TestEconomy2 into settings. Put luasql folder into the main MCServer.
Basic use:
TestEconomy2 creates a new database and table that adds a default balance of 300 when a player joins. use /money command to check balance. The check balance function is in economy_data_manipulation
TestEconomy1 is a separate plugin. Does not require sqlite3.dll. But It does need to require economy_data_manipluation. with /addmoney you can add money to your balance and displays the new balance.
The whole point of this example is if another plugin does not use SQlite3 it can require economy_data_manipulation.lua and be able to alter the balance or manipulate the database created by TestEconomy1 without the need to rewrite code or use sqlite3.dll.
This was all tested. If you run into an Issue while testing this, tell me.
Oh and I recommend using SQLite Browser to easily view database files:
http://sqlitebrowser.sourceforge.net/
I suppose you can all do this Flatfile too if you don't use SQLite. Just read from an INI.
Soo....if this isn't what you want to do then I have no idea how you intend on making your plugin. Just trying to help you.