Mercurial > hg > skillbot
comparison skillbot.pl @ 37:5900a37101eb
Bold names in !next
author | Dominic Cleal <dominic@computerkb.co.uk> |
---|---|
date | Sun, 07 Dec 2008 11:40:11 +0000 |
parents | 6baa10b255ae |
children | a8b60d2968b2 |
comparison
equal
deleted
inserted
replaced
36:6baa10b255ae | 37:5900a37101eb |
---|---|
249 $self->privmsg('#' . $config{channel}, "No characters found"); | 249 $self->privmsg('#' . $config{channel}, "No characters found"); |
250 } | 250 } |
251 } | 251 } |
252 | 252 |
253 # force update/reload of the friends/training data | 253 # force update/reload of the friends/training data |
254 if ($msg =~ /^\!update/i) { | 254 elsif ($msg =~ /^\!update/i) { |
255 update_friends($self); | 255 update_friends($self); |
256 check_training($self); | 256 check_training($self); |
257 $self->privmsg('#' . $config{channel}, "Done"); | 257 $self->privmsg('#' . $config{channel}, "Done"); |
258 } | 258 } |
259 | 259 |
260 # lists the chars in order of shortest training time | 260 # lists the chars in order of shortest training time |
261 if ($msg =~ /^\!next/i) { | 261 elsif ($msg =~ /^\!next/i) { |
262 my $nreply = "Training: "; | 262 my $nreply = "Training: "; |
263 | 263 |
264 for my $f (sort { $a->{skill}->finish_time <=> $b->{skill}->finish_time } grep(defined $_->{skill}, @friends)) { | 264 for my $f (sort { $a->{skill}->finish_time <=> $b->{skill}->finish_time } grep(defined $_->{skill}, @friends)) { |
265 $nreply .= $f->{char}->name . " (" . $f->{skill}->time_remaining . ") | "; | 265 $nreply .= sprintf("\002%s\002 (%s) | ", |
266 $f->{char}->name, $f->{skill}->time_remaining); | |
266 } | 267 } |
267 | 268 |
268 $self->privmsg('#' . $config{channel}, substr($nreply, 0, -3)); | 269 $self->privmsg('#' . $config{channel}, substr($nreply, 0, -3)); |
269 } | 270 } |
270 } | 271 } |