Advertisement
Thelorgoreng

Nih bro asal mula bot ane :v

Aug 6th, 2015
724
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 63.78 KB | None | 0 0
  1. ############################################################################
  2. ############################################################################
  3. ####    Getting Started Bot                                     ############
  4. ####    File            = ExampleBot.py                         ############    
  5. ####    Originaly by    = TryHardHusky                          ############
  6. ####    Edited by       = 0rX                                   ############
  7. ####    you can PM for info about making a chatango             ############
  8. ####    bot in http://0rx.chatango.com, and you can             ############
  9. ####    and you can also chat in :                              ############
  10. ####            http://monosekai.chatango.com                   ############
  11. ############################################################################
  12. ############################################################################
  13. ##Importing Random Crap xD
  14. #here you can see that you're importing ch library
  15.  
  16. import ch
  17. import random
  18. import sys
  19. import sntonick
  20. import json
  21. import youtube
  22. import time
  23. import googleSearch
  24. import re
  25. if sys.version_info[0] > 2:
  26.   import urllib.request as urlreq
  27. else:
  28.   import urllib2 as urlreq
  29.  
  30. wordtodaytime = dict()
  31.  
  32. ##Dance moves!
  33. #kinda useless
  34.  
  35. dancemoves = [
  36.   "(>^.^)>",
  37.   "(v^.^)v",
  38.   "v(^.^v)",
  39.   "<(^.^<)"
  40. ]
  41.  
  42.  
  43.  
  44.  
  45. ## definitions
  46. dictionary = dict() #volatile..
  47. f = open("definitions.txt", 'r') #read-only
  48. print("[INF]Loading Definitions...")
  49. for line in f.readlines():
  50.   try:
  51.     if len(line.strip())>0:
  52.       word, definitions, name = json.loads(line.strip())
  53.       dictionary[word] = json.dumps([definitions, name])
  54.   except:
  55.     print("{ERROR]Cant load Definitions: %s" % line)
  56. f.close()
  57.  
  58. #########################################
  59. ##Guess the number game variable
  60. #########################################
  61. answer = ""
  62.  
  63. def numbergame():
  64.     randomnumber= random.choice(["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59","60","61","62","63","64","65","66","67","68","69","70","71","72","73","74","75","76","77","78","79","80","81","82","83","84","85","86","87","88","89","90","91","92","93","94","95","96","97","98","99","100"])
  65.     answer=randomnumber
  66.     return answer
  67.  
  68.  
  69. ##### Pars Def
  70. def pars(args):
  71.           args=args.lower()
  72.           userlist = roomUsers()
  73.           for name in userlist:
  74.             if args in name:return name
  75.  
  76.  
  77. #### Notif
  78. notif = []
  79. f = open("notif.txt", "r")
  80. print("[INF]Loading Notifs...")
  81. for name in f.readlines():
  82.   if len(name.strip())>0: notif.append(name.strip())
  83. f.close
  84.  
  85.  
  86. #### LOCKS
  87. locks = []
  88. f = open("locks.txt", 'r')
  89. for name in f.readlines():
  90.   if len(name.strip())>0: locks.append(name.strip())
  91. f.close()
  92.  
  93.  
  94.  
  95.  
  96. ## Send Notes
  97. sasaran = dict()
  98. f = open ("notes.txt", "r") #read-only
  99. print("[INF] Loading Notes")
  100. time.sleep(1)
  101. for line in f.readlines():
  102.   try:
  103.     if len(line.strip())>0:
  104.       to, body, sender = json.loads(line.strip())
  105.       sasaran[to] = json.dumps([body, sender])
  106.   except:
  107.     print("[Error] Notes load fails : %s" % line)
  108. f.close()
  109.  
  110.  
  111. #### Ranking #####
  112. # 10
  113. owners = ["thestro","wi3n","tranquilaa"]
  114. nicks = ["thestro"]
  115. # 1
  116. whitelist = ["thestro","xpe"]
  117. # 2
  118. friend = ["thestro"]
  119. # 0
  120. blacklist = ["messedhat"]
  121. # 5
  122. mods = ["thestro","wi3n"]
  123. # 8
  124. specialusers = ["thestro"]
  125. # 9
  126. cowner = ["thestro","YvJ","0rX","Xpe"]
  127. staffa = [""]
  128. wordtodaytime = ["thestro","ramy","yvj"]
  129.  
  130.  
  131. ##Setting Pretty Colors
  132. #Font setting for your bot
  133.  
  134. class TestBot(ch.RoomManager):
  135.   def onInit(self):
  136.     self.setNameColor("F9F")
  137.     self.setFontColor("F33")
  138.     self.setFontFace("1")
  139.     self.setFontSize(13)
  140.     self.enableBg()
  141.     self.enableRecording()
  142.  
  143.   global answer
  144.   global lockdown
  145.  
  146. ##Connecting Crap
  147. #This is what will be printed on your python console when event called
  148.  
  149.   def onConnect(self, room):
  150.     print("Connected.")
  151.     if 0 == 1:
  152.         room.message("Tranquilaa e aici. Rulez fara probleme.")
  153.  
  154.   def onReconnect(self, room):
  155.     print("Reconnected")
  156.  
  157.   def onDisconnect(self, room):
  158.     print("Disconnected")
  159. ##### Time####
  160.   def getUptime():
  161.     # do return startTime if you just want the process start time
  162.     return time.time() - startTime
  163.  
  164.   def uptime():
  165.  
  166.      total_seconds = float(getUptime())
  167.  
  168.      # Helper vars:
  169.      MINUTE  = 60
  170.      HOUR    = MINUTE * 60
  171.      DAY     = HOUR * 24
  172.  
  173.      # Get the days, hours, etc:
  174.      days    = int( total_seconds / DAY )
  175.      hours   = int( ( total_seconds % DAY ) / HOUR )
  176.      minutes = int( ( total_seconds % HOUR ) / MINUTE )
  177.      seconds = int( total_seconds % MINUTE )
  178.      
  179. ##Ignore this, you dont need to worry about this
  180. #Well, you can actually take a little time to look at it and learn something
  181.   def onMessage(self, room, user, message):
  182.   #### Comenzi fără prefix
  183.    if message.body.startswith("test"):
  184.      room.message("Testare efectuată cu succes!")
  185.    if message.body.startswith("Tranquilaa"):
  186.      if user.name == "thestro":
  187.       room.message("Yea, Lord TheStro !?")
  188.      else:
  189.       room.message("What's up,"+ user.name+"?")
  190.    if message.body.startswith("sall"):
  191.      if user.name == "thestro":
  192.       room.message("Salut Lord "+ user.name+".")
  193.      else:
  194.       room.message("Salut,"+ user.name+".")
  195.    if message.body.startswith("brb"):
  196.      if user.name == "thestro":
  197.       room.message("Bye, Lord TheStro.")
  198.      else:
  199.       room.message("Bye,"+ user.name+".")
  200.    if message.body.startswith("back"):
  201.      if user.name == "thestro":
  202.       room.message("Welcome back,Lord TheStro.")
  203.      else:
  204.       room.message("Welcome back,"+ user.name+".")
  205.    try:
  206.     startlag = time.clock()
  207.     if room.getLevel(self.user) > 0:
  208.       print(user.name, message.body)
  209.     else:
  210.       print(user.name, message.body)
  211.     if self.user == user: return
  212.     if message.body[0] == "~" or message.body[0] == "/" or message.body[0] == ">" or message.body[0] == "#" or message.body[0] == "^" or message.body[0] == "^" or message.body[0] == "*":   ##Here is the Prefix part
  213.       data = message.body[1:].split(" ", 1)
  214.       if len(data) > 1:
  215.         cmd, args = data[0], data[1]
  216.       else:
  217.         cmd, args = data[0], ""
  218.  
  219.  
  220.  
  221.       if cmd == "ev" or cmd == "eval" or cmd == "e":
  222.           ret = eval(args)
  223.           if ret == None:
  224.             room.message("Terminat.")
  225.             return
  226.           room.message(str(ret))
  227.  
  228.       ##guess number
  229.       if cmd == "guessnum" or cmd == "gn" or cmd == "Gn" or cmd == "Guessnum":
  230.         if args == "nou":
  231.           numbergame()
  232.           room.message("Jocul reincepe... ;) Un alt număr a fost generat! Acum incercati să-l ghiciti..(E.x. ~gn 27)")
  233.           return
  234.         if(args==answer):
  235.           room.message("DING DING DIIING ^_^ "+sntonick(user.name)+" , got it right with the number : "+args)
  236.         elif(args!=answer and answer > args ):
  237.           room.message("Mai mare! <3")
  238.         elif(args!=answer and answer < args ):
  239.           room.message("Mai mic! <3")
  240.  
  241.       #### Is Down
  242.       if cmd=="isdown":
  243.        if len(args)>0:
  244.         for line in urlreq.urlopen("http://www.downforeveryoneorjustme.com/"+args):
  245.           decoder=line.decode("UTF-8")
  246.           if "It's just you." in decoder:
  247.             room.message(args+" Should be up....")
  248.             break
  249.           if "It's not just you!" in decoder:
  250.             room.message(args+" Looks down for now.")
  251.             break
  252.           if "doesn't look like a site on the interwho." in decoder:
  253.             room.message(args+" isn't a valid url.")
  254.             break
  255.           else:
  256.             continue
  257.       # Ban List
  258.       if cmd == "banlist":
  259.         room.message("The banlist is: "+str(room.banlist))
  260.    
  261.      
  262.       ##ForceSave
  263.       if cmd == "save":
  264.           time.sleep(1)
  265.           print("[SAVE] SAVING DEFINITIONS...")
  266.           f = open("definitions.txt", "w")
  267.           for word in dictionary:
  268.               definition, name = json.loads(dictionary[word])
  269.               f.write(json.dumps([word, definition, name])+"\n")
  270.           if user.name.lower() in owners or user.name in cowner:
  271.               room.message("Se salveaza...(Force Mode!)...")
  272.           else:
  273.               room.message("Se salveaza...(Normal Mode!)")
  274.           f.close()
  275.      
  276.    
  277.       ###### Define            
  278.       if cmd == "def" or cmd == "define" or cmd == "Define" or cmd == "Def" and len(args) > 0:
  279.           try:
  280.             try:
  281.               word, definition = args.split(":", 1)
  282.               word = word.lower()
  283.             except:
  284.               word = args.split()[0].lower()
  285.               definition = ""
  286.             if len(word.split()) > 1:
  287.               room.message("Nu am reusit sa definesc...Scuze. :(")
  288.               return
  289.             if len(args.split()) > 1 and args.lower().split()[1] == "del" :
  290.               if word in dictionary:
  291.                 definition, name = json.loads(dictionary[word])
  292.                 if name == user.name or user.name in owners or user.name in admin or user.name in vip or user.name in tempvip:
  293.                   del dictionary[word]
  294.                   room.message("Definitie stearsa din database.")
  295.                   return
  296.                 else:
  297.                   room.message("Nu ai permisiunea sa folosesti asta.")
  298.                   return
  299.               else:
  300.                 room.message("<b>%s</b> nu este inca definit. Poti sa il definesti chiar acum scriind urmatoarele : <b> /def %s: (definitie)*</b>" % args, True)
  301.             elif len(definition) > 0:
  302.               if word in dictionary:
  303.                 room.message(" Este deja definit. :)")
  304.               else:
  305.                 dictionary[word] = json.dumps([definition, user.name])
  306.                 room.message(word + " a fost definit astfel:" + definition)
  307.             else:
  308.               if word in dictionary:
  309.                 definition, name = json.loads(dictionary[word])
  310.                 room.message(word + " a fost definit astfel: " + definition)
  311.               else:
  312.                 room.message("<b>%s</b> nu este inca definit. Poti sa il definesti chiar acum scriind urmatoarele: <b> /def %s: definitie*</b> " % (args, args), True)
  313.           except:
  314.               room.message("Oh , nu! Ai gresit. Incearca din nou.")
  315.  
  316.       #### Lag
  317.       if cmd == "lag" or cmd == "Lag":
  318.           lag = time.clock() - startlag
  319.           lag1 = time.time() - message.time
  320.           str(time.clock() - startlag)
  321.           room.message("<b>Lag Time:</b> "+str(lag1)+"",True)    
  322.       ### Send Notes
  323.       if cmd == "sn" or cmd == "sendnote" or cmd == "Sn" or cmd == "Sendnote":
  324.           try:
  325.             to, body = args.split(" ", 1)
  326.             sender = user.name
  327.             if to in owners:
  328.               sasaran[to] = json.dumps([body, sender])
  329.               room.message("Trimis!")
  330.               notif.append(to)
  331.             else: room.message(to+" nu se află in whitelist.")
  332.             #if user.name : room.message( kamu dapat sn dari .... silahkan gunakan cmd 'sn read ) kek gitu aja
  333.           except: room.message("Fail !!")
  334.       #### ReadNotes
  335.       if cmd == "readnote" or cmd == "Readnote":
  336.           try:
  337.             if user.name in sasaran:
  338.               body, sender = json.loads(sasaran[user.name])
  339.               room.message(user.name+", ai o notită nouă de la "+sender+" ---> "+body)
  340.               del sasaran[user.name]
  341.               notif.remove(to)
  342.           except: return
  343.       #### WordToday
  344.       if cmd =="wordtoday" or cmd=="wt":
  345.             if user.name in owners:
  346.               if user.name in wordtodaytime:
  347.                 w = json.loads(wordtodaytime[user.name])
  348.                 if time.time() < w:
  349.                   w = int(w) - int(time.time())
  350.                   minute = 60
  351.                   hour = minute * 60
  352.                   day = hour * 24
  353.                   days =  int(w / day)
  354.                   hours = int((w % day) / hour)
  355.                   minutes = int((w % hour) / minute)
  356.                   seconds = int(w % minute)
  357.                   string = ""
  358.                   if days > 0:
  359.                     string += str(days) + " " + (days == 1 and "day" or "days" ) + ", "
  360.                   if len(string) > 0 or hours > 0:
  361.                     string += str(hours) + " " + (hours == 1 and "hour" or "hours" ) + ", "
  362.                   if len(string) > 0 or minutes > 0:
  363.                     string += str(minutes) + " " + (minutes == 1 and "minute" or "minutes" ) + ", "
  364.                   string += str(seconds) + " " + (seconds == 1 and "second" or "seconds" )
  365.                   room.message("You can use wordtoday after <font color='#9999FF'>%s</font>  (~^o^)~ "% string,True)
  366.                   return
  367.               if urank(user.name) >= 1:
  368.                 x=(random.choice(["sadness","happines","yaoi","yuri","horny","nice","bad","bastard","young","lazy","poor","rich","ugly","handshome","beautiful","good","gay","keep calm","arrogant","naughty","special","sweet","tits","areola","pupy","ass","sunny","dizzy","nude","old","lifeless","dying",'death',"impotent","cancer"]))
  369.                 room.message("Dear "+sntonick(user.name)+" Your word today is : <b><font color='#FF9966'>"+str(x)+"</font></b>",True)
  370.                 wordtodaytime[user.name] = json.dumps(time.time()+1200)
  371.  
  372.  
  373.  
  374.       #### Staff
  375.       if cmd =="staff" or cmd =="ss" or cmd =="ranker":
  376.           x = ", ".join(cowner)
  377.           y = ", ".join(staffa)
  378.           o = len(staffa)
  379.           room.message("Owners : "+str(x).title()+" <br>Staff("+str(o)+"): "+str(y).title()+"",True)
  380.        
  381.  
  382.       #### CurrentStats
  383.       if cmd == "cs" or cmd =="currentstats":
  384.         a = len(self.roomnames)
  385.         b = len(whitelist)
  386.         c = len(owners)
  387.         d = len(whitelist)
  388.         e = len(nicks)
  389.         f = len(friend)
  390.         g = len(blacklist)
  391.         room.message("<br><br>Rooms: "+str(a)+"  <br>Whitelist: "+str(b)+" <br>Player: "+str(c)+" <br>Definitions: "+str(d)+" <br>Nick: "+str(e)+" <br>Staffbot: "+str(f)+" <br>Cash: "+str(g)+"",True)
  392.      #### Random Number
  393.       if cmd == "RandomNumber" or cmd == "randomnumber" or cmd == "rn" or cmd == "Rn":
  394.           room.message(random.choice(["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59","60","61","62","63","64","65","66","67","68","69","70","71","72","73","74","75","76","77","78","79","80","81","82","83","84","85","86","87","88","89","90","91","92","93","94","95","96","97","98","99","100"]))
  395.      #### Eval
  396.       if cmd == "ev" or cmd == "eval" or cmd == "e" and user.name in owners:
  397.           lag = time.clock() - startlag
  398.           str(time.clock() - startlag)
  399.           ret = eval(args)
  400.           if ret == None:
  401.             room.message("Done")
  402.             return
  403.           room.message("ANSWER : "+str(ret)+"",True)
  404.  
  405.      #### All cmds for members
  406.       if cmd == "cmds" or cmd == "Cmds" or cmd == "CMDS":
  407.            room.message("Nu este disponibil acum.")
  408.      #### List Of Cmds For Staff
  409.       if cmd =="scmds" or cmd == "acmds":
  410.         room.message("List cmd for staff : ")
  411.  
  412.      #### Music Top (Neterminat)
  413.       if cmd == "scres" or cmd == "Scres":
  414.            room.message(random.choice(["WIZ KHALIFA FEAT. CHARLIE PUTH - SEE YOU AGAIN: https://youtu.be/RgKAFK5djSk","NICKY JAM FEAT. ENRIQUE IGLESIAS - EL PERDON: https://youtu.be/hXI8RQYC36Q","SMILEY - OARECARE: https://youtu.be/gnwlRoFoLXs","NAGUELE FEAT. ANDRA - FALAVA: https://youtu.be/073TNjLc070","DISCLOSURE - HELP ME LOSE MY MIND: https://youtu.be/1MqYtAvtv48","MAJOR LAZER FEAT.MO,DJ SNAKE - LEAN ON: https://youtu.be/YqeW9_5kURI","LOST FREQUENCIES - ARE YOU WITH ME: https://youtu.be/VjHMDlAPMUw","DAN BITTMAN - SI INGERII AU DEMONII LOR: https://youtu.be/xia2Gs6MqmM","THE WEEKND - EARNED IT_FIFTY SHADES OF GREY: https://youtu.be/waU75jdUnYw","DJ SNAKE FEAT. LIL JON - TURN DOWN FOR WHAT: https://youtu.be/HMUDVMiITOU","CARLA'S DREAMS FEAT. DELIAT MATACHE - CUM NE NOI: https://youtu.be/D8-g8CpXdO8","PETER POP FEAT. LORA - SINGURI IN DOI: https://youtu.be/pqb4I7ODTZ8","CONNECT - R FEAT. SHIFT - BAGA MARE: https://youtu.be/2SN9Z3kAc6s","","TOP15","TOP16","TOP17","TOP18","TOP19","TOP20","TOP21","TOP22","TOP23","TOP24","TOP25","TOP26","TOP27","TOP28","TOP29","TOP30","TOP31","TOP32","TOP33","TOP34","TOP35","TOP36","TOP37","TOP38","TOP39","TOP40"]))
  415.  
  416.      #### Doresc femeie
  417.       if cmd == "doresc" and args.startswith("femeie") or cmd == "vreau" and args.startswith("femeie"):
  418.             room.message(random.choice(["http://linzhouweb.com/wp-content/uploads/2015/457095-anime-girl-with-pink-hair-and-headphones.jpg","https://s-media-cache-ak0.pinimg.com/736x/0d/26/0c/0d260c39d75852e64c8ed594deb03600.jpg","http://i59.tinypic.com/t8nl07.jpg","http://i1166.photobucket.com/albums/q608/Starling4anime/54351432.jpg","https://s-media-cache-ak0.pinimg.com/736x/a9/76/fc/a976fc85bfc50f238cb41e59fe2032ea.jpg","http://images4.fanpop.com/image/photos/16400000/Anime-Girls-daina-the-hedgehog-16438588-1024-768.jpg","http://www.mrwallpaper.com/wallpapers/anime-girl-flowers-field-1920x1440.jpg","http://onlyfreewallpaper.com/walls/blue-assassin-girl-wide.jpg","http://www.wallsave.com/wallpapers/1024x768/ninja-blade/518537/ninja-blade-girl-518537.jpg","https://secure.static.tumblr.com/b541803191caf08f1a8790fa44842ce3/fcbjrfp/39en2dnw4/tumblr_static_anime-girl-with-headphones-anime-hd-wallpaper-1920x1080-4277.jpg","http://animewall.net/wp-content/uploads/2015/02/anime_girl_wallpaper_download_for_pc_background.jpeg","http://www.textnovel.com/cover_images/16172/lonely-anime-girl.jpg","http://fc08.deviantart.net/fs71/f/2013/076/b/d/anime_girl_wallpaper_1366x768_by_raykorn-d5ybgz6.png","http://p1.pichost.me/i/73/1983654.jpg","http://images6.fanpop.com/image/photos/32900000/Anime-Girls-anime-32978170-960-540.jpg","http://fc01.deviantart.net/fs71/f/2013/242/9/e/anime_girls_i_have_the_hot_for_by_yukkithesweet-d6kafml.jpg","http://th08.deviantart.net/fs71/PRE/f/2012/154/4/d/anime_girl_by_arkkukakku112-d525zuc.png","https://myneverlanddotcom.files.wordpress.com/2012/02/anime-girls-anime-10342106-1024-7681.jpg","http://nd06.jxs.cz/265/646/9666c423c0_100376483_o2.jpg","http://www.hdwallpapersos.com/wp-content/uploads/2014/11/cute-wallpapers-anime-cute-wallpaper-girl-picture-hair-silver-cartoon-girls-wallpaper-39902.jpg","http://freedwallpaper.com/wp-content/uploads/2014/12/Best-top-desktop-anime-girls-wallpapers-hd-anime-girl-wallpaper-picture-image-19.jpg","http://www.angelxp.eu/galaxys4/Couleur/Manga01.jpg","http://www.wallpaperhi.com/thumbnails/detail/20130809/fairy%20tail%20anime%20anime%20girls%20swords_www.wallpaperhi.com_24.jpg","https://kazasou.files.wordpress.com/2013/04/konachan-com-122492-game_cg-green_eyes-kikouyoku_senki_ii_gin_no_toki_no_corona-moon-red_hair-short_hair-sword-weapon.jpg","http://www.gamersbin.com/attachments/f188/19376-sexy-hd-anime-wallpapers-hotsexyanimegirls8.jpg","http://i.imgur.com/WgDfW.jpg","http://cdn.playbuzz.com/cdn/d717ed0f-a98e-4bd4-8930-f53735a68b15/58c45676-c51d-40e7-8639-f6a24f9d6c4e.jpg","https://s-media-cache-ak0.pinimg.com/originals/eb/15/d1/eb15d17503b7685f1ad4e539914b2a8e.jpg","http://kaminosaber.com/wp-content/uploads/2014/07/super-cute-anime-girls-10.jpg","http://onlyfreewallpaper.com/download/purple-anime-girl-1920x1080.jpg","http://images5.fanpop.com/image/photos/24800000/Anime-Girl-anime-female-characters-24849504-1280-960.jpg","http://3.bp.blogspot.com/_TYuhq0x56sk/Sjm5ycnyzCI/AAAAAAAAARk/XZbBdM1DADs/s1600/14-782314.jpeg","http://img.powerhomepages.com/images/anime/anime_girls_on_a_beach.jpg","http://25.media.tumblr.com/5a7d26fd60d8e85a6122a7aa50ea10bd/tumblr_mu8u7ro47n1rdp5h1o1_500.jpg"]))
  419.  
  420.      #### Spin
  421.       if cmd == "spin" or cmd == "Spin" or cmd == "invarte" or cmd == "Invarte":
  422.             room.message(user.name.capitalize()+" invarte sticla. S-a oprit in dreptul lui "+random.choice(room.usernames)+". ^^")
  423.  
  424.      #### Dice
  425.       if cmd == "zar" or cmd == "Zar" or cmd == "Dice" or cmd == "dice":
  426.           dice1=random.randint(1,6)
  427.           dice2=random.randint(1,6)
  428.           room.message(user.name+",ai aruncat zarul si ai obtinut asta. : "+str(dice1)+" , "+str(dice2))
  429.  
  430.      #### Game Adv ori Prov.
  431.       if cmd == "Adv sau Prov" or cmd == "adv sau prov":
  432.          room.message("Hmmm.. Ador jocul!>.< Adevar sau Provocare?")
  433.  
  434.       if cmd == "adevar" or cmd == "Adevar" or cmd == "Adevăr" or cmd == "Adv." or cmd == "adv." or cmd == "adv" or cmd == "Adv":
  435.           room.message(random.choice(["If you could trade lives with another person you know for one week who would it be?",
  436.          "When where you embarrassed getting caught in the middle of something?",
  437.          "Who in this chat room would be the worst to be trapped in an elevator with?",
  438.          "What is the longest you have gone without taking a bath or shower?",
  439.          "What is more important than money?",
  440.          "If you will be given a chance to become invisible for one day, what would do with this ability?",
  441.          "Describe the strangest dream you have ever had in your life?",
  442.          "What's your wildest fantasy?"
  443.          "If you were to choose people from here for a threesome, who would it be?"]))
  444.  
  445.       if cmd == "provocare" or cmd == "Provocare" or cmd == "prov" or cmd == "Prov" or cmd == "prov." or cmd == "Prov.":
  446.           room.message(random.choice(["Become the slave of another user of your choosing for 10 minutes.",
  447.         "Poke someone you do not know on facebook. Show Proof.",
  448.         "Record a video of you singing any popular song that you know all the words to and post it to youtube.",
  449.         "For the rest of the day/night begin everything you say with 'All hail Queen Nefertari.'",
  450.         "Paste the lyrics of a stupid song.",
  451.         "Masturbate right now no matter where you are or who is around.",
  452.         "Suck your thumb and cry like a baby.",
  453.         "Say the words “in bed” after everything you say for the next 5 min.",
  454.         "Open an art program and attempt to draw a self portrait. Show proof.",
  455.         "Tell us your best joke."]))
  456.      #### Quotes
  457.       if cmd == "citat" or cmd == "Citat":
  458.            room.message(random.choice(["Power isn't determined by your size, but by the size of your heart and dreams.",
  459.           "If you don’t risk your life, you can’t create a future. Right?",
  460.           "You can't bring back what you've lost, think about what you have now.",
  461.           "No one is born into this world to be alone.",
  462.           "To true friendship, how long you've known each other means nothing.",
  463.           "You want weapons? We’re in a library! Books! The best weapons in the world!",
  464.           "Bow ties are cool.",
  465.           "Dividing an impossibly large task into smaller solvable problems is a programmer’s job.",
  466.           "Math is a language.",
  467.           "Hold hands. That's what you're meant to do. Keep doing that... and don't let go.",
  468.           "Be yourself; everyone else is already taken.",
  469.           "Don't worry if plan A fails, there are 25 more letters in the alphabet.",
  470.           "Life doesn't have any hands, but it can sure give you a slap sometimes.",
  471.           "Hope. Hope is the only thing stronger than fear.",
  472.           "It's the things we love the most,that destroy us",
  473.           "Pain has deep roots. The only way to dig it out is to forgive...",
  474.           "Love,after all,always said more about those who felt it then it did about the ones they love.",
  475.           "Memories are funny things.Sometimes they're real ,but other times they change into what we went them to be.",
  476.           "The moment of impact. The moment of impact proves potential for change. Has ripples effects far beyond what we can predict. Sending some particles crashing together. Making them closer than before. While sending others spinning off into great ventures. Landing them where you've never thought you've found them. That's the thing about moments like these. You can't, no matter how hard you try, controlling how it's gonna affect you. You just gotta let the colliding part goes where they may. And wait. For the next collision."]))
  477.  
  478.      #### Da sau Nu .. Random Replic Romana
  479.       if cmd == "Svc" or cmd == "svc":
  480.            room.message(random.choice(["Da","Nu"]))
  481.  
  482.      #### Funny
  483.       if cmd == "funny" or cmd == "Funny":
  484.            room.message(random.choice(["http://static.boredpanda.com/blog/wp-content/uploads/2015/03/ninja-cats-2-21__605.jpg",
  485.          "http://uberhumor.com/wp-content/uploads/2015/03/e5yforz.jpg",
  486.          "https://scontent-fra.xx.fbcdn.net/hphotos-xpf1/v/t1.0-9/11079607_647625022035198_3078461837081461130_n.jpg?oh=d489c2fd0cc7580f45a088ee8fbdd3d5&oe=55B1060A",
  487.          "http://uberhumor.com/wp-content/uploads/2015/03/TGup7sQ.jpg",
  488.          "http://i.imgur.com/YppDSSe.jpg",
  489.          "https://fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-xpt1/v/t34.0-12/s180x540/11091326_843639572362839_869018710_n.jpg?oh=ddfa0f5292332d165f1583a173079b79&oe=5519D867&__gda__=1427700135_823f6b008bf498273bf5a0b99da9c280",
  490.          "https://fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-xfa1/v/t34.0-12/11081586_843639632362833_924691807_n.jpg?oh=cc7703a81f54e39b2109b5be97f9132b&oe=5518D221&__gda__=1427688861_9c6a8873cedda4b93706a2a2e1193e3f",
  491.          "https://fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-xpf1/v/t34.0-12/s180x540/11063308_741675625946541_106159036_n.jpg?oh=696ea267c3ebd11d84279ebbee9565c4&oe=5519FF37&__gda__=1427777352_118ca3c5a006267ff06e518cc80c1eb0",
  492.          "http://img-9gag-ftw.9cache.com/photo/a1e7Arw_460svwm.webm"]))
  493.  
  494.      #### Cats
  495.       if cmd == "cats" or cmd == "Cats":
  496.            room.message(random.choice(["http://lovemeow.com/wp-content/uploads/2013/05/tumblr_mkzzqswXis1r4u63lo2_1280.jpg",
  497.         "http://www.pageresource.com/wallpapers/wallpaper/wild-cats-apple-mac-comic-pet-very-happy-cat_467784.jpg",
  498.         "http://www.catster.com/files/post_images/bf9f08a3412a7e3dd2f09f2ea869042e.jpg",
  499.         "http://www.3d-hdwallpaper.com//bulk_images/cat-dog-wallpaper-dowload.jpg",
  500.         "http://cdn3.vox-cdn.com/imported_assets/2236821/happy-cat.jpg",
  501.         "http://www.alegoo.com/images05/animals/cats-1/024/happy-cat-07.png",
  502.         "http://api.ning.com/files/3vKQkh-Flonsns93BprBPAweXlSnkss65lYwcOZYJiOUYtyTgpue3zOeIA*dmaQcWW0VUAWQKC2sM3IYVCRI0Uda6WgucP8T/happycatt.jpg",
  503.         "http://img5.visualizeus.com/thumbs/0a/07/cat,animals,cats,content,cute,happy-0a07e7e1d3e776f1d63e4aef49b29212_h.jpg",
  504.         "https://s-media-cache-ak0.pinimg.com/236x/c7/8a/8f/c78a8fa4a4bf6337ae3e076deb4e83b8.jpg",
  505.         "https://www.pixoto.com/images-photography/animals---cats/portraits/happy-cat-paws-65225632.jpg",
  506.         "https://stephaniepomfrett.files.wordpress.com/2013/01/happy-cat.jpg"]))
  507.  
  508.      #### Jokes
  509.       if cmd == "jokes" or cmd == "Jokes":
  510.            room.message(random.choice(["The teacher asked Jimmy, 'Why is your cat at school today Jimmy?' Jimmy replied crying, 'Because I heard my daddy tell my mommy, 'I am going to eat that pussy once Jimmy leaves for school today!'",
  511.          "A child asked his father, 'How were people born?' So his father said, 'Adam and Eve made babies, then their babies became adults and made babies, and so on.' The child then went to his mother, asked her the same question and she told him, 'We were monkeys then we evolved to become like we are now.' The child ran back to his father and said, 'You lied to me!' His father replied, 'No, your mom was talking about her side of the family.'",
  512.          "Do not be racist; be like Mario. He's an Italian plumber, who was made by the Japanese, speaks English, looks like a Mexican, jumps like a black man, and grabs coins like a Jew!",
  513.          "Roses are red. Your blood is too. You look like a monkey. And belong in a zoo. Do not worry, I'll be there too. Not in the cage, But laughing at you.",
  514.          "A blonde, a redhead, and a brunette were all lost in the desert. They found a lamp and rubbed it. A genie popped out and granted them each one wish. The redhead wished to be back home. Poof! She was back home. The brunette wished to be at home with her family. Poof! She was back home with her family. The blonde said, 'Awwww, I wish my friends were here.'"]))
  515.  
  516.      #### Response
  517.       if cmd == "response" or cmd == "Response" or cmd == "Rsp":
  518.            room.message(random.choice(["Yes.","Indeed.","No.","No way.","Not in a million years","Possibly.","Not sure","Hell yes.","Hell no.","I'm afraid you're right.","I'm afraid you're wrong.","Not sure what to say.","Repeat the question , please.","Definetely.","Definetely not.","Of course.","Oh my master , no."]))
  519.      #### Parkour
  520.       if cmd == "parkour" or cmd == "Parkour" or cmd == "Prk":
  521.            room.message(random.choice(["http://canal3.md/media/2015/05/parkour.jpg","http://grapeshotmq.com.au/wp-content/uploads/2015/03/Parkour-Luxembourg4.jpg","http://www.circephoto.com/data/photos/372_1parkour_7.jpg","http://www.flowacademy.co.nz/wp-content/uploads/2014/03/sfondo-parkour-1280x800.jpg","http://www.isfsports.org/wp-content/uploads/2015/05/pb-120912-palestinian-parkour-jsa-2photoblog900-2190054.jpeg","http://www.aljazeera.com/mritems/images/2014/3/2/201432125141986945_8.jpg","http://msnbcmedia.msn.com/j/MSNBC/Components/Photo/_new/pb-120912-palestinian-parkour-jsa-1.photoblog900.jpg","http://guildlocal.com/wp-content/uploads/2013/02/Parkour-Crop.jpg","http://upload.wikimedia.org/wikipedia/commons/c/c2/Team_JiYo_-_pioneerne_indenfor_parkour_i_danmark.jpg","http://i.ytimg.com/vi/Qc03qBkh2Do/maxresdefault.jpg","http://www.adamdunlap.com/blog/wp-content/uploads/2014/02/parkour_olympics_david_belle_adam_dunlap.jpg"]))
  522.  #########################################################################################################################################################################
  523.       #### Slap
  524.       elif cmd == "slap" or cmd == "Slap":
  525.            if not args ==  "":
  526.              if args in owners:
  527.                room.message("No I'm not going to slap my owner! No way!")
  528.              else:  
  529.                room.message("*Slaps "+args+" till death* :@")
  530.            else:
  531.              room.message(user.name.capitalize()+", WTF am I supposed to slap! O.o")
  532.      #### Shoot
  533.       elif cmd == "shoot" or cmd == "Shoot":
  534.            if not args ==  "":
  535.              if args in owners:
  536.                room.message("Owner shot! Acum cine va fi ownerul meu?")
  537.              else:  
  538.                room.message("*Shots "+args+" pana cand vine politia * :@")
  539.            else:
  540.              room.message(user.name.capitalize()+", WTF Chiar trebuie să fac asta? O.o")
  541.      #### Kick
  542.       elif cmd == "kick" or cmd == "Kick":
  543.            if not args ==  "":
  544.              if args in owners:
  545.                room.message("Owner a fugit prea repede! Nu am putut să-l dau afară.")
  546.              else:  
  547.                room.message("*Kicks "+args+" 's balls pana "+args+" plange* :@")
  548.            else:
  549.              room.message(user.name.capitalize()+", Pe cine trebuie să dau afară? :|")
  550.      #### Cookie
  551.       elif cmd =="cookie" or cmd == "Cookie":
  552.               room.message(random.choice(["Oh Yeah! Cookie! :3 " , "Suure. ^^" , "O_O Gimme dat right meow." , "Cookie?...YESH" , "Cookie Monster!" , "*noms the cookie* ~thaanks~",]))
  553.  
  554.      #### Give ME
  555.       elif cmd == "giveme" or cmd == "Giveme" or cmd == "GiveMe":
  556.               room.message("Aici esti tu! *gives "+user.name.capitalize()+" "+args+"*")
  557.  
  558.      #### Gender
  559.       elif cmd =="gender" or cmd == "Gen" or cmd == "Gender" or cmd == "gen":
  560.           room.message("Deci, esti curios... In fine... Sunt fată. Asta a fost dorinta Lordului Meu <3.")
  561.  
  562.      #### Announcements
  563.       elif cmd == "Anunt" or cmd == "anunt":
  564.             if user.name.lower() in owners:
  565.                 for room in self.rooms:
  566.                     room.message("[ANUNT]: Anunt foarte important de la "+user.name.title()+" : "+args)
  567.                     room.message("http://i.imgur.com/jE6Jkok.png")
  568.             else:
  569.                 room.message("Nu ai permisiunea de a efectua asta. ")
  570.      #### Events  
  571.       elif cmd == "event" or cmd == "Event":
  572.             if user.name.lower() in owners:
  573.                 for room in self.rooms:
  574.                     room.message("[Event]: Se anunta un eveniment : "+args)
  575.                     room.message("http://i.imgur.com/jE6Jkok.png")
  576.             else:
  577.                 room.message("Nu ai permisiunea de a efectua asta. ")
  578.  
  579.      #### Reverse
  580.       elif cmd == "reverse" or cmd == "Reverse":
  581.                 rev = str(args[::-1])
  582.                 room.message(rev)
  583.      #### Profile picture
  584.       elif cmd == "pfpic" or cmd == "PfPic":
  585.                 link = "http://fp.chatango.com/profileimg/%s/%s/%s/full.jpg" % (args[0], args[1], args)
  586.                 room.message(link)
  587.      #### Info / Help
  588.       elif cmd == "info" or cmd == "Info":
  589.                 room.message("Numele meu este Tranquilaa. Am fost creata de  Lordul TheStro pentru a distra useri ca tine. :)")
  590.  
  591.       elif cmd == "help" or cmd == "Help":
  592.                 room.message("Pentru a afla ce pot face eu, scrie >~Cmds<. ;)")
  593.                
  594.  
  595.      #### Restart
  596.       elif cmd =="restart" or cmd == "Restart" or cmd == "Reconnect" or cmd == "reconnect":
  597.          if user.name.lower() in owners:
  598.            room.reconnect()
  599.          else:
  600.            room.message("Ce ??? *lol*")
  601.      #### Leave
  602.       elif cmd == "Leave" or cmd == "leave" and user.name in owners:
  603.         if user.name in owners:
  604.           room.message("Shutting down ...")
  605.           self.setTimeout(4, self.stop, )
  606.           self.stop()
  607.         else:
  608.           room.message("Ce ??? *lol*")
  609.      #### Join
  610.       elif cmd == "join" or cmd == "Join":
  611.           if user.name in owners:
  612.                 room.message("*Am fost conectată pe un alt chat, numit <b>%s</b>*" % args, True)
  613.                 self.joinRoom(args)
  614.           else:
  615.                 room.message("Sunt deja acolo :|")
  616.      #### Spam
  617.       elif cmd == "spam" or cmd == "Spam":
  618.           room.message("Uite aici niste spam pentru tine, "+user.name.capitalize()+". ;)")
  619.           room.message("http://i.imgur.com/6eJQw.gif")
  620.      #### Recognize
  621.       elif cmd == "rec" or cmd == "Recognize" or cmd == "Rec" or cmd == "recognize":
  622.         if args == "25194 commands":
  623.           room.message("Access granted.")
  624.           file13 = open("cmds.txt", "r")
  625.           room.message(file13.read())
  626.           file13.close()
  627.         elif args == "25194":
  628.           room.message("Acces granted.")
  629.           room.message("Hi there , "+user.name.capitalize()+". :3")
  630.         else:
  631.           room.message("Access denied.")
  632.      #### Scuze
  633.       elif cmd == "scuze" or cmd == "scz" or cmd == "Scuze" or cmd == "Scz":
  634.           room.message("Iti accept scuzele si te voi tine minte. :)")
  635.           file = open("sorry.txt", "a")
  636.           file.write(" "+user.name.capitalize()+". ,")
  637.           file.close()
  638.      #### Invite
  639.       elif cmd == "invite" or cmd == "Invite":
  640.         if len (args) > 0:
  641.             self.pm.message(ch.RoomManager(args),"%s vrea sa i te alaturi intr-un chatroom! http://%s.chatango.com ." %(owners[0],room.name))
  642.             room.message("Am invitat pe %s in acest grup. :)" % args)
  643.         else:
  644.             room.message("Spune-mi pe cine sa invit.")
  645.      
  646. ###################################################################### Comenzi Setate ##########################################################################################
  647.         ##Say
  648.         #Make your bot say what you want
  649.       if cmd == "say" or cmd == "Say" or cmd == "Spune" or cmd == "spune":
  650.         room.message(args)
  651.  
  652.         ##Random User
  653.         #What's this for ? this one cmd will make your boy say the name of a random user in a room
  654.       if cmd == "randomuser" or cmd == "RandomUser" or cmd == "ru" or cmd == "Ru":
  655.         room.message(random.choice(room.usernames))
  656.  
  657.         ##Check Level
  658.         #This one cmd is tho make your bot say your mod level in the current room you're in
  659.       elif cmd == "mylvl" or cmd == "MyLvl" or cmd == "MyLevel" or cmd == "mylevel":
  660.         room.message("Your mod level: %i" %(room.getLevel(user)))
  661.  
  662.         ##DANCE!!!!
  663.         #Dance Of Course !!! ^_^
  664.       elif cmd == "dance" or cmd == "Dance":
  665.         for i, msg in enumerate(dancemoves):
  666.           self.setTimeout(i / 2, room.message, msg)
  667.          
  668.         ##Check if Mod
  669.         #not really important
  670.       elif cmd == "ismod" or cmd == "IsMod" or cmd == "Ismod":
  671.           if args:
  672.             if room.getLevel(ch.User(args)) > 0:
  673.               room.message(args + " is a Mod")
  674.             else:
  675.               room.message(args + " is not a Mod")
  676.           if args == "":
  677.             if room.getLevel(user.name) > 0:
  678.               room.message(user.name + " is a Mod")
  679.             else:
  680.               room.message(user.name + " is not a Mod")
  681.      ##### Active/Deactive ####
  682.      ### Sleep
  683.       if cmd == "sleep" or cmd == "Sleep":
  684.         if user.name in owners: return
  685.         room.message("Tranquilaa's este in Sleep mode")
  686.         lockdown = True
  687.      ### Wake
  688.       if cmd == "wake" or cmd == "Wake":
  689.         if user.name in owners: return
  690.         room.message("Tranquilaa's este in Wake mode")
  691.         lockdown = False
  692.      ### Lock/Unlock
  693.       if cmd == "lock" or cmd == "Lock":
  694.         if user.name in owners:
  695.           room.message("LOCKED!")
  696.           lock = True
  697.           return
  698.         if args in locks:
  699.           room.message("It's locked already")
  700.           return
  701.         if args in self.roomnames:
  702.           if user.name in owners:
  703.             locks.append(args)
  704.             room.message("locked <b>%s</b>" % args, True)
  705.           else: room.message("Only rank 3 gets to lock rooms remotely")
  706.         if args == "":
  707.           if room.name in locks:
  708.             room.message("It's locked already")
  709.             return
  710.           locks.append(room.name)
  711.           room.message("locked <b>%s</b>" % room.name, True)
  712.         if args not in self.roomnames:
  713.           if args == "": return
  714.           room.message("I haven't joined such room")
  715.           return
  716.      
  717.       if cmd == "unlock" or cmd == "UnLock" or cmd == "Unlock":
  718.         if user.name in owners: return
  719.         if args in self.roomnames:
  720.           if args in locks:
  721.             if user.name in owners:
  722.               locks.remove(args)
  723.               room.message("unlocked <b>%s</b>" % args, True)
  724.             else: room.message("Only rank 3 gets to unlock rooms remotely")
  725.           else:
  726.             room.message("It's not even locked")
  727.             return
  728.         if args == "":
  729.           if room.name in locks:
  730.             locks.remove(room.name)
  731.             room.message("unlocked <b>%s</b>" % room.name, True)
  732.           else:
  733.             room.message("It's not even locked")
  734.             return
  735.         if args not in self.roomnames:
  736.           if args == "": return
  737.           room.message("I'm not in that room")
  738.           return
  739.       ##---------------------------------FUTURE---------------------------------##
  740.  
  741.  
  742.     ###### Call the bot
  743.       if "tranquilaa" == message.body.lower() or "kurotsuno" == message.body.lower() or "kuro" == message.body.lower():
  744.           if user.name == "thestro":
  745.               room.message("yes, Lord Prosciutto?")
  746.           else:
  747.               room.message("What's up "+sntonick(user.name)+" ?", True)
  748.  
  749.       if "hi" == message.body.lower():
  750.           room.message("Hi~ ! :)")
  751.       if "<><" == message.body.lower():
  752.         room.message("Pfft, that's a gay fish !")
  753.       if message.body.lower().startswith("afk"):
  754.           if user.name in "thestro":
  755.             room.message("See you Lord Creator!")
  756.           else:
  757.             room.message("See you soon "+sntonick(user.name)+"!", True)
  758.       if "brb" in message.body.lower():
  759.         if user.name == "thestro":
  760.           room.message("See you soon Lord Creator!")
  761.         else:
  762.           room.message("See you soon "+sntonick(user.name)+" !", True)
  763.       if "back" == message.body.lower():
  764.         if user.name == "thestro":
  765.           room.message("Wellcome back Lord Creator!")
  766.         else:
  767.           room.message("Wellcome back "+sntonick(user.name)+" !", True)
  768.       if "pagi" == message.body.lower():
  769.         room.message("Selamat pagi~ ! :)")
  770.       if "morning" == message.body.lower():
  771.         if user.name == "thestro":
  772.           room.message("Good Morning Lord Creator !")
  773.         else:
  774.           room.message("Good Morning %s !" % sntonick(user.name), True)
  775.      ##### End Call The Bot#####
  776.      ### MultiChat
  777.       elif cmd == "multichat" or cmd == "mc" or cmd == "MultiChat" or cmd == "Mc":
  778.         if args == "":
  779.             x = 'My Default room : www.desenecalumea.chatango.com'
  780.             room.message(x,True)
  781.         else:
  782.             b = 'Done ! , This is your Room : <a href="http://ch.besaba.com/chat/flash/?'+args+'" target="_blank"><u><font color="#999999">Click Here!!</u></a> '
  783.             room.message(b,True)
  784.       elif cmd == "multichat2" or cmd == "mc2":
  785.         if args == "":
  786.             x = 'My Default room : <a href="http://ch.besaba.com/chat/html5/?newdenscund!,monosekai!,obsoletedream!" target="_blank"><u>Click Here!!</u></a> '
  787.             room.message(x,True)
  788.         else:
  789.             b = 'Done ! , This is your Room : <a href="http://ch.besaba.com/chat/html6/?'+args+'" target="_blank"><u><font color="#999999">Click Here!!</u></a> '
  790.             room.message(b,True)
  791.      ##### Set Background
  792.       if cmd== "sbg" or cmd == "Sbg" or cmd == "Set Background":
  793.             if user.name in owners:
  794.               if len(args) > 0:
  795.                   if args == "On":
  796.                     room.setBgMode(1)
  797.                     room.message("Background On")
  798.                     return
  799.                   if args == "Off":
  800.                     room.setBgMode(0)
  801.                     room.message("Background Off")
  802.      ###### Fax
  803.       if cmd == "fax" or cmd == "Fax":
  804.         try:
  805.           name, body = args.split(" ", 1)
  806.           l = "http://ch.besaba.com/mty.htm?"+room.name+"!"
  807.           if name in self.roomnames :
  808.             self.getRoom(name).message('[<font color="#6699CC"><b>Message</b></font> - %s ] in <a href=\"%s" target=\"_blank\"><u>%s</u></a> : <font color="#66FFFF"><i> %s <i></font>' % (sntonick(user.name), l, room.name, body),True)
  809.             room.message("Sent")
  810.           else:
  811.             room.message("I haven't joined that room")
  812.         except:room.message("error")
  813.     #### Profile
  814.       elif cmd == "prof" or cmd == "profile" or cmd == "Prof" or cmd == "Profile":
  815.         try:
  816.           args=args.lower()
  817.           stuff=str(urlreq.urlopen("http://"+args+".chatango.com").read().decode("utf-8"))
  818.           crap, age = stuff.split('<span class="profile_text"><strong>Age:</strong></span></td><td><span class="profile_text">', 1)
  819.           age, crap = age.split('<br /></span>', 1)
  820.           crap, gender = stuff.split('<span class="profile_text"><strong>Gender:</strong></span></td><td><span class="profile_text">', 1)
  821.           gender, crap = gender.split(' <br /></span>', 1)
  822.           if gender == 'M':
  823.               gender = 'Male'
  824.           elif gender == 'F':
  825.               gender = 'Female'
  826.           else:
  827.               gender = '?'
  828.           crap, location = stuff.split('<span class="profile_text"><strong>Location:</strong></span></td><td><span class="profile_text">', 1)
  829.           location, crap = location.split(' <br /></span>', 1)
  830.           crap,mini=stuff.split("<span class=\"profile_text\"><!-- google_ad_section_start -->",1)
  831.           mini,crap=mini.split("<!-- google_ad_section_end --></span>",1)
  832.           mini=mini.replace("<img","<!")
  833.           picture = '<a href="http://fp.chatango.com/profileimg/' + args[0] + '/' + args[1] + '/' + args + '/full.jpg" style="z-index:59" target="_blank">http://fp.chatango.com/profileimg/' + args[0] + '/' + args[1] + '/' + args + '/full.jpg</a>'
  834.           prodata = '<br/> <a href="http://chatango.com/fullpix?' + args + '" target="_blank">' + picture + '<br/><br/> Age: '+ age + ' <br/> Gender: ' + gender +  ' <br/> Location: ' +  location + '' '<br/> <a href="http://' + args + '.chatango.com" target="_blank"><u>Chat With User</u></a> ' "<br/><br/> "+ mini
  835.           room.message(prodata,True)
  836.         except:
  837.           room.message(""+args+" doesn't exist o.o ")
  838.      #### Bg
  839.       if cmd =="bg":
  840.         try:
  841.           args=args.lower()
  842.           picture = '<a href="http://st.chatango.com/profileimg/' + args[0] + '/' + args[1] + '/' + args + '/msgbg.jpg" style="z-index:59" target="_blank">http://fp.chatango.com/profileimg/' + args[0] + '/' + args[1] + '/' + args + '/msgbg.jpg</a>'
  843.           prodata = '<br/>'+picture
  844.           room.message(prodata,True)
  845.         except:
  846.           room.message(""+args+" doesn't exist o.o ")
  847.      #### Pm
  848.       elif cmd == "pm" or cmd == "Pm" or cmd == "PM" or cmd == "Private Message":
  849.         data = args.split(" ", 1)
  850.         if len(data) > 1:
  851.           name , args = data[0], data[1]
  852.           self.pm.message(ch.User(name), "[Private.Message] By - "+user.name+" : "+args+" ")
  853.           room.message("Trimis la "+name+"")
  854.      #### MyIp
  855.       elif cmd =="myip" or cmd == "MyIp" or cmd == "MyIP" or cmd == "My IP Adress":
  856.         try:
  857.          room.message("Your I.P. address is : "+message.ip)
  858.         except:
  859.          room.message("IP lookup failed , bot is not a mod in this chat.")
  860.      #### Rooms
  861.       elif cmd == "rooms" or cmd == "Rooms":
  862.         j = []
  863.         for i in self.roomnames:
  864.           j.append(i+'[%s]' % str(self.getRoom(i).usercount))
  865.           j.sort()
  866.         room.message("I'm Playing In "+'[%s] rooms: '%(len(self.roomnames))+", ".join(j))
  867.      #### User Count
  868.       elif cmd == "count" or cmd == "Count":
  869.         room.message("I see: <font color='#9999FF'><b>"+str(room.usercount)+"</b></font>",True)
  870.      ### User List
  871.       elif cmd == "userlist" or cmd == "UserList" or cmd == "User List" or cmd == "User list":
  872.          if args == "":
  873.           usrs = []
  874.           gay = []
  875.           finale = []
  876.           prop = 0
  877.           prop = prop + len(room._userlist) - 1
  878.           for i in room._userlist:
  879.             i = str(i)
  880.             usrs.append(i)
  881.           while prop >= 0:
  882.             j = usrs[prop].replace("<User: ", "")
  883.             i = j.replace(">", "")
  884.             gay.append(i)
  885.             prop = prop - 1
  886.           for i in gay:
  887.             if i not in finale:
  888.               finale.append(i)
  889.           if len(finale) > 40:
  890.             room.message("<font color='#9999FF'><b>40</b></font> of <b>%s</b> users in this room: %s"% (len(finale), ", ".join(finale[:41])), True)
  891.           if len(finale) <=40 :
  892.             room.message("Current <b>%s</b> users of this room: %s"% (len(finale),", ".join(finale)), True)
  893.          if args != "":
  894.            if args not in self.roomnames:
  895.              room.message("I'm not there.")
  896.              return
  897.            users = getParticipant(str(args))
  898.            if len(users) > 40:
  899.              room.message("<font color='#9999FF'><b>40</b></font> of <b>%s</b> current users in <b>%s</b>: %s"% (len(users), args.title(), ", ".join(users[:41])), True)
  900.            if len(users) <=40:
  901.              room.message("Current <b>%s</b> users in <b>%s</b>: %s"% (len(users), args.title(), ", ".join(users)), True)
  902.      #### Mods
  903.       elif cmd == "mods" or cmd == "Mods":
  904.         args = args.lower()
  905.         if not args:
  906.            room.message("<br/><font color='#9999FF'><b>Owner</b></font>:  <u><b>"+(room.ownername)+"</b></u>  <br/><font color='#9999FF'><b>Mods</b></font>: "+", ".join(room.modnames), True)
  907.            return
  908.         if args in self.roomnames:
  909.            moda = self.getRoom(args).modname
  910.            own = self.getRoom(args).ownername
  911.            room.message("<br/><font color='#9999FF'><b>Owner</b></font>:  <b><u>"+(own)+"</u></b>  <br/><font color='#9999FF'><b>Mods</b></font>:  "+",  ".join(moda), True)
  912.         else:
  913.            self.joinRoom(args)
  914.            cek_mods[user.name] = json.dumps([room.name,args])
  915.      #### Google Image Search
  916.       elif cmd == "gis" or cmd == "Gis" or cmd == "Google Search Image" or cmd == "GS Image":
  917.         try:
  918.             search = args.split()
  919.             import urllib.request
  920.             with urllib.request.urlopen("http://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=%s" % "+".join(search)) as url:
  921.                 udict = url.read().decode()
  922.             a = re.finditer('"unescapedUrl":"(.+?)","url":"', udict)
  923.             matches = []
  924.             for match in a:
  925.                 match = str(match.group(1))
  926.                 matches.append(match)
  927.             link = random.choice(matches)
  928.             try:
  929.                 link = link.replace("https", "http")
  930.             except:
  931.                 print("Random choice isn't SSL.")
  932.             if args: room.message("%s, I found: %s" % (sntonick(user.name), link), True)
  933.         except:
  934.             room.message("%s I'm sorry, I was unable to find anything for search term: %s :|" % (str(user.name), args), True)
  935.  
  936.      #### Ban / Unban
  937.       elif cmd == "ban" or cmd == "Ban" or cmd == "Interzicere" or cmd == "interzicere":
  938.           if user.name in owners:
  939.               name = args
  940.               if user.name in owners:
  941.                 room.message("Njet >_>")
  942.                 return
  943.               if name in room.usernames:
  944.                 room.banUser(ch.User(name))
  945.                 room.message("<b>%s</b> is banned" % (name), True)
  946.                 self.pm.message(ch.User(name.lower()), "You have been banned from %s by %s. Please behave lik a Punk!!" % (room.name, user.name))
  947.               else:
  948.                 room.message("i don't see "+name+" here :|")
  949.           else:
  950.               room.message("You mere mortals can never do that !!")
  951.              
  952.       elif cmd == "unban" or cmd == "ub" or cmd == "UnBan" or cmd == "Unban" or cmd == "Scoate Interzicerea" or cmd == "Scoate interzicerea":
  953.           if user.name in owners:
  954.               name = args
  955.               if user.name in owners: return
  956.               room.unban(ch.User(name))
  957.               room.message("<b>%s</b> is unbanned" % (name), True)
  958.               self.pm.message(ch.User(name.lower()), "You have been unbanned from %s by %s. Please behave lik a Punk!!" % (room.name, user.name))
  959.           else:
  960.               room.message("You mere mortals can never do that !!")
  961.      #### Broadcast
  962.       if cmd == "broadcast" or cmd == "Broadcast" or cmd == "Shout" or cmd == "shout" or cmd == "Bc" or cmd == "Bc":
  963.             if user.name in owners: #Only rank 4+ can Broadcast a Message
  964.                 for room in self.rooms:
  965.                   if args == "": return
  966.                   else:
  967.                     room.message("Broadcast de la - "+user.name + ": "+args, True)
  968.             else:
  969.                 room.message("[<b>%s</b>] Only Admins Members are allowed" % "ERROR", True)
  970.          
  971.      #### Send
  972.       if cmd == "send" or cmd == "Send" or cmd == "Senddd" or cmd == "Sendddd":
  973.           try:
  974.             if user.name in ownres:
  975.               name, body = args.split(" ", 1)
  976.               if user.name in owners:
  977.                 if name in self.roomnames:
  978.                   self.getRoom(name).message("Message from <b>%s</b> - %s" % (user.name, body), True)
  979.                   room.message("[<b>%s</b>] Message Sent" % "INF", True)
  980.                 else:
  981.                   room.message("[<b>%s</b>] I haven't joined that room :|" % ("ERROR"), True)
  982.               else:
  983.                 room.message("You mere mortals can never do that !!")
  984.                 self.setTimeout(int(3), room.message, "*Aims Colt. Python Revolver at <b>%s</b> and shot him dead*" % user.name, True)
  985.           except:
  986.             room.message("Fail !!!")
  987.      #### Sayb
  988.       elif cmd == "sayb" or cmd == "SayB" or cmd == "Sayb":
  989.           if args:
  990.             room.message(args[-5])
  991.           else:
  992.             room.message(":| *Speechless*")
  993.      #### Nicks
  994.       elif cmd == "nick" or cmd == "Nick":
  995.           try:
  996.             if args:
  997.               nicks[user.name]=json.dumps(args)
  998.               room.message (user.name+" will now be called "+args ,True)
  999.               saveNicks()
  1000.             if args == "":
  1001.               room.message("type 'nick (your-new-nickname-here)")
  1002.           except:
  1003.             room.message("Failed to create a nickname for "+user.name+".")
  1004.      ### My Nick
  1005.       elif cmd == "mynick" or cmd == "Mynick" or cmd == "MyNick":
  1006.           try:
  1007.             if user.name in nicks:
  1008.               room.message("Your current nick is "+sntonick(user.name)+" :3", True)
  1009.             else:
  1010.               room.message("You haven't told me your nick, do 'nick new-nick-here to make your nick")
  1011.           except:
  1012.             return
  1013.      ## See Nick
  1014.       elif cmd == "seenick" or cmd == "Seenick" or cmd == "SeeNick":
  1015.           try:
  1016.             if args in nicks:
  1017.               room.message(args+"'s nickname is "+sntonick(args)+" X3", True)
  1018.             else:
  1019.               room.message(args+" haven't told me his nick :|")
  1020.           except:
  1021.             return
  1022.      #### Credits
  1023.       elif cmd == "credits" or cmd == "Credits" or cmd == "Creators":
  1024.  
  1025.               room.message('<font color="#FFCC00">%s</font>Credits: ||<font color="#DC1620"><b>%s</b></font>[<font color="#ff0000"><b>%s</b></font>] ||<font color="#f033FF">%s</font>[Coding Tutors] ||<font color="#00CC00">%s</font>[Fellow Bot Maker] ||<font color="#CC00FF">%s</font>[Trusted Test Subjects]' % ("||", "0rX, xMotrhA", "OWNER", "Poeticartist1, TryHardHusky(Horny Dog)", "Agunq", "Hellbobrok Conferrence"), True)
  1026.      #### Seen
  1027.       elif cmd == "seen" or cmd == "Seen":
  1028.           try:
  1029.             nama = args
  1030.             if nama in hist:
  1031.               waktu, ruang, body = json.loads(hist[nama])
  1032.               room.message("Last message i seen by "+nama+" - "+waktu+" - "+ruang+" - "+body)
  1033.             else:
  1034.               room.message("I haven't seen " + nama + " all this days :|")
  1035.           except:
  1036.             room.message("fail")
  1037.      #### Find
  1038.       elif cmd == "find" or cmd == "Find":
  1039.           name = args.split()[0].lower()
  1040.           try:
  1041.             if name in room.usernames:
  1042.                     if not ch.User(name).roomnames:  room.message("dont see them. <_<")
  1043.                     else: room.message("%s is curently in <b>%s</b> >_>" % (args, ", ".join(ch.User(name).roomnames)), True)
  1044.           except: return
  1045.           target = args[1:]
  1046.           if args[0] == "+":
  1047.                 if not ch.User(target).roomnames:  room.message("dont see them. <_<")
  1048.                 else: room.message("%s is curently in <b>%s</b> >_>" % (args[1:], ", ".join(ch.User(target).roomnames)), True)
  1049.           elif args == "true love" or args == "True Love" or args == "True love":
  1050.             orang = random.choice(room.usernames)
  1051.             room.message(random.choice([user.name+", You just found out that "+orang+" is your true love :o","I'm sorry "+user.name+" You didn't found your true love here :(",user.name+"'s true love is "+orang+", Have fun you godamn lovebirds !! ^^","Njet >_> ,, No love for you !","Shut up >_> ,, I love you since we first met !"]))
  1052.  
  1053.      #### LoveMeter
  1054.       elif cmd == "lovemeter" or cmd == "lm" or cmd == "LoveMeter" or cmd == "Love Meter" or cmd == "Lovem":
  1055.           try:
  1056.             user2, user3 = args.split(" and ", 1)
  1057.             moter = random.randint(6,100)
  1058.             try:
  1059.               user1 = args.lower()
  1060.               if user1 in lomet:
  1061.                 meter = json.loads(lomet[user1])
  1062.                 meter = str(meter)
  1063.                 room.message("I Gaze upon the stars... *Closes my eyes and concentrates*. And again, <b>%s</b> and <b>%s</b>, their love meter is <b>%s</b>%s ,, that is the answer of fate ;)" % (user2, user3, str(meter), "%"), True)
  1064.               else:
  1065.                 moter = str(moter)
  1066.                 lomet[user1] = json.dumps(moter)
  1067.                 room.message("I Gaze upon the stars... *Closes my eyes and concentrates*. Gotcha, <b>%s</b> and <b>%s</b>, their love meter is <b>%s</b>%s ,, that is the answer of fate ;)" % (user2, user3, moter, "%"), True)
  1068.             except:
  1069.               room.message("Fail !!")
  1070.           except:
  1071.             room.message("Fail !! You must do as the fate desires !")
  1072.  
  1073.      #### Tea
  1074.       elif cmd == "tea" or cmd == "Tea":
  1075.           if not args == "":
  1076.             if args in owners:
  1077.               room.message("*Pour heavenly tea to my master's cup*")
  1078.             if args == "bot":
  1079.               room.message("*Sips my tea*")
  1080.             else:
  1081.               room.message("*Pour tea to "+sntonick(args)+"'s cup*", True)
  1082.           else:
  1083.             if user.name in owners:
  1084.               room.message("*Pour heavenly tea to my master's cup*")
  1085.             else:
  1086.               room.message("*Pour tea to "+sntonick(user.name)+"'s cup*", True)
  1087.      #### Hug
  1088.       elif cmd == "hug" or cmd == "Hug":
  1089.           if args:
  1090.             room.message("*"+user.name+" hugged "+args+"*")
  1091.           else:
  1092.             room.message("Hugs "+(user.name)+".", True)
  1093.      #### Kiss
  1094.       elif cmd == "kiss" or cmd == "Kiss":
  1095.           if args:
  1096.             if args == "" or args == "bot": return
  1097.             room.message(random.choice([user.name+" Kisses "+args+" so Passionately and lovingly :3",args+" is being kissed by "+user.name+" and "+args+" loves it so much .__.",user.name+" deep kissed "+args, user.name+" kisses "+args+" wildly and they ended up playing in the bushes O_o"]))
  1098.           if args == "" or args.lower() == "messedhat" or args.capitalize() == "messh" or args.capitalize() == "messedhat":
  1099.             if user.name in spermitted or user.name in permitted:
  1100.               room.message(random.choice(["*Kisses "+user.name+"-sama*","Yaay, xD *Kisses "+user.name+"* >///<","*Makes out with "+user.name+"-sama*"]))
  1101.             else:
  1102.               room.message(random.choice(["*Kisses "+user.name+"*","*Kisses* :x","*refused to give "+user.name+" a kiss*"]))
  1103.      #### Google Search
  1104.       elif cmd == "gws" or cmd == "Gws" or cmd == "Google Search":
  1105.           if len(args) > 0:
  1106.             room.rawMessage("<a href='http://lmgtfy.com/?q=" + args + "' target='_blank'><u>" + args + '</u></a>' )
  1107.      #### Jones >.<
  1108.       elif cmd == "jones" or cmd == "Jones":
  1109.           if len(args)>0:
  1110.             obv = ["what do you want ?","what do you want?","what do you want","what do you desire ?","what do you desire","what do you desire?","what do you wish for?","what do you wish for ?","what do you wish for"]
  1111.             insult = ["fuck you","fook you","damn you","i hate you","kiss my ass"]
  1112.             jelas = ["apa maumu ?","apa maumu?","Apa maumu","apa maumu","mau lo apa ?","mau lo apa?","mau lo apa","lu mau apa?","lu mau apa ?","lu mau apa"]
  1113.             if args in obv:
  1114.               room.message(random.choice(["I want a girlfriend :)","I want you >:)","I need a whore","I want a lover","Your Anus !!","Your tits !","I want your soul >:3","Gimme a gun","Your money :|","Give me your money !!!"]))
  1115.             if args in jelas:
  1116.               room.message(random.choice(["Tidakkah jelas ? gue mau jablay !","Gue butuh cewek broh","hadehh dia pake nanya,, gue mau cewek"]))
  1117.             if args in insult:
  1118.               room.message(random.choice(["Well, Fuck you too","oh shit whatever >_>","Stfu and kiss my arse !!"]))
  1119.             else:
  1120.               if args in obv or args in insult or args in jelas: return
  1121.               room.message(random.choice(["yes","no","maybe","not likely","I'm too depressed right now ,try asking again later","It's a secret ;)","Still, i'm not.","True","Better not tell you now.","It is certain.","Certainly :)","I'm not sure >_>","Yes, I'am"]))
  1122.           else:
  1123.             room.message("This is The Mighty Jones command. You must ask a question for The Mighty Jones to answer...(EXAMPLE: 'jones Am I doing this right o.O ???)")
  1124.      #### Bored
  1125.       elif cmd ==  "bored" or cmd == "Bored":
  1126.           room.message(random.choice([user.name+", check the newest manga on http://mangareader.net ","You need to read some hentai "+user.name,"Nih buat "+user.name+", http://fakku.net","Just fap "+user.name+" !!",user.name+", Try chatting in http://ch.pew.im/chat/?animeindotv!,ecchi-us!,monosekai!,tango-hyoo!,i3ryok!","Say that again and i'll kill you "+user.name,"Try again "+user.name+" !!","Watch this Video "+user.name+" - http://www.youtube.com/watch?v=LWi8tNVotAY",user.name+", Play some Death Metal song and do some headbangs",user.name+", Play Jenga !!"]))
  1127.  
  1128.      #### Sex and Rape
  1129.       elif cmd == "sex" or cmd == "rape" or cmd == "Rape" or cmd == "Sex":
  1130.           if room.name == "animeindotv" or room.name == "ecchi-us":
  1131.             room.message("I Prohibit that command here")
  1132.           else:
  1133.             if args == "@random":
  1134.               args = (random.choice(room.usernames))
  1135.               room.message(random.choice([user.name+" had a passionate sex with "+args,user.name+" raped "+args+" and got labeled as a lolicon",user.name+" raped "+args+" in public and got arrested *lol*",user.name+" fucked "+args+"'s nipple and "+user.name+" got a Nipplefuck Addiction :o",user.name+" Had sex with "+args+" and got labeled as a Gay",user.name+" fucks "+args+"'s ass real hard and cums inside",user.name+" had sex with "+args+" and came really hard",user.name+" fooked "+args+"'s pussy and didn't cum",user.name+" fucked "+args+"'s mouth so hard and lost his penis :|"]))
  1136.             else:
  1137.               if args == "": return
  1138.               room.message(random.choice([user.name+" had a passionate sex with "+args,user.name+" raped "+args+" and got labeled as a lolicon",user.name+" raped "+args+" in public and got arrested *lol*",user.name+" fucked "+args+"'s nipple and "+user.name+" got a Nipplefuck Addiction :o",user.name+" Had sex with "+args+" and got labeled as a Gay",user.name+" fucks "+args+"'s ass real hard and cums inside",user.name+" had sex with "+args+" and came really hard",user.name+" fooked "+args+"'s pussy and didn't cum",user.name+" fucked "+args+"'s mouth so hard and lost his penis :|"]))  
  1139.  
  1140.      #### Ud
  1141.       elif cmd == "ud" or cmd == "Urban Dictionary" or cmd == "Urban D" and len(args) > 0:
  1142.             try:
  1143.               term = args.replace(" ", "+")
  1144.               term2 = args
  1145.               import urllib.request
  1146.               with urllib.request.urlopen("http://www.urbandictionary.com/define.php?term=%s" % term[0:]) as url:
  1147.                   udict = url.read().decode()
  1148.               a = re.finditer('<div class="definition">(.+?)</div>', udict)
  1149.               matches = []
  1150.               for match in a:
  1151.                   matches.append(match.group(0))
  1152.               room.message("<br><b>defintion of %s:</b><br><br><i>%s</i></font>" % (term2, random.choice(matches)), True)
  1153.             except Exception as e:
  1154.               room.message("I was unable to find anything for <b>%s</b>" % term2, True)
  1155.       ###Youtube
  1156.       if cmd == "video" or cmd == "Video" or cmd == "Yt" or cmd == "Ytb" or cmd == "Youtube" or cmd == "yt" or cmd == "ytb" or cmd == "youtube":
  1157.            room.message(youtube.search(args), True)
  1158.    except Exception as e:
  1159.       try:
  1160.         et, ev, tb = sys.exc_info()
  1161.         lineno = tb.tb_lineno
  1162.         fn = tb.tb_frame.f_code.co_filename
  1163.         room.message("[Expectation Failed] %s Line %i - %s"% (fn, lineno, str(e)))
  1164.         return
  1165.       except:
  1166.         room.message("Undescribeable error detected !!")
  1167.         return  
  1168.       #### Buna
  1169.   ##### Ends the Commands #####
  1170.   ##Other Crap here, Dont worry about it
  1171.  
  1172.   def onFloodWarning(self, room):
  1173.     room.reconnect()
  1174.  
  1175.   def onJoin(self, room, user):
  1176.    print(user.name + " joined the chat!")
  1177.    if user.name in owners:
  1178.      room.message("Hello ,"+user.name.capitalize()+"! :D")
  1179.  
  1180.   def onLeave(self, room, user):
  1181.    print(user.name + " left the chat!")
  1182.  
  1183.   def onUserCountChange(self, room):
  1184.     print("users: " + str(room.usercount))
  1185.  
  1186.   def onMessageDelete(self, room, user, msg):
  1187.     print("MESSAGE DELETED: " + user.name + ": " + msg.body)
  1188.    
  1189.  
  1190.  
  1191. if __name__ == "__main__": TestBot.easy_start()
  1192.  
  1193.     #The End!!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement