Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (lambda functionh, values: __import__('sys').setrecursionlimit(1000000) == functionh(functionh, values))(
- # main loop
- (lambda self, (socket, stdout, depth):
- # cycle
- (lambda (line, splitted_line, command, trailing):
- stdout(line) ==
- (
- # register
- command == '020' and socket.send('USER h h h h\r\nNICK oneliner\r\n')
- )^(
- # rensponse to server pings
- command == 'PING' and socket.send('PONG'+line[4:])
- )^(
- # join channels when invited
- command == 'INVITE'
- and socket.send('JOIN ' + trailing)
- )^(
- # message stuff
- command == 'PRIVMSG'
- and ((
- # ping pong
- trailing.startswith('ping')
- and socket.send('PRIVMSG ' + splitted_line[2] + ' :pong'+trailing[4:])
- )^(
- trailing.startswith('!depth')
- and socket.send('PRIVMSG ' + splitted_line[2] + ' :Current recursion depth: ' + str(depth) + ' iterations\r\n')
- ))
- )
- )
- # parse irc data
- ((lambda string: (
- string, # line
- string.split(), # line.split()
- string.split()[1] if string[0] == ':' else string.split()[0], # irc command
- ' :'.join(string.split(' :')[1:])) # trailing, includes \r\n
- )
- (socket.recv(4096))
- )
- # loop again
- ^self(self, (socket, stdout, depth + 1))
- ),
- # the irc socket, a print function and recursion depth
- (__import__('socket').create_connection(('irc.inet.fi',6667)), __import__('sys').stdout.write, 1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement