Guest User

Untitled

a guest
Jan 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. import sys
  2. import socket
  3. import string
  4.  
  5. HOST="irc.esper.net"
  6. PORT=6667
  7. NICK="Senix_BOT"
  8. IDENT="Senix"
  9. REALNAME="Senix"
  10. JOIN=""
  11. readbuffer=""
  12. #chat = raw_input("#>")
  13.  
  14. sock=socket.socket( )
  15. sock.connect((HOST, PORT))
  16. sock.send("NICK %s\r\n" % NICK)
  17. sock.send("USER %s %s bla :%s\r\n" % (IDENT, HOST, REALNAME))
  18. sock.send("JOIN #gemu\r\n")
  19.  
  20. while 1:
  21. #readbuffer=readbuffer+sock.recv(1024)
  22. #temp=string.split(readbuffer, "\n")
  23. #readbuffer=temp.pop( )
  24.  
  25. #for line in temp:
  26. # line=string.rstrip(line)
  27. # line=string.split(line)
  28.  
  29. # if(line[0]=="PING"):
  30. # sock.send("PONG %s\r\n" % line[1])
  31. #print line
  32.  
  33. data = sock.recv(4096)
  34. if data.find('PING') != -1:
  35. sock.send('PONG ' + '\r\n')
  36. print data
Add Comment
Please, Sign In to add comment