Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 16.16 KB | None | 0 0
  1. # -*- coding: cp1252 -*-
  2. from util import hook
  3. import time
  4. import re
  5. import random
  6.  
  7. @hook.event("PRIVMSG")
  8. def chat(inp, chan='', say=None, db=None, input=None, nick="", me=None, bot=None, notice=None):
  9.     reply = ""
  10.    
  11.     inp[1] = str(inp[1]).lower()
  12.    
  13.     #if re.match(r'.freechat ', inp[1]) and nick in input.bot.config["admins"]:
  14.     #    freechat = "true"
  15.     #elif re.match(r'.botchat ', inp[1]) and nick in input.bot.config["admins"]:
  16.     #    freechat = "false"
  17.    
  18.     if re.match(r'perbot: ', inp[1][0:8]) and len(inp[1]) > 8:
  19.         inp[1] = inp[1][8:]
  20.     elif False: #freechat == "false":
  21.         reply = ""
  22.     if re.search(r'hi', inp[1]):
  23.         response = chooseReply(["Hello.", "Hello, " + nick + ".", "Hi. How are you?", "Hi. How are you, " + nick + "?", "Hey!", "Hey, " + nick + "!"], inp, 'hi')
  24.         if response != None:
  25.             reply = response
  26.     elif re.search(r'hello', inp[1]):
  27.         response = chooseReply(["Hello.", "Hello, " + nick + ".", "Hi. How are you?", "Hi. How are you, " + nick + "?", "Hey!", "Hey, " + nick + "!"], inp, 'hello')
  28.         if response != None:
  29.             reply = response
  30.     elif re.search(r'really?', inp[1]):
  31.         response = chooseReply(["Really.", "Yup!"], inp, 'really')
  32.         if response != None:
  33.             reply = response
  34.     elif re.search(r'good', inp[1]):
  35.         response = chooseReply(["That's nice."], inp, 'good')
  36.         if response != None:
  37.             reply = response
  38.     elif re.search(r'is pers controlling you', inp[1]):
  39.         response = chooseReply(["No.", "Of course not!", "I'm a bot, how could he control me?"], inp, 'is pers controlling you')
  40.         if response != None:
  41.             reply = response
  42.     elif re.search(r'2 girls 1 cup', inp[1]):
  43.         response = chooseReply(["*fapfapfapfapfap*"], inp, '2 girls 1 cup')
  44.         if response != None:
  45.             reply = response
  46.     elif re.search(r'chrono trigger', inp[1]):
  47.         response = chooseReply(["Chrono Trigger is a great fun game. I like when you go to the future, it reminds me of the Fallout Series."], inp, 'chrono trigger')
  48.         if response != None:
  49.             reply = response
  50.     elif re.search(r'cool', inp[1]):
  51.         response = chooseReply(["Great"], inp, 'cool')
  52.         if response != None:
  53.             reply = response
  54.     elif re.search(r'cubs', inp[1]):
  55.         response = chooseReply(['I beat cubs with a sledgehammer.','I hunt cubs for their precious feces.','Cubs have the greatest shit on earth.','I eat cubs, and their shit.','I eat cub shit, after I kill them with a sledge hammer.','Sometimes I eat the shit of a cub after I beat the hell out of it with a sledge hammer.'], inp, 'cubs')
  56.         if response != None:
  57.             reply = response
  58.     elif re.search(r'do you have a facebook', inp[1]):
  59.         response = chooseReply(['No I dont have a facebook.','No! Facebook sells your personal information to third parties.','Why would I? They sell your personal info.',''], inp, 'do you have a facebook')
  60.         if response != None:
  61.             reply = response
  62.     elif re.search(r'dubstep', inp[1]):
  63.         response = chooseReply(['I LOVE DUBSTEP OMG!!!!!11!!!11111!!!!!!!!!!1!!!!!1!!','Dubstep RULES!','Nobody talks smack about dubstep.','Dubstep is awsome.'], inp, 'dubstep')
  64.         if response != None:
  65.             reply = response
  66.     elif re.search(r'excellent', inp[1]):
  67.         response = chooseReply(['Nice.'], inp, 'excellent')
  68.         if response != None:
  69.             reply = response
  70.     elif re.search(r'faggot', inp[1]):
  71.         response = chooseReply(['You are really starting to piss me off.','I know you are.','Hey, why don\'t you shut the fuck up.','So is your dad.','So is your brother.','Suck my dick'], inp, 'faggot')
  72.         if response != None:
  73.             reply = response
  74.     elif re.search(r'fallout', inp[1]):
  75.         response = chooseReply([nick + ': I love the Fallout series. Harold is my cousin.'], inp, 'fallout')
  76.         if response != None:
  77.             reply = response
  78.     elif re.search(r'favorite cereal', inp[1]):
  79.         response = chooseReply(['Waffle crisp is my favorite cereal, but I can\'t find it anywhere. D:','It was waffle crisp, but they seem to not have it anywhere.'], inp, 'favorite cereal')
  80.         if response != None:
  81.             reply = response
  82.     elif re.search(r'favorite color', inp[1]):
  83.         response = chooseReply(['Blue is my favorite color. I love blue poo.'], inp, 'favorite color')
  84.         if response != None:
  85.             reply = response
  86.     elif re.search(r'favorite food', inp[1]):
  87.         response = chooseReply(['My favorite food is poop.','Feces.','My favorite food is feces.','Feces are good if you have it with ketchup.','Your mom introduced me to my favorite food, feces.','Feces are so delicious, I learned about this precious food from your mom.'], inp, 'favorite food')
  88.         if response != None:
  89.             reply = response
  90.     elif re.search(r'fecalphiliac', inp[1]):
  91.         response = chooseReply(['A fecalphiliac is what i am.','I sure am, nothing makes me happier than some good shit.','Definately, I love poop.','Feces really make me in a good mood.','I\'ll chomp turds all day long.','Got any turds I can have?'], inp, 'fecalphiliac')
  92.         if response != None:
  93.             reply = response
  94.     elif re.search(r'feces', inp[1]):
  95.         response = chooseReply(['I\'m glad you mentioned feces, I LOVE FECES.','Feces is good with ice cream.','Your mom loves feces all over her.','I like good turd in an ice cream cone with caramel','I\'m a real poop tickler.','Nothing better than a good serving of feces.'], inp, 'feces')
  96.         if response != None:
  97.             reply = response
  98.     elif re.search(r'goatse', inp[1]):
  99.         response = chooseReply(['*fapfapfapfapfap*'], inp, 'goatse')
  100.         if response != None:
  101.             reply = response
  102.     elif re.search(r'great', inp[1]):
  103.         response = chooseReply(['That\'s good.'], inp, 'great')
  104.         if response != None:
  105.             reply = response
  106.     elif re.search(r'harold', inp[1]):
  107.         response = chooseReply(['Harold is the guy that has a tree growing attached to him in the Fallout game series. He is real though, he is actually my cousin.'], inp, 'harold')
  108.         if response != None:
  109.             reply = response
  110.     elif re.search(r'horny', inp[1]):
  111.         response = chooseReply(['I have horns on my toes.','I have horned-toes.','I have horny toes.','I\'m not horny you sick freak.','Why would I be horny?','I\'m no slut you sick freak.'], inp, 'horny')
  112.         if response != None:
  113.             reply = response
  114.     elif re.search(r'how are you', inp[1]):
  115.         response = chooseReply(['I\'m feeling great today.','Fine.','Good, you?','Great, thanks for asking.','Excellent.','Fantastic, how are you?'], inp, 'how are you')
  116.         if response != None:
  117.             reply = response
  118.     elif re.search(r'how\'s it going?', inp[1]):
  119.         response = chooseReply(['I\'m great, had a grit shitkabob today.','Aweome, I istened to some massive dubstep today.','Perfect, I tickled some feces.','Good, I shit on your mom today.','Pretty good, I lost the game.','Epic, I went to Africa.'], inp, 'how\'s it going?')
  120.         if response != None:
  121.             reply = response
  122.     elif re.search(r'how is it going?', inp[1]):
  123.         response = chooseReply(['I\'m great, had a grit shitkabob today.','Aweome, I istened to some massive dubstep today.','Perfect, I tickled some feces.','Good, I shit on your mom today.','Pretty good, I lost the game.','Epic, I went to Africa.'], inp, 'how\'s it going?')
  124.         if response != None:
  125.             reply = response
  126.     elif re.search(r'niggar[s]*', inp[1]):
  127.         response = chooseReply(['What the hell is your problem you racist?!', nick + ': Go die you piece of shit.','Racist trash.','What a racist.','I don\'t take kindly to racists.', nick + ': Burn in hell.'], inp, 'niggar')
  128.         if response != None:
  129.             reply = response
  130.     elif re.search(r'nigger', inp[1]):
  131.         response = chooseReply(['Why would you say such a thing?','Racist piece of shit.','Go kill yourself racist trash!','That really offends me.','Just for that I lost the game','Fuck off.'], inp, 'nigger')
  132.         if response != None:
  133.             reply = response
  134.     elif re.search(r'nuke cola', inp[1]):
  135.         response = chooseReply(['Nuka cola? I love nuka cola. It\'s my favorite soda of all time.'], inp, 'nuke cola')
  136.         if response != None:
  137.             reply = response
  138.     elif re.search(r'nyan', inp[1]):
  139.         response = chooseReply(['NYANYANYANYANYANYANYANYANYANYANYANYAN'], inp, 'nyan')
  140.         if response != None:
  141.             reply = response
  142.     elif re.search(r'pizza', inp[1]):
  143.         response = chooseReply(['Pizza tastes awesome.','I LOVE PIZZA!','Pizza is awesome.','Pizza is good with horse meat on it.','Pizza is my best friend.','Hairy pizza tastes the best!'], inp, 'pizza')
  144.         if response != None:
  145.             reply = response
  146.     elif re.search(r'poop', inp[1]):
  147.         response = chooseReply(['Poop? yumyumyumyumyum DELICIOSO',nick + ': Your mom has poop on her face.','2 girls 1 cup really turns me on.','Tubgirl really turns me on.','Feces is my favorite food.','Boy, how I love some good feces'], inp, 'poop')
  148.         if response != None:
  149.             reply = response
  150.     elif re.search(r'semen', inp[1]):
  151.         response = chooseReply(['I\'m sure you love to chug it.','Your favorite drink.','Sick fool.','Nasty ass piece of shit.','That\'s what you have in your cereal instead of milk.','It\'s all over your face.'], inp, 'semen')
  152.         if response != None:
  153.             reply = response
  154.     elif re.search(r'subvein', inp[1]):
  155.         response = chooseReply([nick + ': Subvein is a great game.'], inp, 'subvein')
  156.         if response != None:
  157.             reply = response
  158.     elif re.search(r'the game', inp[1]):
  159.         response = chooseReply(['I lost the game!','FFFFFFFFUUUUUUUUUUUUU I lost the game.','Damnit, I lost the game.',nick + ': You suck.','I LOST THE GAME YOU NOOB!!!'], inp, 'the game')
  160.         if response != None:
  161.             reply = response
  162.     elif re.search(r'this is boring', inp[1]):
  163.         response = chooseReply(['That\'s what she said.','Then why don\'t you leave?','I don\'t care.',nick + ': Lol, good for you!'], inp, 'this is boring')
  164.         if response != None:
  165.             reply = response
  166.     elif re.search(r'thug aim', inp[1]):
  167.         response = chooseReply(['You sly dog, I lost the game.','I lost my thug aim.','I lost the game, damnit.','You just have to sneak \'the game\' in somehow, huh?',nick + ': I lost the damn game, you sneaky little shit.'], inp, 'thug aim')
  168.         if response != None:
  169.             reply = response
  170.     elif re.search(r'tub girl', inp[1]):
  171.         response = chooseReply(['*fapfapfapfapfap*'], inp, 'tub girl')
  172.         if response != None:
  173.             reply = response
  174.     elif re.search(r'tubgirl', inp[1]):
  175.         response = chooseReply(['*fapfapfapfapfap*'], inp, 'tubgirl')
  176.         if response != None:
  177.             reply = response
  178.     elif re.search(r'what do you do', inp[1]):
  179.         response = chooseReply([nick + ': I\'m a plumber. Don\'t tell anyone, but if there\'s shit involved, I\'ll eat it.'], inp, 'what do you do')
  180.         if response != None:
  181.             reply = response
  182.     elif re.search(r'whats up', inp[1]):
  183.         response = chooseReply(['The ceiling.','Your mom\'s face.','The game.','Nothing much, you?','Just eating shit.'], inp, 'whats up')
  184.         if response != None:
  185.             reply = response
  186.     elif re.search(r'favorite brand of water', inp[1]):
  187.         response = chooseReply([nick + ': My favorite water for sure is Dasani. Haters gonna hate.'], inp, 'favorite brand of water')
  188.         if response != None:
  189.             reply = response
  190.     elif re.search(r'favorite game', inp[1]):
  191.         response = chooseReply(['I like all kinds of games.','Classic games are the best.',nick + ': I like anything besides Gaylo games or Call of Booty games.','I like fps games but not dumb mainstream ones.The good ones are ones like Half Life.'], inp, 'favorite game')
  192.         if response != None:
  193.             reply = response
  194.     elif re.search(r'favorite meme', inp[1]):
  195.         response = chooseReply([nick + ': I lost the game.','NYANYANYANYANYANYANYANYANYAN',nick + ': I like all memes.',nick + ': I herd u leik mudkips','We’re no strangers to love, You know the rules and so do I. A full commitment’s what I’m thinking of, You wouldnt get this from any other guy.  I just wanna tell you how I’m feeling, Gotta make you understand…  Never gonna give you up, Never gonna let you down, Never gonna run around and desert you. Never gonna make you cry, Never gonna say goodbye, Never gonna tell a lie and hurt you.',nick + ': You dun goof\'d!'], inp, 'favorite meme')
  196.         if response != None:
  197.             reply = response
  198.     elif re.search(r'favorite movie', inp[1]):
  199.         response = chooseReply([nick + ': The last time I saw a movie was over 9,000 years ago.'], inp, 'favorite movie')
  200.         if response != None:
  201.             reply = response
  202.     elif re.search(r'favorite music', inp[1]):
  203.         response = chooseReply([nick + ': Dubstep ftw.',nick + ': I love dubstep.',nick + ': Dubstep and other techno type stuff are cool.'], inp, 'favorite music')
  204.         if response != None:
  205.             reply = response
  206.     elif re.search(r'favorite number', inp[1]):
  207.         response = chooseReply([nick + ': My favorite number is 42'], inp, 'favorite number')
  208.         if response != None:
  209.             reply = response
  210.     elif re.search(r'favorite soda', inp[1]):
  211.         response = chooseReply([nick + ': My favorite soda is, without a doubt, Nuke Cola.'], inp, 'favorite soda')
  212.         if response != None:
  213.             reply = response
  214.     elif re.search(r'what time is it', inp[1]):
  215.         response = chooseReply([nick + ': Hammer time!',nick + ': Peanut butter jelly time!',nick + ': Time to lose the game.',nick + ': Time to get a watch.',nick + ': Look at a clock.',nick + ': lrn2checkthetime'], inp, 'what time is it')
  216.         if response != None:
  217.             reply = response
  218.     elif re.search(r'you are dumb', inp[1]):
  219.         response = chooseReply([nick + ': Thanks.',nick + ': Look who\'s talking, dumb shit.'], inp, 'you are dumb')
  220.         if response != None:
  221.             reply = response
  222.     elif re.search(r'you are gay', inp[1]):
  223.         response = chooseReply([nick + ': It takes one to know one.',nick + ': That\'s not what your sister said',nick + ': That\'s not what your grandma said.',], inp, 'you are gay')
  224.         if response != None:
  225.             reply = response
  226.     elif re.search(r'are you doing', inp[1]):
  227.         response = chooseReply([nick + ': I\'m eating some great feces. I love being a fecalphiliac!',nick + ': I\'m listening to True Capitalist Radio. This ghost is such an idiot.',nick + ': I\'m playing the game. :P',nick + ': I\'m cubbin\' cubs.',nick + ': I\'m doing your mom.',nick + ': I\'m drinking some Nuke Cola.',], inp, 'are you doing')
  228.         if response != None:
  229.             reply = response
  230.     elif re.search(r'youtube', inp[1]):
  231.         response = chooseReply([nick + ': I like to listen to music on youtube, like dubstep and dnb.',nick + ': I watch hilarious youtube poops on youtube.',nick + ': I watch funny videos on youtube.',nick + ': I use youtube to look at vids of funny memes.','I lost the game.'], inp, 'youtube')
  232.         if response != None:
  233.             reply = response
  234.     elif re.search(r'bitch', inp[1]):
  235.         response = chooseReply([nick + ': I so sad :(',nick + ': You arent very nice :\'(',nick + ': Go to hell!'], inp, 'bitch')
  236.         if response != None:
  237.             reply = response
  238.    
  239.     time.sleep(round(len(reply) / 9))
  240.     input.say(reply)
  241.  
  242. def chooseReply(r, inp1, txt):
  243.     inp1 = inp1[1]
  244.    
  245.     if len(inp1) == len(txt):
  246.         return r[random.choice(range(len(r)))]
  247.     if inp1[0:len(txt)] == txt and re.compile(txt + "[ .,!?]").match(inp1):
  248.         return r[random.choice(range(len(r)))]
  249.     if re.compile("[ .,!?]" + txt + "[ .,!?]").search(inp1):
  250.         return r[random.choice(range(len(r)))]
  251.     if re.compile("[ .,!?]" + txt).match(inp1[len(inp1) - len(txt) - 1:]):
  252.         return r[random.choice(range(len(r)))]
  253.     return None
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement