comparison skillbot.pl @ 10:9cc6dbc803f6

Fixing docs, allowing chankey
author Dominic Cleal <dominic@computerkb.co.uk>
date Sat, 06 Dec 2008 15:47:34 +0000
parents c797330cd371
children 277d818f5496
comparison
equal deleted inserted replaced
9:c797330cd371 10:9cc6dbc803f6
169 } 169 }
170 170
171 sub join_channels 171 sub join_channels
172 { 172 {
173 my $self = shift; 173 my $self = shift;
174 $self->join('#' . $config{channel}); 174 $self->join('#' . $config{channel}, $config{chankey});
175 } 175 }
176 176
177 sub on_join 177 sub on_join
178 { 178 {
179 my ($self, $event) = @_; 179 my ($self, $event) = @_;
326 POSIX::setsid() or die "Can't start a new session: $!"; 326 POSIX::setsid() or die "Can't start a new session: $!";
327 } 327 }
328 328
329 =pod 329 =pod
330 330
331 Read a list of friends from the friends_file. These will be friended in 331 Read a list of friends from the friends_file. Format is:
332 Twitter if they aren't already. Format is: 332
333 333 user_id api_key IRC_nick character_name
334 character_name user_id api_key IRC_nick 334
335 335 Start a line with # for a comment. Character name is optional, if left
336 Start a line with # for a comment. Columns must be tab separated. 336 out then all characters will be monitored.
337 337
338 =cut 338 =cut
339 sub update_friends 339 sub update_friends
340 { 340 {
341 my $self = shift; 341 my $self = shift;
399 399
400 my $skill = $f->{char}->skill->in_training; 400 my $skill = $f->{char}->skill->in_training;
401 # Nothing training 401 # Nothing training
402 next unless $skill; 402 next unless $skill;
403 403
404 irc_debug("Character %s is training %s (%s)", 404 irc_debug("Character %s is training %s %lu (%s == %lu sec)",
405 $f->{char}->name, $skill->name, 405 $f->{char}->name, $skill->name, $skill->level,
406 $skill->time_remaining); 406 $skill->time_remaining, ($skill->finish_time - time()));
407 407
408 $f->{skill} = $skill; 408 $f->{skill} = $skill;
409 409
410 my $text = sprintf("%s has completed training skill %s %s", 410 my $text = sprintf("%s has completed training skill %s %s",
411 $f->{char}->name, $skill->name, $skill->level); 411 $f->{char}->name, $skill->name, $skill->level);