Log in

View Full Version : Database Queries Through Quest Scripts?


Hateborne
08-16-2012, 09:12 PM
Evening ladies/gents, I have a small question that will undoubtedly be annoying.

I am curious if there is any effective way to handle SQL updates/selects/deletes through the quest scripting system. I understand that the quest system is Perl, and I can do basic things through Perl & PHP. I am trying to find a more reliable way to handle instances than with qglobals. Is there a way to make qglobals more efficient or is there some secret to allowing an NPC(s) to allow SQL queries in the quest scripts?

-Hate

Tabasco
08-16-2012, 10:42 PM
You can use the DBI module to access the database from perl. If memory serves there's a spawn plugin that uses it, just grep DBI in your quests/plugins directory for an example.

As for the purpose you've described, I'm not exactly sure what you mean by 'efficient'. Qglobals aren't inefficient and I don't see what you'll gain by using DBI in their stead. The only time I've ever had to step outside qglobals was for a special case with script-driven pets. If you're just managing instances with NPC's, the existing tools are more than enough.

Caryatis
08-16-2012, 10:44 PM
Seriously Dude? Its still on the first page... (http://eqemulator.org/forums/showthread.php?t=35216)

nenelan
08-17-2012, 06:06 AM
+1 for Caryatis, learned so much from your post, thanks again mate for your useful, insightful and helpful comment, as always!

nenelan
08-17-2012, 06:18 AM
The link that Caryatis is referring to is http://www.eqemulator.org/forums/showthread.php?t=35216, which through the title, unless you knew what DBI was, you'd not know to look for it.

Also, in your plugins folder is GetSpawn2IDs.pl which is what Tabasco is referring to if you want to look at an example on how to use it.

But, Qglobals seems to be the way to go, they work for what they are needed for, I wouldn't mess with DBI unless it was absolutely necessary.

Good luck.

Caryatis
08-17-2012, 09:16 AM
Now had you taken the time to actually look at who posted that thread I linked, you might notice its the OP here. So while I wouldn't expect somebody as inbred as you to notice something like that, I would assume Hateborne should remember.