POE                                     0
                   POE::Component::IRC::Plugin::AutoJoin   0
                   POE::Component::IRC::Plugin::NickServID 0
-                  POE::Component::IRC::State              0/,
+                  POE::Component::IRC::State              0
+                  Regexp::Common                          0/,
        },
        META_MERGE       => {
                dynamic_config => 0,
 
 
 use Getopt::Long;
 use POSIX qw/strftime/;
+use Regexp::Common qw /net/;
 
 ##################################################
 
-our $VERSION;
-
 my $nick='devbot';
 my $password;
 my $server='irc.oftc.net';
        Retry_when_banned => 60,
   ));
 
-       $irc->yield(register => "all");
+  if ($server =~ /^($RE{net}{domain})$/) {
+      $server = $1;
+  }
+  if ($port =~ /^([0-9]+)$/) {
+      $port = $1;
+  }
+
+  $irc->yield(register => "all");
   $irc->yield(
        connect => {
          Nick     => $nick,