use feature ':5.10';
use POE qw(Component::IRC::Qnet::State);
-use POE::Component::IRC::Plugin::Logger;
-use POE::Component::IRC::Plugin::BotTraffic;
-use POE::Component::IRC::Plugin::Connector;
-use POE::Component::IRC::Plugin::DCC;
use NDIRC::CommonStates;
-use NDIRC::Delling;
+eval "require NDIRC::$ARGV[0]";
-my $nickname = 'ndbot';
-my $ircname = 'ND test bot';
-my $server = 'irc.netgamers.org';
+die $@ if $@;
# We create a new PoCo-IRC object
my $irc = POE::Component::IRC::Qnet::State->spawn(
- nick => $nickname,
- ircname => $ircname,
- server => $server,
- servers => [$server, 'underworld.no.eu.netgamers.org', ]
+ nick => $ARGV[0],
+ ircname => 'ND bot',
) or die "Oh noooo! $!";
$irc->service_bots(QBOT => 'P@cservice.netgamers.org');
-$irc->plugin_add( 'BotTraffic', POE::Component::IRC::Plugin::BotTraffic->new() );
-$irc->plugin_add( 'DCC', POE::Component::IRC::Plugin::DCC->new() );
-$irc->plugin_add('Logger', POE::Component::IRC::Plugin::Logger->new(
- Path => 'irclogs',
- DCC => 0,
- Private => 1,
- Public => 1,
- Sort_by_date => 1,
- Strip_color => 1,
- Strip_formatting => 1,
-));
-
-$ND::scanchan = '#testarmer';
-$ND::defchan = '#testarlite';
-$ND::memchan = '#testarmer';
-
POE::Session->create(
package_states => [
- 'NDIRC::CommonStates' => [ qw(_default _start irc_001 sig_DIE sig_usr2 signal_handler irc_disconnected irc_invite) ],
- 'NDIRC::Delling' => [ qw(irc_public irc_msg refresh irc_join) ],
+ 'NDIRC::CommonStates' => [ qw(_default _start irc_001 sig_DIE sig_usr1 sig_usr2
+ signal_handler irc_disconnected irc_invite auth) ],
+ "NDIRC::$ARGV[0]" => [ qw(irc_public irc_msg refresh irc_join) ],
],
- heap => { irc => $irc},
+ heap => { irc => $irc },
);
$poe_kernel->run();