Thread: ≈ Auto Loot Possible?
View Single Post
Old 26.10.2005, 16:02   #11
montejo1974
Архивный участник
 
Join Date: Aug 2005
Posts: 42
Default

Yes, here I can contribute....hehe
Well maybe something like this do what you want.

Note that I write that on the reply directly....so it has syntax errors for sure, and need some more work....its only an idea....If more people think is useful I'll write one correctly and test it for sharing




[php:1:739b74f1fb]<meta http-equiv="refresh" content="36000">
<?php

$ip = "localhost";
$port = "2009";
$conn = mssql_connect ("127.0.0.1", "user", "passwrod");
$db = mssql_select_db ("lin2world");
$sql = "select item_id from user_item where char_id=0 and ...";
$result=mssql_query($sql);
while($row=mssql_fetch_array($result)){
$com="54;".mssql_result($row, 0,0);
$mess = "Command: <font color=yellow> deleting not owned item ".mssql_result($result, 0,0)."</font>
";
$fp = fsockopen($ip, $port, $errno, $errstr);
if (!$fp)
{
$mess .= "Error: <font color=red>$errstr ($errno)</font>";
}
else
{
$out = str_replace(";", "\t", $com)."\r\n";
fwrite($fp, $out);
stream_set_timeout($fp, 2);
$answ = fgets($fp, 8);
if ($answ == 1 and strlen($answ) == 1)
{
//Do a list of the items to eliminate from the DB later
}
else
{
$mess .= "<font color=red>Error deleteing item_id".mssql_result($result, 0,0)."</font>";
}
fclose($fp);
}
}
}
echo $mess;
//Eliminate from the DB the items listed above
?>[/php:1:739b74f1fb]
montejo1974 is offline