async def chaos_start(self, ctx): if ctx.author.is_mod: self.stopped = False await ctx.send('Started Chaos Mod.') print('[INFO] Started Chaos Mod') try: p = Pymem('Game.exe') except ProcessNotFound: print('[ERROR] Game is not running') return base = p.process_base.lpBaseOfDll pointer = base + 0x2F9464 while not self.stopped: if not self.queue: effect = self.random_effects(1)[0] else: effect = self.queue[0] self.queue.pop(0) effect_id = float(effect['id'] * 0.008) while not self.stopped: await asyncio.sleep(0.25) try: inGame = p.read_int(base + 0x2F94BC) if not inGame: val = p.read_int(pointer) for i in (0x54, 0x688, 0x4, 0x44): val = p.read_int(val + i) p.write_float(val + 0x674, effect_id) if self.shared: await ctx.send(f'Using effect: {effect_id}') self.blocked.append( (effect, datetime.now() + timedelta(seconds=effect['duration'] * self.duration * 15))) self.new_poll = True self.sleep_task = asyncio.create_task( self.effect_cooldown(self.cooldown)) await asyncio.wait({self.sleep_task}) break except: print( '[WARN] Couldn\'t inject. If your game crashed, use !cend, restart game, wait for "Ended Chaos" message, then !cstart' ) await ctx.send('Ended Chaos.') print('[INFO] Ended Chaos Mod')
async def event_ready(self): print(f'[INFO] Reading from channel {self.channel}') print(f'[INFO] Reacting to bot {self.bot_name}') print(f'[INFO] Toggles: {self.toggles}') print(f'[INFO] Duration: {self.duration}') print(f'[INFO] Cooldown: {self.cooldown}') print('[INFO] Started Chaos Mod') print( f'[WARN] Go to Vincenzo in the options map and set it to {self.duration}!' ) try: p = Pymem('Game.exe') except ProcessNotFound: print('[ERROR] Game is not running') return base = p.process_base.lpBaseOfDll pointer = base + 0x2F9464 while True: while not self.effect_id: await asyncio.sleep(0.25) while True: await asyncio.sleep(0.25) try: inGame = p.read_int(base + 0x2F94BC) if not inGame: val = p.read_int(pointer) for i in (0x54, 0x688, 0x4, 0x44): val = p.read_int(val + i) p.write_float(val + 0x674, self.effect_id) self.effect_id = None self.sleep_task = asyncio.create_task( self.effect_cooldown(self.cooldown)) await asyncio.wait({self.sleep_task}) break except: print( '[WARN] Couldn\'t inject. If your game crashed, use !cend, restart game, wait for "Ended Chaos" message, then !cstart' ) print('[INFO] Ended Chaos Mod')
from pymem import process, Pymem, exception dwEntityList = (0x4D04B04) dwGlowObject = (0x5245018) m_iGlowIndex = (0xA40C) pm = Pymem("csgo.exe") client = process.module_from_name(pm.process_handle, "client_panorama.dll").lpBaseOfDll while True: try: for i in range(0, 11): glow_player_glow_index = pm.read_int( pm.read_int(client + dwEntityList + i * 0x10) + m_iGlowIndex) pm.write_float((pm.read_int(client + dwGlowObject) + ((glow_player_glow_index * 0x38) + 0x8)), float(1)) pm.write_float((pm.read_int(client + dwGlowObject) + ((glow_player_glow_index * 0x38) + 0x10)), float(1)) pm.write_int((pm.read_int(client + dwGlowObject) + ((glow_player_glow_index * 0x38) + 0x24)), 1) except exception.MemoryReadError: pass