comparison skillbot.pl @ 52:0f8275723d81

Update characters on retrieval, remove !update
author Dominic Cleal <dominic@computerkb.co.uk>
date Tue, 23 Dec 2008 16:41:59 +0000
parents 14f0f0b0f83e
children d5872370102a
comparison
equal deleted inserted replaced
51:2b9279fb52a5 52:0f8275723d81
230 my $found = 0; 230 my $found = 0;
231 for my $f (@friends) { 231 for my $f (@friends) {
232 if ((defined $2 && (lc($f->{char}->name) eq lc($2) 232 if ((defined $2 && (lc($f->{char}->name) eq lc($2)
233 || lc($2) eq 'all' || lc($2) eq '*')) 233 || lc($2) eq 'all' || lc($2) eq '*'))
234 || (!defined $2 && $f->{nick} eq $their_nick)) { 234 || (!defined $2 && $f->{nick} eq $their_nick)) {
235 check_friend($self, $f);
235 my $text; 236 my $text;
236 if (defined $f->{skill}) { 237 if (defined $f->{skill}) {
237 my $downtime = ''; 238 my $downtime = '';
238 if (skill_finish_in_downtime($f->{skill})) { 239 if (skill_finish_in_downtime($f->{skill})) {
239 $downtime = ", coincides with downtime"; 240 $downtime = ", coincides with downtime";
264 if ($found == 0) { 265 if ($found == 0) {
265 $self->privmsg('#' . $config{channel}, "No characters found"); 266 $self->privmsg('#' . $config{channel}, "No characters found");
266 } 267 }
267 } 268 }
268 269
269 # force update/reload of the friends/training data
270 elsif ($msg =~ /^\!update/i) {
271 update_friends($self);
272 check_training($self);
273 $self->privmsg('#' . $config{channel}, "Done");
274 }
275
276 # lists the chars in order of shortest training time 270 # lists the chars in order of shortest training time
277 elsif ($msg =~ /^\!next/i) { 271 elsif ($msg =~ /^\!next/i) {
278 my $nreply = "Training: "; 272 my $nreply = "Training: ";
279 273
274 check_training($self);
280 my @training = sort { 275 my @training = sort {
281 $a->{skill}->finish_time <=> $b->{skill}->finish_time 276 $a->{skill}->finish_time <=> $b->{skill}->finish_time
282 } grep { defined $_->{skill} } @friends; 277 } grep { defined $_->{skill} } @friends;
283 278
284 for my $f (@training) { 279 for my $f (@training) {