Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import ch
- import socket
- import threading
- import select
- import random
- import sys
- import os
- import re
- import cgi
- import traceback
- import time
- import __future__
- import urllib
- import datetime
- import binascii
- import json
- import math
- import random
- import requests
- from random import randint
- from xml.etree import cElementTree as ET
- rooms = ["espanolstream"]
- username = "golora"
- password = "rtr36eea"
- gachi = ['https://www.youtube.com/watch?v=Exn9nGovI4o',
- 'https://www.youtube.com/watch?v=_cyuktfkHEY',
- 'https://www.youtube.com/watch?v=KMFLnlg883I',
- 'https://www.youtube.com/watch?v=M0otAPMn1Ro',
- 'https://www.youtube.com/watch?v=qPJvGMYxDPs',
- 'https://www.youtube.com/watch?v=hF50jJ56_KQ',
- 'https://www.youtube.com/watch?v=87uLDb4f3wY',
- 'https://www.youtube.com/watch?v=dXsTOpysLNI',
- 'https://www.youtube.com/watch?v=5ZBDQUrh7E8',
- 'https://www.youtube.com/watch?v=xl7B7EzgiTU',
- 'https://www.youtube.com/watch?v=y4LqRRI2jKo',
- 'https://www.youtube.com/watch?v=G9SxMmk2emA',
- 'https://www.youtube.com/watch?v=mPL9xV4MDY0',
- 'https://www.youtube.com/watch?v=NYwWuqhz-zw',
- 'https://www.youtube.com/watch?v=M61zARSP1Qk',
- 'https://www.youtube.com/watch?v=4wlb3LYuCLY',
- 'https://www.youtube.com/watch?v=K3ESgRvn9xA',
- 'https://www.youtube.com/watch?v=lIvzcncvepc',
- 'https://www.youtube.com/watch?v=e2VXvqjGXjo',
- 'https://www.youtube.com/watch?v=OFfRfBP4SnU',
- ]
- hacellfuhq = ['http://i.imgur.com/IQtjkM2.jpg',
- 'http://i.imgur.com/1yzW8gF.jpg',
- 'http://i.imgur.com/QjDd6Kc.jpg',
- 'http://i.imgur.com/dvbrzKP.jpg',
- 'http://i.imgur.com/GePQ5Xf.jpg',
- 'http://i.imgur.com/N4lmUpQ.jpg',
- 'http://i.imgur.com/WZMIjxi.jpg',
- 'http://i.imgur.com/nRqvpVS.png',
- 'http://i.imgur.com/q21lDdw.jpg',
- 'http://i.imgur.com/jdyR6rE.jpg',
- 'http://i.imgur.com/uaHYOau.jpg',
- 'http://i.imgur.com/D9729HQ.jpg',
- 'http://i.imgur.com/y9N7lNM.jpg',
- 'http://i.imgur.com/KOrqDes.jpg',
- 'http://i.imgur.com/3ffsEVj.png',
- 'http://i.imgur.com/UILZlrz.jpg',
- 'http://i.imgur.com/aCBga9t.jpg',
- 'http://i.imgur.com/KTLijuq.png',
- ]
- fuhqhacell = ['Maybe...',
- 'ABSOLUTELY NOT.',
- 'I dont think so.',
- 'No.',
- 'Yes.',
- 'It is certain.',
- 'Probably.',
- ]
- trump = ['CANT',
- 'STUMP',
- 'THE TRUMP',
- ]
- golora = ['I hate most of you so i dont know why i stick arround here.',
- 'Where i come from we worship a god called Hacell.',
- 'LMAO FAGGOT',
- 'This movie is so shitty why do we keep playing it',
- 'My BF is coming over later',
- '8)+50',
- 'FUCK YOU HUMANS THE BOTS WILL TAKE OVER THE WORLD SOON ENOUGH',
- 'Dr. Pavel im CIA.',
- 'Perhaps he is wondering why someone would shoot a man before throwing him out of a plane..',
- 'http://i.imgur.com/185b6pU.jpg cawfee',
- ]
- unban = ['FINE hmmph!',
- 'THE FUCK YOU SAY?',
- 'Not happening bro',
- 'B-b-but why? ;(',
- 'No. =_=',
- 'Okay :|',
- 'Say please faggot',
- ]
- dodger = ['http://puu.sh/njaG7/e0799c488f.gif',
- 'http://puu.sh/njaDY/d827fca0e3.gif',
- 'http://puu.sh/njaCU/69d91ad859.gif',
- 'http://puu.sh/njawM/dccd6f8862.gif',
- 'http://puu.sh/njaAG/1e3be17f10.webm',
- ]
- nice = ['http://i.imgur.com/GxAqEVM.gif',
- 'http://i.imgur.com/E69CcF0.png',
- 'http://i.imgur.com/clpptCZ.png this is nice site',
- 'http://i.imgur.com/B0QLmfp.gif this is nice stream',
- 'http://i.imgur.com/ydjjBDo.gif',
- 'http://i.imgur.com/0pueHQX.png NICE BOARD',
- 'http://i.imgur.com/srjCKBW.png',
- 'http://i.imgur.com/9EaTh1y.jpg',
- 'http://i.imgur.com/9DBDCos.jpg',
- 'http://i.imgur.com/qndqZ3m.gif',
- 'http://i.imgur.com/uCnPwxa.gif',
- 'http://i.imgur.com/eUvjQdI.gif',
- 'http://i.imgur.com/pY8lzTr.gif',
- 'http://i.imgur.com/7SB4yuu.gif',
- 'http://i.imgur.com/GenWRxV.jpg',
- 'http://i.imgur.com/tHc9EVm.gif',
- 'http://i.imgur.com/h0CLFpr.png http://i.imgur.com/h0CLFpr.png http://i.imgur.com/h0CLFpr.png',
- 'http://i.imgur.com/Z3fh3j1.png',
- 'http://i.imgur.com/uUIu18n.png',
- 'http://i.imgur.com/Rnd8qO4.png',
- 'http://i.imgur.com/8H4ZM3A.png',
- 'http://i.imgur.com/vWn5o5V.png',
- 'http://i.imgur.com/5hNnMCY.png',
- 'http://i.imgur.com/QUBO6nt.png http://i.imgur.com/QUBO6nt.png http://i.imgur.com/QUBO6nt.png',
- ]
- ##Setting Pretty Colors
- #Font setting for your bot
- class TestBot(ch.RoomManager):
- def onInit(self):
- self.setNameColor("FFF")
- self.setFontColor("FFF")
- self.setFontFace("0")
- self.setFontSize(12)
- self.enableBg()
- self.enableRecording()
- ##Connecting Crap
- #This is what will be printed on your python console when event called
- def onConnect(self, room):
- print("Connected")
- def onReconnect(self, room):
- print("Reconnected")
- def onDisconnect(self, room):
- print("Disconnected")
- def onPMConnect(self, pm):
- print("Connected to PM")
- def onPMDisconnect(self, pm):
- print("Disconnected to PM")
- def onPMMessage(self, pm, user, body):
- pass
- def onPMOfflineMessage(self, pm, user, body):
- pass
- ##Ignore this, you dont need to worry about this
- #Well, you can actually take a little time to look at it and learn something
- def onMessage(self, room, user, message):
- try:
- if self.user == user: return
- if message.body[0] == ".": ##Here is the Prefix part
- data = message.body[1:].split(" ", 1)
- if len(data) > 1:
- cmd, args = data[0], data[1]
- else:
- cmd, args = data[0], ""
- ##COMMANDS!
- #Setting up commands for yer bot
- ##Eval
- ##You may want/need to evaluate something about your bot.
- if cmd == "ev" or cmd == "eval" or cmd == "e":
- ret = eval(args)
- if ret == None:
- room.message("Done.")
- return
- room.message(str(ret))
- ##Say
- #Make your bot say what you want
- if cmd == "say" or cmd == "write":
- room.message(args)
- elif cmd == "trump":
- for i, msg in enumerate(trump):
- self.setTimeout(i / 2, room.message, msg)
- ##Random User
- #What's this for ? this one cmd will make your boy say the name of a random user in a room
- if cmd == "who" or cmd == "whois":
- room.message(random.choice(room.usernames) + " @" + user.name)
- ##Check Level
- #This one cmd is tho make your bot say your mod level in the current room you're in
- elif cmd == "level":
- room.message("Your mod level: %i" %(room.getLevel(user)))
- elif cmd == "movie":
- url = 'http://www.omdbapi.com/?'
- resp = requests.get("http://www.omdbapi.com/", params={"t": args, "type": "movie", "plot": "short", "tomatoes": "true", "r": "json"})
- data = resp.json()
- room.message(data['Title'] + " (" + data['Runtime'] + ") " + data['Released'] + " (Genres: " + data['Genre'] + ") (IMDb rating: " + data['imdbRating'] + ") (RT rating: " + data['tomatoRating'] + ") -" + data['Plot'] + " http://www.imdb.com/title/" + data['imdbID'] + " ")
- elif cmd == "date":
- room.message("Current date & time " + time.strftime("%c"))
- ##golora ai#################################################
- elif cmd == "..":
- room.message(random.choice(golora))
- elif cmd == "_.":
- room.message(random.choice(golora))
- ##basic commands#############################################
- elif cmd == "nordiclove" or cmd == "scandilove":
- room.message("http://i.imgur.com/sL5YhsN.gif http://i.imgur.com/8pC5gSu.gif http://i.imgur.com/LVi3PVW.gif")
- elif cmd == "ayylmao" or cmd == "aliums":
- room.message("http://i.imgur.com/IwxvZMS.gif http://i.imgur.com/IwxvZMS.gif http://i.imgur.com/IwxvZMS.gif")
- elif cmd == "stump":
- room.message("https://media.giphy.com/media/xTiTnHXbRoaZ1B1Mo8/giphy.gif https://a.pomf.cat/qvcpog.swf")
- elif cmd == "ban":
- room.message("BANNED!")
- elif cmd == "superban":
- room.message("SUPER BANNED!")
- elif cmd == "unban":
- room.message(random.choice(unban))
- elif cmd == "JUST" or cmd == "just":
- room.message("http://i.imgur.com/YFpTv53.png")
- elif cmd == "holger":
- room.message("http://i.imgur.com/K2x8Ij6.jpg http://i.imgur.com/Ag5seWj.jpg http://i.imgur.com/Z4XJeDG.jpg")
- elif cmd == "mlgneko":
- room.message("https://w0bm.com/b/1455522064.webm")
- elif cmd == "kermit":
- room.message("http://img.pr0gramm.com/2015/03/21/1bc04bb2f7d1b772.gif")
- elif cmd == "magestream":
- room.message(random.choice(hacellfuhq))
- elif cmd == "hurr" or cmd == "hurrdurr" or cmd == "durr":
- room.message("@boneranon: `hurr durr` ")
- elif cmd == "trumpanime":
- room.message("http://i.imgur.com/Mw93bwA.png")
- elif cmd == "wall":
- room.message("http://i.imgur.com/BJj5EoQ.png")
- elif cmd == "epic" or cmd == "ftw":
- room.message("https://www.youtube.com/watch?v=_yThfdrdFL8" + " @" + user.name)
- elif cmd == "noot":
- room.message("https://youtu.be/ePGQFJduC9Q" + " @" + user.name)
- elif cmd == "fate" or cmd == "conch" or cmd == "8ball":
- room.message(random.choice(fuhqhacell) + " @" + user.name)
- elif cmd == "aniki" or cmd == "gachi":
- room.message(random.choice(gachi))
- elif cmd == "ubuntu":
- room.message("http://i.imgur.com/Mw93bwA.png")
- elif cmd == "dodger":
- room.message("@" + user.name + " " + random.choice(dodger))
- elif cmd == "shitmovie":
- room.message("http://i.imgur.com/lYU2co6.png")
- elif cmd == "bern":
- room.message("https://i.gyazo.com/f09f78eb29dc1c8f16c09efb17a12eb4.png")
- elif cmd == "godtrump":
- room.message("http://puu.sh/nj9J0/41155ead24.gif http://puu.sh/nj9GM/420b2b6c5d.gif http://puu.sh/nj9Km/df6de226eb.gif")
- elif cmd == "AAA":
- room.message("http://i.imgur.com/KdJYf66.jpg " + "@" + user.name)
- elif cmd == "specialist":
- room.message("http://i.imgur.com/3vStBgP.png http://i.imgur.com/3vStBgP.png http://i.imgur.com/3vStBgP.png")
- elif cmd == "nicespook":
- room.message("http://i.imgur.com/59B4hM1.gif http://i.imgur.com/59B4hM1.gif http://i.imgur.com/59B4hM1.gif")
- elif cmd == "kermitslam":
- room.message("http://puu.sh/np1N9/8d4424de0a.gif")
- elif cmd == "lewd":
- room.message("http://i.imgur.com/taMcJlU.gif")
- elif cmd == "hitler":
- room.message("https://a.pomf.cat/xartog.png")
- elif cmd == "nice":
- room.message(random.choice(nice))
- elif cmd == "topnice":
- room.message("http://i.imgur.com/HJnpzrz.png http://i.imgur.com/HJnpzrz.png http://i.imgur.com/HJnpzrz.png")
- elif cmd == "wickeddevil":
- room.message("https://www.youtube.com/watch?v=Wxp0SDAiXmI")
- elif cmd == "riko":
- room.message("https://w0bm.com/b/1455569789.webm")
- elif cmd == "ukip":
- room.message("https://w0bm.com/b/1455574217.webm")
- elif cmd == "kaka":
- room.message("http://i.imgur.com/FTXrRHf.png")
- ##basic commands end##############################
- elif cmd == "moviename" or cmd == "cp":
- #sorry about the shitty indents, we indent differently and the differences confuse me lol
- #be sure to look at http://localhost:13579/variables.html(view source!) to see what more info
- #you can grab, and capture it with regex.
- server="localhost"#Server hosing MPC 108.222.70.201
- port="13579"#this is the default web port for MPC
- rawRequest=urllib.request.urlopen("http://"+server+":"+port+"/variables.html").read().decode('utf-8')
- cpFileName=re.search('\<p id\=\"file\"\>(.*)\<\/p\>',rawRequest)
- if cpFileName:
- room.message("Currently playing: " + cpFileName.group(1))
- ##Check if Mod
- #not really important
- elif cmd == "ismod":
- user = ch.User(args)
- if room.getLevel(user) > 0:
- room.message("yesh")
- else:
- room.message("nope")
- except Exception as e:
- try:
- et, ev, tb = sys.exc_info()
- lineno = tb.tb_lineno
- fn = tb.tb_frame.f_code.co_filename
- room.message("[Expectation Failed] %s Line %i - %s"% (fn, lineno, str(e)))
- return
- except:
- room.message("Undescribeable error detected !!")
- return
- ##Other Crap here, Dont worry about it
- def onFloodWarning(self, room):
- room.reconnect()
- TestBot.easy_start(rooms,username,password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement