-use vars qw($VERSION %IRSSI);
-
-use Irssi;
-use Irssi::Irc;
-
-$VERSION = "0.1";
-%IRSSI = (
- authors => "harv",
- contact => "harv\@ruin.nu",
- name => "NewDawn testbot script",
- description => "Testbot used for implementing commands for nd bots",
- license => "GPL-2 or (at your option) any later version",
- url => "",
- changed => "",
+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 ND::DB;
+use ND::Include;
+use NDIRC::Dispatcher;
+use NDIRC::Context;
+use NDIRC::Command;
+use NDIRC::Misc;
+use NDIRC::CommonStates;
+
+my $nickname = 'ndbot';
+my $ircname = 'ND test bot';
+my $server = 'irc.netgamers.org';
+
+# 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', ]
+) 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,
+));
+
+my $DBH = DB();
+my $TICK = $DBH->selectrow_array('SELECT tick()');
+
+$ND::scanchan = '#testarmer';
+$ND::defchan = '#testarlite';
+$ND::memchan = '#testarmer';
+
+POE::Session->create(
+ package_states => [
+ 'NDIRC::CommonStates' => [ qw(_default _start irc_001 sig_DIE signal_handler irc_disconnected irc_invite) ],
+ main => [ qw(irc_public irc_msg refresh sig_usr2 irc_join) ],
+ ],
+ heap => { irc => $irc},