# HG changeset patch # User Dominic Cleal # Date 1228648703 0 # Node ID b0436bc63f9ee19fa0440362bb2de681079d032f # Parent b36c677365aa57cecee2f96f2ed9ebd4a4fd9e41# Parent 8b631d17dfd0f38cedf944d2a013d23b8ff5ab79 Merging df's branch diff -r b36c677365aa -r b0436bc63f9e skillbot.pl --- a/skillbot.pl Sun Dec 07 10:35:39 2008 +0000 +++ b/skillbot.pl Sun Dec 07 11:18:23 2008 +0000 @@ -225,6 +225,7 @@ my ($self, $event) = @_; my ($their_nick, $msg) = ($event->nick, $event->args); + # lists the current chars in training of the caller if ($msg =~ /^\!eta(\s+(.+))?/i) { my $found = 0; for my $f (@friends) { @@ -248,6 +249,24 @@ $self->privmsg('#' . $config{channel}, "No characters found"); } } + + # force update/reload of the friends/training data + if ($msg =~ /^\!update/i) { + update_friends($self); + check_training($self); + $self->privmsg('#' . $config{channel}, "Done"); + } + + # lists the chars in order of shortest training time + if ($msg =~ /^\!next/i) { + my $nreply = "Training: "; + + 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); + } } sub on_notice