]> ruin.nu Git - NDIRC.git/blobdiff - ndawn.pl
Removed the global variables for special chans, using targets hashref in Dispatcher...
[NDIRC.git] / ndawn.pl
index f2eafaa9f74c7dbeb16599badcadf953ffb62509..ca60ea24e1c6593a29fe7339661c61290e15eafa 100755 (executable)
--- a/ndawn.pl
+++ b/ndawn.pl
@@ -26,33 +26,25 @@ use POE qw(Component::IRC::Qnet::State);
 
 
 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');
 
-$ND::scanchan = '#testarmer';
-$ND::defchan = '#testarlite';
-$ND::memchan = '#testarmer';
-
 POE::Session->create(
        package_states => [
                'NDIRC::CommonStates' => [ qw(_default _start irc_001 sig_DIE sig_usr1 sig_usr2
-                       signal_handler irc_disconnected irc_invite) ],
-               'NDIRC::Delling' => [ qw(irc_public irc_msg refresh irc_join) ],
+                       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();