All pastes #221241 Raw Edit

Someone

public text v1 · immutable
#221241 ·published 2006-10-25 16:05 UTC
rendered paste body
#!/usr/bin/perl -w
 
 
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
use HTTP::Cookies;

$agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5';
$proxy = '';

$ua = LWP::UserAgent->new(keep_alive => 1, timeout => 300);
$ua->agent($agent);
$ua->cookie_jar(HTTP::Cookies->new(file => "lwpcookies.txt", autosave => 1));
$ua->proxy('http', $proxy) if ($proxy ne '');

$session = '113241e8364f';

$url_0 = "http://de669.beta.ogame.org/game/flotten1.php?session=".$session."";
$url_1 = "http://de669.beta.ogame.org/game/flotten2.php?session=".$session."";
$url_2 = "http://de669.beta.ogame.org/game/flotten3.php?session=".$session."";
$url_3 = "http://de669.beta.ogame.org/game/flottenversand.php?session=".$session."";

#TODO: GET/POST x3, $vars für vorhandene ress/fleet/session

$gt = 5;

#schritt 1
$req1_1 = HTTP::Request->new(GET => 'http://de669.beta.ogame.org/game/flotten1.php?session=113241e8364f');
$res1 = $ua->request($req1_1);
$content = $res1->as_string;

if ($content =~ /name=\"maxship203\" value=\"(.*)\"/igm) {
	
	$maxgt = $1;



$req1_2  =  POST 'http://de669.beta.ogame.org/game/flotten2.php?session=113241e8364f',  
[ maxship203 => $maxgt, consumption203 => 50,  speed203 => 15750,  capacity203 => 25000, ship203 => $gt];
print $ua->request($req1_2)->as_string;

$content = $res1->as_string;

if ($content =~ /<td align=\"center\" width=\"85\"><i><b><font color=\"#ffffff\">Metal<\/font><\/b><\/i><\/td>
     <td align=\"center\" width=\"85\"><i><b><font color=\"#ffffff\">Crystal<\/font><\/b><\/i><\/td>
     <td align=\"center\" width=\"85\"><i><b><font color=\"#ffffff\">Deuterium<\/font><\/b><\/i><\/td>
     <td align=\"center\" width=\"85\"><i><b><font color=\"#ffffff\">Energy<\/font><\/b><\/i><\/td>
     <td align=\"center\"><i><b>&nbsp;&nbsp;<\/b><\/i><\/td>
    <\/tr>
    <tr>
     <td align=\"center\"><\/td>
     <td align=\"center\" width=\"85\">(.*)<\/td>
     <td align=\"center\" width=\"85\">(.*)<\/td>
     <td align=\"center\" width=\"85\">(.*)<\/td>/igm) {

	$met = $1;
	$kris = $3;
	$deut = $3;

$req2_2  =  POST 'http://de669.beta.ogame.org/game/flotten3.php?session=113241e8364f',  
[ thisgalaxy => 5,  thissystem => 234,  thisplanet => 5,  thisplanettype => 1,  speedfactor => 5,  thisresource1 => $met,  thisresource2 => $kris,  thisresource3 => $deut, maxship203 => $maxgt, consumption203 => 50,  speed203 => 15750,  capacity203 => 25000, ship203 => $gt, galaxy => 6,  system => 211,  planet => 4,  planettype => 1,  speed => 10 ];
print $ua->request($req2_2)->as_string;

$content = $res1->as_string;


my $req3  =  POST 'http://de669.beta.ogame.org/game/flottenversand.php?session=113241e8364f',  
[ order => 4, thisgalaxy => 5,  thissystem => 234,  thisplanet => 5,  thisplanettype => 1,  speedfactor => 5,  thisresource1 => $met,  thisresource2 => $kris,  thisresource3 => $deut, maxship203 => $maxgt, consumption203 => 50,  speed203 => 15750,  capacity203 => 25000, ship203 => $gt, galaxy => 6,  system => 211,  planet => 4,  planettype => 1,  speed => 10 ];
print $ua->request($req3)->as_string;

}
}