diff --git a/GameplayScripts/__pycache__/actor.cpython-39.pyc b/GameplayScripts/__pycache__/actor.cpython-39.pyc index 5ec4e3d..336af76 100644 Binary files a/GameplayScripts/__pycache__/actor.cpython-39.pyc and b/GameplayScripts/__pycache__/actor.cpython-39.pyc differ diff --git a/GameplayScripts/actor.py b/GameplayScripts/actor.py index f45748e..ca2b5ed 100644 --- a/GameplayScripts/actor.py +++ b/GameplayScripts/actor.py @@ -1,5 +1,9 @@ from lview import * +import math +import pandas as pd +import zerorpc + lview_script_info = { "script": "Actor", "author": "MiscellaneousStuff", @@ -15,5 +19,95 @@ def lview_save_cfg(cfg): 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): - pass \ No newline at end of file + 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/auto_smite.py b/GameplayScripts/spare/auto_smite.py similarity index 100% rename from GameplayScripts/auto_smite.py rename to GameplayScripts/spare/auto_smite.py diff --git a/GameplayScripts/auto_spell.py b/GameplayScripts/spare/auto_spell.py similarity index 100% rename from GameplayScripts/auto_spell.py rename to GameplayScripts/spare/auto_spell.py diff --git a/GameplayScripts/base_script.py b/GameplayScripts/spare/base_script.py similarity index 100% rename from GameplayScripts/base_script.py rename to GameplayScripts/spare/base_script.py diff --git a/GameplayScripts/champ_tracker.py b/GameplayScripts/spare/champ_tracker.py similarity index 100% rename from GameplayScripts/champ_tracker.py rename to GameplayScripts/spare/champ_tracker.py diff --git a/GameplayScripts/drawings.py b/GameplayScripts/spare/drawings.py similarity index 100% rename from GameplayScripts/drawings.py rename to GameplayScripts/spare/drawings.py diff --git a/GameplayScripts/execution_notifier.py b/GameplayScripts/spare/execution_notifier.py similarity index 100% rename from GameplayScripts/execution_notifier.py rename to GameplayScripts/spare/execution_notifier.py diff --git a/GameplayScripts/extractor.py b/GameplayScripts/spare/extractor.py similarity index 100% rename from GameplayScripts/extractor.py rename to GameplayScripts/spare/extractor.py diff --git a/GameplayScripts/map_awareness.py b/GameplayScripts/spare/map_awareness.py similarity index 100% rename from GameplayScripts/map_awareness.py rename to GameplayScripts/spare/map_awareness.py diff --git a/GameplayScripts/object_viewer.py b/GameplayScripts/spare/object_viewer.py similarity index 100% rename from GameplayScripts/object_viewer.py rename to GameplayScripts/spare/object_viewer.py diff --git a/GameplayScripts/orb_walker.py b/GameplayScripts/spare/orb_walker.py similarity index 100% rename from GameplayScripts/orb_walker.py rename to GameplayScripts/spare/orb_walker.py diff --git a/GameplayScripts/spell_tracker.py b/GameplayScripts/spare/spell_tracker.py similarity index 100% rename from GameplayScripts/spell_tracker.py rename to GameplayScripts/spare/spell_tracker.py diff --git a/GameplayScripts/tf_card_picker.py b/GameplayScripts/spare/tf_card_picker.py similarity index 100% rename from GameplayScripts/tf_card_picker.py rename to GameplayScripts/spare/tf_card_picker.py diff --git a/GameplayScripts/util_make_heightmap.py____ b/GameplayScripts/spare/util_make_heightmap.py____ similarity index 100% rename from GameplayScripts/util_make_heightmap.py____ rename to GameplayScripts/spare/util_make_heightmap.py____ diff --git a/GameplayScripts/vision_tracker.py b/GameplayScripts/spare/vision_tracker.py similarity index 100% rename from GameplayScripts/vision_tracker.py rename to GameplayScripts/spare/vision_tracker.py diff --git a/LView/config.ini b/LView/config.ini index 2096798..c9ad99e 100644 --- a/LView/config.ini +++ b/LView/config.ini @@ -7,6 +7,7 @@ Auto Spell::enabled=0 Auto Spell::target_jungle=1 Auto Spell::target_minions=1 Auto Spell::targeting_target=1 +Actor::enabled=1 Champion Tracker::enabled=0 Champion Tracker::seconds_to_track=15.000000 Drawings::attack_range=1 diff --git a/LView/imgui.ini b/LView/imgui.ini index fedf256..7dd160a 100644 --- a/LView/imgui.ini +++ b/LView/imgui.ini @@ -109,7 +109,7 @@ Size=569,442 Collapsed=0 [Window][LVIEW by leryss] -Pos=1184,126 +Pos=1204,124 Size=690,889 Collapsed=1