Aluf

Chatango bot code- [Aluf] - How to make a chatango bot???

Apr 17th, 2015
1,528
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 47.47 KB | None | 0 0
  1. ########################################################################
  2. ########################################################################
  3. ####                     Posts  © Aluf                              ####
  4. ####               http://D3F4ULTS.chatango.com                     ####
  5. ####                                                                ####
  6.   _____  .__          _____                                         ####
  7.   /  _  \ |  |  __ ___/ ____\                                       ####
  8.  /  /_\  \|  | |  |  \   __\                                        ####
  9. /    |    \  |_|  |  /|  |                                          ####
  10. \____|__  /____/____/ |__|     © Aluf-[http://pastebin.com/u/Aluf]  ####
  11.         \/                                                          ####
  12. ####   Message me anytime for any doubts .CC's i post might not     ####
  13. ####   be working  everytime,so message me for fresh cc's  .        ####
  14. ####   Website :   www.pastebing.tk                                 ####
  15. ####   If you need suggestion for the pastebin bots of chatango     ####
  16. ####   message me,lol i have run all the bots here myself,so        ####
  17. ####   i guess ,i know which is the worst and best   .              ####
  18. ####   Do not ask for my bot code on pm ,i quit years back .        ####
  19. ####   If you have doubts regarding other codes on my pastebin      ####
  20. ####   Still message me on   D3F4ULTS  or 93. [93 FOR COMPLAINS]    ####
  21. ####   I Have been getting a lot of messages lately for cc's        ####
  22. ####   and the worst part is many want to know to hack cc           ####
  23. ####   I cannot help you with that ,you have to find a way yourself ####
  24. ####   but ofc you can always ask for cc's but don't ask me how to  ####
  25.  ____  _     _     _____                                            ####
  26. /  _ \/ \   / \ /\/    /                                            ####
  27. | / \|| |   | | |||  __\                                            ####
  28. | |-||| |_/\| \_/|| |                                               ####
  29. \_/ \|\____/\____/\_/   ©   PMR [ Add me before messaging ]         ####
  30. ########################################################################
  31.  
  32. currentver = ("Ver 1.3.3")
  33. verinfo = ("<br>This version, <font color='#01DF01'>" + currentver + "</font>, now has an updated level system, nick support, options for non-mod mode. <br> <br> Out-dated command list.")
  34.  
  35. rooms = []
  36. f = open("rooms.txt", "r")
  37. for name in f.readlines():
  38.     if len(name.strip())>0: rooms.append(name.strip())
  39. f.close()
  40. owners = ['aluf', 'oo5']
  41. dev = ['Aluf']
  42. botname = ['generates']
  43.  
  44. #imports################################
  45. import ch
  46. import subprocess
  47. import re
  48. import random
  49. import math
  50. import json
  51. from random import randint
  52. import os.path
  53. import sys
  54. import cgi
  55. import os
  56. import traceback
  57. import urllib
  58. import http.client
  59. from urllib import parse, request
  60. from html.parser import HTMLParser
  61. import datetime
  62. import socket
  63. import binascii
  64. import helperCmd
  65. import winsound
  66. import __future__
  67. import threading
  68. from xml.etree import cElementTree as ET
  69. import time
  70. from datetime import date
  71. import webbrowser,re,urllib.request
  72. #urllib supp
  73. if sys.version_info[0] > 2:
  74.     import urllib.request as urlreq
  75. else:
  76.     import urllib2 as urlreq
  77.  
  78.  
  79.  
  80. #Global variables#########################################
  81. lockdown = False
  82. desu = False
  83. blizzard = False
  84. purge = False
  85. #Timestart########################################
  86. starttime = str(datetime.datetime.fromtimestamp(int(time.time())).strftime('%Y-%m-%d %H:%M:%S'))
  87.  
  88. #On console Startup#####################################
  89. print ("Made by Aluf! :D")
  90. time.sleep(.5)
  91. print (currentver)
  92. time.sleep(1)
  93. print ("Loading important shit...")
  94. time.sleep(.5)
  95.  
  96. #list loading####################################
  97. #OWNER#
  98. owners = []
  99. f = open("owners.txt", "r")
  100. for name in f.readlines():
  101.     if len(name.strip())>0: owners.append(name.strip())
  102. f.close()
  103.  
  104. #WHITELIST#
  105. whitelist = []
  106. f = open("whitelist.txt", "r")
  107. for name in f.readlines():
  108.     if len(name.strip())>0: whitelist.append(name.strip())
  109. f.close()
  110.  
  111. #BLACKLIST#
  112. blacklist = []
  113. f = open("blacklist.txt", "r")
  114. for name in f.readlines():
  115.     if len(name.strip())>0: blacklist.append(name.strip())
  116. f.close()
  117.  
  118. #SPECIAL#
  119. special = []
  120. f = open("special.txt", "r")
  121. for name in f.readlines():
  122.     if len(name.strip())>0: special.append(name.strip())
  123. f.close()
  124.  
  125. #COMMAND LISTS########################################
  126.     #REGULAR#
  127. regcmd = []
  128. f = open("regcmd.txt", "r")
  129. for name in f.readlines():
  130.     if len(name.strip())>0: regcmd.append(name.strip())
  131. f.close()
  132.     #REGULAR#
  133. regcmd2 = []
  134. f = open("regcmd2.txt", "r")
  135. for name in f.readlines():
  136.     if len(name.strip())>0: regcmd2.append(name.strip())
  137. f.close()
  138.     #MODDIE#
  139. modcmd = []
  140. f = open("modcmd.txt", "r")
  141. for name in f.readlines():
  142.     if len(name.strip())>0: modcmd.append(name.strip())
  143. f.close()
  144.     #OWNER#
  145. owncmd = []
  146. f = open("owncmd.txt", "r")
  147. for name in f.readlines():
  148.     if len(name.strip())>0: owncmd.append(name.strip())
  149. f.close()
  150.  
  151. #DICTIONARY###################################
  152. dictionary = dict()
  153. f = open("definitions.txt","r")
  154. for line in f.readlines():
  155.         try:
  156.                 if len(line.strip())>0:
  157.                         word, definition, name = json.loads(line.strip())
  158.                         dictionary[word] = json.dumps([definition, name])
  159.         except:
  160.                 print("Def loading error in %s" % line)
  161. f.close()
  162.  
  163. #NICKS######################################
  164. nicks = dict()
  165. f = open("nicks.txt","r")
  166. for line in f.readlines():
  167.         try:
  168.                 if len(line.strip())>0:
  169.                         IP, nick = json.loads(line.strip())
  170.                         nicks[IP] = json.dumps([IP, nick])
  171.         except:
  172.                 print("Def loading error in %s" % line)
  173. f.close()
  174.  
  175. ###################################################
  176.  
  177. #Bot Defs##########################################
  178.  
  179. class LavenciBot(ch.RoomManager):
  180.   def everything_between(text,begin,end):
  181.                   idx1=text.find(begin)
  182.                   idx2=text.find(end,idx1)
  183.                   return ' '.join(text[idx1+len(begin):idx2].strip().split())
  184.   def onInit(self):
  185.     self.setNameColor("333333")
  186.     self.setFontColor("666666")
  187.     self.setFontFace("0")
  188.     self.setFontSize(9)
  189.     self.enableBg()
  190.     self.enableRecording()
  191.   def getAccess(self, user):
  192.         if user.name in botname: return 0
  193.         if user.name in owners: return 3
  194.         elif user.name in special: return 2
  195.         elif user.name in whitelist: return 1
  196.         else: return 0
  197.   def uptime():
  198.  
  199.          total_seconds = float(getUptime())
  200.  
  201.          # Helper vars:
  202.          MINUTE  = 60
  203.          HOUR    = MINUTE * 60
  204.          DAY     = HOUR * 24
  205.  
  206.          # Get the days, hours, etc:
  207.          days    = int( total_seconds / DAY )
  208.          hours   = int( ( total_seconds % DAY ) / HOUR )
  209.          minutes = int( ( total_seconds % HOUR ) / MINUTE )
  210.          seconds = int( total_seconds % MINUTE )
  211.  
  212.          # Build up the pretty string (like this: "N days, N hours, N minutes, N seconds")
  213.          string = ""
  214.          if days > 0:
  215.              string += str(days) + " " + (days == 1 and "day" or "days" ) + ", "
  216.          if len(string) > 0 or hours > 0:
  217.              string += str(hours) + " " + (hours == 1 and "hour" or "hours" ) + ", "
  218.          if len(string) > 0 or minutes > 0:
  219.              string += str(minutes) + " " + (minutes == 1 and "minute" or "minutes" ) + ", "
  220.          string += str(seconds) + " " + (seconds == 1 and "second" or "seconds" )
  221.  
  222.          return string;
  223.   def onConnect(self, room):
  224.     print("[+] Connected to "+room.name)
  225.   def sendCmd(self, *args, firstcmd = False):
  226.       if not firstcmd: self.wqueue.put_nowait(bytes(':'.join(args)+"\r\n\x00", "utf-8"))
  227.       else: self.wqueue.put_nowait(bytes(':'.join(args)+"\x00", "utf-8"))
  228.   def onModChange(self, room):
  229.       room.message("Room modlist updated.")
  230.   def onReconnect(self, room):
  231.     print("[+] Reconnected to "+room.name)
  232.   def onDisconnect(self, room):
  233.     print("[+] Disconnected from "+room.name)
  234.   def onJoin(self, room, user):
  235.    print(user.name + " joined the chat!")
  236.    if self.getAccess(user) >= 3:
  237.      if room.name == "animeget1":
  238.          room.message("Hello master <font color='#00FF00'>" + user.name.capitalize() + "</font>. ^~^", True)
  239.   def onLeave(self, room, user):
  240.    print(user.name + user.ip + " left the chat!")
  241.   def getUptime():
  242.       return time.time() - startTime
  243.   def onFloodBan(self, room):
  244.     print("You've been flood banned in" +room.name)
  245.     room.message("Too much spam, locking...")
  246.     lockdown == True
  247.   def onFloodWarning(self, room):
  248.     room.reconnect()
  249.     print("[+] Reconnecting...")
  250.   def onPMMessage(self, pm, user, body):
  251.     print("PM - "+user.name+": "+body)
  252.     pm.message(user, "Not real.")
  253.    
  254.   def onMessage(self, room, user, message):
  255.     global lockdown
  256.     global shush
  257.     global desu
  258.     global blizzard
  259.     global purge
  260.     if "Botteh" in user.name: return
  261.     print(message.ip, "[{0}] {1}: {2}".format(room.name.capitalize(), user.name.capitalize(), message.body))      
  262.     if "ryan" in message.body.lower():
  263.       if "ryan" not in room.usernames:
  264.         self.pm.message(ch.User("005"), "Master, "+user.name.capitalize()+" mentioned you in "+room.name+"")
  265.     if self.user == user: return
  266.     if user.name in blacklist: return
  267.     if lockdown == True:
  268.         if self.getAccess(user) < 3:
  269.             return
  270.     if purge == True:
  271.       if "!anon" in user.name:
  272.             anon = user.name
  273.             room.clearUser(ch.User(anon))
  274.             return
  275.     if desu == True:
  276.       if user.name not in dev:
  277.         if "desu" not in message.body.lower():
  278.             room.delete(message)
  279.     if blizzard == True:
  280.       if user.name not in dev:
  281.         if "*snow*" not in message.body.lower():
  282.             room.delete(message)
  283.     if message.body[0] == "+":
  284.       data = message.body[1:].split(" ", 1)
  285.       if len(data) > 1:
  286.         cmd, args = data[0], data[1]
  287.       else:
  288.         cmd, args = data[0], ""
  289.  
  290.  
  291.  
  292. #commands######################################
  293.       if cmd.lower() == "ping":
  294.         if self.getAccess(user) >= 2:
  295.           if len(args) >0:
  296.             if ".com" not in message.body:
  297.                 room.message("http://www.isitdownrightnow.com/data/"+args+".com.png")
  298.             else:
  299.                 room.message("http://www.isitdownrightnow.com/data/"+args+".png")          
  300.       if cmd.lower() == "test":
  301.           IP = message.ip
  302.           for IP in nicks:
  303.                 IP, nick = json.loads(nicks[IP])
  304.                 room.message("" + nick + "", True)
  305.                 return
  306.       if cmd.lower() == "anime" and len(args) > 0:
  307.           if args:
  308.             try:
  309.                 search = args.replace(" ","_")
  310.                 gdata = urlreq.urlopen("http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=site:anilist.co+%s" % "+".join(search))
  311.                 xdat = gdata.read().decode()
  312.                 x = re.finditer('"unescapedUrl":"(.+?)","url":"', xdat)
  313.                 mes = []
  314.                 for m in x:
  315.                     m = str(m.group(1))
  316.                     mes.append(m)
  317.                 link = random.choice(mes)
  318.                 link = link.replace("https","http")
  319.                 room.message('%s' % link)
  320.             except Exception as e:
  321.                 print("\n%s\n" % e),time.sleep(1)
  322.    
  323.       if cmd.lower() == "prof":
  324.           try:
  325.             args=args.lower()
  326.             stuff=str(urlreq.urlopen("http://"+args+".chatango.com").read())
  327.             crap, age = stuff.split('<span class="profile_text"><strong>Age:</strong></span></td><td><span class="profile_text">', 1)
  328.             age, crap = age.split('<br /></span>', 1)
  329.             crap, gender = stuff.split('<span class="profile_text"><strong>Gender:</strong></span></td><td><span class="profile_text">', 1)
  330.             gender, crap = gender.split(' <br /></span>', 1)
  331.             if gender == 'M':
  332.                 gender = 'Male'
  333.             elif gender == 'F':
  334.                 gender = 'Female'
  335.             else:
  336.                 gender = '?'
  337.             crap, location = stuff.split('<span class="profile_text"><strong>Location:</strong></span></td><td><span class="profile_text">', 1)
  338.             location, crap = location.split(' <br /></span>', 1)
  339.             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>'
  340.             prodata = '<u>http://' + args + '.chatango.com </u><a href="http://chatango.com/fullpix?' + args + '" target="_blank"> Age: '+ age +' Gender: '+ gender +' Location: ' + location + '</a>' + picture
  341.             room.rawMessage(prodata)
  342.           except:
  343.             room.message("There was an error in calculating "+args+"'s profile....are you sure they exist???")  
  344.  
  345.          
  346.       if (cmd.lower() == "ud")  and len(args) > 0:
  347.             try:
  348.               term = args.replace(" ", "+")
  349.               term2 = args
  350.               import urllib.request
  351.               with urllib.request.urlopen("http://www.urbandictionary.com/define.php?term=%s" % term[0:]) as url:
  352.                   udict = url.read().decode()
  353.               a = re.finditer('<div class="definition">(.+?)</div>', udict)
  354.               matches = []
  355.               for match in a:
  356.                   matches.append(match.group(0))
  357.               room.message("<br><b>defintion of %s:</b><br><br><i>%s</i></font>" % (term2, random.choice(matches)), True)
  358.             except Exception as e:
  359.               room.message("I was unable to find anything for <b>%s</b>" % term2, True)  
  360.  
  361.  
  362.       if cmd.lower() == "bg":
  363.         if self.getAccess(user) >= 2:
  364.           if len(args) > 0:
  365.               if args == "on":
  366.                 room.setBgMode(1)
  367.                 room.message("Muh BG~")
  368.                 return
  369.               if args == "off":
  370.                 room.setBgMode(0)
  371.                 room.message("I feel naked now ._.")
  372.                 return
  373.       if cmd.lower() == "active":
  374.           if self.getAccess(user) >= 2:
  375.             room.message("I've been active since: " + starttime)
  376.       if cmd.lower() == "gis" and len(args) > 0:
  377.           if self.getAccess(user) >= 1:
  378.             try:
  379.                 search = args.replace(" ","_")
  380.                 gdata = urlreq.urlopen("http://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=%s" % "+".join(search))
  381.                 xdat = gdata.read().decode()
  382.                 x = re.finditer('"unescapedUrl":"(.+?)","url":"', xdat)
  383.                 mes = []
  384.                 for m in x:
  385.                     m = str(m.group(1))
  386.                     mes.append(m)
  387.                 link = random.choice(mes)
  388.                 link = link.replace("https","http")
  389.                 room.message('%s' % link)
  390.             except Exception as e:
  391.                 print("\n%s\n" % e),time.sleep(1)
  392.       if cmd.lower() == "anime" and len(args) > 0:
  393.           if self.getAccess(user) >= 1:
  394.             try:
  395.                 search = args.replace(" ","_")
  396.                 gdata = urlreq.urlopen("http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=site:anilist.co+%s" % "+".join(search))
  397.                 xdat = gdata.read().decode()
  398.                 x = re.finditer('"unescapedUrl":"(.+?)","url":"', xdat)
  399.                 mes = []
  400.                 for m in x:
  401.                     m = str(m.group(1))
  402.                     mes.append(m)
  403.                 link = random.choice(mes)
  404.                 link = link.replace("https","http")
  405.                 room.message('%s' % link)
  406.             except Exception as e:
  407.                 print("\n%s\n" % e),time.sleep(1)
  408.       if cmd.lower() == "linkz" and len(args) > 0:
  409.           if self.getAccess(user) >= 1:
  410.             try:
  411.                 search = args.replace(" ","_")
  412.                 gdata = urlreq.urlopen("http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=site:anilinkz.com+/series/+%s" % "+".join(search))
  413.                 xdat = gdata.read().decode()
  414.                 x = re.finditer('"unescapedUrl":"(.+?)","url":"', xdat)
  415.                 mes = []
  416.                 for m in x:
  417.                     m = str(m.group(1))
  418.                     mes.append(m)
  419.                 link = random.choice(mes)
  420.                 link = link.replace("-episode-","   ")
  421.                 room.message('%s' % link)
  422.             except Exception as e:
  423.                 print("\n%s\n" % e),time.sleep(1)
  424.       if cmd.lower() == "mods":
  425.         time.sleep(1)
  426.         room.message("Owner: <font color='#FF0000'>"+room.ownername+"</font> Mods: <font color='#FF0000'>"+" , ".join(room.modnames), True)
  427.       if cmd.lower() == "dice":
  428.           if self.getAccess(user) >= 1:
  429.               room.message(random.choice(["2","3","4","5","6","7","8","9","10","11","12"]))
  430.       if cmd.lower() == "pm" and len(args) > 0:
  431.           if self.getAccess(user) >= 1:
  432.               name = args.split()[0].lower()
  433.               personalm = " ".join(args.split()[1:])
  434.               self.pm.message(ch.User(name), "Message from "+user.name.capitalize()+" in the room http://"+room.name+".chatango.com : \""+personalm.capitalize()+"\" Go there or pm them to reply.")
  435.               room.message("<font color='#FF0000'>"+user.name.capitalize()+"</font>, I sent a message to <font color='#FF0000'>" +name.capitalize()+ "</font>.", True)
  436.       if cmd.lower() == "rn":
  437.           if self.getAccess(user) >= 1:
  438.               room.message(str(randint(1,1000000)))
  439.       if cmd.lower() == "say":
  440.         if self.getAccess(user) >= 1:
  441.           if args:
  442.             room.delete(message)
  443.             room.message(args, True)
  444.           else:
  445.             room.message("What?")
  446.       if cmd.lower() == "an":
  447.         if self.getAccess(user) >= 3:
  448.           if args:
  449.             for _room in self.rooms:
  450.                 _room.message("Announcement from: <font color='#FF0000'>"+user.name.capitalize()+"</font> : "+args, True)
  451.           else:
  452.             room.message("<font color='#FF0000'>Say what now?</font>", True)
  453.       if cmd.lower() == "ghost":
  454.         if user.name == "aluf":
  455.           if args:
  456.             for _room in self.rooms:
  457.                 _room.message("" + args, True)
  458.       if cmd.lower() == 'rslap':
  459.         if self.getAccess(user) >= 1:
  460.           (random.choice(room.usernames))
  461.           room.message("Slaps <font color='#01DF01'>"+(random.choice(room.usernames))+"</font> xD.", True)
  462.       if cmd.lower() == "info":
  463.         time.sleep(1)
  464.         room.message("Made by Aluf. <font color='#01DF01'>"+(currentver)+"</font>", True)
  465.       if cmd.lower() == "vinfo":
  466.           room.message(verinfo, True)
  467.       if cmd.lower() == "ml":
  468.             time.sleep(1)
  469.             room.message("http://www.youtube.com/watch?v=s5CP72VutKc&list=FLTs8CmRWgK0437esCkwbmDQ&feature=share")
  470.       if cmd.lower() == "chkmigs":
  471.         if self.getAccess(user) >= 3:
  472.           room.message("Checking...")
  473.           time.sleep(1)
  474.           room.message(random.choice(["None! =]", "6 with ID match.", "1 with ID match.","2 with ID match.", "2 with ID match.","3 with ID match.", "4 with ID match.","5 with ID match.", "7 with ID match."]))
  475.       if cmd.lower() == "cl" or cmd.lower() == "cmds" or cmd.lower() == "cmd":
  476.         time.sleep(1)
  477.         if self.getAccess(user) >= 1:
  478.           room.message("Command Help:<br><br>For regular commands:<font color='#FF0000'>'/regcmd'</font>. <br>For moddie commands:<font color='#FF0000'>'/modcmd'</font>. <br>For Master commands:<font color='#FF0000'>'/mascmd'</font>. <br> Access is limited by level.", True)
  479.           return
  480.       if cmd.lower() == "regcmd":
  481.         if self.getAccess(user) >= 1:
  482.           room.message((str(", ".join(regcmd))), True)
  483.           room.message((str(", ".join(regcmd2))), True)
  484.       if cmd.lower() == "modcmd":
  485.         if self.getAccess(user) >= 2:
  486.           room.message((str(", ".join(modcmd))), True)
  487.       if cmd.lower() == "mascmd":
  488.         if self.getAccess(user) >= 3:
  489.           room.message((str(", ".join(owncmd))), True)  
  490.       if cmd.lower() == "help":
  491.         if self.getAccess(user) >= 3:
  492.           room.message("Why would you need help, <font color='#00FF00'>Master?</font> o. o", True)
  493.         else:
  494.           room.message("Commands are case-sensitive. Try '/wlme' for self-whitelisting and '/cl' for commands access. ;)")
  495.       if cmd.lower() == "definehelp":
  496.         if self.getAccess(user) >= 1:
  497.           room.message("Try <br> '/define (word)' to check definition.<br> '/define (word): (definition)' to define a word. <br>'/define (word) remove' to remove a definition.", True)
  498.       if cmd.lower() == "sav":
  499.         if self.getAccess(user) >= 3:
  500.           room.message("Saving...")
  501.           print("Saving values...")
  502.           f = open("definitions.txt","w")
  503.           for word in dictionary:
  504.               definition, name = json.loads(dictionary[word])
  505.               f.write(json.dumps([word,definition, name])+"\n")
  506.           f.close()
  507.           f = open("whitelist.txt", "w")
  508.           f.write("\n".join(whitelist))
  509.           f.close()
  510.           f = open("nicks.txt", "w")
  511.           for IP in nicks:
  512.               IP, nick = json.loads(nicks[IP])
  513.               f.write(json.dumps([IP,nick])+"\n")
  514.           f.close()
  515.           f = open("special.txt", "w")
  516.           f.write("\n".join(special))
  517.           f.close()
  518.         else:
  519.           room.message("Nope ^-^")
  520.       if cmd.lower() == "define" and len(args) > 0:
  521.         if self.getAccess(user) >= 1:
  522.             try:
  523.                 word, definition = args.split(":", 1)
  524.                 word = word.lower()
  525.             except:
  526.                 word = args.split()[0].lower()
  527.                 definition = ""
  528.             if len(word.split()) > 1:
  529.                 room.message("The hell am i supposed to define it as? :|")
  530.                 return
  531.             if len(args.split()) > 1 and args.lower().split()[1] == "remove":
  532.               if self.getAccess(user) >= 2:
  533.                 if word in dictionary:
  534.                     definition, name = json.loads(dictionary[word])
  535.                     if name in owners:
  536.                         del dictionary[word]
  537.                         room.message("removed")
  538.                         return
  539.                     else:
  540.                         return
  541.                 else:
  542.                     room.message("<font color='#00FF00'>%s</font> is not defined." % args, True)
  543.             elif len(definition) > 0:
  544.                 if word in dictionary:
  545.                     room.message("<b>%s</b>, that's is already defined. You may not define it again." % user.name, True)
  546.                 else:
  547.                     room.delete(message)
  548.                     dictionary[word] = json.dumps([definition, user.name])
  549.                     room.message(word + ": " + definition + " by " + user.name)
  550.             else:
  551.                 if word in dictionary:
  552.                     definition, name = json.loads(dictionary[word])
  553.                     room.message(word + ": " + definition + " - " + name)
  554.                 else:
  555.                     room.message("<font color='#00FF00'><b>%s</b></font> is not defined yet." % args, True)
  556.       if cmd.lower() == "nickr":
  557.         if self.getAccess(user) >= 2:
  558.             if username in nicks:
  559.                 nick = args
  560.                 username = user.name
  561.                 username, nick = json.loads(nicks[username])
  562.                 del nicks[username]
  563.                 room.message("removed")
  564.                 return
  565.             else:
  566.                 room.message("I can't find you.")
  567.                 return
  568.  
  569.  
  570.       if cmd.lower() == "nick":
  571.         if self.getAccess(user) >= 1:
  572.             nick = args
  573.             username = user.name
  574.             if len(args) == 0:
  575.               if username in nicks:
  576.                 username, nick = json.loads(nicks[username])
  577.                 room.message("Your nickname is " + nick + ".", True)
  578.                 return
  579.               else:
  580.                 room.message("Use /nick 'nickname' to set a nick. You may use HTML tags in your name. NICKS MAY NOT BE CHANGED. CHOOSE WISELY.")
  581.                 return
  582.             else:
  583.               if username in nicks:
  584.                 username, nick = json.loads(nicks[username])
  585.                 room.message("You already have a nickname, " + nick + ".", True)
  586.                 return
  587.               else:
  588.                 nicks[username, nick] = json.dumps([username, nick])
  589.                 room.message(user.name + " set nick as " + nick, True)
  590.                 f = open("nicks.txt", "w")
  591.                 for IP in nicks:
  592.                     IP, nick = json.loads(nicks[IP])
  593.                     f.write(json.dumps([IP,nick])+"\n")
  594.                 f.close()
  595.                 return
  596.         else:
  597.             return
  598.        
  599.       if cmd.lower() == "addmod":
  600.         if len(args) > 0:
  601.             if self.name in room.ownername:
  602.                 if args in room.modnames:
  603.                     room.message("<font color='#00FF00'>%s</font> is already a moderator in this room." % args, True)
  604.                    
  605.                 if self.getAccess(user) == 2.5:
  606.                     room.addMod(ch.User(args))
  607.                     room.message("<font color='#00FF00'>%s</font> has been promoted to a room moderator!" % args, True)
  608.                 else:
  609.                     room.message("Denied.")
  610.             else:
  611.                 room.message("This is not my chat, sorry! D:")
  612.         else:
  613.             room.message("Who am i supposed to mod? :|")
  614.            
  615.      
  616.      
  617.       if cmd.lower() == "fpix" and len (args) > 0:
  618.         if self.getAccess(user) >= 1:
  619.             name=args
  620.             room.message("http://fp.chatango.com/profileimg/"+name[:1]+"/"+name[1:2]+"/"+name+"/full.jpg")
  621.       if cmd.lower() == "fullpix" and len (args) > 0:
  622.         if self.getAccess(user) >= 1:
  623.             name=args
  624.             room.message("http://bingo.sorch.info/picture/" + name + ".jpg")
  625.  
  626.       if cmd.lower() == "invite":
  627.         if self.getAccess(user) >= 2:
  628.             if len(args) > 0:
  629.                 self.pm.message(ch.User(args), "%s wants you to join me in a chatroom!  www.%s.chatango.com" % (owners[0], room.name))
  630.                 room.message("I invited %s to the room." % args)
  631.             else:
  632.                 room.message('You need to enter a username.')
  633.       if cmd.lower() == "tracker" and self.getAccess(user) >= 1:
  634.           try:
  635.              if len(args) == 0:
  636.                f = urlreq.urlopen("http://chtracker.info/index.py?output=html&x=page&y={}&results=0".format(user.name))
  637.                data = json.loads(f.readall().decode("utf-8"))
  638.                viewers = [(item['viewer'], item2['timestamp']) for item, item2 in data]
  639.                room.message("The last 10 people who visited your profile: %s %s ago".format(item, stamp.getTimeStamp(item2)))
  640.           except:
  641.              room.message((str(sys.exc_info()[1])))
  642.              
  643.       if cmd.lower() == "sn" and len(args) > 0:
  644.           try:
  645.             to, body = args.split(" ", 1)
  646.             sender = user.name
  647.             if args:
  648.               sasaran[to] = json.dumps([body, sender])
  649.               room.message("sent")
  650.               notif.append(to)
  651.             else: room.message(to+" is not a whitelisted user")
  652.             #if user.name : room.message( kamu dapat sn dari .... silahkan gunakan cmd 'sn read ) kek gitu aja
  653.           except: room.message("Fail !!")
  654.          
  655.       if cmd.lower() == "rn":
  656.           try:
  657.             if user.name in sasaran:
  658.               body, sender = json.loads(sasaran[user.name])
  659.               room.message(user.name+", you got a note from "+sender+" ---> "+body)
  660.               del sasaran[user.name]
  661.               notif.remove(to)
  662.           except: return
  663.          
  664.  
  665.                
  666.       if cmd.lower() == "shutdown":
  667.         if user.name.lower() == '005':
  668.           room.message("Bye bye :]")
  669.           self.stop()
  670.         else:
  671.           room.message("<font color='#FF0000'>Denied.</font>", True)
  672.       elif cmd.lower() == "ban":
  673.           if self.user.name in room.modnames:
  674.               if self.getAccess(user) >= 2:
  675.                 if len(args) > 0:
  676.                     if self.getAccess(user) >= 2:
  677.                       if args in botname:
  678.                             room.message("Why the hell would i ban myself? ._.")
  679.                             return
  680.                       if args.lower() == user.name:
  681.                           room.message("Banning yourself...not a wise move.")
  682.                           return
  683.                       if user.name in owners:
  684.                           room.banUser(ch.User(args))
  685.                           room.clearUser(ch.User(args))
  686.                           room.message("<font color='#F7FE2E'>%s</font> has been <font color='#FF0000'>BANNED</font> by Master. You done fucked up." % args, True)
  687.                           return
  688.                       if args in owners or args in special:
  689.                             room.message("<font color='#FF0000'>%s</font> is unbannable through me. ^^" % args.capitalize(), True)
  690.                             return
  691.                       else:
  692.                           if args in room.usernames:
  693.                             room.clearUser(ch.User(args))
  694.                             room.banUser(ch.User(args))
  695.                             room.message("<font color='#F7FE2E'>%s</font> has been <font color='#FF0000'>BANNED</font> >:D!" % args, True)
  696.                           else:
  697.                               room.message("I can't find the bastard! D:<")
  698.                     else:
  699.                         room.message("<font color='#FF0000'>Denied.</font>", True)
  700.                 else:
  701.                     room.message('Ban who?')
  702.           else:
  703.               room.message("I've no power in this realm...")
  704.            
  705.       if cmd.lower() == "unban":
  706.           if self.user.name in room.modnames:
  707.             if self.getAccess(user) >= 2:
  708.                 if len(args) > 0:
  709.                     if self.getAccess(user) >= 2:
  710.                       room.unban(ch.User(args))
  711.                       room.message("<font color='#F7FE2E'>%s</font> has been <font color='#00FF00'>unbanned</font> ^~^" % args, True)
  712.                     else:
  713.                         room.message("<font color='#FF0000'>Denied.</font>", True)
  714.                         return
  715.                 else:
  716.                     room.message('Who?')
  717.             else:
  718.                room.message("I've no power in this realm...")
  719.          
  720.       if (cmd.lower() == "goto" or cmd.lower() == "join")  and len(args) > 0:
  721.         if self.getAccess(user) >= 2:
  722.           if len(args) > 0:
  723.             if args not in rooms:
  724.                 self.joinRoom(args)
  725.                 rooms.append(args)
  726.                 f = open("rooms.txt", "w")
  727.                 f.write("\n".join(rooms))
  728.                 f.close()
  729.                 room.message("Added.")
  730.                 return
  731.             else:
  732.                 room.message("Already there ^~^")
  733.                 return
  734.           else:
  735.                 room.message("You room name to join~")
  736.              
  737.       if cmd.lower() == "leave" and len(args) > 0:
  738.         if self.getAccess(user) >= 2:
  739.             time.sleep(1)
  740.             if len(args) > 0:
  741.                 if args in rooms:
  742.                     self.leaveRoom(args)
  743.                     rooms.remove(args)
  744.                     f = open("rooms.txt", "w")
  745.                     f.write("\n".join(rooms))
  746.                     f.close()
  747.                     room.message("Okay :<")
  748.                 else:
  749.                     room.message("I'm not there ._.")
  750.             else:
  751.                 room.message("You room name to leave~")
  752.       if cmd.lower() == "lock":
  753.             if self.getAccess(user) >= 3:
  754.                     lockdown = True
  755.                     print("#####LOCKING")
  756.                     room.message("Bye for now~ *waves*")
  757.                     return                    
  758.             else:
  759.                 room.message("<font color='#FF0000'>Denied.</font>", True)
  760.       if cmd.lower() == "unlock":
  761.             if self.getAccess(user) >= 3:
  762.                     lockdown = False
  763.                     room.message("I'm Baaack~")
  764.                     print("#####UNLOCKING")
  765.                     return
  766.  
  767.  
  768.       if cmd.lower() == "locate" and len(args) > 0:
  769.           if self.getAccess(user) >= 1:
  770.               name = args.split()[0].lower()
  771.               if not ch.User(name).roomnames:  room.message("I'm not seeing them in any of my rooms...")
  772.               else: room.message("<font color='#FF0000'>%s</font>, they are in <font color='#666666'>%s</font>" % (user.name.capitalize(), ", ".join(ch.User(name).roomnames)), True)
  773.           else:
  774.               room.message("No can do~")
  775.       if cmd.lower() == "hug":
  776.         if self.getAccess(user) >= 1:
  777.             time.sleep(1)
  778.             if not len(args) == 0:
  779.               if args in dev or args in sara:
  780.                 room.message("*Snuggles <font color='#01DF01'>Master</font>* ^_^", True)
  781.                 return
  782.               if args in botname:
  783.                 room.message("*hugs self*")
  784.                 return
  785.               if args in whitelist or args in special:
  786.                 room.message("*Hugs <font color='#01DF01'>%s</font> tightly* :3" % args, True)
  787.                 return
  788.               if args in baron:
  789.                 room.message("No hugs for Baron. :|")
  790.                 return
  791.               if args.lower() == "chat":
  792.                 room.message("<font color='#01DF01'>G</font><font color='#FF0000'>R</font><font color='#FF00BF'>O</font><font color='#FBFBEF'>U</font><font color='#FFFF00'>P</font> HUG! >:D", True)
  793.                 return
  794.               else:
  795.                 room.message("*Gives <font color='#01DF01'>%s</font> a hug*" % args, True)
  796.             else:
  797.               room.message("Lets snuggle.")
  798.       if cmd.lower() == "dhug":
  799.         if self.getAccess(user) >= 1:
  800.           if not len(args) == 0:
  801.             if args in dev or args in sara:
  802.               room.message("*master snuggles self*")
  803.               return
  804.             if args in botname:
  805.               room.message("*<font color='#01DF01'>" + user.name.capitalize() +"</font> hugs <font color='#01DF01'>Lavenci</font>*", True)
  806.               return
  807.             if args in whitelist or args in special:
  808.               room.message("*<font color='#01DF01'>" + user.name.capitalize() + "</font> Hugs <font color='#01DF01'>%s</font> ." % args, True)
  809.               return
  810.             else:
  811.               room.message("*<font color='#01DF01'>" + user.name.capitalize() + "</font> gives a hug to <font color='#01DF01'>%s</font> *" % args, True)
  812.           else:
  813.             room.message("Lets snuggle.")
  814.      
  815.       if cmd.lower() == "flip":
  816.         if self.getAccess(user) >= 1:
  817.             if len(args) > 0:
  818.               (str(randint(1,2)))
  819.               if args == (str(randint(1,2))):
  820.                 room.message("YOU GOT IT! >:D")
  821.                 return
  822.               else:
  823.                 room.message("You lost! D:")
  824.                 return
  825.             else:
  826.                 room.message("You need to guess a number (1 or 2), that's how this works...")
  827.       if cmd.lower() == "wl":
  828.         if self.getAccess(user) >= 2:
  829.             time.sleep(1)
  830.             if len(args) > 0:
  831.               if args in room.usernames:
  832.                   if "anon" in args:
  833.                       room.message("Anons are unable to be whitelisted.")
  834.                       return
  835.                   else:
  836.                         if args not in whitelist:
  837.                           whitelist.append(args)
  838.                           rooms.append(args)
  839.                           f = open("whitelist.txt", "w")
  840.                           f.write("\n".join(whitelist))
  841.                           f.close()
  842.                           room.message("Added.")
  843.                         else:
  844.                           room.message("Already added.")
  845.               else:
  846.                   room.message("I can't find them D:")
  847.             else:
  848.                 room.message("You need a name to whitelist.")
  849.       if cmd.lower() == "bmod":
  850.         if self.getAccess(user) >= 3:
  851.             time.sleep(1)
  852.             if len(args) > 0:
  853.               if "anon" in args:
  854.                   room.message("Anons are unable to be spec'd.")
  855.                   return
  856.               else:
  857.                     if args not in special:
  858.                       special.append(args)
  859.                       f = open("special.txt", "w")
  860.                       f.write("\n".join(special))
  861.                       f.close()
  862.                       room.message("Added.")
  863.                     else:
  864.                       room.message("Already added.")
  865.             else:
  866.                 room.message("You need a name to spec.")
  867.                
  868.       if cmd.lower() =="bgtime" and len(args) > 0:
  869.                 args=args.lower()
  870.                 if len(args.split(" ", -1)) != 1:
  871.                      return
  872.                 if len(args) == 1:
  873.                     f_args, s_args = args, args
  874.                 elif len(args) > 1:
  875.                     f_args, s_args = args[0], args[1]
  876.  
  877.                 def getBgtime(args):
  878.                     expired = True
  879.                     url = ("http://st.chatango.com/profileimg/" + f_args + "/" + s_args + "/" + args + "/mod1.xml")
  880.                     f = urlreq.urlopen(url)
  881.                     data = f.read().decode("utf-8")
  882.                     e = ET.XML(data)
  883.                     bg = e.findtext("d")
  884.                     bg = int(urlreq.unquote(bg))
  885.                     if bg - int(time.time()) < 0:
  886.                       total_seconds = int(time.time())-bg
  887.                     else:
  888.                       total_seconds = bg-int(time.time())
  889.                       expired = False
  890.  
  891.                 # Helper vars:
  892.                     MINUTE  = 60
  893.                     HOUR    = MINUTE * 60
  894.                     DAY     = HOUR * 24
  895.  
  896.                 # Get the days, hours, etc:
  897.                     days    = int( total_seconds / DAY )
  898.                     hours   = int( ( total_seconds % DAY ) / HOUR )
  899.                     minutes = int( ( total_seconds % HOUR ) / MINUTE )
  900.                     seconds = int( total_seconds % MINUTE )
  901.  
  902.                 # Build up the pretty string (like this: "N days, N hours, N minutes, N seconds")
  903.                     string = ""
  904.                     if days > 0 or days < 0:
  905.                         string += str(days) + " " + (days == 1 and "day" or "days" ) + ", "
  906.                     if len(string) > 0 or hours > 0:
  907.                         string += str(hours) + " " + (hours == 1 and "hour" or "hours" ) + ", "
  908.                     if len(string) > 0 or minutes > 0:
  909.                         string += str(minutes) + " " + (minutes == 1 and "minute" or "minutes" ) + ", "
  910.                     string += str(seconds) + " " + (seconds == 1 and "second" or "seconds" )
  911.                     if expired == True:
  912.                       return "expired: "+string
  913.                     elif expired == False:
  914.                       return "time is: "+string
  915.                 room.message("<font face=\"arial\" size=\"11\"><b>" + args.title() + "</b> BG " + getBgtime(args), True)
  916.                
  917.          
  918.       if cmd.lower() =="userlist":
  919.           room.message("The names of the people here are : "+str(room.usernames))
  920.  
  921.       if cmd.lower() == "bmodr":
  922.         if self.getAccess(user) >= 3:
  923.             time.sleep(1)
  924.             if len(args) > 0:
  925.                 if args in special:
  926.                   special.remove(args)
  927.                   f = open("special.txt", "w")
  928.                   f.write("\n".join(special))
  929.                   f.close()
  930.                   room.message("Removed.")
  931.                 else:
  932.                   room.message("Who now?")
  933.                   return
  934.             else:
  935.                 room.message("You need a name to remove.")
  936.       if cmd.lower() == "bmodlist":
  937.         if self.getAccess(user) >= 2:
  938.             room.message(str(special))        
  939.       if cmd.lower() == "wlr":
  940.         if self.getAccess(user) >= 2:
  941.             time.sleep(1)
  942.             if len(args) > 0:
  943.                 if args in whitelist:
  944.                   whitelist.remove(args)
  945.                   f = open("whitelist.txt", "w")
  946.                   f.write("\n".join(whitelist))
  947.                   f.close()
  948.                   room.message("Removed.")
  949.                 else:
  950.                   room.message("Who now?")
  951.                   return
  952.             else:
  953.                 room.message("You need a name to remove.")
  954.       if cmd.lower() == "banlist":
  955.         if self.user.name in room.modnames:
  956.           if self.getAccess(user) >= 2:
  957.             room.message("Naughty people: " + (str(", ".join(room.banlist))))
  958.       if cmd.lower() == "wll":
  959.         if self.getAccess(user) >= 2:
  960.             time.sleep(1)
  961.             room.message(str(", ".join(whitelist)))
  962.       if cmd.lower() == "bl":
  963.         if self.getAccess(user) >= 3:
  964.             time.sleep(1)
  965.             if len(args) > 0:
  966.               if "!anon" in args:
  967.                   room.message("Anons are unable to be blacklisted.")
  968.                   return
  969.               else:
  970.                     if args not in blacklist:
  971.                       blacklist.append(args)
  972.                       f = open("blacklist.txt", "w")
  973.                       f.write("\n".join(blacklist))
  974.                       f.close()
  975.                       room.message("*tosses <font color='#FF0000'>" +(args)+ "</font> in a hole for eternity*", True)
  976.                     else:
  977.                       room.message("They're already dead to me ._.")
  978.             else:
  979.                 room.message("You need a name to blacklist.")
  980.       if cmd.lower() == "blr" and len(args) >0:
  981.           if self.getAccess(user) >= 3:
  982.             time.sleep(1)
  983.             if len(args) > 0:
  984.                 if args in blacklist:
  985.                   blacklist.remove(args)
  986.                   f = open("blacklist.txt", "w")
  987.                   f.write("\n".join(blacklist))
  988.                   f.close()
  989.                   room.message("Removed, they better behave...")
  990.                 else:
  991.                   room.message("Who now?")
  992.                   return
  993.             else:
  994.                 room.message("You need a name to blacklist.")
  995.       if cmd.lower() == "bll":
  996.         time.sleep(1)
  997.         if self.getAccess(user) >= 2:
  998.           room.message(str(", ".join(blacklist)))
  999.       if cmd.lower() == "rr":
  1000.         time.sleep(1)
  1001.         if self.getAccess(user) >= 1:
  1002.             room.message("Shoots at " + (random.choice(room.usernames))+ " with " + (random.choice(["a rocket launcher", "a magnum", "a kitten", "an elbow", "a phone", "a boomerang", "a whip", "a guitar", "an SKS", "a car", "some bananas", "The Internet", "a Coke bottle", "a sword", "a mace", "Lavenci", "a Gameboy", "the Truth", "a television", "the sound of music", "a snowboard", "a pokeball", "some chewed gum", "a train", "a club", "an egg", "mean words", "a spaceship", "an elephant", "their keychain", "a book"]))+ (random.choice([" for a critical hit!", ", but it doesn't do much.", ", and it's super effective!", ", and they die instantly.", " and hits " + (random.choice(room.usernames)) + " for a double kill!", ", but misses.", ", Good one!"])))
  1003.         else:
  1004.             room.message("Nope. ^~^")
  1005.       if cmd == "yt" or cmd == "ytb":            
  1006.             try:
  1007.               word = args\
  1008.                      .replace(" ", "+")
  1009.               ydata = urlreq.urlopen('http://gdata.youtube.com/feeds/api/videos?q=' + word)
  1010.               tree = ET.parse(ydata)
  1011.               youentry = tree.findall('{http://www.w3.org/2005/Atom}entry')
  1012.               youtitle = youentry[0].findtext('{http://www.w3.org/2005/Atom}title')
  1013.               youvar99 = youentry[0].findall('{http://www.w3.org/2005/Atom}link')
  1014.               if youvar99[0].get('rel') == 'alternate':
  1015.                 youvid = youvar99[0].get('href')
  1016.                 youvar98 = youentry[0].findall('{http://www.w3.org/2005/Atom}author')
  1017.                 youname = youvar98[0].findtext('{http://www.w3.org/2005/Atom}name')
  1018.                 room.message("<font color='#01DF01'>%s</font>, I found - "% user.name.capitalize() + youtitle + " by <font color='#01DF01'>" + youname + "</font> " + youvid, True)
  1019.               else:
  1020.                 room.message("This never displays :| Don't worry")
  1021.             except:
  1022.               room.message("Something went wrong! D:")
  1023.       if cmd.lower() == "wlme":
  1024.         time.sleep(1)
  1025.         if "anon" in user.name.lower():
  1026.             room.message("Please log in to whitelist.")
  1027.             return
  1028.         if user.name not in whitelist:
  1029.           whitelist.append(user.name)
  1030.           f = open("whitelist.txt", "w")
  1031.           f.write("\n".join(whitelist))
  1032.           f.close()
  1033.           room.message("Added.")
  1034.         else:
  1035.           room.message("Already added.")
  1036.           return
  1037.       if cmd.lower() == "slap":
  1038.         time.sleep(1)
  1039.         if self.getAccess(user) >= 1:
  1040.           if not len(args) == 0:
  1041.             if args in owners:
  1042.               room.message("*Slaps Master*")
  1043.               return
  1044.             if args in special:
  1045.               room.message("*pats %ss cheek*" % args)
  1046.               return
  1047.             if args in botname:
  1048.               room.message("*holds out butt* >///<")
  1049.               return
  1050.             else:
  1051.               room.message("*slaps %s*" % args)
  1052.           else:
  1053.             room.message("Who do I slap? O.o")
  1054.  
  1055. #Seeded commands###################
  1056.     if message.body.lower() == "Generates":
  1057.           time.sleep(1)
  1058.           if self.getAccess(user) >= 3:
  1059.             lockdown = False
  1060.             room.message(random.choice(["Yush,<font color='#01DF01'> Master</font>?", "Yes, <font color='#01DF01'>Master</font>?", "What can i do for you, <font color='#01DF01'>Master</font>?", "<font color='#01DF01'>Master</font>?"]), True)
  1061.           else:
  1062.             room.message(random.choice(["Yush, <font color='#01DF01'>" + user.name.capitalize() + "</font>?", "What is it?", "Need something <font color='#01DF01'>" + user.name.capitalize() + "</font>?", "I could be busy, you know."]), True)
  1063.             return
  1064.      
  1065.     if message.body ==("hi") or message.body.lower() ==("hi."):
  1066.       time.sleep(1)
  1067.       if self.getAccess(user) >= 3:
  1068.         room.message("Hello " +user.name)
  1069.         return
  1070.       else:
  1071.         room.message("Hi")
  1072.         return
  1073.     if message.body ==("HI") or message.body ==("HI.") or message.body ==("HI!"):
  1074.       time.sleep(1)
  1075.       if self.getAccess(user) >= 3:
  1076.         room.message("HELLO, MASTER!")
  1077.       else:
  1078.         room.message("HI")
  1079.     if message.body =="FUCK":
  1080.       if self.getAccess(user) >= 3:
  1081.         room.message("Me~")
  1082.     if message.body.lower() =="good morning" or message.body.lower() =="good morning." or message.body.lower() =="good morning!":
  1083.       time.sleep(1)
  1084.       if self.getAccess(user) >= 3:
  1085.         room.message("Good morning, Master.")
  1086.       else:
  1087.         room.message("Good morning %s." % user.name.capitalize())
  1088.  
  1089.              
  1090. #super secret numznumz :3####################################
  1091.          
  1092. if __name__ == "__main__":
  1093.     error = 0
  1094.     try:
  1095.         LavenciBot.easy_start(rooms, "b0t", "prxxx")
  1096.     except KeyboardInterrupt:
  1097.         print("[ERROR] Keyboard-initiated kill.")
  1098.     except Exception as e:
  1099.         print("[ERROR] Fatal error.")
  1100.         error = 1
  1101.        
  1102. #Error specification#######################################
  1103.  
  1104.     if error == 1:
  1105.         print("Encountered error, bumping for 10 seconds...")
  1106.         time.sleep(10)
  1107.         print("Somethingsomething...")
  1108.         pass
Add Comment
Please, Sign In to add comment