Advertisement
pantteri

Oneliner IRC bot v2

Apr 11th, 2013
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.82 KB | None | 0 0
  1. import itertools as i,socket as s,sys as z,re,select as y,time;[globals().update({'g':globals().update}),g({'n':'oneb','w':lambda d:z.stdout.write(time.strftime('[%T] ')+str(d)+'\n'),'r':lambda:[g({'c':s.create_connection((z.argv[1],int(z.argv[2])))}),g({'d':lambda k:[w('<- '+k),c.send(k+'\r\n')],'m':lambda k:[w(a,k),[d('PRIVMSG '+a+' :'+j)for j in k.split('\n')]],'e':''}),d('NICK '+n),d('USER '+n+' h h :\x0fFelixxin botti')]}),r(),[[y.select([c],[],[],300)[0]and[g({'e':c.makefile().readline()[:-2]}),w('-> '+e),g({'p':re.match('(:(([^ @!]*)(!([^@]*)[^ ]*)?(@([^ ]*))?) )?([^ ]*)(.*?)( :(.*))?',e).group}),g({'b':p(3),'f':p(8),'h':p(9).split()+[p(11)]}),f=='PING'and d('PONG '+h[0]),f=='433'and[g({'n':n+'_'}),s('NICK '+n)],f=='INVITE'and d('JOIN '+h[1]),f=='NICK'and g('n':h[0])]and e or[w('Reconnecting...'),r()]]for j in i.count()]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement