в рулетку скрипт у меня проигрывает пока
ломалку транспорта запускаю ккроном раз в 3 мин сам беру лодку
скрипт для крона пришлось переделать
<?
error_reporting(0);
set_time_limit(0);
ignore_user_abort(0);
//////////////////////////////////////////////////////////
$login='login';
$password='password';
$step="right"; // направление первого шага right право left лево
/////////////////////////////////////////////////////////
function login($url){
global $login,$password;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_HEADER,1);
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS,"login=$login&pass=$password");
curl_setopt($ch, CURLOPT_COOKIEJAR, "cook");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cook");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT,100);
$result = curl_exec ($ch);
curl_close($ch);
}
//////////////////////////////////////////////////////////
function download_pretending($url) {
$url=parse_url($url);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://$url[host]$url[path]");
curl_setopt($ch, CURLOPT_HEADER,1);
curl_setopt($ch, CURLOPT_REFERER, "http://$url[host]$url[path]");
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS,"$url[query]");
curl_setopt($ch, CURLOPT_COOKIEJAR, "cook");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cook");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT,100);
$result = curl_exec ($ch);
curl_close ($ch);
return $result;
}
//////////////////////////////////////////////////////////
$f=fopen("datem","w");
fputs($f,$step);
fclose($f);
login("
http://www.ganjawars.ru/login.php");
if("right"==file_get_contents("datem"))
{
download_pretending("
http://www.ganjawars.ru/map.move.php?moveright=1");
$f=fopen("datem","w");
fputs($f,"right");
fclose($f);
}
if("left"==file_get_contents("datem"))
{
download_pretending("
http://www.ganjawars.ru/map.move.php?moveleft=1");
$f=fopen("datem","w");
fputs($f,"left");
fclose($f);
}
?>