• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

MQ2SQL

Joined
Sep 19, 2010
RedCents
110¢
Rich (BB code):
/sqlconnect [ini <iniApp>] [<user> <password> <database>] [host <host address> <user> <password> <database>]

/sqlcreate <db name|table name [field1 field2 ...]>

/sqldelete <db|table> name

/sql <select [table_reference tbl_name [WHERE where_definition]]|saveset [set_name table_reference tbl_name [WHERE where_definition]]|deleteset [set_name],addfield [field1, (field1 field2), ...]|delete [tbl_name (field=name, field>#)]|update [tbl_name field1=oldValue field1=newValue]|insert[field=value, (field=value field2=value2), ...]|usedb [database]|changeuser [user] [password]>

/sqllist <db|table|field tbl_name>

/sqlquery QUERY;

$sqlresult(set_name,column,row)


Simple little macro i wrote to test it over and over... yes it works very well and maybe someone can write a good macro for it... i know this one is sloppy... but after 4 months of working with sql... give me a break...

**These are just examples... this plugin should be able to do almost anything you want...
Rich (BB code):
Sub Main
/Call DoSQLCONNECT
/Call DoSQLCREATE
/Call DoSQLINSERT
/Call DoSQLLIST
/call CheckQuery
/call DoSQLREMOVE
/call DoSQLDELETE
/return

Sub DoSQLCONNECT
/sqlconnect host 127.0.0.1 USERNAME PASSWORD DBNAME
/return

Sub DoSQLCREATE
/sqlcreate db Zaped
/sql usedb Zaped
/sqlcreate table Zones ZoneID Safe
/return

Sub DoSQLINSERT
/sql insert Zones ZoneID='${Zone.ID}' Safe='TRUE'
/return

Sub DoSQLLIST
/sqllist table
/return

Sub CheckQuery
/sqlquery query ZoneCheck SELECT Safe FROM Zones WHERE ZoneID='${Zone.ID}'
/if (${sqlresult[ZoneCheck 0 0]}) {
/echo Its safe to play here! go ahead!!!
/return
}
/if (${sqlresult[ZoneCheck 0 0].Equal[FALSE]}) {
/echo Its Unsafe to play here... run away!!!
/return
}
/echo Nope nothing found... find a new zone to play in..
/return

Sub DoSQLREMOVE
/sql delete Zones ZonesID='${Zone.ID}'
/return

Sub DoSQLDELETE
/sqldelete table Zones
/sqldelete db Zaped
/return

Will work on it more... i tested it pretty theroly so shouldn't crash...

View attachment MQ2SQL.dll
 
Not part of the Redguide's compile... untill i get one of the admins to add it.. but the link i showed you is the basic idea of it... testing it on a non-developer computer to double check its working right now... so feel free to tell me if you find any bugs...
 
I think we will be adding this in for users to use..its a good idea to have stuff like this around!

Good job dencelle
 
Any chance of getting a compiled version of the MQ2Sql plugin?
Knightly has written MQ2SQLite (and my entire set up depends on this plugin). MQ2SQLite is included in very vanilla. Not sure if that satisfies your needs or not.
 
The challenge is I have a significant amount of time sunk into my EQ integration with a MySql database. To convert everything over to SQLite would required several days to create all the schema, migrate the data, implement the trigger (if possible) and then re-implement the queries, updates, and reports. That said, I think EqMule can help me out by provide a new compile of the plugin.
 
That plugin was originally written for MySQL 4 and I don't think it was ever updated beyond some minor fixes for 5.1.

If you want to convert your database, it's pretty easy:
https://github.com/dumblob/mysql2sqlite

But I can understand not wanting to do so if you're not comfortable updating your queries or are using specific functionality of MySQL.

If you want to try to get the plugin working, you probably want to do it through the builder at macroquest2.com. But looking at the code for that plugin, if you were to do it today, I would recommend just starting from scratch with either the MySQL or Mariadb connector for C++.
 
MQ2SQL

Users who are viewing this thread

Back
Top
Cart