User Control Panel
Advertisements

HELP US, HELP YOU!

IP Address To IPv6

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands
View unanswered posts
Author Message
mat007
Almost An Agent
Almost An Agent


Joined: 12 Jan 2004
Posts: 1375

Reputation: 15.8Reputation: 15.8
votes: 2

PostPosted: Thu Jul 28, 2005 6:01 pm    Post subject: IP Address To IPv6 Reply with quote

Long time since i last posted well anyway this command converts an IP address to IPv6

Code:
sub cmd_ip2long {
   my($self, $username, $name, $msg) = @_;

   if($msg ne '' && $msg =~ /^(.*\d).(.*\d).(.*\d).(.*\d)/) {
      $n = 256;
      @sip = split(/\./, $msg);
      $ip = ($sip[0] * ($n * $n * $n)) + ($sip[1] * ($n * $n)) + ($sip[2] * $n) + ($sip[3]);

      return $self->sendMessage("The IP converted to IPv6 is: $ip");
   } else {
      return $self->sendMessage("Error, Sorry you did not give any params.\n"
               . "Eg: !ip2long 127.0.0.1!", Color => "0000CC") if($msg eq '');
      return $self->sendMessage("Error, Sorry you did not give me a valid IP.", Color => "0000CC");
   }
}


Matthew
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group