NAME
POE::Component::IRC::Plugin::POE::Knee - A POE::Component::IRC plugin that runs Acme::POE::Knee races.
VERSION
version 1.12
SYNOPSIS
use strict;
use warnings;
use POE qw(Component::IRC::State Component::IRC::Plugin::POE::Knee);
my $nickname = 'PoeKnee' . $$;
my $ircname = 'PoeKnee the Sailor Bot';
my $ircserver = 'irc.blah.org';
my $port = 6667;
my $channel = '#IRC.pm';
my $irc = POE::Component::IRC::State->spawn(
nick => $nickname,
server => $ircserver,
port => $port,
ircname => $ircname,
debug => 0,
plugin_debug => 1,
options => { trace => 0 },
) or die "Oh noooo! $!";
POE::Session->create(
package_states => [
'main' => [ qw(_start irc_001 irc_poeknee_results) ],
],
);
$poe_kernel->run();
exit 0;
sub _start {
# Create and load our CTCP plugin
$irc->plugin_add( 'PoeKnee' =>
POE::Component::IRC::Plugin::POE::Knee->new( stages => 8 ) );
$irc->yield( register => 'all' );
$irc->yield( connect => { } );
undef;
}
sub irc_001 {
$irc->yield( join => $channel );
undef;
}
sub irc_poeknee_results {
my ($channel,$results) = @_[ARG0,ARG1];
print "$channel\n";
print "$_\n" for @{ $results };
undef;
}
DESCRIPTION
POE::Component::IRC::Plugin::POE::Knee, is a POE::Component::IRC plugin that runs Acme::POE::Knee style horse races on IRC channels using the channel member list to generate the POE::Knees. >:)
CONSTRUCTOR
new
-
Creates a new plugin object. You may specify the following optional parameters:
'stages' => the number of stages involved in the race, default is 5;
IRC INPUT
POEKNEE
-
If your bot is addressed by name with the command 'POEKNEE' (case doesn't matter), with optional number of stages, a POE::Knee race is started.
GumbyBRAIN: POEKNEE 10
OUTPUT
Apart from the output seen on the IRC channel where a POE::Knee race is currently underway, at the end of a race the following 'irc' event is generated.
irc_poeknee_results
-
Generated each time a POE::Knee race finishes.
ARG0, the channel where the race was run; ARG1, an arrayref containing lots of potentially uninteresting data;
SEE ALSO
AUTHORS
Chris Williams
Jos Boumans
Rocco Caputo
COPYRIGHT AND LICENSE
This software is copyright (c) 2017 by Chris Williams, Jos Boumans and Rocco Caputo.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.