comparison scores.pl @ 10:f590b5ea5e55

fixed bug of sheep.pl
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Wed, 08 Oct 2008 09:55:43 +0800
parents ae412d1f7761
children 0aeb0fe59257
comparison
equal deleted inserted replaced
9:ae412d1f7761 10:f590b5ea5e55
35 foreach my $x (qw/score army_score_main trader_score_secondary/) 35 foreach my $x (qw/score army_score_main trader_score_secondary/)
36 { 36 {
37 $users = $i->viewScore($x, $ARGV[0], 0); 37 $users = $i->viewScore($x, $ARGV[0], 0);
38 saveUser($users); 38 saveUser($users);
39 } 39 }
40 $i->logout;
40 } elsif ($#ARGV == 1) { 41 } elsif ($#ARGV == 1) {
41 $i->login; 42 $i->login;
42 43
43 # search the islands and cities nearby 44 # search the islands and cities nearby
44 my ($x, $y) = @ARGV; 45 my ($x, $y) = @ARGV;
68 { 69 {
69 my $users = $i->viewScore($type, $o, 0); 70 my $users = $i->viewScore($type, $o, 0);
70 saveUser($users); 71 saveUser($users);
71 } 72 }
72 } 73 }
74 $i->logout;
73 } else { 75 } else {
74 # my $users = $i->viewScore('army_score_main'); 76 # my $users = $i->viewScore('army_score_main');
75 # saveUser($users); 77 # saveUser($users);
76 die("Usage: $0 nickname\nUsage: $0 x y"); 78 die("Usage: $0 nickname\nUsage: $0 x y");
77 } 79 }