1 ################################
3 ################################
5 package BotModules::KeepAlive;
10 # RegisterConfig - Called when initialised, should call registerVariables
13 $self->SUPER::RegisterConfig(@_);
14 $self->registerVariables(
15 # [ name, save?, settable? ]
17 ['string', 1, 1, 'ping'],
18 ['target', 1, 1, '#spam'],
22 # Schedule - called when bot connects to a server, to install any schedulers
23 # use $self->schedule($event, $delay, $times, $data)
24 # where $times is 1 for a single event, -1 for recurring events,
25 # and a +ve number for an event that occurs that many times.
29 $self->schedule($event, \$self->{'delay'}, -1, 'keepalive');
30 $self->SUPER::Schedule($event);
37 '' => 'This is a simple keep-alive module, it regularly sends text out. This has been known to help with network lag.',
38 } if $self->isAdmin($event);
44 my ($event, @data) = @_;
45 if ($data[0] eq 'keepalive') {
46 local $event->{'target'} = $self->{'target'};
47 $self->say($event, $self->{'string'});
49 $self->SUPER::Scheduled($event, @data);