coding windows-1251 import sys import socket import string log open lo

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# -*- coding: windows-1251 -*-
import sys
import socket
import string
log = open("log","w")
HOST="irc.turli.net"
PORT=6667
NICK="d327h"
IDENT="H311"
REALNAME="noname"
readbuffer=""
def send(stren):
s.send(stren)
bac = s.recv(1024)
return bac
def l2s(listeg):
tru=listeg[4:]
return ' '.join(tru)
idinax = 'go away nigga'
s=socket.socket( )
s.connect((HOST, PORT))
s.send("NICK %s\r\n" % NICK)
s.send("USER %s %s bla :%s\r\n" % (IDENT, HOST, REALNAME))
s.send("JOIN #unix\n")
while 1:
readbuffer=readbuffer+s.recv(1024)
temp=string.split(readbuffer, "\n")
readbuffer=temp.pop( )
for line in temp:
line=string.rstrip(line)
line=string.split(line)
print line
leng=len(line)
atc=line[0]
log.write("\n".join(line))
if(line[0]=="PING"):
s.send("PONG %s\r\n" % line[1])
elif(len(line)>=4):
if(line[3]==":!bla"):
s.send("PRIVMSG %s %s\r\n" % (line[2],idinax))
if(line[3]==":\xea\xf3"):
s.send("PRIVMSG %s %s\r\n" % (line[2],"hi"))
if(line[3]==":!s"):
if(atc[:3]==":xN"):
assd=send(l2s(line))
s.send("NOTICE xN %s" % (assd))
else:
s.send("PRIVMSG %s u are noob=)" % (line[2])
log.close()