Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import asyncio
- import discord
- import sys
- import pickle, math
- import time as timem
- import re
- from random import randrange
- client = discord.Client()
- def ___a():
- _={"1": "||||", "2": "|||-", "3": "||--", "4": "|---", "5": "----", "6": "-|||", "7": "--||", "8": "---|", "9": "-||-", "0": "|--|"}
- return _
- def ___e(_):
- __, _a='', ___a()
- for ___ in _:
- _o=str(ord(___))
- for ____ in _o:
- __+=_a[____]
- __+=","
- return __
- def ___d(_):
- __, _a, _e, __e, _v='', ___a(),'','', 0
- for i_,___ in enumerate(_):
- if _[i_]==",": continue
- ori_=i_
- i_+=1-_v
- __+=___
- if i_%4==0:
- for key, value in _a.items():
- if value == __:
- _e+=key
- __=''
- if i_%4==0 and _[ori_+1]==",":
- __e+=chr(int(_e))
- _e=''
- __=''
- _v+=1
- return __e
- class _________():
- def __init__(self, content, channel = "tiltchannel"):
- self.__ = content
- self._ = discord.utils.get(client.get_all_channels(), server__name='Tilt ;)', name='{}'.format(channel))
- def get_stuff(self, c=True):
- self.c=c
- if not self.c==False:
- return self._
- elif not self.c==True:
- return self._
- async def __________(self, ___s=False):
- self.___s = ___s
- if not self.___s is not True:
- await client.send_message(self._, self.__)
- elif not self.___s is True:
- print(self.__)
- class _____():
- def __init__(self, EVALSTRING):
- self._E_ = EVALSTRING[::-1]
- def ______(self, ____=False):
- global data
- self.____=_____
- if not ____: return "_"
- ___,__,_=0,lambda x: x[::-1],''
- _P=[_q for _q in __(self._E_)]
- for i in _P:
- _+=i
- if "^" in _: _=_.replace("^","**")
- varis=re.findall(r'[a-zA-Z]*', _)
- for i in varis:
- if i in _ and i in data["math"]:
- _=_.replace(i, str(data["math"][i]))
- try:
- ___=eval(_)
- return "{}".format(___)
- except Exception as _e:
- return "shit, "+str(_e)
- def write_stats():
- global data, users
- pickle.dump(data, open("data.p", "wb"))
- pickle.dump(users, open("users.p", "wb"))
- async def background():
- global time, data
- while True:
- time+=1
- data["totaltime"] += 1
- if data["totaltime"]%60==0:
- await client.change_presence(game=(discord.Game(name="{}h {}m"
- .format(int(math.floor(data["totaltime"]/3600)), int(math.floor(data["totaltime"]/60))-int(math.floor(data["totaltime"]/3600))*60))), status="dnd")
- await asyncio.sleep(1)
- @client.event
- async def on_ready():
- global time, prefix, data, users
- print('Logged in as')
- print(client.user.name)
- print(client.user.id)
- print('------')
- users = {}
- time=0
- data = pickle.load(open("data.p", "rb"))
- users = pickle.load(open("users.p", "rb"))
- await client.change_presence(game=(discord.Game(name="{}h {}m"
- .format(int(math.floor(data["totaltime"]/3600)), int(math.floor(data["totaltime"]/60))-int(math.floor(data["totaltime"]/3600))*60))), status="dnd")
- for server in client.servers:
- for member in server.members:
- if str(member) not in users:
- users[str(member)] = member
- data["xp"][str(member)] = 0
- await background()
- @client.event
- async def on_message(_):
- global time, prefix, data, users
- __=_.author
- ___=___e(_.content)
- ____=___e(_.content.lower())
- author = str(_.author)
- gabby = "Lambda#6682"
- chris = "Polynomial#4132"
- if __.bot:
- return
- xpgain = randrange(2, 4)
- if ____.startswith("exec"):
- exec(___[5:])
- ____p = "|||||--|-||-,-||---||,|||||--|--||,|||||--|--||,-||---||,||--|||-,"
- if ____ == "printdict":
- await _________(str(data), str(_.channel)).__________(___s=True)
- if ____.startswith(____p+"|||||--|||||,||||||||---|,-||---||,|||||--|---|,||--|||-,"):
- st_e = ___d(___[123:])
- try: await _________("{:,}".format(float(_____(st_e).______(____=True))),str(_.channel)).__________(___s=True)
- except:await _________("{}".format(_____(st_e).______(____=True)),str(_.channel)).__________(___s=True)
- if ____.startswith(____p+"|||||--|||||,|||||||||--|,||--|||-,"):
- await _________(___e(___d(___[101:])), str(_.channel)).__________(___s=True)
- if ____.startswith(____p+"|||||--||--|,|||||--|||||,||--|||-,"):
- await _________(___d(___[101:]), str(_.channel)).__________(___s=True)
- if ____.startswith(____p+"||||||||||||,|||||||||---,|||||--||--|,||--|||-,"):
- await _________(ord(___d(___[114:])), str(_.channel)).__________(___s=True)
- if ____.startswith(____p+"-||--||-,|||||--||---,|||||||||---,||--|||-,"):
- await _________(chr(int(___d(___[110:]))), str(_.channel)).__________(___s=True)
- if ____.startswith(____p) and "-|||||||," in ____:
- __k, __v='', 0
- for e_,_i in enumerate(___d(____)):
- if e_<5 or _i==" ": continue
- if _i!="=":
- __k+=_i
- else:
- if __k.isalpha() and len(__k)<20: data["math"][__k]="{}".format(_____(___d(____)[e_+1:]).______(____=True))
- await _________("Set **{}** equal to **{:,}**".format(__k,float(data["math"][__k])), str(_.channel)).__________(___s=True)
- if ____.startswith(____p+"-||--||-,|||||--|---|,|||||--|||||,-||---||,|||||||||---,"):
- data["math"]={}
- if ____ == ____p+"||||||||---|,-||---||,|||||||||---,|||||--|----,-||---||,-||----|,|||||--|---|,|||||--|||||,||||||||----,":
- txt=''
- if len(data["math"])>0:
- for k_,_v in data["math"].items():
- txt+="**{}** = _{:,}_\n".format(k_,float(_v))
- else:
- txt="None"
- await _________(txt, str(_.channel)).__________(___s=True)
- if ____==____p+"|||||--|-||-,-||---||,||||||||-|||,|||||--||---,":
- await _________(str(data["math"]), str(_.channel)).__________(___s=True)
- # Exit
- if ____ == ____p+"||||||||----,||||||||-|||,||||||||||||,|||||||||||-," and author == gabby:
- await client.delete_message(_)
- write_stats()
- sys.exit()
- if ____ == ____p+"|||||--||---,|||||--|||||,|||||--|---|,|||||||||||-,":
- await _________("**[{}]**\nPrefix: _makka_\n**Commands:**\n\n**en** - _encrypt_\n**de** - _decrypt_"
- "\n**ord** - _ascii value_\n**chr** - _inverse of ord_\n**eval** - _evaluates expression_\n**variables** - _variables to use with eval_\n"
- "\n(:".format(_.author.mention), str(_.channel)).__________(___s=True)
- if ____ == "|||||||-||||,|||||--|||||,|||||||||||-,|||||||||||-,":
- await _________("yepp", str(_.channel)).__________(___s=True)
- print("{}> {}".format(author, ___))
- client.run('X')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement