Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # IF YOU WANNA USE A TOKEN TO LOGIN USE THIS ONE: https://pastebin.com/ivZXyxzf
- import discord,asyncio,aiohttp,websockets,logging,urllib.request,sys,getpass,ctypes,ctypes.wintypes,time,backoff,HackAPI
- # backoff - https://gist.github.com/Hornwitser/93aceb86533ed3538b6f
- # HackAPI - https://pastebin.com/cm1NiXej
- def GetIdValue(data,x,splitter=':'):
- 'Find the value corresponding by the id, used for organising the server responce which can look something like "1,value,2,value2,etc.."'
- split = data.split(splitter)
- for i in range(len(split)):
- if ((i%2==0) and (split[i]==str(x))):
- return split[i+1]
- def GetData(lvlid):
- url = 'http://www.boomlings.com/database/getGJLevels21.php'
- data = ('gameVersion=21&binaryVersion=33&gdw=0&type=0&str='+str(lvlid)+'&diff=-&len=-&page=0&total=9999&uncompleted=0&onlyCompleted=0&featured=0&original=0&twoPlayer=0&coins=0&epic=0&secret=Wmfd2893gb7').encode()
- responce = urllib.request.urlopen(url,data).read().decode().split('#')
- return GetIdValue(responce[0],2),GetIdValue(responce[1],GetIdValue(responce[0],6))
- client = discord.Client()
- async def keep_running(client, usrn,pswd): # (very slightly modified) - https://gist.github.com/Hornwitser/93aceb86533ed3538b6f
- retry = backoff.ExponentialBackoff()
- while True:
- try:
- await client.login(usrn,pswd)
- except:
- logging.exception("Discord.py pls login")
- await asyncio.sleep(retry.delay())
- else:
- break
- while client.is_logged_in:
- if client.is_closed:
- client._closed.clear()
- client.http.recreate()
- try:
- await client.connect()
- except (discord.HTTPException, aiohttp.ClientError,
- discord.GatewayNotFound, discord.ConnectionClosed,
- websockets.InvalidHandshake,
- websockets.WebSocketProtocolError) as e:
- if isinstance(e, discord.ConnectionClosed) and e.code == 4004:
- raise # Do not reconnect on authentication failure
- logging.exception("Discord.py pls keep running")
- await asyncio.sleep(retry.delay())
- @client.event # function called when logged in
- async def on_ready():
- print('Login successful!')
- print('Username: {}#{}'.format(client.user.name,client.user.discriminator))
- @client.event # function called upon message being sent
- async def on_message(message):
- pass
- async def background_task(string): # function used to scan for current level
- await client.wait_until_ready()
- print('Running, will update every 60s')
- hProc = HackAPI.Handle()
- hProc.processname = 'GeometryDash.exe'
- hProc.Open()
- base = hProc.GetModuleAddress(0,0)
- print('Base: {}'.format(hex(base)))
- attempts = HackAPI.Pointer()
- attempts.SetBase(base+0x303118)
- attempts.SetOffsets([0x164,0x228,0x114,0x21C])
- attempts.SetLevel(4)
- levelid = HackAPI.Pointer()
- levelid.SetBase(base+0x303118)
- levelid.SetOffsets([0x294])
- levelid.SetLevel(1)
- while (1):
- att_addr,id_addr = hProc.FollowPointer(attempts),hProc.FollowPointer(levelid)
- name,author = GetData(hProc.ReadInt(id_addr))
- string = string\
- .replace('[id]',str(hProc.ReadInt(id_addr)))\
- .replace('[att]',str(hProc.ReadInt(att_addr)))\
- .replace('[jmp]',str(hProc.ReadInt(att_addr+0xC)))\
- .replace('[rcd]',str(hProc.ReadInt(att_addr+0x28)))\
- .replace('[prc]',str(hProc.ReadInt(att_addr+0x2C)))\
- .replace('[name]',name)\
- .replace('[user]',author)\
- .replace('\]',']')
- await client.change_presence(game=discord.Game(name=string))
- time.sleep(60)
- print('GD-Discord loaded, please login (your password is never shared).')
- idle = 'idlelib.run' in sys.modules # check if user is running in idle
- if (idle):
- print('IDLE detected, password will not be masked.')
- username = input('\nEmail: ') # getting email
- password = input('Password: ') if idle else getpass.getpass() # getting pass, if not in idle use getpass.getpass()
- string = input('''\n[id] = LevelId, [att] = Attempts, [jmp] = jumps
- [rcd] = Current Record, [prc] = Practice Record
- [name] = Level Name, [user] = Uploader
- Enter Playing String: ''')
- print('Logging in...')
- client.loop.create_task(background_task(string)) # creating loop
- asyncio.get_event_loop().run_until_complete(keep_running(client,username,password))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement