From d21d868b28b8a3114b3490a720e295d36be04974 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Wed, 27 Aug 2003 22:43:29 +0000 Subject: [PATCH] Added hexip command. --- plugins/FunCommands.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/plugins/FunCommands.py b/plugins/FunCommands.py index 8a86fd871..98689137b 100644 --- a/plugins/FunCommands.py +++ b/plugins/FunCommands.py @@ -175,6 +175,22 @@ class FunCommands(callbacks.Privmsg): (self.recvdMsgs, self.recvdBytes, self.sentMsgs, self.sentBytes)) + def hexip(self, irc, msg, args): + """ + + Returns the hexadecimal IP for that IP. + """ + ip = privmsgs.getArgs(args) + if not ircutils.isIP(ip): + irc.error(msg, '%r is not a valid IP.' % ip) + return + quads = ip.split('.') + ret = "" + for quad in quads: + i = int(quad) + ret += '%02x' % i + irc.reply(msg, ret.upper()) + def ord(self, irc, msg, args): """