PDA

View Full Version : Scripting with SQL


Andy0687
08-23-2006, 10:14 PM
Is it possible to allow scripts to interact with an external SQL Server?
I saw Maniaman had made a script to send stuff to an IRC bot which forwarded it to his server, but I also want to forward the data from the webserver BACK to graal.

Also is it possible to detect what world a player is logged on by player.world or something?

And the playerlist, a lot like on Login when you press F7 you see no one online, even if someone is logged online there. (Maybe I timed it wrong or no one actually was online?) Id like to know if there is a way to disable the default playerlist.

If none of these are possible, please move this to future improvements as I can only post once per 8 hours, and would like to suggest they be implimented.

Rapidwolve
08-24-2006, 04:35 AM
I think this has been disabled...

not sure though

Andy0687
08-24-2006, 06:14 PM
I think this has been disabled...

not sure though


I am not aware of interfacing with SQL ever being enabled. I wouldnt have asked if I didnt need it for something.

I just need to be able to get data back from my SQL server and start using it IN the script. I also wanted to be able to indentify what world the player was on (There has to be a way to do it, since the global playerlist identifies what world they are on?).

Oh well can anyone else chime in with some comments? Maybe stefan will notice this thread eventually.

Tolnaftate2004
08-24-2006, 06:41 PM
You could requesturl() a php/asp/perl/whatever script that retrieves the necessary information.

e:
I think a bit of clarifying is in order.

I mean something like this:

temp.req = requesturl("http://myurl.com/myscript.php?account=Tolnaftate2004");


myscript.php:

<?php
$host = "localhost";
$user = "joe";
$pass = "mypass";

foreach ($_GET as $index => $val)
$$index = $val;

$conn = mysql_connect($host , $user , $pass);
mysql_select_db('mydb' , $conn);

$res = mysql_query("SELECT * FROM `mytable` WHERE account=$account",$conn);

// print the results in a fashion that can be easily translated into GScript
...
?>


Private data can be encrypted using GScript's md5() function.