comparison Ikariam.pm @ 185:c6c6db6eea76

merged.
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Sun, 02 Nov 2008 21:17:50 +0800
parents 2362c8c8909e 8afd380c20ac
children 5501ce37b50f
comparison
equal deleted inserted replaced
184:857a67be1609 185:c6c6db6eea76
606 my $treaty = Ikariam::Extractor->new(content => $res->content)->find('//div[@class="warning"]'); 606 my $treaty = Ikariam::Extractor->new(content => $res->content)->find('//div[@class="warning"]');
607 if(!defined($treaty)) { 607 if(!defined($treaty)) {
608 $self->{mech}->submit_form( 608 $self->{mech}->submit_form(
609 form_number => 1, 609 form_number => 1,
610 fields => { 610 fields => {
611 cargo_army_302 => '2', 611 cargo_army_302 => '2', # 劍士
612 } 612 }
613 ); 613 );
614 } else { 614 } else {
615 warn ($treaty); 615 # put the id in the friends.txt file.
616 Ikariam::Cities->has_a(user => 'Ikariam::User');
617 my $city = Ikariam::Cities->retrieve($cityId);
618 my $sheep = $city->user;
619
620 open(OUT, ">>friends.txt") or Carp::carp("can not open friends.txt");
621 print OUT $sheep->name . "\n";
622 close(OUT);
623 Carp::carp($treaty);
616 } 624 }
617 } 625 }
618 626
619 sub changeCity { 627 sub changeCity {
620 my $self = shift; 628 my $self = shift;