mirror of
https://github.com/progval/Limnoria.git
synced 2025-04-30 07:21:10 -05:00
Fixed binary command.
This commit is contained in:
parent
1a704ef1f7
commit
046c6998e4
@ -140,13 +140,21 @@ class FunCommands(callbacks.Privmsg):
|
|||||||
"""
|
"""
|
||||||
L = []
|
L = []
|
||||||
for c in privmsgs.getArgs(args):
|
for c in privmsgs.getArgs(args):
|
||||||
|
LL = []
|
||||||
i = ord(c)
|
i = ord(c)
|
||||||
|
counter = 8
|
||||||
while i:
|
while i:
|
||||||
|
counter -= 1
|
||||||
if i & 1:
|
if i & 1:
|
||||||
L.append('1')
|
LL.append('1')
|
||||||
else:
|
else:
|
||||||
L.append('0')
|
LL.append('0')
|
||||||
i >>= 1
|
i >>= 1
|
||||||
|
while counter:
|
||||||
|
LL.append('0')
|
||||||
|
counter -= 1
|
||||||
|
LL.reverse()
|
||||||
|
L.extend(LL)
|
||||||
irc.reply(msg, ''.join(L))
|
irc.reply(msg, ''.join(L))
|
||||||
|
|
||||||
def hexlify(self, irc, msg, args):
|
def hexlify(self, irc, msg, args):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user