diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..074a3fe5 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,5 @@ +# Rules in this file were initially inferred by Visual Studio IntelliCode from the C:\Users\win8t\OneDrive\Desktop\projects\tlol-replay-scraper codebase based on best match to current usage at 27/10/2021 +# You can modify the rules from these initially generated values to suit your own policies +# You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference +[*.cs] + diff --git a/.gitignore b/.gitignore index e276ede5..6f45b509 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,4 @@ Release/ LView/boost/ LView/Debug/ LView/Release/ -LView/x64/ -.vs/ \ No newline at end of file +LView/x64/ \ No newline at end of file diff --git a/GameplayScripts/__pycache__/actor.cpython-39.pyc b/GameplayScripts/__pycache__/actor.cpython-39.pyc deleted file mode 100644 index 336af767..00000000 Binary files a/GameplayScripts/__pycache__/actor.cpython-39.pyc and /dev/null differ diff --git a/GameplayScripts/__pycache__/auto_smite.cpython-39.pyc b/GameplayScripts/__pycache__/auto_smite.cpython-39.pyc deleted file mode 100644 index 2f00e3ab..00000000 Binary files a/GameplayScripts/__pycache__/auto_smite.cpython-39.pyc and /dev/null differ diff --git a/GameplayScripts/__pycache__/auto_spell.cpython-39.pyc b/GameplayScripts/__pycache__/auto_spell.cpython-39.pyc deleted file mode 100644 index a57ddc6c..00000000 Binary files a/GameplayScripts/__pycache__/auto_spell.cpython-39.pyc and /dev/null differ diff --git a/GameplayScripts/__pycache__/base_script.cpython-39.pyc b/GameplayScripts/__pycache__/base_script.cpython-39.pyc deleted file mode 100644 index 7cf65fd2..00000000 Binary files a/GameplayScripts/__pycache__/base_script.cpython-39.pyc and /dev/null differ diff --git a/GameplayScripts/__pycache__/champ_tracker.cpython-39.pyc b/GameplayScripts/__pycache__/champ_tracker.cpython-39.pyc deleted file mode 100644 index 195ec228..00000000 Binary files a/GameplayScripts/__pycache__/champ_tracker.cpython-39.pyc and /dev/null differ diff --git a/GameplayScripts/__pycache__/drawings.cpython-39.pyc b/GameplayScripts/__pycache__/drawings.cpython-39.pyc deleted file mode 100644 index b120d9d1..00000000 Binary files a/GameplayScripts/__pycache__/drawings.cpython-39.pyc and /dev/null differ diff --git a/GameplayScripts/__pycache__/execution_notifier.cpython-39.pyc b/GameplayScripts/__pycache__/execution_notifier.cpython-39.pyc deleted file mode 100644 index 0dc0fcd3..00000000 Binary files a/GameplayScripts/__pycache__/execution_notifier.cpython-39.pyc and /dev/null differ diff --git a/GameplayScripts/__pycache__/extractor.cpython-39.pyc b/GameplayScripts/__pycache__/extractor.cpython-39.pyc deleted file mode 100644 index 7c907a6e..00000000 Binary files a/GameplayScripts/__pycache__/extractor.cpython-39.pyc and /dev/null differ diff --git a/GameplayScripts/__pycache__/map_awareness.cpython-39.pyc b/GameplayScripts/__pycache__/map_awareness.cpython-39.pyc deleted file mode 100644 index 22549ae4..00000000 Binary files a/GameplayScripts/__pycache__/map_awareness.cpython-39.pyc and /dev/null differ diff --git a/GameplayScripts/__pycache__/object_viewer.cpython-39.pyc b/GameplayScripts/__pycache__/object_viewer.cpython-39.pyc deleted file mode 100644 index b1634907..00000000 Binary files a/GameplayScripts/__pycache__/object_viewer.cpython-39.pyc and /dev/null differ diff --git a/GameplayScripts/__pycache__/orb_walker.cpython-39.pyc b/GameplayScripts/__pycache__/orb_walker.cpython-39.pyc deleted file mode 100644 index 680c74f0..00000000 Binary files a/GameplayScripts/__pycache__/orb_walker.cpython-39.pyc and /dev/null differ diff --git a/GameplayScripts/__pycache__/spell_tracker.cpython-39.pyc b/GameplayScripts/__pycache__/spell_tracker.cpython-39.pyc deleted file mode 100644 index 81203d29..00000000 Binary files a/GameplayScripts/__pycache__/spell_tracker.cpython-39.pyc and /dev/null differ diff --git a/GameplayScripts/__pycache__/tf_card_picker.cpython-39.pyc b/GameplayScripts/__pycache__/tf_card_picker.cpython-39.pyc deleted file mode 100644 index bcef5762..00000000 Binary files a/GameplayScripts/__pycache__/tf_card_picker.cpython-39.pyc and /dev/null differ diff --git a/GameplayScripts/__pycache__/vision_tracker.cpython-39.pyc b/GameplayScripts/__pycache__/vision_tracker.cpython-39.pyc deleted file mode 100644 index 967709bd..00000000 Binary files a/GameplayScripts/__pycache__/vision_tracker.cpython-39.pyc and /dev/null differ diff --git a/GameplayScripts/actor.py b/GameplayScripts/actor.py deleted file mode 100644 index ca2b5edb..00000000 --- a/GameplayScripts/actor.py +++ /dev/null @@ -1,113 +0,0 @@ -from lview import * - -import math -import pandas as pd -import zerorpc - -lview_script_info = { - "script": "Actor", - "author": "MiscellaneousStuff", - "description": "Executes a machine learning model which plays League of Legends." -} - -def lview_load_cfg(cfg): - pass - -def lview_save_cfg(cfg): - pass - -def lview_draw_settings(game, ui): - pass - -prev_x = 0 -prev_y = 0 -prev_z = 0 -multiplier = 3.5 # Obs/Sec -limit_rate = 1 / multiplier -counter = -1 - -def lview_update(game, ui): - global prev_x, prev_y, prev_z, counter, limit_rate - - first_minion_spawn = 60 + 5 - - min_spawn = 30 - ((game.time - first_minion_spawn) % 30) \ - if game.time >= first_minion_spawn \ - else first_minion_spawn - game.time - - cur_counter = math.floor(game.time / limit_rate) - if cur_counter > counter and game.time >= 5.0: - print(game.time, limit_rate, cur_counter) - - # Construct obs - obs = [ - game.time, - min_spawn, - game.player.health, - game.player.max_health, - game.player.team, - game.player.armour, - game.player.magic_resist, - game.player.movement_speed, - game.player.is_alive, - game.player.pos.x, - game.player.pos.y, - game.player.pos.z, - 0, # is_moving - 0, # targetable - 0, # invulnerable - 0, # recallState - game.player.Q.level, - 0, # game.player.Q.cd, - game.player.W.level, - 0, # game.player.W.cd, - game.player.E.level, - 0, # game.player.E.cd, - game.player.R.level, - 0, # game.player.R.cd, - game.player.D.level, - 0, # game.player.D.cd, - 0, # D spell type - game.player.F.level, - 0, # game.player.F.cd, - 0, # F spell type - game.player.crit, - game.player.crit_multi, - 1, # game.player.level, - 200, # game.player.mana, - 245.0, # max mana - 0, # ability haste - 0, # ap - 0, # lethality - 0, # xp - 0, # mp regen - 0.8, # game.player.hp_regen, - game.player.base_atk_range, - 0, # current gold - 0, # total gold - prev_x, - prev_y, - prev_z] - - # Infer action - c = zerorpc.Client() - c.connect("tcp://127.0.0.1:4242") - move = c.infer(obs) - - # Calculate player-relative offsets - x_off = (move % 9) - 4 - z_off = (move // 9) - 4 - print(move, x_off, z_off) - - # Move to inferred location - new_pos = game.player.pos - new_pos.x = new_pos.x + (x_off * 100) - new_pos.z = new_pos.z + (z_off * 100) - game.click_at(False, game.world_to_screen(new_pos)) - - # Set prev positions for next iteration - prev_x = game.player.pos.x - prev_y = game.player.pos.y - prev_z = game.player.pos.z - - counter = cur_counter \ No newline at end of file diff --git a/GameplayScripts/commons/__pycache__/__init__.cpython-39.pyc b/GameplayScripts/commons/__pycache__/__init__.cpython-39.pyc deleted file mode 100644 index 321f21ea..00000000 Binary files a/GameplayScripts/commons/__pycache__/__init__.cpython-39.pyc and /dev/null differ diff --git a/GameplayScripts/commons/__pycache__/damage_calculator.cpython-39.pyc b/GameplayScripts/commons/__pycache__/damage_calculator.cpython-39.pyc deleted file mode 100644 index cac2bf6f..00000000 Binary files a/GameplayScripts/commons/__pycache__/damage_calculator.cpython-39.pyc and /dev/null differ diff --git a/GameplayScripts/commons/__pycache__/items.cpython-39.pyc b/GameplayScripts/commons/__pycache__/items.cpython-39.pyc deleted file mode 100644 index df79f569..00000000 Binary files a/GameplayScripts/commons/__pycache__/items.cpython-39.pyc and /dev/null differ diff --git a/GameplayScripts/commons/__pycache__/skills.cpython-39.pyc b/GameplayScripts/commons/__pycache__/skills.cpython-39.pyc deleted file mode 100644 index 717a8576..00000000 Binary files a/GameplayScripts/commons/__pycache__/skills.cpython-39.pyc and /dev/null differ diff --git a/GameplayScripts/commons/__pycache__/targeting.cpython-39.pyc b/GameplayScripts/commons/__pycache__/targeting.cpython-39.pyc deleted file mode 100644 index 457ad482..00000000 Binary files a/GameplayScripts/commons/__pycache__/targeting.cpython-39.pyc and /dev/null differ diff --git a/GameplayScripts/commons/skills.py b/GameplayScripts/commons/skills.py index f4173701..1ee843f0 100644 --- a/GameplayScripts/commons/skills.py +++ b/GameplayScripts/commons/skills.py @@ -252,7 +252,7 @@ def __init__(self, name, missile_names, flags, delay = 0.0): ] } -def draw_prediction_info(game, ui): +def draw_prediction_info(game): global ChampionSpells, Version ui.separator() diff --git a/GameplayScripts/commons/targeting.py b/GameplayScripts/commons/targeting.py index 15382db7..a038c761 100644 --- a/GameplayScripts/commons/targeting.py +++ b/GameplayScripts/commons/targeting.py @@ -16,7 +16,7 @@ class TargetingConfig: target_minions = False target_jungle = False - def draw(self, ui): + def draw(self): ui.separator() self.selected = ui.listbox("Target", [str(target)[7:] for target in self.targets], self.selected) self.target_jungle = ui.checkbox("Allow targeting jungle monsters", self.target_jungle) diff --git a/GameplayScripts/replay_extractor.py b/GameplayScripts/replay_extractor.py new file mode 100644 index 00000000..66af4127 --- /dev/null +++ b/GameplayScripts/replay_extractor.py @@ -0,0 +1,19 @@ +from lview import * + +lview_script_info = { + "script": "TLoL - Replay Extractor", + "author": "MiscellaneousStuff", + "description": "Extracts information from replay files as they're running for deep learning" +} + +def lview_load_cfg(cfg): pass +def lview_save_cfg(cfg): pass +def lview_draw_settings(game): pass + +last_time = 0.0 + +def lview_update(game): + global last_time + + if game.time != last_time: + pass \ No newline at end of file diff --git a/GameplayScripts/spare/auto_smite.py b/GameplayScripts/spare/auto_smite.py deleted file mode 100644 index b6bd35bd..00000000 --- a/GameplayScripts/spare/auto_smite.py +++ /dev/null @@ -1,50 +0,0 @@ -from lview import * - -enable_key = 0 -show_smitable = False - -enabled_autosmite = False - -lview_script_info = { - "script": "Auto Smite", - "author": "leryss", - "description": "Auto smites the jungle mob under the cursor" -} - -def lview_load_cfg(cfg): - global enable_key, show_smitable - enable_key = cfg.get_int("enable_key", 0) - show_smitable = cfg.get_bool("show_smitable", True) - -def lview_save_cfg(cfg): - global enable_key, show_smitable - cfg.set_int("enable_key", enable_key) - cfg.set_bool("show_smitable", show_smitable) - -def lview_draw_settings(game, ui): - global enable_key, show_smitable - show_smitable = ui.checkbox("Show when to smite", show_smitable) - enable_key = ui.keyselect("Enable auto smite key", enable_key) - -def lview_update(game, ui): - global enable_key, enabled_autosmite, show_smitable - - smite = game.player.get_summoner_spell(SummonerSpellType.Smite) - if smite == None: - return - - if game.was_key_pressed(enable_key): - enabled_autosmite = ~enabled_autosmite - - hovered = game.hovered_obj - is_smitable = (hovered and (hovered.has_tags(UnitTag.Unit_Monster_Large) or hovered.has_tags(UnitTag.Unit_Monster_Epic)) and hovered.health - smite.value <= 0) - if enabled_autosmite: - p = game.world_to_screen(game.player.pos) - p.y -= 50 - game.draw_button(p, "AutoSmiteOn", Color.BLACK, Color.YELLOW, 10); - - if is_smitable: - smite.trigger() - - if show_smitable and is_smitable: - game.draw_circle_world(hovered.pos, hovered.gameplay_radius, 30, 3, Color.YELLOW) \ No newline at end of file diff --git a/GameplayScripts/spare/auto_spell.py b/GameplayScripts/spare/auto_spell.py deleted file mode 100644 index b4edcce5..00000000 --- a/GameplayScripts/spare/auto_spell.py +++ /dev/null @@ -1,63 +0,0 @@ -from lview import * -from commons.targeting import TargetingConfig -from commons.skills import * -import json, time -from pprint import pprint - -lview_script_info = { - "script": "Auto Spell", - "author": "leryss", - "description": "Automatically casts spells on targets. Skillshots are cast using movement speed prediction. Works great for MOST skills but fails miserably for a few (for example yuumis Q)", -} - -targeting = TargetingConfig() -cast_keys = { - 'Q': 0, - 'W': 0, - 'E': 0, - 'R': 0 -} - -def lview_load_cfg(cfg): - global targeting, cast_keys - targeting.load_from_cfg(cfg) - cast_keys = json.loads(cfg.get_str('cast_keys', json.dumps(cast_keys))) - -def lview_save_cfg(cfg): - global targeting, cast_keys - targeting.save_to_cfg(cfg) - cfg.set_str('cast_keys', json.dumps(cast_keys)) - -def lview_draw_settings(game, ui): - global targeting, cast_keys - targeting.draw(ui) - for slot, key in cast_keys.items(): - cast_keys[slot] = ui.keyselect(f'Key to cast {slot}', key) - draw_prediction_info(game, ui) - -def lview_update(game, ui): - global targeting, cast_keys - - for slot, key in cast_keys.items(): - if game.was_key_pressed(key): - skill = getattr(game.player, slot) - b_is_skillshot = is_skillshot(skill.name) - skill_range = get_skillshot_range(game, skill.name) if b_is_skillshot else 1500.0 - target = targeting.get_target(game, skill_range) - - if target: - if b_is_skillshot: - cast_point = castpoint_for_collision(game, skill, game.player, target) - else: - cast_point = target.pos - - if cast_point: - cast_point = game.world_to_screen(cast_point) - - old_cpos = game.get_cursor() - game.move_cursor(cast_point) - - skill.trigger() - - time.sleep(0.01) - game.move_cursor(old_cpos) \ No newline at end of file diff --git a/GameplayScripts/spare/base_script.py b/GameplayScripts/spare/base_script.py deleted file mode 100644 index 7e5392cb..00000000 --- a/GameplayScripts/spare/base_script.py +++ /dev/null @@ -1,20 +0,0 @@ -from lview import * - -lview_script_info = { - "script": "", - "author": "", - "description": "", - "target_champ": "none" -} - -def lview_load_cfg(cfg): - pass - -def lview_save_cfg(cfg): - pass - -def lview_draw_settings(game, ui): - pass - -def lview_update(game, ui): - pass \ No newline at end of file diff --git a/GameplayScripts/spare/champ_tracker.py b/GameplayScripts/spare/champ_tracker.py deleted file mode 100644 index 8256eadc..00000000 --- a/GameplayScripts/spare/champ_tracker.py +++ /dev/null @@ -1,75 +0,0 @@ -from lview import * -from time import time - -lview_script_info = { - "script": "Champion Tracker", - "author": "leryss", - "description": "Tracks a enemy throughout the map leaving a trail on the minimap. It will track the enemy jungler by default" -} - -first_iter = True - -champ_ids = [] -tracks = {} -tracked_champ_id = 0 - -seconds_to_track = 3.0 -t_last_save_tracks = 0 - -def lview_load_cfg(cfg): - global seconds_to_track - seconds_to_track = cfg.get_float("seconds_to_track", 10) - -def lview_save_cfg(cfg): - global seconds_to_track - cfg.set_float("seconds_to_track", seconds_to_track) - -def lview_draw_settings(game, ui): - global tracked_champ_id, seconds_to_track, tracks, champ_ids - - seconds_to_track = ui.dragfloat("Seconds to track", seconds_to_track, 0.1, 3, 20) - tracked_champ_id = ui.listbox("Champion to track", [game.get_obj_by_netid(net_id).name for net_id in champ_ids], tracked_champ_id) - -def lview_update(game, ui): - - global first_iter, champ_ids - global tracks, tracked_champ_id, seconds_to_track, t_last_save_tracks - - if first_iter: - first_iter = False - - # Populate tracks dict and find jungler to track - for champ in game.champs: - if champ.is_ally_to(game.player): - continue - - champ_ids.append(champ.net_id) - last_idx = len(champ_ids) - 1 - tracks[last_idx] = [] - if champ.get_summoner_spell(SummonerSpellType.Smite) != None: - tracked_champ_id = last_idx - - # If we didnt find a jungler we just track the first champ by default - if tracked_champ_id == 0: - tracked_champ_id = 0 - - if len(tracks) == 0: - return - - now = time() - if now - t_last_save_tracks > 0.4: - t_last_save_tracks = now - for idx, track in tracks.items(): - champ = game.get_obj_by_netid(champ_ids[idx]) - if champ and champ.is_alive: - tracks[idx].append((Vec3(champ.pos.x, champ.pos.y, champ.pos.z), now)) - tracks[idx] = list(filter(lambda t: now - t[1] < seconds_to_track, tracks[idx])) - - for i, (pos, t) in enumerate(tracks[tracked_champ_id]): - x = i/len(tracks[tracked_champ_id]) - green = (1-2*(x-0.5)/1.0 if x > 0.5 else 1.0); - red = (1.0 if x > 0.5 else 2*x/1.0); - - p = game.world_to_minimap(pos) - game.draw_circle_filled(p, 4, 4, Color(red, green, 0.0, 1.0)) - \ No newline at end of file diff --git a/GameplayScripts/spare/drawings.py b/GameplayScripts/spare/drawings.py deleted file mode 100644 index 7353bf37..00000000 --- a/GameplayScripts/spare/drawings.py +++ /dev/null @@ -1,170 +0,0 @@ -### Note: -### Currently the code to draw skillshots is disabled because there are way too many exceptions to make a general renderer. -### Each skill must have flags/ranges defined separately. Maybe in the future ill make a separate python package with skillshot related things if im helped. - -from lview import * -from time import time -import itertools, math -from commons.skills import * -from copy import copy - -lview_script_info = { - "script": "Drawings", - "author": "leryss", - "description": "Draws indicators for different things" -} - -turret_ranges = False -minion_last_hit = False -attack_range = False - -skillshots = False -skillshots_predict = False -skillshots_min_range = 0 -skillshots_max_speed = 0 -skillshots_show_ally = False -skillshots_show_enemy = False - -def lview_load_cfg(cfg): - global turret_ranges, minion_last_hit, attack_range - global skillshots, skillshots_predict, skillshots_min_range, skillshots_max_speed, skillshots_show_ally, skillshots_show_enemy - turret_ranges = cfg.get_bool("turret_ranges", True) - minion_last_hit = cfg.get_bool("minion_last_hit", True) - attack_range = cfg.get_bool("attack_range", True) - - skillshots = cfg.get_bool("skillshots", True) - skillshots_show_ally = cfg.get_bool("skillshots_show_ally", True) - skillshots_show_enemy = cfg.get_bool("skillshots_show_enemy", True) - #skillshots_predict = cfg.get_bool("skillshots_predict", True) - skillshots_min_range = cfg.get_float("skillshots_min_range", 500) - skillshots_max_speed = cfg.get_float("skillshots_max_speed", 2500) - -def lview_save_cfg(cfg): - global turret_ranges, minion_last_hit, attack_range - global skillshots, skillshots_predict, skillshots_min_range, skillshots_max_speed, skillshots_show_ally, skillshots_show_enemy - cfg.set_bool("turret_ranges", turret_ranges) - cfg.set_bool("minion_last_hit", minion_last_hit) - cfg.set_bool("attack_range", attack_range) - - cfg.set_bool("skillshots", skillshots) - cfg.set_bool("skillshots_show_ally", skillshots_show_ally) - cfg.set_bool("skillshots_show_enemy", skillshots_show_enemy) - #cfg.set_bool("skillshots_predict", skillshots_predict) - cfg.set_float("skillshots_min_range", skillshots_min_range) - cfg.set_float("skillshots_max_speed", skillshots_max_speed) - -def lview_draw_settings(game, ui): - global turret_ranges, minion_last_hit, attack_range - global skillshots, skillshots_predict, skillshots_min_range, skillshots_max_speed, skillshots_show_ally, skillshots_show_enemy - turret_ranges = ui.checkbox("Turret ranges", turret_ranges) - minion_last_hit = ui.checkbox("Minion last hit", minion_last_hit) - attack_range = ui.checkbox("Champion attack range", attack_range) - - ui.separator() - ui.text("Skillshots (Experimental)") - skillshots = ui.checkbox("Draw skillshots", skillshots) - skillshots_show_ally = ui.checkbox("Show for allies", skillshots_show_ally) - skillshots_show_enemy = ui.checkbox("Show for enemies", skillshots_show_enemy) - #skillshots_predict = ui.checkbox("Use skillshot prediction", skillshots_predict) - skillshots_min_range = ui.dragfloat("Minimum skillshot range", skillshots_min_range, 100, 0, 3000) - skillshots_max_speed = ui.dragfloat("Maximum skillshot speed", skillshots_max_speed, 100, 1000, 5000) - - draw_prediction_info(game, ui) - -def draw_rect(game, start_pos, end_pos, radius, color): - - dir = Vec3(end_pos.x - start_pos.x, 0, end_pos.z - start_pos.z).normalize() - - left_dir = Vec3(dir.x, dir.y, dir.z).rotate_y(90).scale(radius) - right_dir = Vec3(dir.x, dir.y, dir.z).rotate_y(-90).scale(radius) - - p1 = Vec3(start_pos.x + left_dir.x, start_pos.y + left_dir.y, start_pos.z + left_dir.z) - p2 = Vec3(end_pos.x + left_dir.x, end_pos.y + left_dir.y, end_pos.z + left_dir.z) - p3 = Vec3(end_pos.x + right_dir.x, end_pos.y + right_dir.y, end_pos.z + right_dir.z) - p4 = Vec3(start_pos.x + right_dir.x, start_pos.y + right_dir.y, start_pos.z + right_dir.z) - - game.draw_rect_world(p1, p2, p3, p4, 3, color) - -def draw_atk_range(game, player): - color = Color.GREEN - color.a = 0.5 - game.draw_circle_world(player.pos, player.base_atk_range + player.gameplay_radius, 100, 2, color) - -def draw_turret_ranges(game, player): - color = Color.RED - color.a = 0.5 - for turret in game.turrets: - if turret.is_alive and turret.is_enemy_to(player) and game.is_point_on_screen(turret.pos): - range = turret.base_atk_range + turret.gameplay_radius - game.draw_circle_world(turret.pos, range, 100, 2, color) - dist = turret.pos.distance(player.pos) - range - if dist <= player.gameplay_radius: - game.draw_circle_world(player.pos, player.gameplay_radius*2, 30, 3, Color.RED) - -def draw_minion_last_hit(game, player): - color = Color.CYAN - for minion in game.minions: - if minion.is_visible and minion.is_alive and minion.is_enemy_to(player) and game.is_point_on_screen(minion.pos): - if is_last_hitable(game, player, minion): - p = game.hp_bar_pos(minion) - game.draw_rect(Vec4(p.x - 34, p.y - 9, p.x + 32, p.y + 1), Color.CYAN, 0, 2) - -def draw_skillshots(game, player): - global skillshots, skillshots_predict, skillshots_min_range, skillshots_max_speed, skillshots_show_ally, skillshots_show_enemy - - color = Color.WHITE - for missile in game.missiles: - if not skillshots_show_ally and missile.is_ally_to(game.player): - continue - if not skillshots_show_enemy and missile.is_enemy_to(game.player): - continue - - if not is_skillshot(missile.name) or missile.speed > skillshots_max_speed or missile.start_pos.distance(missile.end_pos) < skillshots_min_range: - continue - - spell = get_missile_parent_spell(missile.name) - if not spell: - continue - - end_pos = missile.end_pos.clone() - start_pos = missile.start_pos.clone() - curr_pos = missile.pos.clone() - impact_pos = None - - start_pos.y = game.map.height_at(start_pos.x, start_pos.z) + missile.height - end_pos.y = start_pos.y - curr_pos.y = start_pos.y - - - if spell.flags & SFlag.Line: - draw_rect(game, curr_pos, end_pos, missile.width, color) - game.draw_circle_world_filled(curr_pos, missile.width, 20, Color.RED) - - elif spell.flags & SFlag.Area: - r = game.get_spell_info(spell.name).cast_radius - end_pos.y = game.map.height_at(end_pos.x, end_pos.z) - percent_done = missile.start_pos.distance(curr_pos)/missile.start_pos.distance(end_pos) - color = Color(1, 1.0 - percent_done, 0, 0.5) - - game.draw_circle_world(end_pos, r, 40, 3, color) - game.draw_circle_world_filled(end_pos, r*percent_done, 40, color) - - -def lview_update(game, ui): - global turret_ranges, minion_last_hit, attack_range, skillshots - - player = game.player - - if attack_range and game.is_point_on_screen(player.pos): - draw_atk_range(game, player) - - if turret_ranges: - draw_turret_ranges(game, player) - - if minion_last_hit: - draw_minion_last_hit(game, player) - - if skillshots: - draw_skillshots(game, player) - - \ No newline at end of file diff --git a/GameplayScripts/spare/execution_notifier.py b/GameplayScripts/spare/execution_notifier.py deleted file mode 100644 index 09e2b249..00000000 --- a/GameplayScripts/spare/execution_notifier.py +++ /dev/null @@ -1,31 +0,0 @@ -from lview import * -import commons.damage_calculator as damage_calculator - -lview_script_info = { - "script": "Execution notifier", - "author": "orkido", - "description": "Shows message if a enemy champion can be executed with an ability" -} - - -def lview_load_cfg(cfg): - pass - -def lview_save_cfg(cfg): - pass - -def lview_draw_settings(game, ui): - pass - -def lview_update(game, ui): - damage_spec = damage_calculator.get_damage_specification(game.player) - if damage_spec is None: - # Current champion is not supported - return - - for champ in game.champs: - if champ.is_enemy_to(game.player): - dmg = damage_spec.calculate_damage(game.player, champ) - - if champ.health <= dmg: - game.draw_circle_filled(game.world_to_screen(champ.pos), 100.0, 100, Color.RED) diff --git a/GameplayScripts/spare/extractor.py b/GameplayScripts/spare/extractor.py deleted file mode 100644 index 18d8ebc3..00000000 --- a/GameplayScripts/spare/extractor.py +++ /dev/null @@ -1,46 +0,0 @@ -from lview import * - -import requests -import sys -import json - -from urllib3.exceptions import InsecureRequestWarning - -requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning) - -set_replay = False - -lview_script_info = { - "script": "Extractor", - "author": "MiscellaneousStuff", - "description": "Extracts observations for machine learning." -} - -replay_speed = 16 - -def lview_load_cfg(cfg): - pass - -def lview_save_cfg(cfg): - pass - -def lview_draw_settings(game, ui): - pass - -def lview_update(game, ui): - global set_replay - if game.time > 2.0: - if not set_replay: - requests.post( - 'https://127.0.0.1:2999/replay/playback', - headers={ - 'Accept': 'application/json', - 'Content-Type': 'application/json' - }, - data = json.dumps({ - "time": 2, - "speed": replay_speed - }), - verify=False - ) - set_replay = True \ No newline at end of file diff --git a/GameplayScripts/spare/map_awareness.py b/GameplayScripts/spare/map_awareness.py deleted file mode 100644 index c937786f..00000000 --- a/GameplayScripts/spare/map_awareness.py +++ /dev/null @@ -1,103 +0,0 @@ -from lview import * - -lview_script_info = { - "script": "Map Awareness", - "author": "leryss", - "description": "Cheat that improves your map awareness." -} - -bound_max = 0 -show_alert_enemy_close = False -show_last_enemy_pos = False -show_last_enemy_pos_minimap = False - -def lview_load_cfg(cfg): - global bound_max, show_alert_enemy_close, show_last_enemy_pos, show_last_enemy_pos_minimap - show_alert_enemy_close = cfg.get_bool("show_alert_enemy_close", True) - show_last_enemy_pos = cfg.get_bool("show_last_enemy_pos", True) - show_last_enemy_pos_minimap = cfg.get_bool("show_last_enemy_pos_minimap", True) - bound_max = cfg.get_float("bound_max", 4000) - -def lview_save_cfg(cfg): - global bound_max, show_alert_enemy_close, show_last_enemy_pos, show_last_enemy_pos_minimap - cfg.set_float("bound_max", bound_max) - cfg.set_bool("show_alert_enemy_close", show_alert_enemy_close) - cfg.set_bool("show_last_enemy_pos", show_last_enemy_pos) - cfg.set_bool("show_last_enemy_pos_minimap", show_last_enemy_pos_minimap) - -def lview_draw_settings(game, ui): - global bound_max, show_alert_enemy_close, show_last_enemy_pos, show_last_enemy_pos_minimap - - show_last_enemy_pos = ui.checkbox("Show last position of champions", show_last_enemy_pos) - show_last_enemy_pos_minimap = ui.checkbox("Show last position of champions on minimap", show_last_enemy_pos_minimap) - - ui.separator() - show_alert_enemy_close = ui.checkbox("Show champions that are getting close", show_alert_enemy_close) - bound_max = ui.dragfloat("Alert when distance less than", bound_max, 100.0, 500.0, 10000.0) - -def draw_champ_world_icon(game, champ, pos, size, draw_distance = False, draw_hp_bar = False, draw_invisible_duration = False): - - size_hp_bar = size/10.0 - percent_hp = champ.health/champ.max_health - - # Draw champ icon - pos.x -= size/2.0 - pos.y -= size/2.0 - game.draw_image(champ.name.lower() + "_square", pos, pos.add(Vec2(size, size)), Color.WHITE if champ.is_visible else Color.GRAY, 100.0) - - # Draw hp bar - if draw_hp_bar: - pos.y += size - game.draw_rect_filled(Vec4(pos.x, pos.y, pos.x + size, pos.y + size_hp_bar), Color.BLACK) - game.draw_rect_filled(Vec4(pos.x + 1, pos.y + 1, pos.x + 1 + (size - 1)*percent_hp, pos.y + size_hp_bar - 1), Color.GREEN) - - # Draw distance - if draw_distance: - pos.x += size_hp_bar - pos.y += size_hp_bar - game.draw_text(pos, '{:.0f}m'.format(game.distance(champ, game.player)), Color.WHITE) - - if not champ.is_visible and draw_invisible_duration: - pos.x += 2*size_hp_bar - pos.y += size_hp_bar - game.draw_text(pos, '{:.0f}'.format(game.time - champ.last_visible_at), Color.WHITE) - -def show_alert(game, champ): - if game.is_point_on_screen(champ.pos) or not champ.is_alive or not champ.is_visible or champ.is_ally_to(game.player): - return - - dist = champ.pos.distance(game.player.pos) - if dist > bound_max: - return - - pos = game.world_to_screen(champ.pos.sub(game.player.pos).normalize().scale(500).add(game.player.pos)) - draw_champ_world_icon(game, champ, pos, 48.0, True, True, False) - -def show_last_pos_world(game, champ): - if champ.is_visible or not champ.is_alive or not game.is_point_on_screen(champ.pos): - return - - draw_champ_world_icon(game, champ, game.world_to_screen(champ.pos), 48.0, False, True, True) - -def show_last_pos_minimap(game, champ): - if champ.is_visible or not champ.is_alive: - return - - draw_champ_world_icon(game, champ, game.world_to_minimap(champ.pos), 24.0, False, False, False) - -def lview_update(game, ui): - global bound_max, show_alert_enemy_close, show_last_enemy_pos, show_last_enemy_pos_minimap - for champ in game.champs: - if show_alert_enemy_close: - show_alert(game, champ) - - if show_last_enemy_pos: - show_last_pos_world(game, champ) - - if show_last_enemy_pos_minimap: - show_last_pos_minimap(game, champ) - - - - - \ No newline at end of file diff --git a/GameplayScripts/spare/object_viewer.py b/GameplayScripts/spare/object_viewer.py deleted file mode 100644 index 202b3e18..00000000 --- a/GameplayScripts/spare/object_viewer.py +++ /dev/null @@ -1,178 +0,0 @@ -from lview import * -from pprint import pprint - -lview_script_info = { - "script": "Object Explorer", - "author": "leryss", - "description": "This is not a cheat. This just provides a way to explore ingame objects" -} - -def draw_spell(spell, ui): - - if ui.treenode(str(spell.slot)): - ui.labeltext("name", spell.name) - ui.labeltext("summmoner_spell_type", str(spell.summoner_spell_type)) - ui.dragint("level", spell.level) - ui.dragfloat("ready_at", spell.ready_at) - ui.dragfloat("value", spell.value) - - ui.separator() - ui.dragfloat("speed", spell.speed) - ui.dragfloat("cast_range", spell.cast_range) - ui.dragfloat("width", spell.width) - ui.dragfloat("cast_radius", spell.cast_radius) - ui.dragfloat("height", spell.height) - ui.dragfloat("delay", spell.delay) - - ui.treepop() - -def draw_items(items, ui): - for item in items: - if ui.treenode(str(item.id)): - - ui.dragint("slot", item.slot) - if item.movement_speed > 0: ui.dragfloat("movement_speed", item.movement_speed) - if item.health > 0: ui.dragfloat("health", item.health) - if item.crit > 0: ui.dragfloat("crit", item.crit) - if item.ability_power > 0: ui.dragfloat("ability_power", item.ability_power) - if item.mana > 0: ui.dragfloat("mana", item.mana) - if item.armour > 0: ui.dragfloat("armour", item.armour) - if item.magic_resist > 0: ui.dragfloat("magic_resist", item.magic_resist) - if item.physical_damage > 0: ui.dragfloat("physical_damage", item.physical_damage) - if item.attack_speed > 0: ui.dragfloat("attack_speed", item.attack_speed) - if item.life_steal > 0: ui.dragfloat("life_steal", item.life_steal) - if item.hp_regen > 0: ui.dragfloat("hp_regen", item.hp_regen) - if item.movement_speed_percent > 0: ui.dragfloat("movement_speed_percent", item.movement_speed_percent) - - ui.treepop() - -def draw_missile(obj, ui): - if ui.treenode("{}_({}->{}) ({})".format(obj.name, obj.src_id, obj.dest_id, hex(obj.address))): - ui.dragint("id", obj.id) - ui.labeltext("net_id", hex(obj.net_id)) - ui.dragint("team", obj.team) - - ui.labeltext("start_pos", f"x={obj.start_pos.x:.2f}, y={obj.start_pos.y:.2f}, z={obj.start_pos.z:.2f}") - ui.labeltext("end_pos", f"x={obj.end_pos.x:.2f}, y={obj.end_pos.y:.2f}, z={obj.end_pos.z:.2f}") - ui.labeltext("pos", f"x={obj.pos.x:.2f}, y={obj.pos.y:.2f}, z={obj.pos.z:.2f}") - ui.dragint("src_id", obj.src_id) - ui.dragint("dest_id", obj.dest_id) - - ui.separator() - ui.dragfloat("speed", obj.speed) - ui.dragfloat("cast_range", obj.cast_range) - ui.dragfloat("width", obj.width) - ui.dragfloat("cast_radius", obj.cast_radius) - ui.dragfloat("height", obj.height) - ui.dragfloat("delay", obj.delay) - ui.treepop() - -def draw_game_object(obj, ui, additional_draw = None, set_open=False): - - if(obj == None): - ui.text("null", Color.RED) - return - if(set_open): - ui.opennext() - if ui.treenode("{}_{} ({})".format(obj.name, obj.id, hex(obj.address))): - ui.labeltext("address", hex(obj.address)) - ui.labeltext("net_id", hex(obj.net_id)) - ui.labeltext("name", obj.name, Color.ORANGE) - ui.labeltext("pos", f"x={obj.pos.x:.2f}, y={obj.pos.y:.2f}, z={obj.pos.z:.2f}") - ui.dragint("id", obj.id) - - ui.separator() - ui.dragfloat("health", obj.health) - ui.checkbox("is_alive", obj.is_alive) - - ui.separator() - ui.dragfloat("base_atk", obj.base_atk) - ui.dragfloat("bonus_atk", obj.bonus_atk) - ui.dragfloat("armour", obj.armour) - ui.dragfloat("magic_resist", obj.magic_resist) - ui.dragfloat("ap", obj.ap) - ui.dragfloat("crit", obj.crit) - ui.dragfloat("crit_multi", obj.crit_multi) - - ui.separator() - ui.dragfloat("atk_range", obj.atk_range) - ui.dragfloat("base_atk_range", obj.base_atk_range) - ui.dragfloat("base_atk_speed", obj.base_atk_speed) - ui.dragfloat("atk_speed_multi", obj.atk_speed_multi) - ui.dragfloat("atk_speed_ratio", obj.atk_speed_ratio) - ui.dragfloat("basic_missile_speed", obj.basic_missile_speed) - ui.dragfloat("base_ms", obj.base_ms) - ui.dragfloat("movement_speed", obj.movement_speed) - - ui.separator() - ui.dragfloat("selection_radius", obj.selection_radius) - ui.dragfloat("gameplay_radius", obj.gameplay_radius) - ui.dragfloat("pathing_radius", obj.pathing_radius) - ui.dragfloat("acquisition_radius", obj.acquisition_radius) - - ui.separator() - ui.dragfloat("duration", obj.duration) - ui.dragfloat("last_visible_at", obj.last_visible_at) - ui.checkbox("is_visible", obj.is_visible) - - if additional_draw != None: - additional_draw() - - ui.treepop() - -def draw_champion(obj, ui): - def draw_spells(): - ui.dragint("Level", obj.lvl) - - ui.text("Items") - draw_items(obj.items, ui) - - ui.text("Skills") - draw_spell(obj.Q, ui) - draw_spell(obj.W, ui) - draw_spell(obj.E, ui) - draw_spell(obj.R, ui) - draw_spell(obj.D, ui) - draw_spell(obj.F, ui) - - draw_game_object(obj, ui, additional_draw = draw_spells) - -def draw_list(label, objs, ui, draw_func): - if ui.treenode(label): - for obj in objs: - draw_func(obj, ui) - ui.treepop() - -def lview_load_cfg(cfg): - pass - -def lview_save_cfg(cfg): - pass - -def lview_draw_settings(objs, ui): - pass - -def lview_update(game, ui): - - ui.begin("Object Viewer") - - ui.dragfloat("time", game.time) - if game.hovered_obj: - ui.labeltext("hovered_obj", f"{game.hovered_obj.name} ({hex(game.hovered_obj.address)})") - else: - ui.labeltext("hovered_obj", "none") - - ui.text("Local Champion") - draw_champion(game.player, ui) - - ui.text("Lists") - draw_list("Champions", game.champs, ui, draw_champion) - draw_list("Minions", game.minions, ui, draw_game_object) - draw_list("Jungle", game.jungle, ui, draw_game_object) - draw_list("Turrets", game.turrets, ui, draw_game_object) - draw_list("Missiles", game.missiles, ui, draw_missile) - draw_list("Others", game.others, ui, draw_game_object) - - - ui.end() - \ No newline at end of file diff --git a/GameplayScripts/spare/orb_walker.py b/GameplayScripts/spare/orb_walker.py deleted file mode 100644 index bda2c6f7..00000000 --- a/GameplayScripts/spare/orb_walker.py +++ /dev/null @@ -1,118 +0,0 @@ -from lview import * -from commons import skills -from commons.targeting import TargetingConfig -import time, json - -lview_script_info = { - "script": "Orbwalker", - "author": "leryss", - "description": "Automatically kites enemies. Also has last hit built in" -} - -last_attacked = 0 -last_moved = 0 - -key_attack_move = 0 -key_orbwalk = 0 -auto_last_hit = False -max_atk_speed = 0 - -toggle_mode = False -toggled = False - -targeting = TargetingConfig() - -def lview_load_cfg(cfg): - global key_attack_move, key_orbwalk, max_atk_speed, auto_last_hit, toggle_mode - global targeting - - key_attack_move = cfg.get_int("key_attack_move", 0) - key_orbwalk = cfg.get_int("key_orbwalk", 0) - max_atk_speed = cfg.get_float("max_atk_speed", 2.0) - auto_last_hit = cfg.get_bool("auto_last_hit", True) - toggle_mode = cfg.get_bool("toggle_mode", False) - targeting.load_from_cfg(cfg) - -def lview_save_cfg(cfg): - global key_attack_move, key_orbwalk, max_atk_speed, auto_last_hit, toggle_mode - global targeting - - cfg.set_int("key_attack_move", key_attack_move) - cfg.set_int("key_orbwalk", key_orbwalk) - cfg.set_float("max_atk_speed", max_atk_speed) - cfg.set_bool("auto_last_hit", auto_last_hit) - cfg.set_bool("toggle_mode", toggle_mode) - targeting.save_to_cfg(cfg) - -def lview_draw_settings(game, ui): - global key_attack_move, key_orbwalk, max_atk_speed, auto_last_hit, toggle_mode - global targeting - - champ_name = game.player.name - max_atk_speed = ui.sliderfloat("Max attack speed", max_atk_speed, 1.5, 3.0) - key_attack_move = ui.keyselect("Attack move key", key_attack_move) - key_orbwalk = ui.keyselect("Orbwalk activate key", key_orbwalk) - auto_last_hit = ui.checkbox("Last hit minions when no targets", auto_last_hit) - toggle_mode = ui.checkbox("Toggle mode", toggle_mode) - targeting.draw(ui) - -def find_minion_target(game): - atk_range = game.player.base_atk_range + game.player.gameplay_radius - min_health = 9999999999 - target = None - for minion in game.minions: - if minion.is_enemy_to(game.player) and minion.is_alive and minion.health < min_health and game.distance(game.player, minion) < atk_range and skills.is_last_hitable(game, game.player, minion): - target = minion - min_health = minion.health - - return target - -def get_target(game): - global auto_last_hit - - target = targeting.get_target(game, game.player.base_atk_range + game.player.gameplay_radius) - if not target and auto_last_hit: - return find_minion_target(game) - - return target - -def lview_update(game, ui): - global last_attacked, alternate, last_moved - global key_attack_move, key_orbwalk, max_atk_speed - global toggle_mode, toggled - - if toggle_mode: - if game.was_key_pressed(key_orbwalk): - toggled = not toggled - if not toggled: - return - - elif not game.is_key_down(key_orbwalk): - return - - game.draw_button(game.world_to_screen(game.player.pos), "OrbWalking", Color.BLACK, Color.WHITE) - - # Handle basic attacks - self = game.player - - atk_speed = self.base_atk_speed * self.atk_speed_multi - b_windup_time = (1.0/self.base_atk_speed)*game.player.basic_atk_windup - c_atk_time = 1.0/atk_speed - max_atk_time = 1.0/max_atk_speed - - target = get_target(game) - t = time.time() - if t - last_attacked > max(c_atk_time, max_atk_time) and target: - last_attacked = t - - game.press_key(key_attack_move) - game.click_at(True, game.world_to_screen(target.pos)) - else: - dt = t - last_attacked - if dt > b_windup_time and t - last_moved > 0.15: - last_moved = t - game.press_right_click() - - - - \ No newline at end of file diff --git a/GameplayScripts/spare/spell_tracker.py b/GameplayScripts/spare/spell_tracker.py deleted file mode 100644 index e352ad37..00000000 --- a/GameplayScripts/spare/spell_tracker.py +++ /dev/null @@ -1,90 +0,0 @@ -from lview import * - -show_local_champ = False -show_allies = False -show_enemies = False - -lview_script_info = { - "script": "Spell Tracker", - "author": "leryss", - "description": "Tracks spell cooldowns and levels" -} - -def get_color_for_cooldown(cooldown): - if cooldown > 0.0: - return Color.DARK_RED - else: - return Color(1, 1, 1, 1) - - -def draw_spell(game, spell, pos, size, show_lvl = True, show_cd = True): - - cooldown = spell.get_current_cooldown(game.time) - color = get_color_for_cooldown(cooldown) if spell.level > 0 else Color.GRAY - - game.draw_image(spell.icon, pos, pos.add(Vec2(size, size)), color, 10.0) - if show_cd and cooldown > 0.0: - game.draw_text(pos.add(Vec2(4, 5)), str(int(cooldown)), Color.WHITE) - if show_lvl: - for i in range(spell.level): - offset = i*4 - game.draw_rect_filled(Vec4(pos.x + offset, pos.y + 24, pos.x + offset + 3, pos.y + 26), Color.YELLOW) - -def draw_overlay_on_champ(game, champ): - - p = game.hp_bar_pos(champ) - p.x -= 70 - if not game.is_point_on_screen(p): - return - - p.x += 25 - draw_spell(game, champ.Q, p, 24) - p.x += 25 - draw_spell(game, champ.W, p, 24) - p.x += 25 - draw_spell(game, champ.E, p, 24) - p.x += 25 - draw_spell(game, champ.R, p, 24) - - p.x += 37 - p.y -= 32 - draw_spell(game, champ.D, p, 15, False, False) - p.y += 16 - draw_spell(game, champ.F, p, 15, False, False) - - -def lview_update(game, ui): - global show_allies, show_enemies, show_local_champ - - for champ in game.champs: - if not champ.is_visible or not champ.is_alive: - continue - if champ == game.player and show_local_champ: - draw_overlay_on_champ(game, champ) - elif champ != game.player: - if champ.is_ally_to(game.player) and show_allies: - draw_overlay_on_champ(game, champ) - elif champ.is_enemy_to(game.player) and show_enemies: - draw_overlay_on_champ(game, champ) - -def lview_load_cfg(cfg): - global show_allies, show_enemies, show_local_champ - - show_allies = cfg.get_bool("show_allies", False) - show_enemies = cfg.get_bool("show_enemies", True) - show_local_champ = cfg.get_bool("show_local_champ", False) - -def lview_save_cfg(cfg): - global show_allies, show_enemies, show_local_champ - - cfg.set_bool("show_allies", show_allies) - cfg.set_bool("show_enemies", show_enemies) - cfg.set_bool("show_local_champ", show_local_champ) - -def lview_draw_settings(game, ui): - global show_allies, show_enemies, show_local_champ - - show_allies = ui.checkbox("Show overlay on allies", show_allies) - show_enemies = ui.checkbox("Show overlay on enemies", show_enemies) - show_local_champ = ui.checkbox("Show overlay on self", show_local_champ) - diff --git a/GameplayScripts/spare/tf_card_picker.py b/GameplayScripts/spare/tf_card_picker.py deleted file mode 100644 index 70e7d558..00000000 --- a/GameplayScripts/spare/tf_card_picker.py +++ /dev/null @@ -1,52 +0,0 @@ -from lview import * - -lview_script_info = { - "script": "Twisted Fate Card Picker", - "author": "leryss", - "description": "Picks specific cards for twisted fate", - "target_champ": "twistedfate" -} - -key_blue, key_red, key_yellow = 0, 0, 0 -card_to_lock = None -key_w = 17 - -def lview_load_cfg(cfg): - global key_blue, key_red, key_yellow - key_blue = cfg.get_int("key_blue", 0) - key_red = cfg.get_int("key_red", 0) - key_yellow = cfg.get_int("key_yellow", 0) - -def lview_save_cfg(cfg): - global key_blue, key_red, key_yellow - cfg.set_int("key_blue", key_blue) - cfg.set_int("key_red", key_red) - cfg.set_int("key_yellow", key_yellow) - -def lview_draw_settings(game, ui): - global key_blue, key_red, key_yellow - key_blue = ui.keyselect("Key blue card", key_blue) - key_red = ui.keyselect("Key red card", key_red) - key_yellow = ui.keyselect("Key yellow card", key_yellow) - -def lview_update(game, ui): - global key_blue, key_red, key_yellow, key_w - global card_to_lock - - if card_to_lock is not None: - if card_to_lock == game.player.W.name: - game.press_key(key_w) - card_to_lock = None - elif game.player.W.name == 'pickacard' and game.player.W.get_current_cooldown(game.time) == 0.0: - key_to_press = None - if game.was_key_pressed(key_blue): - card_to_lock = "bluecardlock" - key_to_press = key_blue - elif game.was_key_pressed(key_red): - card_to_lock = "redcardlock" - key_to_press = key_red - elif game.was_key_pressed(key_yellow): - card_to_lock = "goldcardlock" - key_to_press = key_yellow - if key_to_press: - game.press_key(key_w) \ No newline at end of file diff --git a/GameplayScripts/spare/vision_tracker.py b/GameplayScripts/spare/vision_tracker.py deleted file mode 100644 index 406f93b5..00000000 --- a/GameplayScripts/spare/vision_tracker.py +++ /dev/null @@ -1,124 +0,0 @@ -from lview import * -import json - -lview_script_info = { - "script": "Vision Tracker", - "author": "leryss", - "description": "Tracks enemy invisible objects and clones" -} - -show_clones, show_wards, show_traps = None, None, None - -traps = { - #Name -> (radius, show_radius_circle, show_radius_circle_minimap, icon) - 'caitlyntrap' : [50, True, False, "caitlyn_yordlesnaptrap"], - 'jhintrap' : [140, True, False, "jhin_e"], - 'jinxmine' : [50, True, False, "jinx_e"], - 'maokaisproutling' : [50, False, False, "maokai_e"], - 'nidaleespear' : [50, True, False, "nidalee_w1"], - 'shacobox' : [300, True, False, "jester_deathward"], - 'teemomushroom' : [75, True, True, "teemo_r"] -} - -wards = { - 'bluetrinket' : [900, True, True, "bluetrinket"], - 'jammerdevice' : [900, True, True, "pinkward"], - 'perkszombieward' : [900, True, True, "bluetrinket"], - 'sightward' : [900, True, True, "sightward"], - 'visionward' : [900, True, True, "sightward"], - 'yellowtrinket' : [900, True, True, "yellowtrinket"], - 'yellowtrinketupgrade' : [900, True, True, "yellowtrinket"], - 'ward' : [900, True, True, "sightward"], -} - -clones = { - 'shaco' : [0, False, False, "shaco_square"], - 'leblanc' : [0, False, False, "leblanc_square"], - 'monkeyking' : [0, False, False, "monkeyking_square"], - 'neeko' : [0, False, False, "neeko_square"], - 'fiddlesticks' : [0, False, False, "fiddlesticks_square"], -} - - -def lview_load_cfg(cfg): - global show_clones, show_wards, show_traps, traps, wards - - show_clones = cfg.get_bool("show_clones", True) - show_wards = cfg.get_bool("show_wards", True) - show_traps = cfg.get_bool("show_traps", True) - - traps = json.loads(cfg.get_str("traps", json.dumps(traps))) - wards = json.loads(cfg.get_str("wards", json.dumps(wards))) - -def lview_save_cfg(cfg): - global show_clones, show_wards, show_traps, traps, wards - - cfg.set_bool("show_clones", show_clones) - cfg.set_bool("show_wards", show_wards) - cfg.set_bool("show_traps", show_traps) - - cfg.set_str("traps", json.dumps(traps)) - cfg.set_str("wards", json.dumps(wards)) - -def lview_draw_settings(game, ui): - global traps, wards - global show_clones, show_wards, show_traps - - show_clones = ui.checkbox("Show clones", show_clones) - show_wards = ui.checkbox("Show wards", show_wards) - show_traps = ui.checkbox("Show clones", show_traps) - - ui.text("Traps") - for x in traps.keys(): - if ui.treenode(x): - traps[x][1] = ui.checkbox("Show range circles", traps[x][1]) - traps[x][2] = ui.checkbox("Show on minimap", traps[x][2]) - - ui.treepop() - - ui.text("Wards") - for x in wards.keys(): - if ui.treenode(x): - wards[x][1] = ui.checkbox("Show range circles", wards[x][1]) - wards[x][2] = ui.checkbox("Show on minimap", wards[x][2]) - - ui.treepop() - -def draw(game, obj, radius, show_circle_world, show_circle_map, icon): - - sp = game.world_to_screen(obj.pos) - - if game.is_point_on_screen(sp): - duration = obj.duration + obj.last_visible_at - game.time - if duration > 0: - game.draw_text(sp.add(Vec2(5, 30)), f'{duration:.0f}', Color.WHITE) - game.draw_image(icon, sp, sp.add(Vec2(30, 30)), Color.WHITE, 10) - - if show_circle_world: - game.draw_circle_world(obj.pos, radius, 30, 3, Color.RED) - - if show_circle_map: - p = game.world_to_minimap(obj.pos) - game.draw_circle(game.world_to_minimap(obj.pos), game.distance_to_minimap(radius), 15, 2, Color.RED) - -def lview_update(game, ui): - - global show_clones, show_wards, show_traps - global traps, wards, clones - - for obj in game.others: - if obj.is_ally_to(game.player) or not obj.is_alive: - continue - - if show_wards and obj.has_tags(UnitTag.Unit_Ward) and obj.name in wards: - draw(game, obj, *(wards[obj.name])) - elif show_traps and obj.has_tags(UnitTag.Unit_Special_Trap) and obj.name in traps: - draw(game, obj, *(traps[obj.name])) - - if show_clones: - for champ in game.champs: - if champ.is_ally_to(game.player) or not champ.is_alive: - continue - if champ.name in clones and champ.R.name == champ.D.name: - draw(game, champ, *(clones[champ.name])) - \ No newline at end of file diff --git a/GameplayScripts/spare/util_make_heightmap.py____ b/GameplayScripts/util_make_heightmap.py____ similarity index 100% rename from GameplayScripts/spare/util_make_heightmap.py____ rename to GameplayScripts/util_make_heightmap.py____ diff --git a/LView.sln b/LView.sln index 984a52c0..18afd51a 100644 --- a/LView.sln +++ b/LView.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28307.1000 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31727.386 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LView", "LView\LView.vcxproj", "{B1847FC4-24EC-448C-8478-1AF955EF2C28}" EndProject diff --git a/LView/ConsoleApplication.exe b/LView/ConsoleApplication.exe index 69d3e05d..1e45efa1 100644 Binary files a/LView/ConsoleApplication.exe and b/LView/ConsoleApplication.exe differ diff --git a/LView/ConsoleApplication.exp b/LView/ConsoleApplication.exp index f678e421..a4d7f35c 100644 Binary files a/LView/ConsoleApplication.exp and b/LView/ConsoleApplication.exp differ diff --git a/LView/ConsoleApplication.pdb b/LView/ConsoleApplication.pdb index a15f4dfe..1b6e5f96 100644 Binary files a/LView/ConsoleApplication.pdb and b/LView/ConsoleApplication.pdb differ diff --git a/LView/GameData.cpp b/LView/GameData.cpp index de38bab7..d4ef2ba7 100644 --- a/LView/GameData.cpp +++ b/LView/GameData.cpp @@ -3,7 +3,7 @@ #include #include #include "Utils.h" -#include "Overlay.h" +//#include "Overlay.h" using namespace std; @@ -168,7 +168,8 @@ void GameData::LoadIcons(std::string& path) printf("\r Loading %d/%d ", nrFile, nrFiles); std::string filePath = folder + "/" + findData.cFileName; - Texture2D* image = Texture2D::LoadFromFile(Overlay::GetDxDevice(), filePath); + //Texture2D* image = Texture2D::LoadFromFile(Overlay::GetDxDevice(), filePath); + /* if (image == nullptr) printf("Failed to load: %s\n", filePath.c_str()); else { @@ -176,6 +177,7 @@ void GameData::LoadIcons(std::string& path) fileName.erase(fileName.find(".png"), 4); Images[Character::ToLower(fileName)] = image; } + */ } nrFile++; } while (FindNextFileA(hFind, &findData)); diff --git a/LView/GameObject.cpp b/LView/GameObject.cpp index 4983a108..83c3dc60 100644 --- a/LView/GameObject.cpp +++ b/LView/GameObject.cpp @@ -98,41 +98,41 @@ void GameObject::LoadFromMem(DWORD base, HANDLE hProcess, bool deepLoad) { timeSinceLastPreviousPosition = high_resolution_clock::now(); } - memcpy(&team, &buff[Offsets::ObjTeam], sizeof(short)); - memcpy(&position, &buff[Offsets::ObjPos], sizeof(Vector3)); - memcpy(&health, &buff[Offsets::ObjHealth], sizeof(float)); - memcpy(&maxHealth, &buff[Offsets::ObjMaxHealth], sizeof(float)); - memcpy(&baseAttack, &buff[Offsets::ObjBaseAtk], sizeof(float)); - memcpy(&bonusAttack, &buff[Offsets::ObjBonusAtk], sizeof(float)); - memcpy(&armour, &buff[Offsets::ObjArmor], sizeof(float)); - memcpy(&magicResist, &buff[Offsets::ObjMagicRes], sizeof(float)); - memcpy(&duration, &buff[Offsets::ObjExpiry], sizeof(float)); - memcpy(&isVisible, &buff[Offsets::ObjVisibility], sizeof(bool)); - memcpy(&objectIndex, &buff[Offsets::ObjIndex], sizeof(short)); - memcpy(&crit, &buff[Offsets::ObjCrit], sizeof(float)); - memcpy(&critMulti, &buff[Offsets::ObjCritMulti], sizeof(float)); - memcpy(&abilityPower, &buff[Offsets::ObjAbilityPower], sizeof(float)); - memcpy(&atkSpeedMulti, &buff[Offsets::ObjAtkSpeedMulti], sizeof(float)); - memcpy(&movementSpeed, &buff[Offsets::ObjMoveSpeed], sizeof(float)); - memcpy(&networkId, &buff[Offsets::ObjNetworkID], sizeof(DWORD)); - + memcpy(&team, &buff[Offsets::ObjTeam], sizeof(short)); + memcpy(&position, &buff[Offsets::ObjPos], sizeof(Vector3)); + memcpy(&health, &buff[Offsets::ObjHealth], sizeof(float)); + memcpy(&maxHealth, &buff[Offsets::ObjMaxHealth], sizeof(float)); + memcpy(&baseAttack, &buff[Offsets::ObjBaseAtk], sizeof(float)); + memcpy(&bonusAttack, &buff[Offsets::ObjBonusAtk], sizeof(float)); + memcpy(&armour, &buff[Offsets::ObjArmor], sizeof(float)); + memcpy(&magicResist, &buff[Offsets::ObjMagicRes], sizeof(float)); + memcpy(&duration, &buff[Offsets::ObjExpiry], sizeof(float)); + memcpy(&isVisible, &buff[Offsets::ObjVisibility], sizeof(bool)); + memcpy(&objectIndex, &buff[Offsets::ObjIndex], sizeof(short)); + memcpy(&crit, &buff[Offsets::ObjCrit], sizeof(float)); + memcpy(&critMulti, &buff[Offsets::ObjCritMulti], sizeof(float)); + memcpy(&abilityPower, &buff[Offsets::ObjAbilityPower], sizeof(float)); + memcpy(&atkSpeedMulti, &buff[Offsets::ObjAtkSpeedMulti], sizeof(float)); + memcpy(&movementSpeed, &buff[Offsets::ObjMoveSpeed], sizeof(float)); + memcpy(&networkId, &buff[Offsets::ObjNetworkID], sizeof(DWORD)); + // Additional - memcpy(&abilityHaste, &buff[Offsets::ObjAbilityHaste], sizeof(float)); - memcpy(&lethality, &buff[Offsets::ObjLethality], sizeof(float)); - memcpy(&direction, &buff[Offsets::ObjDirection], sizeof(float)); - memcpy(&experience, &buff[Offsets::ObjExperience], sizeof(float)); - memcpy(&manaRegen, &buff[Offsets::ObjManaRegen], sizeof(float)); - memcpy(&healthRegen, &buff[Offsets::ObjHealthRegen], sizeof(float)); - memcpy(&maxMana, &buff[Offsets::ObjMaxMana], sizeof(float)); - memcpy(&mana, &buff[Offsets::ObjMana], sizeof(float)); - memcpy(&transformation, &buff[Offsets::ObjTransformation], sizeof(float)); - memcpy(&isMoving, &buff[Offsets::ObjIsMoving], sizeof(bool)); - memcpy(&targetable, &buff[Offsets::ObjTargetable], sizeof(bool)); - memcpy(&invulnerable, &buff[Offsets::ObjInvulnerable], sizeof(bool)); - memcpy(&recallState, &buff[Offsets::ObjRecallState], sizeof(int)); - memcpy(¤tGold, &buff[Offsets::ObjCurrentGold], sizeof(float)); - memcpy(&totalGold, &buff[Offsets::ObjGoldTotal], sizeof(float)); - memcpy(&attackRange, &buff[Offsets::ObjAtkRange], sizeof(float)); + memcpy(&abilityHaste, &buff[Offsets::ObjAbilityHaste], sizeof(float)); + memcpy(&lethality, &buff[Offsets::ObjLethality], sizeof(float)); + memcpy(&direction, &buff[Offsets::ObjDirection], sizeof(float)); + memcpy(&experience, &buff[Offsets::ObjExperience], sizeof(float)); + memcpy(&manaRegen, &buff[Offsets::ObjManaRegen], sizeof(float)); + memcpy(&healthRegen, &buff[Offsets::ObjHealthRegen], sizeof(float)); + memcpy(&maxMana, &buff[Offsets::ObjMaxMana], sizeof(float)); + memcpy(&mana, &buff[Offsets::ObjMana], sizeof(float)); + memcpy(&transformation, &buff[Offsets::ObjTransformation], sizeof(float)); + memcpy(&isMoving, &buff[Offsets::ObjIsMoving], sizeof(bool)); + memcpy(&targetable, &buff[Offsets::ObjTargetable], sizeof(bool)); + memcpy(&invulnerable, &buff[Offsets::ObjInvulnerable], sizeof(bool)); + memcpy(&recallState, &buff[Offsets::ObjRecallState], sizeof(int)); + memcpy(¤tGold, &buff[Offsets::ObjCurrentGold], sizeof(float)); + memcpy(&totalGold, &buff[Offsets::ObjGoldTotal], sizeof(float)); + memcpy(&attackRange, &buff[Offsets::ObjAtkRange], sizeof(float)); // Check if alive DWORD spawnCount; diff --git a/LView/GameObject.h b/LView/GameObject.h index 520519ca..0a20e350 100644 --- a/LView/GameObject.h +++ b/LView/GameObject.h @@ -82,7 +82,7 @@ class GameObject: MemoryLoadable, SpellInterface { DWORD address; UnitInfo* unitInfo = GameData::UnknownUnit; - + // Additional float abilityHaste; float lethality; diff --git a/LView/LView Offsets.cpp b/LView/LView Offsets.cpp new file mode 100644 index 00000000..e69de29b diff --git a/LView/LView.cpp b/LView/LView.cpp index b2298a9c..13087d8b 100644 --- a/LView/LView.cpp +++ b/LView/LView.cpp @@ -1,4 +1,4 @@ -#define BOOST_DEBUG_PYTHON +#define BOOST_DEBUG_PYTHON #define USE_IMPORT_EXPORT #define USE_WINDOWS_DLL_SEMANTICS #define STB_IMAGE_IMPLEMENTATION @@ -16,18 +16,37 @@ #include "GameData.h" #include -#include "Overlay.h" #include #include #include +// NOTE: This is required due to high coupling between script UI and script execution +// imgui script execution decoupling +#include "ConfigSet.h" +#include "ScriptManager.h" +#include "PyGame.h" + +// Extra +#include +#include + using namespace std::chrono; +using namespace boost::json; + +void MainLoop(LeagueMemoryReader& reader); -/* bool Authenticate(); */ -void MainLoop(Overlay& overlay, LeagueMemoryReader& reader); +std::string outpath; +float endtime; +int replay_mult; +std::string replay_cmd; -int main() +int main(int argc, char *argv[]) { + outpath = std::string(argv[1]); + endtime = std::stof(argv[2]); + replay_mult = std::stoi(argv[3]); + replay_cmd = std::string(argv[4]); + printf( " ::: ::: ::: ::::::::::: :::::::::: ::: ::: \n" " :+: :+: :+: :+: :+: :+: :+: \n" @@ -38,7 +57,6 @@ int main() " ########## ### ########### ########## ### ### \n\n" ); - Overlay overlay = Overlay(); LeagueMemoryReader reader = LeagueMemoryReader(); try { @@ -46,9 +64,6 @@ int main() PyImport_AppendInittab("lview", &PyInit_lview); Py_Initialize(); - printf("[+] Initialising imgui and directx UI\n"); - overlay.Init(); - printf("[+] Loading static map data\n\n"); MapObject::Get(MapType::SUMMONERS_RIFT)->Load("data/height_map_sru.bin"); MapObject::Get(MapType::HOWLING_ABYSS)->Load("data/height_map_ha.bin"); @@ -57,7 +72,8 @@ int main() std::string dataPath("data"); GameData::Load(dataPath); - MainLoop(overlay, reader); + //MainLoop(overlay, reader); + MainLoop(reader); Py_Finalize(); } @@ -69,32 +85,173 @@ int main() getch(); } -void MainLoop(Overlay& overlay, LeagueMemoryReader& reader) { +boost::json::object e_pos(Vector3 pos) { + boost::json::object obj = boost::json::object({ + {"x", pos.x}, + {"y", pos.y}, + {"z", pos.z} + }); + return obj; +} + +boost::json::object e_obj(std::shared_ptr o) +{ + boost::json::object obj = boost::json::object({ + // Base + {"net_id", o->networkId}, + {"obj_id", o->objectIndex}, + {"name", o->name}, + {"health", o->health}, + {"max_health", o->maxHealth}, + {"team", o->team}, + {"armour", o->armour}, + {"mr", o->magicResist}, + {"movement_speed", o->movementSpeed}, + {"is_alive", o->isAlive}, + {"position", e_pos(o->position)}, + + // Additional + {"is_moving", o->isMoving}, + {"targetable", o->targetable}, + {"invulnerable", o->invulnerable}, + {"recallState", o->recallState}, + }); + + return obj; +} + +boost::json::object e_missile(std::shared_ptr o) { + boost::json::object obj = e_obj(o); + obj["src_id"] = o->srcIndex; + obj["dest_id"] = o->destIndex; + obj["start_pos"] = e_pos(o->startPos); + obj["end_pos"] = e_pos(o->endPos); + return obj; +} + +boost::json::object e_spell(float gameTime, Spell s) { + boost::json::object obj = boost::json::object({ + {"name", s.name}, + {"slot", (int) s.slot}, + {"summoner_spell_type", (int) s.summonerSpellType}, + {"level", s.level}, + {"cd", s.GetRemainingCooldown(gameTime)} + }); + return obj; +} + +boost::json::object e_champ(float gameTime, std::shared_ptr o) { + boost::json::object obj = e_obj(o); + obj["Q"] = e_spell(gameTime, o->Q); + obj["W"] = e_spell(gameTime, o->W); + obj["E"] = e_spell(gameTime, o->E); + obj["R"] = e_spell(gameTime, o->R); + obj["D"] = e_spell(gameTime, o->D); + obj["F"] = e_spell(gameTime, o->F); + + obj["crit"] = o->crit; + obj["crit_multi"] = o->critMulti; + obj["level"] = o->level; + obj["mana"] = o->mana; + obj["max_mana"] = o->maxMana; + obj["ability_haste"] = o->abilityHaste; + obj["ap"] = o->abilityPower; + obj["lethality"] = o->lethality; + obj["experience"] = o->experience; + obj["mana_regen"] = o->manaRegen; + obj["health_regen"] = o->healthRegen; + obj["attack_range"] = o->attackRange; + + obj["current_gold"] = o->currentGold; + obj["total_gold"] = o->totalGold; + + /* + std::vector items; + for (auto &item : o->itemSlots) { + int itemId = item.GetId(); + items.push_back(itemId); + } + obj["items"] = { {"item_ids", items} }; + */ + + return obj; +} +boost::json::object extraction(MemSnapshot& ms) +{ + // Champ + std::vector champs; + for (std::shared_ptr o : ms.champions) + champs.push_back(e_champ(ms.gameTime, o)); + std::cout << "Champ Count: " << ms.champions.size() << "\n"; + + // Minions + std::vector minions; + for (std::shared_ptr o : ms.minions) + minions.push_back(e_obj(o)); + std::cout << "Minions Count: " << ms.minions.size() << "\n"; + + // Turrets + std::vector turrets; + for (std::shared_ptr o : ms.turrets) + turrets.push_back(e_obj(o)); + std::cout << "Turrets Count: " << ms.turrets.size() << "\n"; + + // Jungle + std::vector jungle; + for (std::shared_ptr o : ms.jungle) + jungle.push_back(e_obj(o)); + std::cout << "Jungle Count: " << ms.jungle.size() << "\n"; + + // Missiles + std::vector missiles; + for (std::shared_ptr o : ms.missiles) + missiles.push_back(e_missile(o)); + std::cout << "Missiles Count: " << ms.missiles.size() << "\n"; + + // Others + std::vector others; + for (std::shared_ptr o : ms.others) + others.push_back(e_obj(o)); + std::cout << "Others Count: " << ms.others.size() << "\n"; + + // Observation + boost::json::object obj = boost::json::object({ + {"time", ms.gameTime}, + {"champs", champs}, + {"minions", minions}, + {"turrets", turrets}, + {"jungle", jungle}, + {"missiles", missiles}, + {"others", others}, + }); + + // Return obs + return obj; +} + +void MainLoop(LeagueMemoryReader& reader) +{ MemSnapshot memSnapshot; bool rehook = true; bool firstIter = true; + ScriptManager scriptManager; + ConfigSet& configs = *(ConfigSet::Get()); + // Init JSON file + std::ofstream replay_file; + replay_file.open(outpath); + replay_file << "[\n"; + bool first_record = true; + bool record_set = false; // Set seek and replay speed + + // Init LView printf("[i] Waiting for league process...\n"); while (true) { bool isLeagueWindowActive = reader.IsLeagueWindowActive(); - if (overlay.IsVisible()) { - // One some systems the ingame cursor is replaced with the default Windows cursor - // With the WS_EX_TRANSPARENT window flag enabled the cursor is as expected but the user cannot control the overlay - if (Input::WasKeyPressed(HKey::F8)) { - overlay.ToggleTransparent(); - } - if (!isLeagueWindowActive) { - overlay.Hide(); - } - } - else if (isLeagueWindowActive) { - overlay.Show(); - } try { - overlay.StartFrame(); // Try to find the league process and get its information necessary for reading if (rehook) { @@ -118,10 +275,48 @@ void MainLoop(Overlay& overlay, LeagueMemoryReader& reader) { // Tell the UI that a new game has started if (firstIter) { - overlay.GameStart(memSnapshot); + //std::string PLACEHOLDER_VALUE = std::string("ELLO_COUSIN"); + //scriptManager.LoadAll(configs.GetStr("scriptsFolder", "."), memSnapshot.player->name); // Set this to invalid name to force load scripts// memSnapshot.player->name); firstIter = false; + // std::string cmd = std::string("\"python C:\\Users\\win8t\\OneDrive\\Desktop\\projects\\tlol\\set_replay.py " + std::to_string(replay_mult) + "\""); + std::string cmd = std::string("\"" + replay_cmd + " " + std::to_string(replay_mult) + "\""); + std::cout << cmd << "\n"; + system(cmd.c_str()); + } + + // if (memSnapshot.champions.size() > 0) { + /* + PyGame state = PyGame::ConstructFromMemSnapshot(memSnapshot); + for (auto& script : scriptManager.activeScripts) { + if (script->enabled && script->loadError.empty() && script->execError.empty()) { + script->ExecUpdate(state); + } + else if (!script->loadError.empty()) { + std::cout << "Script Error: " << script->loadError; + } + } + */ + + float game_time = memSnapshot.gameTime; + + if ((int) game_time < (int) endtime) { + std::cout << game_time << "\n"; + if (!first_record) { + replay_file << ",\n" << extraction(memSnapshot); + } + else { + replay_file << extraction(memSnapshot); + first_record = false; + } + } else { + // Save file + replay_file << "]"; + std::cout << "Exiting scraper...\n"; + replay_file.close(); + + // Exit + exit(0); } - overlay.Update(memSnapshot); } } } @@ -133,85 +328,5 @@ void MainLoop(Overlay& overlay, LeagueMemoryReader& reader) { printf("[!] Unexpected error occured: \n [!] %s \n", exception.what()); break; } - overlay.RenderFrame(); - } -} - -/* - -#include -#include -#include - -#include -#include - -/// Authentication using AWS. Calls a lambda from AWS that will do the authentication. -bool Authenticate() { - - - Aws::SDKOptions options; - Aws::InitAPI(options); - - ConfigSet* cfg = ConfigSet::Get(); - cfg->SetPrefixKey("auth"); - std::string name = cfg->GetStr("user", ""); - std::string region = cfg->GetStr("region", ""); - std::string accessKey = cfg->GetStr("access_key", ""); - std::string secretKey = cfg->GetStr("secret_key", ""); - cfg->SetPrefixKey(""); - - if (region.empty() || name.empty() || accessKey.empty() || secretKey.empty()) { - printf("[!] auth:: config fields are missing"); - return false; - } - - Aws::Auth::AWSCredentials credentials; - credentials.SetAWSAccessKeyId(accessKey.c_str()); - credentials.SetAWSSecretKey(secretKey.c_str()); - - Aws::Client::ClientConfiguration config; - config.region = Aws::String(region.c_str()); - - std::string hwid = AntiCrack::GetHardwareID(); - - std::shared_ptr payload = Aws::MakeShared("FunctionTest"); - Aws::Utils::Json::JsonValue json; - json.WithString("operation", "auth"); - json.WithString("name", name.c_str()); - json.WithString("secret_key", secretKey.c_str()); - json.WithString("access_key", accessKey.c_str()); - json.WithString("hwid", hwid.c_str()); - *payload << json.View().WriteReadable(); - - auto client = Aws::MakeShared("alloc_tag", credentials, config); - Aws::Lambda::Model::InvokeRequest invokeRequest; - invokeRequest.SetFunctionName("lview-auth"); - invokeRequest.SetInvocationType(Aws::Lambda::Model::InvocationType::RequestResponse); - invokeRequest.SetLogType(Aws::Lambda::Model::LogType::Tail); - invokeRequest.SetBody(payload); - invokeRequest.SetContentType("application/javascript"); - - auto outcome = client->Invoke(invokeRequest); - if (!outcome.IsSuccess()) { - printf("[!] Access denied.\n"); - - auto err = outcome.GetError(); - printf(err.GetExceptionName().c_str()); - return false; } - - auto& result = outcome.GetResult(); - Aws::Utils::Json::JsonValue resultJson(result.GetPayload()); - int statusCode = resultJson.View().GetInteger("status"); - Aws::String msg = resultJson.View().GetString("msg"); - - if (statusCode != 200) { - printf("[!] Server authentication failed: %s\n", msg.c_str()); - return false; - } - printf("[+] Server authentication succeeded: %s\n", msg.c_str()); - - return true; -} -*/ +} \ No newline at end of file diff --git a/LView/LView.vcxproj b/LView/LView.vcxproj index f391006d..f31b841c 100644 --- a/LView/LView.vcxproj +++ b/LView/LView.vcxproj @@ -191,7 +191,6 @@ - @@ -228,7 +227,6 @@ - diff --git a/LView/LView.vcxproj.filters b/LView/LView.vcxproj.filters index 3c502e25..24154f55 100644 --- a/LView/LView.vcxproj.filters +++ b/LView/LView.vcxproj.filters @@ -99,9 +99,6 @@ Source Files\External\imgui - - Source Files\GUI - Source Files\Structs\GameRelated\Spells @@ -194,9 +191,6 @@ Source Files\External\imgui - - Source Files\GUI - Source Files\Structs\GameRelated\Spells diff --git a/LView/LView.vcxproj.user b/LView/LView.vcxproj.user index be250787..05d9e091 100644 --- a/LView/LView.vcxproj.user +++ b/LView/LView.vcxproj.user @@ -1,4 +1,7 @@  - + + "D:\LoL Replays\11.21\Datasets\Early Surrender\JSON\test.json" "190" "64" "C:\Users\win8t\OneDrive\Desktop\projects\tlol\set_replay.py" + WindowsLocalDebugger + \ No newline at end of file diff --git a/LView/LeagueMemoryReader.cpp b/LView/LeagueMemoryReader.cpp index 6a54edf0..b28c1315 100644 --- a/LView/LeagueMemoryReader.cpp +++ b/LView/LeagueMemoryReader.cpp @@ -118,6 +118,7 @@ void LeagueMemoryReader::ReadObjects(MemSnapshot& ms) { int numMissiles, rootNode; memcpy(&numMissiles, buff + Offsets::ObjectMapCount, sizeof(int)); memcpy(&rootNode, buff + Offsets::ObjectMapRoot, sizeof(int)); + std::cout << "Num Missiles: " << numMissiles << ", Root Node: " << rootNode << "\n"; std::queue nodesToVisit; std::set visitedNodes; @@ -161,10 +162,14 @@ void LeagueMemoryReader::ReadObjects(MemSnapshot& ms) { nrObj++; } + std::cout << "nrObj: " << nrObj << "\n"; + // Read objects from the pointers we just read for (int i = 0; i < nrObj; ++i) { int netId; Mem::Read(hProcess, pointerArray[i] + Offsets::ObjNetworkID, &netId, sizeof(int)); + + // MOVE THIS BACK TO `1. THIS IS WHERE BLACKLISTED OBJS WAS` if (blacklistedObjects.find(netId) != blacklistedObjects.end()) continue; @@ -185,6 +190,8 @@ void LeagueMemoryReader::ReadObjects(MemSnapshot& ms) { } } + // std::cout << "Obj Name: " << obj->name << "\n + if (obj->isVisible) { obj->lastVisibleAt = ms.gameTime; } @@ -193,6 +200,8 @@ void LeagueMemoryReader::ReadObjects(MemSnapshot& ms) { ms.indexToNetId[obj->objectIndex] = obj->networkId; ms.updatedThisFrame.insert(obj->networkId); + // std::cout << "CUR OBJ:" << obj->name << "\n"; + if (obj->name.size() <= 2 || blacklistedObjectNames.find(obj->name) != blacklistedObjectNames.end()) blacklistedObjects.insert(obj->networkId); else if (obj->HasUnitTags(Unit_Champion)) @@ -208,6 +217,9 @@ void LeagueMemoryReader::ReadObjects(MemSnapshot& ms) { else ms.others.push_back(obj); } + else { + // std::cout << "CUR OBJ:" << obj->name << "\n"; + } } readDuration = high_resolution_clock::now() - readTimeBegin; diff --git a/LView/Offsets.cpp b/LView/Offsets.cpp index 3070690f..32f706d7 100644 --- a/LView/Offsets.cpp +++ b/LView/Offsets.cpp @@ -92,4 +92,1007 @@ int Offsets::MissileEndPos = 0x02E8; // 12.10 int Offsets::MinimapObject = 0x30DA27C; // 12.11 int Offsets::MinimapObjectHud = 0x120; // 12.11 int Offsets::MinimapHudPos = 0x44; -int Offsets::MinimapHudSize = 0x4C; \ No newline at end of file +int Offsets::MinimapHudSize = 0x4C; + +/* +#include "Offsets.h" + +Offsets::Offsets() {}; + +// ? +int Offsets::GameTime = 0x31023CC; // 12.6 +int Offsets::ObjectManager = 0x24B9BB0; // 12.6 +int Offsets::LocalPlayer = 0x310B314; // 12.6 +int Offsets::UnderMouseObject = 0x30FED10; // 12.6 +int Offsets::ViewProjMatrices = 0x3135818; // 12.6 +int Offsets::Renderer = 0x3138718; // 12.6 + +// MOSTLY CORRECT! +int Offsets::ObjIndex = 0x20; // 12.6 +int Offsets::ObjTeam = 0x4C; // 12.6 +int Offsets::ObjMissileName = 0x6C; // 12.5 +int Offsets::ObjNetworkID = 0xCC; // 12.6 +int Offsets::ObjPos = 0x1F4; // 12.6 +int Offsets::ObjMissileSpellCast = 0x250; // 12.5 +int Offsets::ObjVisibility = 0x28C; // 12.6 +int Offsets::ObjSpawnCount = 0x2A0; // 12.6 +int Offsets::ObjSrcIndex = 0x02AC; // 12.6? +int Offsets::ObjMana = 0x2B4; // 12.6? +int Offsets::ObjMaxMana = 0x2B4 + 0x10; // 12.6? +int Offsets::ObjRecallState = 0xD78; // 12.6? +int Offsets::ObjHealth = 0xDB4; // 12.6 +int Offsets::ObjMaxHealth = 0xDB4 + 0x10; // 12.6 +int Offsets::ObjAbilityHaste = 0x110C; // 12.6? +int Offsets::ObjLethality = 0x10F4; // 12.6? +int Offsets::ObjArmor = 0x12E4; // 12.6 +int Offsets::ObjBonusArmor = 0x12E4 + 0x04; // 12.6 +int Offsets::ObjMagicRes = 0x12EC; // 12.6 +int Offsets::ObjBonusMagicRes = 0x12EC + 0x04; // 12.6 +int Offsets::ObjBaseAtk = 0x12BC; // 12.6 +int Offsets::ObjBonusAtk = 0x1234; // 12.6 +int Offsets::ObjMoveSpeed = 0x12FC; // 12.6 +int Offsets::ObjSpellBook = 0x27F8; // 12.6 +int Offsets::ObjTransformation = 0x3040; // Wrong +int Offsets::ObjName = 0x2BE4; // 12.6 +int Offsets::ObjLvl = 0x3394; // 12.6 +int Offsets::ObjExpiry = 0x298; // ? +int Offsets::ObjCrit = 0x12E0; // 12.5? +int Offsets::ObjCritMulti = 0x12D0; // 12.5? +int Offsets::ObjAbilityPower = 0x1244; // 12.5? +int Offsets::ObjAtkSpeedMulti = 0x12B8; // 12.5? +int Offsets::ObjAtkRange = 0x1304; // 12.6 +int Offsets::ObjTargetable = 0xD1C; // 12.5? +int Offsets::ObjInvulnerable = 0x3EC; // 12.5? +int Offsets::ObjIsMoving = 0x3638; // 12.5? +int Offsets::ObjDirection = 0x1BD8; // 12.6? +int Offsets::ObjItemList = 0x3478; // 12.5? +int Offsets::ObjExperience = 0x3394; // 12.6 +int Offsets::ObjMagicPen = 0x11DC; // Unknown +int Offsets::ObjMagicPenMulti = 0x11E4; // Unknown +int Offsets::ObjAdditionalApMulti = 0x1248; // 11.20 +int Offsets::ObjManaRegen = 0x1150; // 12.2? +int Offsets::ObjHealthRegen = 0x12F8; // 12.4 +int Offsets::ObjCurrentGold = 0x1B98; // 12.6 +int Offsets::ObjGoldTotal = 0x1BA8; // 12.6 + +// UNKNOWN! +int Offsets::ItemListItem = 0xC; +int Offsets::ItemInfo = 0x20; +int Offsets::ItemInfoId = 0x68; + +int Offsets::RendererWidth = 0xC; +int Offsets::RendererHeight = 0x10; + +// CORRECT +int Offsets::SpellSlotLevel = 0x20; // 12.6 +int Offsets::SpellSlotTime = 0x28; // 12.6 +int Offsets::SpellSlotDamage = 0xA0; // 12.6 +int Offsets::SpellSlotSpellInfo = 0x13C; // // 12.6 +int Offsets::SpellInfoSpellData = 0x44; // 12.6 +int Offsets::SpellDataSpellName = 0x78; // 12.6 // 0x6C; // 12.5 +int Offsets::SpellDataMissileName = 0x78; // 12.6 // 0x6C; // 12.6 + +// CORRECT +int Offsets::ObjectMapCount = 0x2C; // 12.6 +int Offsets::ObjectMapRoot = 0x28; // 12.6 +int Offsets::ObjectMapNodeNetId = 0x10; // 12.6 +int Offsets::ObjectMapNodeObject = 0x14; // 12.6 + +// ? +int Offsets::MissileSpellInfo = 0x278; // 12.6? +int Offsets::MissileSrcIdx = 0x2DC; // 12.6? +int Offsets::MissileDestIdx = 0x334; // 12.6? +int Offsets::MissileStartPos = 0x2F4; // 12.6? +int Offsets::MissileEndPos = 0x300; // 12.6? + +// Minimap +int Offsets::MinimapObject = 0x310240C; // 12.6 +int Offsets::MinimapObjectHud = 0x110; +int Offsets::MinimapHudPos = 0x44; +int Offsets::MinimapHudSize = 0x4C; +*/ + +/* +#include "Offsets.h" + +Offsets::Offsets() {}; + +// CORRECT! +int Offsets::GameTime = 0x310DF84; // 12.5 +int Offsets::ObjectManager = 0x1879830; // 12.5 +int Offsets::LocalPlayer = 0x31168D4; // 12.5 +int Offsets::UnderMouseObject = 0x310A9D8; // 12.5 +int Offsets::ViewProjMatrices = 0x3140F40; // 12.5 +int Offsets::Renderer = 0x3143DE0; // 12.5 + +// MOSTLY CORRECT! +int Offsets::ObjIndex = 0x20; // 12.5 +int Offsets::ObjTeam = 0x4C; // 12.5 +int Offsets::ObjMissileName = 0x6C; // 12.5 +int Offsets::ObjNetworkID = 0xCC; // 12.5 +int Offsets::ObjPos = 0x1F4; // 12.5 +int Offsets::ObjMissileSpellCast = 0x250; // 12.5 +int Offsets::ObjVisibility = 0x28C; // 12.5 +int Offsets::ObjSpawnCount = 0x2A0; // 12.5 +int Offsets::ObjSrcIndex = 0x02AC; // 12.5 +int Offsets::ObjMana = 0x2B4; // 12.5 +int Offsets::ObjMaxMana = 0x2B4 + 0x10; // 12.5 +int Offsets::ObjRecallState = 0xD78; // 12.5 +int Offsets::ObjHealth = 0xDB4; // 12.5 +int Offsets::ObjMaxHealth = 0xDB4 + 0x10; // 12.5 +int Offsets::ObjAbilityHaste = 0x110C; // 12.5 +int Offsets::ObjLethality = 0x10F4; // 12.5 +int Offsets::ObjArmor = 0x12E4; // 12.5 +int Offsets::ObjBonusArmor = 0x12E4 + 0x04; // 12.5 +int Offsets::ObjMagicRes = 0x12EC; // 12.5 +int Offsets::ObjBonusMagicRes = 0x12EC + 0x04; // 12.5 +int Offsets::ObjBaseAtk = 0x12BC; // 12.5 +int Offsets::ObjBonusAtk = 0x1234; // 12.5 +int Offsets::ObjMoveSpeed = 0x12FC; // 12.5 +int Offsets::ObjSpellBook = 0x27F8; // 12.5 +int Offsets::ObjTransformation = 0x3040; // Wrong +int Offsets::ObjName = 0x2BE4; // 12.5 +int Offsets::ObjLvl = 0x3394; // 12.5 +int Offsets::ObjExpiry = 0x298; // Unknown +int Offsets::ObjCrit = 0x12E0; // 12.5? +int Offsets::ObjCritMulti = 0x12D0; // 12.5? +int Offsets::ObjAbilityPower = 0x1244; // 12.5? +int Offsets::ObjAtkSpeedMulti = 0x12B8; // 12.5? +int Offsets::ObjAtkRange = 0x1304; // 12.5 +int Offsets::ObjTargetable = 0xD1C; // 12.5? +int Offsets::ObjInvulnerable = 0x3EC; // 12.5? +int Offsets::ObjIsMoving = 0x3638; // 12.5? +int Offsets::ObjDirection = 0x1BD8; // 12.5? +int Offsets::ObjItemList = 0x3478; // 12.5? +int Offsets::ObjExperience = 0x3394; // 12.5 +int Offsets::ObjMagicPen = 0x11DC; // Unknown +int Offsets::ObjMagicPenMulti = 0x11E4; // Unknown +int Offsets::ObjAdditionalApMulti = 0x1248; // 11.20 +int Offsets::ObjManaRegen = 0x1150; // 12.2? +int Offsets::ObjHealthRegen = 0x12F8; // 12.4 +int Offsets::ObjCurrentGold = 0x1B98; // 12.5 +int Offsets::ObjGoldTotal = 0x1BA8; // 12.5 + +// UNKNOWN! +int Offsets::ItemListItem = 0xC; +int Offsets::ItemInfo = 0x20; +int Offsets::ItemInfoId = 0x68; + +int Offsets::RendererWidth = 0xC; +int Offsets::RendererHeight = 0x10; + +// MOSTLY CORRECT! +int Offsets::SpellSlotLevel = 0x20; // 12.5 +int Offsets::SpellSlotTime = 0x28; // 12.5 +int Offsets::SpellSlotDamage = 0xA0; // 12.5 +int Offsets::SpellSlotSpellInfo = 0x13C; // // 12.5 +int Offsets::SpellInfoSpellData = 0x44; // 12.5 +int Offsets::SpellDataSpellName = 0x6C; // 12.5 +int Offsets::SpellDataMissileName = 0x6C; // 12.5 + +// CORRECT +int Offsets::ObjectMapCount = 0x2C; // 12.5 +int Offsets::ObjectMapRoot = 0x28; // 12.5 +int Offsets::ObjectMapNodeNetId = 0x10; // 12.5 +int Offsets::ObjectMapNodeObject = 0x14; // 12.5 + +// CORRECT! +int Offsets::MissileSpellInfo = 0x278; // 12.5 +int Offsets::MissileSrcIdx = 0x2DC; // 12.5 +int Offsets::MissileDestIdx = 0x334; // 12.5 +int Offsets::MissileStartPos = 0x2F4; // 12.5 +int Offsets::MissileEndPos = 0x300; // 12.5 + +// Minimap +int Offsets::MinimapObject = 0x310F288; // 12.5 +int Offsets::MinimapObjectHud = 0x110; +int Offsets::MinimapHudPos = 0x44; +int Offsets::MinimapHudSize = 0x4C; +*/ + +/* +// v12.4 +#include "Offsets.h" + +Offsets::Offsets() {}; + +// CORRECT! +int Offsets::GameTime = 0x30F07C4; // 12.4 +int Offsets::ObjectManager = 0x185C0C8; // 12.4 +int Offsets::LocalPlayer = 0x30F9734; // 12.4 +int Offsets::UnderMouseObject = 0x30EB740; // 12.4 +int Offsets::ViewProjMatrices = 0x3122BD0; // 12.4 +int Offsets::Renderer = 0x3125A70; // 12.4 + +// MOSTLY CORRECT! +int Offsets::ObjIndex = 0x20; // 12.4 +int Offsets::ObjTeam = 0x4C; // 12.4 +int Offsets::ObjMissileName = 0x6C; // 12.4 +int Offsets::ObjNetworkID = 0xCC; // 12.4 +int Offsets::ObjPos = 0x1F4; // 12.4 +int Offsets::ObjMissileSpellCast = 0x250; // 12.3 +int Offsets::ObjVisibility = 0x00; // 12.4? // 0x28C; // 12.3 +int Offsets::ObjSpawnCount = 0x2A0; // 12.4 +int Offsets::ObjSrcIndex = 0x02AC; // 12.4 +int Offsets::ObjMana = 0x2B4; // 12.4 +int Offsets::ObjMaxMana = 0x2B4 + 0x10; // 12.4 +int Offsets::ObjRecallState = 0xD78; // 12.4 +int Offsets::ObjHealth = 0xDB4; // 12.4 +int Offsets::ObjMaxHealth = 0xDB4 + 0x10; // 12.4 +int Offsets::ObjAbilityHaste = 0x110C; // 12.4 +int Offsets::ObjLethality = 0x10F4; // 12.4 +int Offsets::ObjArmor = 0x12E4; // 12.4 +int Offsets::ObjBonusArmor = 0x12E4 + 0x04; // 12.4 +int Offsets::ObjMagicRes = 0x12EC; // 12.4 +int Offsets::ObjBonusMagicRes = 0x12EC + 0x04; // 12.4 +int Offsets::ObjBaseAtk = 0x12BC; // 12.4 +int Offsets::ObjBonusAtk = 0x1234; // 12.4 +int Offsets::ObjMoveSpeed = 0x12FC; // 12.4 +int Offsets::ObjSpellBook = 0x27F8; // 12.4 +int Offsets::ObjTransformation = 0x3040; // Wrong +int Offsets::ObjName = 0x2BE4; // 12.4 +int Offsets::ObjLvl = 0x33A4; // 12.4 +int Offsets::ObjExpiry = 0x298; // Unknown +int Offsets::ObjCrit = 0x12E0; // 12.4 +int Offsets::ObjCritMulti = 0x12D0; // Unknown +int Offsets::ObjAbilityPower = 0x1244; // 12.4 +int Offsets::ObjAtkSpeedMulti = 0x12B8; // Unknown +int Offsets::ObjAtkRange = 0x1304; // 12.3 +int Offsets::ObjTargetable = 0xD1C; // 12.3 +int Offsets::ObjInvulnerable = 0x3EC; // 12.3 +int Offsets::ObjIsMoving = 0x3638; // Unknown +int Offsets::ObjDirection = 0x1BD8; // 12.4 +int Offsets::ObjItemList = 0x3478; // 0x3478; // 12.2? // 0x33D0; // 12.2? +int Offsets::ObjExperience = 0x3394; // 12.4 +int Offsets::ObjMagicPen = 0x11DC; // Unknown +int Offsets::ObjMagicPenMulti = 0x11E4; // Unknown +int Offsets::ObjAdditionalApMulti = 0x1248; // 11.20 +int Offsets::ObjManaRegen = 0x1150; // 12.2? +int Offsets::ObjHealthRegen = 0x12F8; // 12.4 +int Offsets::ObjCurrentGold = 0x1B98; // 12.4 +int Offsets::ObjGoldTotal = 0x1BA8; // 12.4 + +// MOSTLY CORRECT! +int Offsets::SpellSlotLevel = 0x20; // 12.2 +int Offsets::SpellSlotTime = 0x28; // 12.2 +int Offsets::SpellSlotCharges = 0x58; // 12.2 +int Offsets::SpellSlotTimeCharge = 0x78; // 12.2 +int Offsets::SpellSlotDamage = 0xA0; // 12.2 +int Offsets::SpellSlotSpellInfo = 0x13C; // // 12.2 +int Offsets::SpellInfoSpellData = 0x44; // 12.2 +int Offsets::SpellDataSpellName = 0x6C; // 12.2 +int Offsets::SpellDataMissileName = 0x6C; // 12.2 +int Offsets::SpellSlotSmiteTimer = 0x64; // 12.2 +int Offsets::SpellSlotSmiteCharges = 0x5c; // 12.2 + +// CORRECT! +int Offsets::MissileSpellInfo = 0x278; // 12.2 +int Offsets::MissileSrcIdx = 0x2DC; // 12.2 +int Offsets::MissileDestIdx = 0x334; // 12.2 +int Offsets::MissileStartPos = 0x2F4; // 12.2 +int Offsets::MissileEndPos = 0x300; // 12.2 + +// UNKNOWN! +int Offsets::ItemListItem = 0xC; +int Offsets::ItemInfo = 0x20; +int Offsets::ItemInfoId = 0x68; + +// AI Manager +int Offsets::CurrentDashSpeed = 0x1D0; +int Offsets::IsDashing = 0x398; +int Offsets::DashPos = 0x1FC; +int Offsets::IsMoving = 0x198; +int Offsets::NavBegin = 0x1BC; +int Offsets::NavEnd = 0x1C0; + +// Renderer +int Offsets::RendererWidth = 0xC; +int Offsets::RendererHeight = 0x10; + +int Offsets::ObjectMapCount = 0x2C; // 12.3? +int Offsets::ObjectMapRoot = 0x28; // 12.3 +int Offsets::ObjectMapNodeNetId = 0x10; // 12.3 +int Offsets::ObjectMapNodeObject = 0x14; // 12.3 + +// Minimap +int Offsets::MinimapObject = 0x30F1D94; // WRONG +int Offsets::MinimapObjectHud = 0x110; +int Offsets::MinimapHudPos = 0x44; +int Offsets::MinimapHudSize = 0x4C; +*/ + +/* +// v12.3 +#include "Offsets.h" + +Offsets::Offsets() {}; + +// CORRECT! +int Offsets::GameTime = 0x30E585C; // 12.3 +int Offsets::ObjectManager = 0x1851168; // 12.3 +int Offsets::LocalPlayer = 0x30EE58C; // 12.3 +int Offsets::UnderMouseObject = 0x30EBBC4; // 12.2 +int Offsets::ViewProjMatrices = 0x3122690; // 12.3? +int Offsets::Renderer = 0x311A238; // 12.3? + +// MOSTLY CORRECT! +int Offsets::ObjIndex = 0x20; // 12.3? +int Offsets::ObjTeam = 0x4C; // 12.3 +int Offsets::ObjMissileName = 0x6C; // 12.3? +int Offsets::ObjNetworkID = 0xCC; // 12.3 +int Offsets::ObjPos = 0x1F4; // 12.3 +int Offsets::ObjMissileSpellCast = 0x250; // 12.3 +int Offsets::ObjVisibility = 0x28C; // 12.3 +int Offsets::ObjSpawnCount = 0x2A0; // 12.3 +int Offsets::ObjSrcIndex = 0x02AC; // 12.3? +int Offsets::ObjMana = 0x2B4; // 12.3 +int Offsets::ObjMaxMana = 0x2B4 + 0x10; // 12.3 +int Offsets::ObjRecallState = 0xDA8; // 12.3 +int Offsets::ObjHealth = 0xDB4; // 12.3 +int Offsets::ObjMaxHealth = 0xDB4 + 0x10; // 12.3 +int Offsets::ObjAbilityHaste = 0x16D8; // 12.3? +int Offsets::ObjLethality = 0x11F8; // 12.3? +int Offsets::ObjArmor = 0x12E4; // 12.3 +int Offsets::ObjBonusArmor = 0x12E4 + 0x04; // 12.3 +int Offsets::ObjMagicRes = 0x12EC; // 12.3 +int Offsets::ObjBonusMagicRes = 0x12EC + 0x04; // 12.3 +int Offsets::ObjBaseAtk = 0x12BC; // 12.3 +int Offsets::ObjBonusAtk = 0x1234; // 12.3 +int Offsets::ObjMoveSpeed = 0x12FC; // 12.3? +int Offsets::ObjSpellBook = 0x27F8; // 12.2 // 0x2C6C || 0x27e4 // 12.3? +int Offsets::ObjTransformation = 0x3040; // Wrong +int Offsets::ObjName = 0x2BE4; // 12.3? +int Offsets::ObjLvl = 0x339C; // 12.3? +int Offsets::ObjExpiry = 0x298; // Unknown +int Offsets::ObjCrit = 0x12E0; // 12.3? +int Offsets::ObjCritMulti = 0x12D0; // Unknown +int Offsets::ObjAbilityPower = 0x1788; // 12.3 +int Offsets::ObjAtkSpeedMulti = 0x12B8; // Unknown +int Offsets::ObjAtkRange = 0x1304; // 12.3 +int Offsets::ObjTargetable = 0xD1C; // 12.3 +int Offsets::ObjInvulnerable = 0x3EC; // 12.3 +int Offsets::ObjIsMoving = 0x3638; // Unknown +int Offsets::ObjDirection = 0x1B88; // Unknown +int Offsets::ObjItemList = 0x3478; // 0x3478; // 12.2? // 0x33D0; // 12.2? +int Offsets::ObjExperience = 0x338C; // 12.3 +int Offsets::ObjMagicPen = 0x11DC; // Unknown +int Offsets::ObjMagicPenMulti = 0x11E4; // Unknown +int Offsets::ObjAdditionalApMulti = 0x1248; //11.20 +int Offsets::ObjManaRegen = 0x1150; // 12.2? +int Offsets::ObjHealthRegen = 0x12F8; // 12.3? +int Offsets::ObjCurrentGold = 0x1B98; // 12.3 +int Offsets::ObjGoldTotal = 0x1BA8; // 12.3 + +// MOSTLY CORRECT! +int Offsets::SpellSlotLevel = 0x20; // 12.2 +int Offsets::SpellSlotTime = 0x28; // 12.2 +int Offsets::SpellSlotCharges = 0x58; // 12.2 +int Offsets::SpellSlotTimeCharge = 0x78; // 12.2 +int Offsets::SpellSlotDamage = 0xA0; // 12.2 +int Offsets::SpellSlotSpellInfo = 0x13C; // // 12.2 +int Offsets::SpellInfoSpellData = 0x44; // 12.2 +int Offsets::SpellDataSpellName = 0x6C; // 12.2 +int Offsets::SpellDataMissileName = 0x6C; // 12.2 +int Offsets::SpellSlotSmiteTimer = 0x64; // 12.2 +int Offsets::SpellSlotSmiteCharges = 0x5c; // 12.2 + +// CORRECT! +int Offsets::MissileSpellInfo = 0x278; // 12.2 +int Offsets::MissileSrcIdx = 0x2DC; // 12.2 +int Offsets::MissileDestIdx = 0x334; // 12.2 +int Offsets::MissileStartPos = 0x2F4; // 12.2 +int Offsets::MissileEndPos = 0x300; // 12.2 + +// UNKNOWN! +int Offsets::ItemListItem = 0xC; +int Offsets::ItemInfo = 0x20; +int Offsets::ItemInfoId = 0x68; + +// AI Manager +int Offsets::CurrentDashSpeed = 0x1D0; +int Offsets::IsDashing = 0x398; +int Offsets::DashPos = 0x1FC; +int Offsets::IsMoving = 0x198; +int Offsets::NavBegin = 0x1BC; +int Offsets::NavEnd = 0x1C0; + +// Renderer +int Offsets::RendererWidth = 0xC; +int Offsets::RendererHeight = 0x10; + +int Offsets::ObjectMapCount = 0x2C; // 12.3? +int Offsets::ObjectMapRoot = 0x28; // 12.3 +int Offsets::ObjectMapNodeNetId = 0x10; // 12.3 +int Offsets::ObjectMapNodeObject = 0x14; // 12.3 + +// Minimap +int Offsets::MinimapObject = 0x30F1D94; // WRONG +int Offsets::MinimapObjectHud = 0x110; +int Offsets::MinimapHudPos = 0x44; +int Offsets::MinimapHudSize = 0x4C; +*/ + +/* +// v12.2 +#include "Offsets.h" + +Offsets::Offsets() {}; + +// CORRECT! +int Offsets::GameTime = 0x30F08CC; // 12.2 +int Offsets::ObjectManager = 0x185C544; // 12.2 +int Offsets::LocalPlayer = 0x30F990C; // 12.2 +int Offsets::UnderMouseObject = 0x30EBBC4; // 12.2 +// int Offsets::ZoomClass = 0x30F080C; // 12.2 +// int Offsets::Chat = 0x30F999C; // 12.2 +int Offsets::ViewProjMatrices = 0x3122690; // 12.2 +int Offsets::Renderer = 0x30F94D0; // 12.2 // 0x3125530; // 12.2? + +// MOSTLY CORRECT! +int Offsets::ObjIndex = 0x20; // 12.2 +int Offsets::ObjTeam = 0x4C; // 12.2 +int Offsets::ObjMissileName = 0x6C; // 12.2? +int Offsets::ObjNetworkID = 0xCC; // 12.2 +int Offsets::ObjPos = 0x1F4; // 0xF0; // 12.2? +int Offsets::ObjMissileSpellCast = 0x250; // 12.2 +int Offsets::ObjVisibility = 0x28C; // 12.2 +int Offsets::ObjSpawnCount = 0x2A0; // 12.2 +int Offsets::ObjSrcIndex = 0x02AC; +int Offsets::ObjMana = 0x2B4; // 12.2 +int Offsets::ObjMaxMana = 0x2B4 + 0x10; // 12.2 +int Offsets::ObjRecallState = 0xDA8; +int Offsets::ObjHealth = 0xDB4; // 12.2 +int Offsets::ObjMaxHealth = 0xDB4 + 0x10; // 12.2 +int Offsets::ObjAbilityHaste = 0x16D8; // 12.2 +int Offsets::ObjLethality = 0x11F8; +int Offsets::ObjArmor = 0x12E4; // 12.2 +int Offsets::ObjBonusArmor = 0x12E4 + 0x04; // 12.2 +int Offsets::ObjMagicRes = 0x12EC; // 12.2 +int Offsets::ObjBonusMagicRes = 0x12EC + 0x04; // 12.2 +int Offsets::ObjBaseAtk = 0x12BC; // 12.2 +int Offsets::ObjBonusAtk = 0x1234; // 12.2 +int Offsets::ObjMoveSpeed = 0x12FC; // 12.2 +int Offsets::ObjSpellBook = 0x27F8; // 12.2 +int Offsets::ObjTransformation = 0x3040; // Wrong +int Offsets::ObjName = 0x2BE4; // 12.2 +int Offsets::ObjLvl = 0x339C; // 12.2 +int Offsets::ObjExpiry = 0x298; // Unknown +int Offsets::ObjCrit = 0x12E0; // 12.2 +int Offsets::ObjCritMulti = 0x12D0; // Unknown +int Offsets::ObjAbilityPower = 0x1788; // 12.2 +int Offsets::ObjAtkSpeedMulti = 0x12B8; // Unknown +int Offsets::ObjAtkRange = 0x1304; // 12.2 +int Offsets::ObjTargetable = 0xD1C; // 12.2 +int Offsets::ObjInvulnerable = 0x3EC; // 12.2 +int Offsets::ObjIsMoving = 0x3638; // Unknown +int Offsets::ObjDirection = 0x1B88; // Unknown +int Offsets::ObjItemList = 0x3478; // 0x3478; // 12.2? // 0x33D0; // 12.2? +int Offsets::ObjExperience = 0x338C; // 12.2 +int Offsets::ObjMagicPen = 0x11DC; // Unknown +int Offsets::ObjMagicPenMulti = 0x11E4; // Unknown +int Offsets::ObjAdditionalApMulti = 0x1248; //11.20 +int Offsets::ObjManaRegen = 0x1150; // 12.2 +int Offsets::ObjHealthRegen = 0x12F8; // 12.2 +int Offsets::ObjCurrentGold = 0x1B98; // 12.2 +int Offsets::ObjGoldTotal = 0x1BA8; // 12.2 + +// MOSTLY CORRECT! +int Offsets::SpellSlotLevel = 0x20; // 12.2 +int Offsets::SpellSlotTime = 0x28; // 12.2 +int Offsets::SpellSlotCharges = 0x58; // 12.2 +int Offsets::SpellSlotTimeCharge = 0x78; // 12.2 +int Offsets::SpellSlotDamage = 0xA0; // 12.2 +int Offsets::SpellSlotSpellInfo = 0x13C; // // 12.2 +int Offsets::SpellInfoSpellData = 0x44; // 12.2 +int Offsets::SpellDataSpellName = 0x6C; // 12.2 +int Offsets::SpellDataMissileName = 0x6C; // 12.2 +int Offsets::SpellSlotSmiteTimer = 0x64; // 12.2 +int Offsets::SpellSlotSmiteCharges = 0x5c; // 12.2 + +// CORRECT! +int Offsets::MissileSpellInfo = 0x278; // 12.2 +int Offsets::MissileSrcIdx = 0x2DC; // 12.2 +int Offsets::MissileDestIdx = 0x334; // 12.2 +int Offsets::MissileStartPos = 0x2F4; // 12.2 +int Offsets::MissileEndPos = 0x300; // 12.2 + +// UNKNOWN! +int Offsets::ItemListItem = 0xC; +int Offsets::ItemInfo = 0x20; +int Offsets::ItemInfoId = 0x68; + +// AI Manager +int Offsets::CurrentDashSpeed = 0x1D0; +int Offsets::IsDashing = 0x398; +int Offsets::DashPos = 0x1FC; +int Offsets::IsMoving = 0x198; +int Offsets::NavBegin = 0x1BC; +int Offsets::NavEnd = 0x1C0; + +// Renderer +int Offsets::RendererWidth = 0xC; +int Offsets::RendererHeight = 0x10; + +int Offsets::ObjectMapCount = 0x2C; // 12.2 +int Offsets::ObjectMapRoot = 0x28; // 12.2 +int Offsets::ObjectMapNodeNetId = 0x10; // 12.2 +int Offsets::ObjectMapNodeObject = 0x14; // 12.2 + +// Minimap +int Offsets::MinimapObject = 0x30F1D94; // 12.2 +int Offsets::MinimapObjectHud = 0x110; +int Offsets::MinimapHudPos = 0x44; +int Offsets::MinimapHudSize = 0x4C; +*/ + +/* +// v11.23 (Mixture of 11.21 and 11.23 perhaps?) +#include "Offsets.h" + +Offsets::Offsets() {}; + +int Offsets::GameTime = 0x3101384; //updated +int Offsets::ObjectManager = 0x186CD20; //updated +int Offsets::LocalPlayer = 0x310990C; //updated +int Offsets::UnderMouseObject = 0x182B0E8; //updated +//int Offsets::ZoomClass = 0x30F02BC; // updated +//int Offsets::Chat = 0x3109EF0; //updated +int Offsets::ViewProjMatrices = 0x31322A8; //updatede +int Offsets::Renderer = 0x03135148; //updated + +int Offsets::ObjIndex = 0x20; +int Offsets::ObjTeam = 0x4C; +int Offsets::ObjMissileName = 0x6C; +int Offsets::ObjNetworkID = 0xCC; +int Offsets::ObjPos = 0x1F4; //11.21 +int Offsets::ObjMissileSpellCast = 0x250; +int Offsets::ObjVisibility = 0x28C; +int Offsets::ObjSpawnCount = 0x2A0; +int Offsets::ObjSrcIndex = 0x02AC; +int Offsets::ObjMana = 0x2B4; //currect +int Offsets::ObjMaxMana = 0x2C4; //currect +int Offsets::ObjRecallState = 0xD90; //currect +int Offsets::ObjHealth = 0xDB4; //11.21 +int Offsets::ObjMaxHealth = 0xDC4; //11.21 +int Offsets::ObjAbilityHaste = 0x110C; //11.21 +int Offsets::ObjLethality = 0x11F8; //11.21 +int Offsets::ObjArmor = 0x12E4; //11.21 +int Offsets::ObjBonusArmor = 0x12E8; //11.21 +int Offsets::ObjMagicRes = 0x12EC; //11.21 +int Offsets::ObjBonusMagicRes = 0x12F0; //11.21 +int Offsets::ObjBaseAtk = 0x12BC; //11.21 +int Offsets::ObjBonusAtk = 0x1234; //11.21 +int Offsets::ObjMoveSpeed = 0x12FC; //11.21 +int Offsets::ObjSpellBook = 0x27f8;//11.21 +int Offsets::ObjTransformation = 0x3040; +int Offsets::ObjName = 0x2BE4;//11.21 +int Offsets::ObjLvl = 0x339C;//11.21 +int Offsets::ObjExpiry = 0x298; +int Offsets::ObjCrit = 0x12E0; //11.21 +int Offsets::ObjCritMulti = 0x12D0;//11.21 +int Offsets::ObjAbilityPower = 0x1788; //11.21 +int Offsets::ObjAtkSpeedMulti = 0x12B8; //11.20 +int Offsets::ObjAtkRange = 0x1304; //currect +int Offsets::ObjTargetable = 0xD1C;//11.21s +int Offsets::ObjInvulnerable = 0x3EC;//11.21 +int Offsets::ObjIsMoving = 0x3638; +int Offsets::ObjDirection = 0x1B88; +int Offsets::ObjItemList = 0x33C8; //11.20 +int Offsets::ObjExperience = 0x338C; //11.21 +int Offsets::ObjMagicPen = 0x11DC; //11.21 +int Offsets::ObjMagicPenMulti = 0x11E4; //11.21 +int Offsets::ObjAdditionalApMulti = 0x1248; //11.20 +int Offsets::ObjManaRegen = 0x1150; //11.21 +int Offsets::ObjHealthRegen = 0x12F8; //11.21 + + +// int Offsets::MaxZoom = 0x20; //always the same + + +// int Offsets::ChatIsOpen = 0x73C; //updated + +// int Offsets::SpellBookActiveSpellCast = 0x20; +// int Offsets::SpellBookSpellSlots = 0x478; + + +int Offsets::ObjBuffManager = 0x21B8;//0x21BC; +int Offsets::BuffManagerEntriesArray = 0x10; +int Offsets::BuffEntryBuff = 0x8; +int Offsets::BuffType = 0x4; +int Offsets::BuffEntryBuffStartTime = 0xC; +int Offsets::BuffEntryBuffEndTime = 0x10; +int Offsets::BuffEntryBuffCount = 0x74; +int Offsets::BuffEntryBuffCountAlt = 0x24; +int Offsets::BuffEntryBuffCountAlt2 = 0x20; +int Offsets::BuffName = 0x8; +int Offsets::BuffEntryBuffNodeStart = 0x20; +int Offsets::BuffEntryBuffNodeCurrent = 0x24; + + +//always the same +int Offsets::ItemListItem = 0xC; +int Offsets::ItemInfo = 0x20; +int Offsets::ItemInfoId = 0x68; + +//always the same +int Offsets::CurrentDashSpeed = 0x1D0; +int Offsets::IsDashing = 0x398; +int Offsets::DashPos = 0x1FC; +int Offsets::IsMoving = 0x198; +int Offsets::NavBegin = 0x1BC; +int Offsets::NavEnd = 0x1C0; + + +//never change +int Offsets::RendererWidth = 0xC; +int Offsets::RendererHeight = 0x10; + +//spellslots never change +int Offsets::SpellSlotLevel = 0x20; +int Offsets::SpellSlotTime = 0x28; +int Offsets::SpellSlotCharges = 0x58;//0x5C; +int Offsets::SpellSlotTimeCharge = 0x78;// 0x15; +int Offsets::SpellSlotDamage = 0xA0; +int Offsets::SpellSlotSpellInfo = 0x144; +int Offsets::SpellInfoSpellData = 0x44; +int Offsets::SpellDataSpellName = 0x6C; +int Offsets::SpellDataMissileName = 0x6C; +int Offsets::SpellSlotSmiteTimer = 0x64; +int Offsets::SpellSlotSmiteCharges = 0x5c; //0x58; + + +//these never change +int Offsets::ObjectMapCount = 0x2C; +int Offsets::ObjectMapRoot = 0x28; +int Offsets::ObjectMapNodeNetId = 0x10; +int Offsets::ObjectMapNodeObject = 0x14; + + + +//these never change +int Offsets::SpellCastSpellInfo = 0x8; +int Offsets::SpellCastStartTime = 0x544; +int Offsets::SpellCastStartTimeAlt = 0x534; +int Offsets::SpellCastCastTime = 0x4C0; +int Offsets::SpellCastStart = 0x80; +int Offsets::SpellCastEnd = 0x8C; +int Offsets::SpellCastSrcIdx = 0x68; +int Offsets::SpellCastDestIdx = 0xC0; + + +//updated 11.21 +int Offsets::MissileSpellInfo = 0x278; +int Offsets::MissileSrcIdx = 0x2DC; +int Offsets::MissileDestIdx = 0x310; +int Offsets::MissileStartPos = 0x2F4;//0x2F4; +int Offsets::MissileEndPos = 0x300; + +int Offsets::MinimapObject = 0x30F88B8; +int Offsets::MinimapObjectHud = 0x10c; +int Offsets::MinimapHudPos = 0x44; +int Offsets::MinimapHudSize = 0x4C; + + +// not in use, no need of updating +int Offsets::AiManagerStartPath = 0x1e4; +int Offsets::AiManagerEndPath = 0x1e8; +int Offsets::AiManagerTargetPosition = 0x10; +int Offsets::AiManagerIsMoving = 0x1c0; +int Offsets::AiManagerIsDashing = 0x3c0; +int Offsets::AiManagerCurrentSegment = 0x1c4; +int Offsets::AiManagerDashSpeed = 0x1f8; +*/ + +/* +// v11.21 +#include "Offsets.h" + +int Offsets::GameTime = 0x30F0384; //updated +int Offsets::ObjectManager = 0x185C01C; //updated +int Offsets::LocalPlayer = 0x30F88DC; //updated +int Offsets::UnderMouseObject = 0x30D3CB8; //not updated +//int Offsets::ZoomClass = 0x30F02BC; // updated +//int Offsets::Chat = 0x30E14A0; //not updated +int Offsets::ViewProjMatrices = 0x311EFC8; //updatede +int Offsets::Renderer = 0x3121DA8; //updated + + + +int Offsets::ObjIndex = 0x20; +int Offsets::ObjTeam = 0x4C; +int Offsets::ObjMissileName = 0x6C; +int Offsets::ObjNetworkID = 0xCC; +int Offsets::ObjPos = 0x1F4; //11.21 +int Offsets::ObjMissileSpellCast = 0x250; +int Offsets::ObjVisibility = 0x28C; +int Offsets::ObjSpawnCount = 0x2A0; +int Offsets::ObjSrcIndex = 0x02AC; +int Offsets::ObjMana = 0x2B4; //currect +int Offsets::ObjMaxMana = 0x2C4; //currect +int Offsets::ObjRecallState = 0xD90; //currect +int Offsets::ObjHealth = 0xDB4; //11.21 +int Offsets::ObjMaxHealth = 0xDC4; //11.21 +int Offsets::ObjAbilityHaste = 0x110C; //11.21 +int Offsets::ObjLethality = 0x11F8; //11.21 +int Offsets::ObjArmor = 0x12E4; //11.21 +int Offsets::ObjBonusArmor = 0x12E8; //11.21 +int Offsets::ObjMagicRes = 0x12EC; //11.21 +int Offsets::ObjBonusMagicRes = 0x12F0; //11.21 +int Offsets::ObjBaseAtk = 0x12BC; //11.21 +int Offsets::ObjBonusAtk = 0x1234; //11.21 +int Offsets::ObjMoveSpeed = 0x12FC; //11.21 +int Offsets::ObjSpellBook = 0x27f8;//11.21 +int Offsets::ObjTransformation = 0x3040; +int Offsets::ObjName = 0x2BE4; //11.21 +int Offsets::ObjLvl = 0x339C; //11.21 +int Offsets::ObjExpiry = 0x298; +int Offsets::ObjCrit = 0x12E0; //11.21 +int Offsets::ObjCritMulti = 0x12D0; //11.21 +int Offsets::ObjAbilityPower = 0x1244; //11.21 +int Offsets::ObjAtkSpeedMulti = 0x128C; //11.20 +int Offsets::ObjAtkRange = 0x1304; //currect +int Offsets::ObjTargetable = 0xD1C; //11.21s +int Offsets::ObjInvulnerable = 0x3EC; //11.21 + +int Offsets::ObjIsMoving = 0x3638; +int Offsets::ObjIsDashing = 0x3638 + (0x398 - 0x198); + +int Offsets::ObjDirection = 0x1B88; +int Offsets::ObjItemList = 0x3700; //11.20 +int Offsets::ObjExperience = 0x338C; //11.21 +int Offsets::ObjMagicPen = 0x11DC; //11.21 +int Offsets::ObjMagicPenMulti = 0x11E4; //11.21 +int Offsets::ObjAdditionalApMulti = 0x1248; //11.20 +int Offsets::ObjManaRegen = 0x1150; //11.21 +int Offsets::ObjHealthRegen = 0x12F8; //11.21 + + +//int Offsets::MaxZoom = 0x20; //always the same + + +//int Offsets::ChatIsOpen = 0x06A4; //not updated + +//int Offsets::SpellBookActiveSpellCast = 0x20; +//int Offsets::SpellBookSpellSlots = 0x478; + +// +int Offsets::ObjBuffManager = 0x21B8;//0x21BC; +int Offsets::BuffManagerEntriesArray = 0x10; +int Offsets::BuffEntryBuff = 0x8; +int Offsets::BuffType = 0x4; +int Offsets::BuffEntryBuffStartTime = 0xC; +int Offsets::BuffEntryBuffEndTime = 0x10; +int Offsets::BuffEntryBuffCount = 0x74; +int Offsets::BuffEntryBuffCountAlt = 0x24; +int Offsets::BuffEntryBuffCountAlt2 = 0x20; +int Offsets::BuffName = 0x8; +int Offsets::BuffEntryBuffNodeStart = 0x20; +int Offsets::BuffEntryBuffNodeCurrent = 0x24; +// + +//always the same +int Offsets::ItemListItem = 0xC; +int Offsets::ItemInfo = 0x20; +int Offsets::ItemInfoId = 0x68; + +//always the same +//int Offsets::CurrentDashSpeed = 0x1D0; +//int Offsets::IsDashing = 0x398; +//int Offsets::DashPos = 0x1FC; +//int Offsets::IsMoving = 0x198; +//int Offsets::NavBegin = 0x1BC; +//int Offsets::NavEnd = 0x1C0; + + +//never change +int Offsets::RendererWidth = 0xC; +int Offsets::RendererHeight = 0x10; + +//spellslots never change +int Offsets::SpellSlotLevel = 0x20; +int Offsets::SpellSlotTime = 0x28; +int Offsets::SpellSlotCharges = 0x58; // Additional +int Offsets::SpellSlotTimeCharge = 0x78; // Additional +int Offsets::SpellSlotDamage = 0xA0; +int Offsets::SpellSlotSpellInfo = 0x144; +int Offsets::SpellInfoSpellData = 0x44; +int Offsets::SpellDataSpellName = 0x6C; +int Offsets::SpellDataMissileName = 0x6C; +int Offsets::SpellSlotSmiteTimer = 0x64; // Additional +int Offsets::SpellSlotSmiteCharges = 0x5c; // Additional + + +//these never change +int Offsets::ObjectMapCount = 0x2C; +int Offsets::ObjectMapRoot = 0x28; +int Offsets::ObjectMapNodeNetId = 0x10; +int Offsets::ObjectMapNodeObject = 0x14; + + +//these never change +//int Offsets::SpellCastSpellInfo = 0x8; +//int Offsets::SpellCastStartTime = 0x544; +//int Offsets::SpellCastStartTimeAlt = 0x534; +//int Offsets::SpellCastCastTime = 0x4C0; +//int Offsets::SpellCastStart = 0x80; +//int Offsets::SpellCastEnd = 0x8C; +//int Offsets::SpellCastSrcIdx = 0x68; +//int Offsets::SpellCastDestIdx = 0xC0; + + +//updated 11.21 +int Offsets::MissileSpellInfo = 0x278; +int Offsets::MissileSrcIdx = 0x2DC; +int Offsets::MissileDestIdx = 0x310; +int Offsets::MissileStartPos = 0x2F4; +int Offsets::MissileEndPos = 0x300; + +int Offsets::MinimapObject = 0x30E13B0; +int Offsets::MinimapObjectHud = 0x10c; +int Offsets::MinimapHudPos = 0x44; +int Offsets::MinimapHudSize = 0x4C; +*/ + +/* +// not in use, no need of updating +int Offsets::AiManagerStartPath = 0x1e4; +int Offsets::AiManagerEndPath = 0x1e8; +int Offsets::AiManagerTargetPosition = 0x10; +int Offsets::AiManagerIsMoving = 0x1c0; +int Offsets::AiManagerIsDashing = 0x3c0; +int Offsets::AiManagerCurrentSegment = 0x1c4; +int Offsets::AiManagerDashSpeed = 0x1f8; +*/ + +/* + +#include "Offsets.h" + +Offsets::Offsets() {}; + +int Offsets::GameTime = 0x31047C4; +int Offsets::ObjectManager = 0x187015C; +int Offsets::LocalPlayer = 0x310D250; +int Offsets::UnderMouseObject = 0x30D3CB8; //outdated +int Offsets::ZoomClass = 0x31046FC; +int Offsets::Chat = 0x311471C; +int Offsets::ViewProjMatrices = 0x3134D58; +int Offsets::Renderer = 0x3137BF8; + +int Offsets::ObjIndex = 0x20; +int Offsets::ObjTeam = 0x4C; +int Offsets::ObjMissileName = 0x6C; +int Offsets::ObjNetworkID = 0xCC; +int Offsets::ObjPos = 0x1F4; +int Offsets::ObjMissileSpellCast = 0x250; +int Offsets::ObjVisibility = 0x28C; +int Offsets::ObjSpawnCount = 0x2A0; +int Offsets::ObjSrcIndex = 0x02AC; +int Offsets::ObjMana = 0x2B4; +int Offsets::ObjMaxMana = 0x2C4; +int Offsets::ObjRecallState = 0xD90; +int Offsets::ObjHealth = 0xDB4; +int Offsets::ObjMaxHealth = 0xDC4; +int Offsets::ObjAbilityHaste = 0x110C; +int Offsets::ObjLethality = 0x11F8; +int Offsets::ObjArmor = 0x12E4; +int Offsets::ObjBonusArmor = 0x12E8; +int Offsets::ObjMagicRes = 0x12EC; +int Offsets::ObjBonusMagicRes = 0x12F0; +int Offsets::ObjBaseAtk = 0x12BC; +int Offsets::ObjBonusAtk = 0x1234; +int Offsets::ObjMoveSpeed = 0x12FC; +int Offsets::ObjSpellBook = 0x27e4; +int Offsets::ObjTransformation = 0x3040; +int Offsets::ObjName = 0x2BE4; +int Offsets::ObjLvl = 0x33c4; +int Offsets::ObjExpiry = 0x298; +int Offsets::ObjCrit = 0x12E0; +int Offsets::ObjCritMulti = 0x12D0; +int Offsets::ObjAbilityPower = 0x1244; +int Offsets::ObjAtkSpeedMulti = 0x128C; +int Offsets::ObjAtkRange = 0x1304; +int Offsets::ObjTargetable = 0xD1C; +int Offsets::ObjInvulnerable = 0x3EC; +int Offsets::ObjIsMoving = 0x3638; +int Offsets::ObjDirection = 0x1B88; +int Offsets::ObjItemList = 0x33C8; +int Offsets::ObjExpierience = 0x338C; +int Offsets::ObjMagicPen = 0x11DC; +int Offsets::ObjMagicPenMulti = 0x11E4; +int Offsets::ObjAdditionalApMulti = 0x1248; +int Offsets::ObjManaRegen = 0x1150; +int Offsets::ObjHealthRegen = 0x12F8; + + +int Offsets::MaxZoom = 0x20; //always the same +int Offsets::ChatIsOpen = 0x06A4; //not updated + +int Offsets::SpellBookActiveSpellCast = 0x20; +int Offsets::SpellBookSpellSlots = 0x478; + +int Offsets::ObjBuffManager = 0x21C8; +int Offsets::BuffManagerEntriesArray = 0x10; +int Offsets::BuffEntryBuff = 0x8; +int Offsets::BuffType = 0x4; +int Offsets::BuffEntryBuffStartTime = 0xC; +int Offsets::BuffEntryBuffEndTime = 0x10; +int Offsets::BuffEntryBuffCount = 0x74; +int Offsets::BuffEntryBuffCountAlt = 0x24; +int Offsets::BuffEntryBuffCountAlt2 = 0x20; +int Offsets::BuffName = 0x8; +int Offsets::BuffEntryBuffNodeStart = 0x20; +int Offsets::BuffEntryBuffNodeCurrent = 0x24; + +//always the same +int Offsets::ItemListItem = 0xC; +int Offsets::ItemInfo = 0x20; +int Offsets::ItemInfoId = 0x68; + +//always the same +int Offsets::CurrentDashSpeed = 0x1D0; +int Offsets::IsDashing = 0x398; +int Offsets::DashPos = 0x1FC; +int Offsets::IsMoving = 0x198; +int Offsets::NavBegin = 0x1BC; +int Offsets::NavEnd = 0x1C0; + + +//never change +int Offsets::RendererWidth = 0xC; +int Offsets::RendererHeight = 0x10; + +//spellslots never change +int Offsets::SpellSlotLevel = 0x20; +int Offsets::SpellSlotTime = 0x28; +int Offsets::SpellSlotCharges = 0x58; +int Offsets::SpellSlotTimeCharge = 0x78; +int Offsets::SpellSlotDamage = 0xA0; +int Offsets::SpellSlotSpellInfo = 0x144; +int Offsets::SpellInfoSpellData = 0x44; +int Offsets::SpellDataSpellName = 0x6C; +int Offsets::SpellDataMissileName = 0x6C; +int Offsets::SpellSlotSmiteTimer = 0x64; +int Offsets::SpellSlotSmiteCharges = 0x5c; //0x58; + + +//these never change +int Offsets::ObjectMapCount = 0x2C; +int Offsets::ObjectMapRoot = 0x28; +int Offsets::ObjectMapNodeNetId = 0x10; +int Offsets::ObjectMapNodeObject = 0x14; + + +//these never change +int Offsets::SpellCastSpellInfo = 0x8; +int Offsets::SpellCastStartTime = 0x544; +int Offsets::SpellCastStartTimeAlt = 0x534; +int Offsets::SpellCastCastTime = 0x4C4; +int Offsets::SpellCastStart = 0x84; +int Offsets::SpellCastEnd = 0x90; +int Offsets::SpellCastSrcIdx = 0x68; +int Offsets::SpellCastDestIdx = 0xC0; + + +//updated 11.21 +int Offsets::MissileSpellInfo = 0x278; +int Offsets::MissileSrcIdx = 0x2DC; +int Offsets::MissileDestIdx = 0x310; +int Offsets::MissileStartPos = 0x2F4; +int Offsets::MissileEndPos = 0x300; + +int Offsets::MinimapObject = 0x30E13B0; +int Offsets::MinimapObjectHud = 0x10c; +int Offsets::MinimapHudPos = 0x44; +int Offsets::MinimapHudSize = 0x4C; + + +// not in use, no need of updating +int Offsets::AiManagerStartPath = 0x1e4; +int Offsets::AiManagerEndPath = 0x1e8; +int Offsets::AiManagerTargetPosition = 0x10; +int Offsets::AiManagerIsMoving = 0x1c0; +int Offsets::AiManagerIsDashing = 0x3c0; +int Offsets::AiManagerCurrentSegment = 0x1c4; +int Offsets::AiManagerDashSpeed = 0x1f8; +*/ \ No newline at end of file diff --git a/LView/Offsets.h b/LView/Offsets.h index ddd661a5..4d90ac86 100644 --- a/LView/Offsets.h +++ b/LView/Offsets.h @@ -11,19 +11,28 @@ class Offsets { static int ObjIndex; static int ObjTeam; + static int ObjMissileName; // Additional static int ObjNetworkID; static int ObjPos; + static int ObjMissileSpellCast; // Additional static int ObjVisibility; static int ObjSpawnCount; static int ObjHealth; static int ObjMaxHealth; + static int ObjAbilityHaste; // Additional + static int ObjLethality; // Additional static int ObjMana; + static int ObjMaxMana; // Additional + static int ObjRecallState; // Additional static int ObjArmor; + static int ObjBonusArmor; // Additional static int ObjMagicRes; + static int ObjBonusMagicRes; // Additional static int ObjBaseAtk; static int ObjBonusAtk; static int ObjMoveSpeed; static int ObjSpellBook; + static int ObjTransformation; // Additional static int ObjName; static int ObjLvl; static int ObjExpiry; @@ -31,36 +40,34 @@ class Offsets { static int ObjCritMulti; static int ObjAbilityPower; static int ObjAtkSpeedMulti; + static int ObjAtkRange; // Additional + static int ObjTargetable; // Additional + static int ObjInvulnerable; // Additional + static int ObjIsMoving; // Additional + static int ObjIsDashing; // Additional + static int ObjDirection; // Additional static int ObjItemList; - static int ObjSrcIndex; - - static int ObjMissileName; - static int ObjMissileSpellCast; - static int ObjMaxMana; - static int ObjRecallState; - static int ObjAbilityHaste; - static int ObjLethality; - static int ObjBonusArmor; - static int ObjBonusMagicRes; - static int ObjTransformation; - static int ObjAtkRange; - static int ObjExperience; - static int ObjMagicPen; - static int ObjMagicPenMulti; - static int ObjAdditionalApMulti; - static int ObjManaRegen; - static int ObjHealthRegen; + static int ObjExperience; // Additional + static int ObjMagicPen; // Additional + static int ObjMagicPenMulti; // Additional + static int ObjAdditionalApMulti; // Additional // 11.20 + static int ObjManaRegen; // Additional + static int ObjHealthRegen; // Additional static int ObjCurrentGold; static int ObjGoldTotal; - static int ObjTargetable; - static int ObjInvulnerable; - static int ObjIsMoving; - static int ObjDirection; + static int ObjSrcIndex; static int ItemListItem; static int ItemInfo; static int ItemInfoId; + static int CurrentDashSpeed; // Additional + static int IsDashing; // Additional + static int DashPos; // Additional + static int IsMoving; // Additional + static int NavBegin; // Additional + static int NavEnd; // Additional + static int ViewProjMatrices; static int Renderer; static int RendererWidth; @@ -68,11 +75,15 @@ class Offsets { static int SpellSlotLevel; static int SpellSlotTime; + static int SpellSlotCharges; // Additional + static int SpellSlotTimeCharge; // Additional static int SpellSlotDamage; static int SpellSlotSpellInfo; static int SpellInfoSpellData; static int SpellDataSpellName; static int SpellDataMissileName; + static int SpellSlotSmiteTimer; // Additional + static int SpellSlotSmiteCharges; // Additional static int ObjectManager; static int LocalPlayer; diff --git a/LView/Overlay.cpp b/LView/Overlay.cpp_ similarity index 100% rename from LView/Overlay.cpp rename to LView/Overlay.cpp_ diff --git a/LView/Overlay.h b/LView/Overlay.h deleted file mode 100644 index 803048e9..00000000 --- a/LView/Overlay.h +++ /dev/null @@ -1,90 +0,0 @@ -#pragma once -#include "Structs.h" -#include "LeagueMemoryReader.h" - -#include -#include -#include - -#include "windows.h" -#include "imgui.h" -#include "imgui_impl_dx11.h" -#include "imgui_impl_win32.h" - -#include -#include "Python.h" - -#include "ConfigSet.h" -#include "ScriptManager.h" -#include "PyGame.h" - -#include -#include -#include -#include - -#include "PyImguiInterface.h" - -using namespace std::chrono; -using namespace boost::python; - -/// Manages the overlay of the cheat. Also manages the executing scripts. -class Overlay { - -public: - Overlay(); - void Init(); - void GameStart(MemSnapshot& memSnapshot); - - void StartFrame(); - void Update(MemSnapshot& memSnapshot); - void RenderFrame(); - - bool IsVisible(); - void Hide(); - void Show(); - void ToggleTransparent(); - - static ID3D11Device* GetDxDevice(); - -private: - void DrawUI(PyGame& state, MemSnapshot& memSnapshot); - void ExecScripts(PyGame& state); - - void DrawOverlayWindows(PyGame& state); - void DrawScriptSettings(PyGame& state, MemSnapshot& memSnapshot); - void DrawBenchmarks(MemSnapshot& memSnapshot); - - void DrawScriptError(std::shared_ptr