
06.09.2006, 23:05
|
|
ветеран
Регистрация: 22.06.2004
Сообщений: 2,128
Провел на форуме: 5355463
Репутация:
2258
|
|
он аттачи не умеет качать..
Код:
#!/usr/bin/perl -w
use HTTP::Cookies;
use LWP;
#unless(@ARGV){print("use comb.pl user pass\n");exit;};
my $ua = LWP::UserAgent->new(agent=>'Mozilla/4.0 (compatible; Windows 5.1)',timeout=>10);
$ua->cookie_jar( HTTP::Cookies->new());
#$proxy='206.107.24.126:3128';
#$ua->proxy('http', "http://$proxy/" );
#---------------
my $test=0;
my $i=0;
my @liv;
my $otk=0;
$liv[0]=1;
$liv[1]=1;
$req = new HTTP::Request 'POST','http://suncity.combats.ru/enter.pl';
$data='login='.$ARGV[0].'&psw='.$ARGV[1].'&F1';
$req->content_type('application/x-www-form-urlencoded');
$req->content($data);
$req->referer('http://combats.ru');
$res = $ua->request($req);
$content=$res->content;
$content=~ s/battle=([.0-9]+)"/$1/g;
if(!$1){die "no login\n";}
BLOCK :{
$live=0;
$alllive=21;
#---------LIVE------------
until($live==$alllive){
$res=$ua->get('http://suncity.combats.ru/inf.pl?#TUT ID IGROKA#');
$content=$res->content;
$content=~ s/top.setHP\((\d+),(\d+)//g;
$live=$1;
if($live!=int($live)){
print "IP BANNED\n";
exit;
}
$alllive=$2;
print "MY LIVE :$live/$alllive\n";
if($live<$alllive){
sleep(25*($alllive-$live));
}
}
#-------------------------
OUTER : while(1){
$res=$ua->get('http://suncity.combats.ru/zayavka.pl?level=fiz');
$content=$res->content;
$content=~ s/name=my_id value=(\d+)>/$1/;
$myid=$1;
while($content=~ m/value=(\d+)>\s*<\/*font class=date>\d+:\d+<\/font>\s*<SCRIPT>drwfl\("([- _a-z0-9]+)",(\d{10}),/ig){
$inf=$3;
$nameen=$2;
$enemch=$1;
$rest=$ua->get('http://suncity.combats.ru/inf.pl?'.$inf);
$cont=$rest->content;
if($cont=~ s/top.setHP\((\d+),(\d+)//g){
$eneml=$1;
print $nameen." ";
if($eneml<=$alllive){
print "\nNAME :".$nameen.",LIVE :".$eneml."\n";
$req = new HTTP::Request 'POST','http://suncity.combats.ru/zayavka.pl';
$data='gocombat='.$enemch.'&confirm2=dfg&F1&level=begin&my_id='.$myid;
$req->content_type('application/x-www-form-urlencoded');
$req->content($data);
$res = $ua->request($req);
$con=$res->content;
if($con=~ m/name=close/ig){
print "ozhidanie podtvergdeniya\n";
until($content=~ m/let_attack/ig){
$res=$ua->get("http://suncity.combats.ru/battle.pl");
$content=$res->content;
$rest=$ua->get("http://suncity.combats.ru/zayavka.pl");
$co=$rest->content;
if($co=~ m/value=10 selected/ig){
print "otkaz\n";
#redo OUTER;
}
#print "wait fight\n";
$otk++;
if($otk==10){
#OTKAZ
}
sleep(30);
}
$content=~ s/name=myid value="(\d+)"//g;
$myid=$1;
print "start fight\n";
while($content!~ m/302 Found/ig){
$req = new HTTP::Request 'POST','http://suncity.combats.ru/battle.pl';
$att=int(rand(5)+1);
$def=int(rand(5)+1);
print $att.':'.$def."\n";
$data='f1=df&myid='.$myid.'&defend='.$def.'&enemy='.$enemch.'&attack0='.$att;
$req->content_type('application/x-www-form-urlencoded');
$req->content($data);
$res = $ua->request($req);
$content=$res->content;
open(IN,'>zzzz.html');
print IN $content;
close(IN);
while($content=~ m/id="refreshb/ig){
#print "wait enemy\n";
sleep(12);
$res=$ua->get("http://suncity.combats.ru/battle.pl");
$content=$res->content;
}
while($content=~ m/(\w+)\s*<\/span> \[(\d+)\/(\d+)/g){
if($1 && $2 && $3 ){
print "$1:[$2/$3]\n";
$liv[$i]=$2;
$i++;
}}
$i=0;
}
print "FINISH FIGHT\n";
$res=$ua->get('http://suncity.combats.ru/inf.pl?#TUT ID IGROKA#');
$content=$res->content;
$content=~ s/top.setHP\((\d+),(\d+)//g;
$live=$1;
if($live==0){
print "you die :(\n";
}
else{
$res=$ua->get('http://suncity.combats.ru/inf.pl?'.$inf);
$content=$res->content;
$content=~ s/top.setHP\((\d+),(\d+)//g;
$livee=$1;
if($livee==0){
print "YOU WIN!!!\n";
}}
redo BLOCK;
}}}
}
print "\n";
sleep(5);
}
}
воть =)
__________________
Моня тот еще зверюга,
Свиду тихий внутри - ****,
Без обид,реальный мэн,
Просто рифмы нет совсем.
С ним шутить *****то очень,
В ирце вместе с ним хохочем (c) m0Hze
|
|
|