X-Git-Url: https://ruin.nu/git/?p=NDIRC.git;a=blobdiff_plain;f=ndawn.pl;h=a14ee36fe319bef16eaaeb34b7eda5d8c3e5acf3;hp=ca60ea24e1c6593a29fe7339661c61290e15eafa;hb=05629ec258dcfc359decc3cbc44c3345dd0eb62e;hpb=0d63bf9da52cdfe2c9d8850b690032ff539b6398 diff --git a/ndawn.pl b/ndawn.pl index ca60ea2..a14ee36 100755 --- a/ndawn.pl +++ b/ndawn.pl @@ -24,8 +24,6 @@ use warnings; use feature ':5.10'; use POE qw(Component::IRC::Qnet::State); - -use NDIRC::CommonStates; eval "require NDIRC::$ARGV[0]"; die $@ if $@; @@ -38,11 +36,13 @@ my $irc = POE::Component::IRC::Qnet::State->spawn( $irc->service_bots(QBOT => 'P@cservice.netgamers.org'); +my $bot = eval "new NDIRC::$ARGV[0]"; + POE::Session->create( - package_states => [ - '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) ], + object_states => [ + $bot => [ qw(_default _start irc_001 sig_DIE sig_usr1 sig_usr2 + signal_handler irc_disconnected irc_invite auth + irc_public irc_msg refresh irc_join) ], ], heap => { irc => $irc }, );