Mercurial > hg > skillbot
comparison skillbot.pl @ 25:1d57373d1c04
Merging in df's branch
author | Dominic Cleal <dominic@computerkb.co.uk> |
---|---|
date | Sat, 06 Dec 2008 22:54:58 +0000 |
parents | 7bcc70b2121a db2e2a751dd6 |
children | bb1f7ab990b1 |
comparison
equal
deleted
inserted
replaced
21:7bcc70b2121a | 25:1d57373d1c04 |
---|---|
125 Timers to set going when we start. | 125 Timers to set going when we start. |
126 | 126 |
127 =cut | 127 =cut |
128 sub init_timers | 128 sub init_timers |
129 { | 129 { |
130 # Join channels fort eh first time, ~15 secs after connect | 130 # Join channels for the first time, ~15 secs after connect |
131 add_one_shot_timer(15, sub { my ($timer, $self) = @_; join_channels($self); }); | 131 add_one_shot_timer(15, sub { my ($timer, $self) = @_; join_channels($self); }); |
132 | 132 |
133 # Check we are in the right channels every 10 minutes | 133 # Check we are in the right channels every 10 minutes |
134 add_repeat_timer(600, sub { my ($timer, $self) = @_; join_channels($self); }); | 134 add_repeat_timer(600, sub { my ($timer, $self) = @_; join_channels($self); }); |
135 | 135 |
294 | 294 |
295 sub on_cversion | 295 sub on_cversion |
296 { | 296 { |
297 my ($self, $event) = @_; | 297 my ($self, $event) = @_; |
298 | 298 |
299 my $vstring = sprintf("VERSION twitfolk v%s " . | 299 my $vstring = sprintf("VERSION %s", $ircname); |
300 "(\002grifferz\002 is responsible for this atrocity)", $version); | |
301 | 300 |
302 $self->ctcp_reply($event->nick, $vstring); | 301 $self->ctcp_reply($event->nick, $vstring); |
303 } | 302 } |
304 | 303 |
305 sub justme | 304 sub justme |
396 $loaded++; | 395 $loaded++; |
397 } | 396 } |
398 | 397 |
399 if (defined $c && $loaded eq 0) | 398 if (defined $c && $loaded eq 0) |
400 { | 399 { |
401 irc_debug("EVE: Unable to find character %s for ID %lu", | 400 irc_debug("Unable to find character %s for ID %lu", |
402 $c, $uid); | 401 $c, $uid); |
403 next; | 402 next; |
404 } | 403 } |
405 | 404 |
406 $frienduids{$uid} = $loaded; | 405 $frienduids{$uid} = $loaded; |
407 irc_debug("EVE: Adding new friend %s (%lu), %lu characters", | 406 irc_debug("Adding new friend %s (%lu), %lu characters", |
408 $nick, $uid, $loaded); | 407 $nick, $uid, $loaded); |
409 } | 408 } |
410 } | 409 } |
411 } | 410 } |
412 | 411 |
413 close(FF) or warn "Something weird when closing friends_file: $!"; | 412 close(FF) or warn "Something weird occured when closing friends_file: $!"; |
414 } | 413 } |
415 | 414 |
416 =pod | 415 =pod |
417 | 416 |
418 Check for any characters that aren't known to be training, then call the API | 417 Check for any characters that aren't known to be training, then call the API |