Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import socket, string, random, time
- HOST = "irc.twitch.tv"
- NICK = "notnuulsbot"
- PORT = 6667
- PASS = "oauth:qp6s0f01jsj5hjfilt0amffezbss9m"
- readbuffer = ""
- MODT = False
- global t
- t = time.time()
- global tping
- tping = time.time()
- s = socket.socket()
- s.connect((HOST, PORT))
- s.send("PASS " + PASS + "\r\n")
- s.send("NICK " + NICK + "\r\n")
- s.send("JOIN #os_sloth \r\n")
- def Send_message(message):
- s.send("PRIVMSG #os_sloth :" + 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 t + 2 < time.time():
- if "!" in message:
- checkCom(user, message)
- t = time.time()
- if MODT:
- print username + ": " + message
- if "sup" in message:
- Send_message("sup " + username + " nymnWink ")
- if "pun" in message:
- foo = ['Having sex in an elevator is wrong on so many levels.',
- 'When I get naked in the bathroom, the shower usually gets turned on.',
- 'I couldnt work out how to fasten my seatbelt. Then it clicked.',
- 'If Apple made a car, would it have Windows?',
- 'Thank god for nipples. Without it, boobs would be pointless.',
- 'Vagina jokes arent funny. Period.',
- 'There are plenty of fish in the sea but until I catch one Im just stuck here holding my rod...']
- Send_message((random.choice(foo)))
- if "zloty" in message :
- Send_message(" PogChamp ")
- if "notnuulsbot" in message:
- Send_message("YES SIR gachiGASM ")
- for l in parts:
- if "End of /NAMES list" in l:
- MODT = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement