Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. import socket
  2. import sys
  3.  
  4. server="irc.freenode.net"
  5. channel="##mychannel"
  6. botnick="testbot"
  7. irc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  8. irc.connect((server,6667))
  9. irc.send("USER "+botnick+" "+botnick+" "+botnick+" :TestBotn")
  10. irc.send("NICK "+botnick+"n")
  11. irc.send("PRIVMSG nickserv :iNOOPErn") #I don't know what this line does....
  12. irc.send("JOIN "+channel+"n")
  13.  
  14. while 1:
  15. text=irc.recv(2040)
  16. print (text)
  17. if text.find("PING")!=-1:
  18. irc.send("PONG "+text.split("PING ")[i]+"rn")
  19. if text.find(":!hi")!=-1:
  20. irc.send("PRIVMSG "+channel+" :Hello!rn")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement