Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import string
- from Read import getUser, getMessage
- from Socket import openSocket, sendMessage
- from Initialize import joinRoom
- import time
- import random
- from datetime import datetime
- import re
- s = openSocket()
- joinRoom(s)
- readbuffer = ""
- # random emotes
- emotes = [" Kappa", " Keepo", " BrokeBack", " TriHard", " BabyRage", " CoolCat", " FreakinStinkin"]
- # List of commands
- commands = ["!judnas", "!abe", "!alsoa", "!games", "!request", "!games", "!salmoncum", "!adhd", "!spam", "!salute"]
- while True:
- readbuffer = readbuffer + s.recv(1024)
- temp = string.split(readbuffer, "\n")
- readbuffer = temp.pop()
- for line in temp:
- print(line)
- if "PING" in line:
- s.send(line.replace("PING", "PONG"))
- break
- user = getUser(line)
- message = getMessage(line).strip()
- print user + " typed :" + message
- # Commands
- if message.startswith("!commands"):
- sendMessage(s, "The following commands are available for this channel : " + (", ".join(commands)))
- break
- # Abe
- if message.startswith("!abe"):
- sendMessage(s, "No, " + user + " you abe! StinkyCheese")
- break
- # Judnas
- if message.startswith("!judnas"):
- sendMessage(s,
- "Wow " + user + " I see you want something sexy, please follow this sweet gay @ https://www.twitch.tv/judnas")
- break
- # Alsoa
- if message.startswith("!alsoa"):
- sendMessage(s, user + " just gave AlsoaTV a shoutout 4Head Catch him at https://www.twitch.tv/alsoatv")
- break
- # Games
- games = ["Rimworld", "Prison Architect", "My Summer Car", "Genital Jousting", "Factorio",
- "AND sometimes I will be programming in the future. Feel free to !request one of these games"]
- if message.startswith("!games"):
- sendMessage(s, user + " here is a list of games I play on stream, updated 22/06-18 " + (
- ", ".join(games) + random.choice(emotes)))
- break
- # Request
- if message.startswith("!request"):
- req = message.lstrip("!request").strip()
- # Check if anything after request
- if req != "":
- sendMessage(s, "@Noctaliuz " + user + " requested " + req + random.choice(emotes))
- break
- # Salmoncum
- if message.startswith("!salmoncum"):
- print("Calculating aids! MrDestructoid")
- random.seed("{0}-{1}".format(user, datetime.now().hour))
- percent = random.randrange(0, 100)
- resp = "{0} has {1}% salmon cum in the mouth! SabaPing https://bit.ly/2ttps5H".format(user, percent)
- # Printing aids message
- print(resp)
- sendMessage(s, resp)
- break
- # ADHD
- if message.startswith("!adhd"):
- print("Calculating aids! MrDestructoid")
- random.seed(
- "{0}/{1}/{2}-{3}:{4} - {5}".format(datetime.now().year, datetime.now().month, datetime.now().date,
- datetime.now().hour, datetime.now().minute, user))
- percent = random.randrange(0, 100)
- resp = "{0} has {1}% ADHD TheThing".format(user, percent)
- # Printing aids message
- print(resp)
- sendMessage(s, resp)
- break
- # SPAM
- if message.startswith("!spam"):
- message = message.lstrip("!spam").strip()
- found = re.search("({0})\s([0-9])".format("|".join(emotes)), message)
- if (found):
- tmpEmote, tmpCount = found.groups()
- print("Found {0} x {1}".format(tmpEmote, tmpCount))
- tmpCount = int(tmpCount)
- # If number of times is over 1 and under 100
- if (tmpCount >= 1 and tmpCount <= 100):
- resp = [tmpEmote] * tmpCount
- print(resp)
- sendMessage(s, " ".join(resp))
- else:
- print("NO MATCH FOR SPAM! BabyRage")
- break
- # Salute
- if message.startswith("!salute"):
- sendMessage(s, "Kappa 7")
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement