Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import socket, string
- import time
- HOST = "irc.twitch.tv"
- NICK = "jewsless"
- PORT = 6667
- PASS = "oauth:3c7yntkpx4pujrw20j0ddijf5y0uzh"
- readbuffer = ""
- MODT = False
- cooldown1 = time.time()
- s = socket.socket()
- s.connect((HOST, PORT))
- s.send("PASS " + PASS + "\r\n")
- s.send("NICK " + NICK + "\r\n")
- s.send("JOIN #ramhh96 \r\n")
- def Send_message(message):
- s.send("PRIVMSG #ramhh96 :" + message + "\r\n")
- while True:
- readbuffer = readbuffer + s.recv(1024)
- temp = string.split(readbuffer, "\n")
- readbuffer = temp.pop()
- for line in temp:
- if (line[0] == "PING"):
- s.send("PONG %s\r\n" % line[1])
- else:
- parts = string.split(line, ":")
- if "QUIT" not in parts[1] and "JOIN" not in parts[1] and "PART" not in parts[1]:
- try:
- message = parts[2][:len(parts[2]) - 1]
- except:
- message = ""
- usernamesplit = string.split(parts[1], "!")
- username = usernamesplit[0]
- if MODT:
- print username + ": " + message
- if message == "!config" and cooldown1 < time.time():
- Send_message("Shroods config http://play.esea.net/users/248592. ")
- cooldown1 = time.time() + 15 #15 second cooldown
- if message == "!twitter":
- Send_message("https://twitter.com/Ramhh96, ")
- if message == "!settings":
- Send_message("CSGO Settings, ")
- for l in parts:
- if "End of /NAMES list" in l:
- MODT = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement