# HG changeset patch # User df # Date 1228648609 0 # Node ID 8b631d17dfd0f38cedf944d2a013d23b8ff5ab79 # Parent 48df6d55427b65da0fb7f83b041c26c3e0e45d66 Fixed some stuff after talking to dom -- yeah it could have been done simpler if he told me yesterday :P diff -r 48df6d55427b -r 8b631d17dfd0 skillbot.pl --- a/skillbot.pl Sun Dec 07 09:44:59 2008 +0000 +++ b/skillbot.pl Sun Dec 07 11:16:49 2008 +0000 @@ -260,10 +260,10 @@ # lists the chars in order of shortest training time if ($msg =~ /^\!next/i) { my $nreply = "Training: "; - my (@fc) = (order_friend_copy @friends); - foreach (@fc) - $nreply .= $_->{char}->name . " (" . $_->{skill}->time_remaining . ") | "; + for my $f (sort { $a->{skill}->finish_time <=> $b->{skill}->finish_time } grep(defined $_->{skill}, @friends)) { + $nreply .= $f->{char}->name . " (" . $f->{skill}->time_remaining . ") | "; + } $self->privmsg('#' . $config{channel}, $nreply); } @@ -508,23 +508,6 @@ }); } -=pod - -Returns a copy of the input @friends that is ordered by training time -and doesnt contain any chars that are not in training. - -=cut -sub order_friend_copy -{ - my @friendcopy; - foreach ($_) - push(@friendcopy, $_) unless defined($_->{char}->skill->in_training); - - sort { $a->{skill}->finish_time <=> $b->{skill}->finish_time } @friendcopy; - - return @friendcopy; -} - END { cleanup_and_die(); }