comparison skillbot.pl @ 30:ba7303a5f42d

Added \!update command
author df
date Sun, 07 Dec 2008 08:47:25 +0000
parents c25d5c1e7f28
children 276658826bc0
comparison
equal deleted inserted replaced
29:c25d5c1e7f28 30:ba7303a5f42d
223 sub on_public 223 sub on_public
224 { 224 {
225 my ($self, $event) = @_; 225 my ($self, $event) = @_;
226 my ($their_nick, $msg) = ($event->nick, $event->args); 226 my ($their_nick, $msg) = ($event->nick, $event->args);
227 227
228 # lists the current chars in training of the caller
228 if ($msg =~ /^\!eta(\s+(.+))?/i) { 229 if ($msg =~ /^\!eta(\s+(.+))?/i) {
229 my $found = 0; 230 my $found = 0;
230 for my $f (@friends) { 231 for my $f (@friends) {
231 if ((defined $2 && $f->{char}->name eq $2) 232 if ((defined $2 && $f->{char}->name eq $2)
232 || (!defined $2 && $f->{nick} eq $their_nick)) { 233 || (!defined $2 && $f->{nick} eq $their_nick)) {
246 247
247 if ($found == 0) { 248 if ($found == 0) {
248 $self->privmsg('#' . $config{channel}, "No characters found"); 249 $self->privmsg('#' . $config{channel}, "No characters found");
249 } 250 }
250 } 251 }
252
253 # force update/reload of the friends/training data
254 if ($msg =~ /^\!update/i) {
255 update_friends($self);
256 check_training($self);
257 $self->privmsg('#' . $config{channel}, "Done");
258 }
259
251 } 260 }
252 261
253 sub on_notice 262 sub on_notice
254 { 263 {
255 my ($self, $event) = @_; 264 my ($self, $event) = @_;