comparison disturb.pl @ 372:9f19fe8d189c

withdraw the ship 10 minutes first, we have only need 2 ships for blocking a town.
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Tue, 14 Apr 2009 17:00:05 +0800
parents 7274d8f41d5f
children
comparison
equal deleted inserted replaced
371:0522468991c1 372:9f19fe8d189c
23 my $to_city = $1 if($t =~ /\?view=island&cityId=(\d+)/); 23 my $to_city = $1 if($t =~ /\?view=island&cityId=(\d+)/);
24 24
25 if($from_city == $myCity && $to_city == $blockadeCity) { 25 if($from_city == $myCity && $to_city == $blockadeCity) {
26 # Cancel the last attack 26 # Cancel the last attack
27 $ikariam->{mech}->get(sprintf("http://%s/index.php%s", $::server, $extractor->find('//td[9]/a/@href'))); 27 $ikariam->{mech}->get(sprintf("http://%s/index.php%s", $::server, $extractor->find('//td[9]/a/@href')));
28 $ikariam->logout;
29
30 sleep(60);
28 31
29 # Create a new one. 32 # Create a new one.
33 $ikariam->login;
30 $ikariam->changeCity($myCity); 34 $ikariam->changeCity($myCity);
31 $ikariam->blockadeCity($blockadeCity, { 35 $ikariam->blockadeCity($blockadeCity, {
32 blockadeDuration => 8*60*60, 36 blockadeDuration => 8*60*60,
33 cargo_fleet_211 => 1, # Flamethrower 37 cargo_fleet_211 => 1, # Flamethrower
34 }); 38 });
35 $ikariam->logout; 39 $ikariam->logout;
36 40
37 sleep($travelTime*60); 41 sleep(($travelTime-1)*60);
38 next LOOP; 42 next LOOP;
39 } 43 }
40 } 44 }
41 45
42 $ikariam->login; 46 $ikariam->login;