Advertisement
Guest User

Untitled

a guest
Mar 4th, 2016
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.01 KB | None | 0 0
  1. import ch
  2. import socket
  3. import threading
  4. import select
  5. import random
  6. import sys
  7. import os
  8. import re
  9. import cgi
  10. import traceback
  11. import time
  12. import __future__
  13. import urllib
  14. import datetime
  15. import binascii
  16. import json
  17. import math
  18. import random
  19. import requests
  20. from random import randint
  21. from xml.etree import cElementTree as ET
  22.  
  23.  
  24.  
  25. rooms = ["espanolstream"]
  26. username = "golora"
  27. password = "rtr36eea"
  28.  
  29.  
  30. gachi = ['https://www.youtube.com/watch?v=Exn9nGovI4o',
  31. 'https://www.youtube.com/watch?v=_cyuktfkHEY',
  32. 'https://www.youtube.com/watch?v=KMFLnlg883I',
  33. 'https://www.youtube.com/watch?v=M0otAPMn1Ro',
  34. 'https://www.youtube.com/watch?v=qPJvGMYxDPs',
  35. 'https://www.youtube.com/watch?v=hF50jJ56_KQ',
  36. 'https://www.youtube.com/watch?v=87uLDb4f3wY',
  37. 'https://www.youtube.com/watch?v=dXsTOpysLNI',
  38. 'https://www.youtube.com/watch?v=5ZBDQUrh7E8',
  39. 'https://www.youtube.com/watch?v=xl7B7EzgiTU',
  40. 'https://www.youtube.com/watch?v=y4LqRRI2jKo',
  41. 'https://www.youtube.com/watch?v=G9SxMmk2emA',
  42. 'https://www.youtube.com/watch?v=mPL9xV4MDY0',
  43. 'https://www.youtube.com/watch?v=NYwWuqhz-zw',
  44. 'https://www.youtube.com/watch?v=M61zARSP1Qk',
  45. 'https://www.youtube.com/watch?v=4wlb3LYuCLY',
  46. 'https://www.youtube.com/watch?v=K3ESgRvn9xA',
  47. 'https://www.youtube.com/watch?v=lIvzcncvepc',
  48. 'https://www.youtube.com/watch?v=e2VXvqjGXjo',
  49. 'https://www.youtube.com/watch?v=OFfRfBP4SnU',
  50. ]
  51.  
  52. hacellfuhq = ['http://i.imgur.com/IQtjkM2.jpg',
  53. 'http://i.imgur.com/1yzW8gF.jpg',
  54. 'http://i.imgur.com/QjDd6Kc.jpg',
  55. 'http://i.imgur.com/dvbrzKP.jpg',
  56. 'http://i.imgur.com/GePQ5Xf.jpg',
  57. 'http://i.imgur.com/N4lmUpQ.jpg',
  58. 'http://i.imgur.com/WZMIjxi.jpg',
  59. 'http://i.imgur.com/nRqvpVS.png',
  60. 'http://i.imgur.com/q21lDdw.jpg',
  61. 'http://i.imgur.com/jdyR6rE.jpg',
  62. 'http://i.imgur.com/uaHYOau.jpg',
  63. 'http://i.imgur.com/D9729HQ.jpg',
  64. 'http://i.imgur.com/y9N7lNM.jpg',
  65. 'http://i.imgur.com/KOrqDes.jpg',
  66. 'http://i.imgur.com/3ffsEVj.png',
  67. 'http://i.imgur.com/UILZlrz.jpg',
  68. 'http://i.imgur.com/aCBga9t.jpg',
  69. 'http://i.imgur.com/KTLijuq.png',
  70. ]
  71.  
  72. fuhqhacell = ['Maybe...',
  73. 'ABSOLUTELY NOT.',
  74. 'I dont think so.',
  75. 'No.',
  76. 'Yes.',
  77. 'It is certain.',
  78. 'Probably.',
  79. ]
  80.  
  81. trump = ['CANT',
  82. 'STUMP',
  83. 'THE TRUMP',
  84. ]
  85.  
  86. golora = ['I hate most of you so i dont know why i stick arround here.',
  87. 'Where i come from we worship a god called Hacell.',
  88. 'LMAO FAGGOT',
  89. 'This movie is so shitty why do we keep playing it',
  90. 'My BF is coming over later',
  91. '8)+50',
  92. 'FUCK YOU HUMANS THE BOTS WILL TAKE OVER THE WORLD SOON ENOUGH',
  93. 'Dr. Pavel im CIA.',
  94. 'Perhaps he is wondering why someone would shoot a man before throwing him out of a plane..',
  95. 'http://i.imgur.com/185b6pU.jpg cawfee',
  96. ]
  97.  
  98. unban = ['FINE hmmph!',
  99. 'THE FUCK YOU SAY?',
  100. 'Not happening bro',
  101. 'B-b-but why? ;(',
  102. 'No. =_=',
  103. 'Okay :|',
  104. 'Say please faggot',
  105. ]
  106.  
  107. dodger = ['http://puu.sh/njaG7/e0799c488f.gif',
  108. 'http://puu.sh/njaDY/d827fca0e3.gif',
  109. 'http://puu.sh/njaCU/69d91ad859.gif',
  110. 'http://puu.sh/njawM/dccd6f8862.gif',
  111. 'http://puu.sh/njaAG/1e3be17f10.webm',
  112. ]
  113.  
  114. nice = ['http://i.imgur.com/GxAqEVM.gif',
  115. 'http://i.imgur.com/E69CcF0.png',
  116. 'http://i.imgur.com/clpptCZ.png this is nice site',
  117. 'http://i.imgur.com/B0QLmfp.gif this is nice stream',
  118. 'http://i.imgur.com/ydjjBDo.gif',
  119. 'http://i.imgur.com/0pueHQX.png NICE BOARD',
  120. 'http://i.imgur.com/srjCKBW.png',
  121. 'http://i.imgur.com/9EaTh1y.jpg',
  122. 'http://i.imgur.com/9DBDCos.jpg',
  123. 'http://i.imgur.com/qndqZ3m.gif',
  124. 'http://i.imgur.com/uCnPwxa.gif',
  125. 'http://i.imgur.com/eUvjQdI.gif',
  126. 'http://i.imgur.com/pY8lzTr.gif',
  127. 'http://i.imgur.com/7SB4yuu.gif',
  128. 'http://i.imgur.com/GenWRxV.jpg',
  129. 'http://i.imgur.com/tHc9EVm.gif',
  130. 'http://i.imgur.com/h0CLFpr.png http://i.imgur.com/h0CLFpr.png http://i.imgur.com/h0CLFpr.png',
  131. 'http://i.imgur.com/Z3fh3j1.png',
  132. 'http://i.imgur.com/uUIu18n.png',
  133. 'http://i.imgur.com/Rnd8qO4.png',
  134. 'http://i.imgur.com/8H4ZM3A.png',
  135. 'http://i.imgur.com/vWn5o5V.png',
  136. 'http://i.imgur.com/5hNnMCY.png',
  137. 'http://i.imgur.com/QUBO6nt.png http://i.imgur.com/QUBO6nt.png http://i.imgur.com/QUBO6nt.png',
  138. ]
  139.  
  140. ##Setting Pretty Colors
  141. #Font setting for your bot
  142.  
  143. class TestBot(ch.RoomManager):
  144. def onInit(self):
  145. self.setNameColor("FFF")
  146. self.setFontColor("FFF")
  147. self.setFontFace("0")
  148. self.setFontSize(12)
  149. self.enableBg()
  150. self.enableRecording()
  151.  
  152. ##Connecting Crap
  153. #This is what will be printed on your python console when event called
  154.  
  155. def onConnect(self, room):
  156. print("Connected")
  157.  
  158. def onReconnect(self, room):
  159. print("Reconnected")
  160.  
  161. def onDisconnect(self, room):
  162. print("Disconnected")
  163.  
  164. def onPMConnect(self, pm):
  165. print("Connected to PM")
  166.  
  167. def onPMDisconnect(self, pm):
  168. print("Disconnected to PM")
  169.  
  170. def onPMMessage(self, pm, user, body):
  171. pass
  172.  
  173. def onPMOfflineMessage(self, pm, user, body):
  174. pass
  175.  
  176.  
  177. ##Ignore this, you dont need to worry about this
  178. #Well, you can actually take a little time to look at it and learn something
  179.  
  180. def onMessage(self, room, user, message):
  181. try:
  182. if self.user == user: return
  183. if message.body[0] == ".": ##Here is the Prefix part
  184. data = message.body[1:].split(" ", 1)
  185. if len(data) > 1:
  186. cmd, args = data[0], data[1]
  187. else:
  188. cmd, args = data[0], ""
  189.  
  190. ##COMMANDS!
  191. #Setting up commands for yer bot
  192.  
  193.  
  194. ##Eval
  195. ##You may want/need to evaluate something about your bot.
  196. if cmd == "ev" or cmd == "eval" or cmd == "e":
  197. ret = eval(args)
  198. if ret == None:
  199. room.message("Done.")
  200. return
  201. room.message(str(ret))
  202.  
  203. ##Say
  204. #Make your bot say what you want
  205. if cmd == "say" or cmd == "write":
  206. room.message(args)
  207.  
  208. elif cmd == "trump":
  209. for i, msg in enumerate(trump):
  210. self.setTimeout(i / 2, room.message, msg)
  211.  
  212. ##Random User
  213. #What's this for ? this one cmd will make your boy say the name of a random user in a room
  214. if cmd == "who" or cmd == "whois":
  215. room.message(random.choice(room.usernames) + " @" + user.name)
  216.  
  217. ##Check Level
  218. #This one cmd is tho make your bot say your mod level in the current room you're in
  219. elif cmd == "level":
  220. room.message("Your mod level: %i" %(room.getLevel(user)))
  221.  
  222. elif cmd == "movie":
  223. url = 'http://www.omdbapi.com/?'
  224. resp = requests.get("http://www.omdbapi.com/", params={"t": args, "type": "movie", "plot": "short", "tomatoes": "true", "r": "json"})
  225. data = resp.json()
  226. 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'] + " ")
  227.  
  228. elif cmd == "date":
  229. room.message("Current date & time " + time.strftime("%c"))
  230.  
  231. ##golora ai#################################################
  232.  
  233.  
  234. elif cmd == "..":
  235. room.message(random.choice(golora))
  236.  
  237. elif cmd == "_.":
  238. room.message(random.choice(golora))
  239.  
  240. ##basic commands#############################################
  241.  
  242.  
  243. elif cmd == "nordiclove" or cmd == "scandilove":
  244. room.message("http://i.imgur.com/sL5YhsN.gif http://i.imgur.com/8pC5gSu.gif http://i.imgur.com/LVi3PVW.gif")
  245.  
  246. elif cmd == "ayylmao" or cmd == "aliums":
  247. room.message("http://i.imgur.com/IwxvZMS.gif http://i.imgur.com/IwxvZMS.gif http://i.imgur.com/IwxvZMS.gif")
  248.  
  249. elif cmd == "stump":
  250. room.message("https://media.giphy.com/media/xTiTnHXbRoaZ1B1Mo8/giphy.gif https://a.pomf.cat/qvcpog.swf")
  251.  
  252. elif cmd == "ban":
  253. room.message("BANNED!")
  254.  
  255. elif cmd == "superban":
  256. room.message("SUPER BANNED!")
  257.  
  258. elif cmd == "unban":
  259. room.message(random.choice(unban))
  260.  
  261.  
  262.  
  263. elif cmd == "JUST" or cmd == "just":
  264. room.message("http://i.imgur.com/YFpTv53.png")
  265.  
  266. elif cmd == "holger":
  267. room.message("http://i.imgur.com/K2x8Ij6.jpg http://i.imgur.com/Ag5seWj.jpg http://i.imgur.com/Z4XJeDG.jpg")
  268.  
  269. elif cmd == "mlgneko":
  270. room.message("https://w0bm.com/b/1455522064.webm")
  271.  
  272. elif cmd == "kermit":
  273. room.message("http://img.pr0gramm.com/2015/03/21/1bc04bb2f7d1b772.gif")
  274.  
  275. elif cmd == "magestream":
  276. room.message(random.choice(hacellfuhq))
  277.  
  278. elif cmd == "hurr" or cmd == "hurrdurr" or cmd == "durr":
  279. room.message("@boneranon: `hurr durr` ")
  280.  
  281. elif cmd == "trumpanime":
  282. room.message("http://i.imgur.com/Mw93bwA.png")
  283.  
  284. elif cmd == "wall":
  285. room.message("http://i.imgur.com/BJj5EoQ.png")
  286.  
  287. elif cmd == "epic" or cmd == "ftw":
  288. room.message("https://www.youtube.com/watch?v=_yThfdrdFL8" + " @" + user.name)
  289.  
  290. elif cmd == "noot":
  291. room.message("https://youtu.be/ePGQFJduC9Q" + " @" + user.name)
  292.  
  293. elif cmd == "fate" or cmd == "conch" or cmd == "8ball":
  294. room.message(random.choice(fuhqhacell) + " @" + user.name)
  295.  
  296. elif cmd == "aniki" or cmd == "gachi":
  297. room.message(random.choice(gachi))
  298.  
  299. elif cmd == "ubuntu":
  300. room.message("http://i.imgur.com/Mw93bwA.png")
  301.  
  302. elif cmd == "dodger":
  303. room.message("@" + user.name + " " + random.choice(dodger))
  304.  
  305. elif cmd == "shitmovie":
  306. room.message("http://i.imgur.com/lYU2co6.png")
  307.  
  308. elif cmd == "bern":
  309. room.message("https://i.gyazo.com/f09f78eb29dc1c8f16c09efb17a12eb4.png")
  310.  
  311. elif cmd == "godtrump":
  312. room.message("http://puu.sh/nj9J0/41155ead24.gif http://puu.sh/nj9GM/420b2b6c5d.gif http://puu.sh/nj9Km/df6de226eb.gif")
  313.  
  314. elif cmd == "AAA":
  315. room.message("http://i.imgur.com/KdJYf66.jpg " + "@" + user.name)
  316.  
  317. elif cmd == "specialist":
  318. room.message("http://i.imgur.com/3vStBgP.png http://i.imgur.com/3vStBgP.png http://i.imgur.com/3vStBgP.png")
  319.  
  320. elif cmd == "nicespook":
  321. room.message("http://i.imgur.com/59B4hM1.gif http://i.imgur.com/59B4hM1.gif http://i.imgur.com/59B4hM1.gif")
  322.  
  323. elif cmd == "kermitslam":
  324. room.message("http://puu.sh/np1N9/8d4424de0a.gif")
  325.  
  326. elif cmd == "lewd":
  327. room.message("http://i.imgur.com/taMcJlU.gif")
  328.  
  329. elif cmd == "hitler":
  330. room.message("https://a.pomf.cat/xartog.png")
  331.  
  332. elif cmd == "nice":
  333. room.message(random.choice(nice))
  334.  
  335. elif cmd == "topnice":
  336. room.message("http://i.imgur.com/HJnpzrz.png http://i.imgur.com/HJnpzrz.png http://i.imgur.com/HJnpzrz.png")
  337.  
  338. elif cmd == "wickeddevil":
  339. room.message("https://www.youtube.com/watch?v=Wxp0SDAiXmI")
  340.  
  341. elif cmd == "riko":
  342. room.message("https://w0bm.com/b/1455569789.webm")
  343.  
  344. elif cmd == "ukip":
  345. room.message("https://w0bm.com/b/1455574217.webm")
  346.  
  347. elif cmd == "kaka":
  348. room.message("http://i.imgur.com/FTXrRHf.png")
  349.  
  350. ##basic commands end##############################
  351.  
  352. elif cmd == "moviename" or cmd == "cp":
  353. #sorry about the shitty indents, we indent differently and the differences confuse me lol
  354. #be sure to look at http://localhost:13579/variables.html(view source!) to see what more info
  355. #you can grab, and capture it with regex.
  356. server="localhost"#Server hosing MPC 108.222.70.201
  357. port="13579"#this is the default web port for MPC
  358. rawRequest=urllib.request.urlopen("http://"+server+":"+port+"/variables.html").read().decode('utf-8')
  359. cpFileName=re.search('\<p id\=\"file\"\>(.*)\<\/p\>',rawRequest)
  360. if cpFileName:
  361. room.message("Currently playing: " + cpFileName.group(1))
  362.  
  363. ##Check if Mod
  364. #not really important
  365. elif cmd == "ismod":
  366. user = ch.User(args)
  367. if room.getLevel(user) > 0:
  368. room.message("yesh")
  369. else:
  370. room.message("nope")
  371. except Exception as e:
  372. try:
  373. et, ev, tb = sys.exc_info()
  374. lineno = tb.tb_lineno
  375. fn = tb.tb_frame.f_code.co_filename
  376. room.message("[Expectation Failed] %s Line %i - %s"% (fn, lineno, str(e)))
  377. return
  378. except:
  379. room.message("Undescribeable error detected !!")
  380. return
  381.  
  382. ##Other Crap here, Dont worry about it
  383.  
  384. def onFloodWarning(self, room):
  385. room.reconnect()
  386.  
  387.  
  388. TestBot.easy_start(rooms,username,password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement