trainerbase 3.16.0__tar.gz → 3.16.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {trainerbase-3.16.0 → trainerbase-3.16.2}/PKG-INFO +2 -2
- {trainerbase-3.16.0 → trainerbase-3.16.2}/pyproject.toml +3 -3
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/common/rainbow.py +0 -3
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/gui/helpers.py +4 -1
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/gui/teleport.py +6 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/main.py +10 -5
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/scriptengine.py +4 -1
- {trainerbase-3.16.0 → trainerbase-3.16.2}/LICENSE +0 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/README.md +0 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/__init__.py +0 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/codeinjection.py +0 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/common/__init__.py +0 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/common/abc.py +0 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/common/helpers.py +0 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/common/keyboard.py +0 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/common/teleport.py +0 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/config.py +0 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/gameobject.py +0 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/gui/__init__.py +0 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/gui/injections.py +0 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/gui/misc.py +0 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/gui/objects.py +0 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/gui/rainbow.py +0 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/gui/scripts.py +0 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/gui/speedhack.py +0 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/gui/types.py +0 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/memory.py +0 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/process.py +0 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/speedhack.py +0 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase/tts.py +0 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase_vendor/FASM.EXE +0 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase_vendor/speedhack32.dll +0 -0
- {trainerbase-3.16.0 → trainerbase-3.16.2}/trainerbase_vendor/speedhack64.dll +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: trainerbase
|
|
3
|
-
Version: 3.16.
|
|
3
|
+
Version: 3.16.2
|
|
4
4
|
Summary: Framework for creating game trainers/mods
|
|
5
5
|
Home-page: https://gitlab.com/python-trainers/trainer-base
|
|
6
6
|
License: MIT
|
|
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.12
|
|
13
13
|
Requires-Dist: dearpygui (>=1.11.1,<2.0.0)
|
|
14
14
|
Requires-Dist: keyboard (>=0.13.5,<0.14.0)
|
|
15
|
-
Requires-Dist: psutil (>=
|
|
15
|
+
Requires-Dist: psutil (>=6.0.0,<7.0.0)
|
|
16
16
|
Requires-Dist: pyinjector (>=1.3.0,<2.0.0)
|
|
17
17
|
Requires-Dist: pymem (>=1.13.1,<2.0.0)
|
|
18
18
|
Requires-Dist: pyttsx3 (>=2.90,<3.0)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "trainerbase"
|
|
3
|
-
version = "3.16.
|
|
3
|
+
version = "3.16.2"
|
|
4
4
|
description = "Framework for creating game trainers/mods"
|
|
5
5
|
authors = ["v01d <v01d@v01d.ru>", "doomayka <zd@doomayka.ru>"]
|
|
6
6
|
license = "MIT"
|
|
@@ -17,7 +17,7 @@ include = [
|
|
|
17
17
|
]
|
|
18
18
|
|
|
19
19
|
[tool.poetry.group.dev.dependencies]
|
|
20
|
-
ruff = "^0.
|
|
20
|
+
ruff = "^0.5.7"
|
|
21
21
|
|
|
22
22
|
[tool.ruff]
|
|
23
23
|
src = ["trainerbase"]
|
|
@@ -53,7 +53,7 @@ dearpygui = "^1.11.1"
|
|
|
53
53
|
keyboard = "^0.13.5"
|
|
54
54
|
pyttsx3 = "^2.90"
|
|
55
55
|
pyinjector = "^1.3.0"
|
|
56
|
-
psutil = "^
|
|
56
|
+
psutil = "^6.0.0"
|
|
57
57
|
|
|
58
58
|
[build-system]
|
|
59
59
|
requires = ["poetry-core"]
|
|
@@ -3,8 +3,6 @@ from itertools import cycle
|
|
|
3
3
|
|
|
4
4
|
from dearpygui import dearpygui as dpg
|
|
5
5
|
|
|
6
|
-
from trainerbase.scriptengine import Script, rainbow_script_engine
|
|
7
|
-
|
|
8
6
|
|
|
9
7
|
type TagList = list[int | str]
|
|
10
8
|
type Color = tuple[int, int, int]
|
|
@@ -91,4 +89,3 @@ class GradientUpdater:
|
|
|
91
89
|
|
|
92
90
|
|
|
93
91
|
gradient_updater = GradientUpdater()
|
|
94
|
-
rainbow_script_engine.register_script(Script(gradient_updater, enabled=True))
|
|
@@ -23,7 +23,7 @@ def simple_trainerbase_menu(
|
|
|
23
23
|
):
|
|
24
24
|
def menu_decorator(initializer: Callable[[], None]):
|
|
25
25
|
@wraps(initializer)
|
|
26
|
-
def run_menu_wrapper(on_initialized: Callable[[], None]):
|
|
26
|
+
def run_menu_wrapper(on_initialized: Callable[[], None], on_shutdown: Callable[[], None]):
|
|
27
27
|
dpg.create_context()
|
|
28
28
|
dpg.create_viewport(
|
|
29
29
|
title=window_title,
|
|
@@ -59,6 +59,9 @@ def simple_trainerbase_menu(
|
|
|
59
59
|
on_initialized()
|
|
60
60
|
|
|
61
61
|
dpg.start_dearpygui()
|
|
62
|
+
|
|
63
|
+
on_shutdown() # it's better to call it here, because after destroy_context it may not be possible
|
|
64
|
+
|
|
62
65
|
dpg.destroy_context()
|
|
63
66
|
|
|
64
67
|
return run_menu_wrapper
|
|
@@ -5,6 +5,7 @@ from typing import override
|
|
|
5
5
|
from dearpygui import dearpygui as dpg
|
|
6
6
|
from keyboard import add_hotkey
|
|
7
7
|
|
|
8
|
+
from trainerbase.common.helpers import suppress_memory_exceptions
|
|
8
9
|
from trainerbase.common.teleport import Teleport
|
|
9
10
|
from trainerbase.gui.helpers import add_components
|
|
10
11
|
from trainerbase.gui.objects import GameObjectUI
|
|
@@ -48,26 +49,31 @@ class TeleportUI(AbstractUIComponent):
|
|
|
48
49
|
|
|
49
50
|
dpg.add_button(label="Clip Coords", callback=self.on_clip_coords)
|
|
50
51
|
|
|
52
|
+
@suppress_memory_exceptions
|
|
51
53
|
def on_clip_coords(self):
|
|
52
54
|
dpg.set_clipboard_text(repr(self.tp.get_coords()))
|
|
53
55
|
|
|
56
|
+
@suppress_memory_exceptions
|
|
54
57
|
def on_hotkey_save_position_press(self, key: Hashable):
|
|
55
58
|
self.tp.save_position(key)
|
|
56
59
|
|
|
57
60
|
if self.tts_on_hotkey:
|
|
58
61
|
say("Position saved")
|
|
59
62
|
|
|
63
|
+
@suppress_memory_exceptions
|
|
60
64
|
def on_hotkey_set_saved_position_press(self, key: Hashable):
|
|
61
65
|
is_position_restored = self.tp.restore_saved_position(key)
|
|
62
66
|
|
|
63
67
|
if self.tts_on_hotkey:
|
|
64
68
|
say("Position restored" if is_position_restored else "Save position at first")
|
|
65
69
|
|
|
70
|
+
@suppress_memory_exceptions
|
|
66
71
|
def on_hotkey_dash_press(self):
|
|
67
72
|
self.tp.dash()
|
|
68
73
|
if self.tts_on_hotkey:
|
|
69
74
|
say("Dash!")
|
|
70
75
|
|
|
76
|
+
@suppress_memory_exceptions
|
|
71
77
|
def on_goto_label(self):
|
|
72
78
|
self.tp.goto(dpg.get_value(self.DPG_TAG_TELEPORT_LABELS))
|
|
73
79
|
|
|
@@ -4,6 +4,7 @@ from traceback import print_exc
|
|
|
4
4
|
from typing import NoReturn
|
|
5
5
|
|
|
6
6
|
from trainerbase.codeinjection import safely_eject_all_code_injections
|
|
7
|
+
from trainerbase.common.rainbow import gradient_updater
|
|
7
8
|
from trainerbase.gameobject import update_frozen_objects
|
|
8
9
|
from trainerbase.gui.objects import update_displayed_objects
|
|
9
10
|
from trainerbase.process import show_message_and_shutdown_if_process_exited
|
|
@@ -16,15 +17,18 @@ from trainerbase.scriptengine import (
|
|
|
16
17
|
from trainerbase.speedhack import SpeedHack
|
|
17
18
|
|
|
18
19
|
|
|
20
|
+
type Callback = Callable[[], None]
|
|
21
|
+
|
|
22
|
+
|
|
19
23
|
def run( # pylint: disable=too-complex
|
|
20
|
-
run_gui: Callable[[
|
|
21
|
-
on_gui_initialized_hook:
|
|
22
|
-
on_shutdown_hook:
|
|
24
|
+
run_gui: Callable[[Callback, Callback], None],
|
|
25
|
+
on_gui_initialized_hook: Callback | None = None,
|
|
26
|
+
on_shutdown_hook: Callback | None = None,
|
|
23
27
|
) -> NoReturn:
|
|
24
28
|
def on_shutdown() -> NoReturn:
|
|
29
|
+
rainbow_script_engine.stop()
|
|
25
30
|
system_script_engine.stop()
|
|
26
31
|
process_healthcheck_script_engine.stop()
|
|
27
|
-
rainbow_script_engine.stop()
|
|
28
32
|
|
|
29
33
|
safely_eject_all_code_injections()
|
|
30
34
|
SpeedHack.disable()
|
|
@@ -49,9 +53,10 @@ def run( # pylint: disable=too-complex
|
|
|
49
53
|
system_script_engine.register_script(Script(update_frozen_objects, enabled=True))
|
|
50
54
|
system_script_engine.register_script(Script(update_displayed_objects, enabled=True))
|
|
51
55
|
process_healthcheck_script_engine.register_script(Script(show_message_and_shutdown_if_process_exited, enabled=True))
|
|
56
|
+
rainbow_script_engine.register_script(Script(gradient_updater, enabled=True))
|
|
52
57
|
|
|
53
58
|
try:
|
|
54
|
-
run_gui(on_gui_initialized)
|
|
59
|
+
run_gui(on_gui_initialized, on_shutdown)
|
|
55
60
|
except Exception:
|
|
56
61
|
print_exc()
|
|
57
62
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from collections.abc import Callable
|
|
2
|
+
from contextlib import suppress
|
|
2
3
|
from sys import stderr
|
|
3
4
|
from threading import Thread
|
|
4
5
|
from time import sleep
|
|
@@ -34,7 +35,9 @@ class ScriptEngine:
|
|
|
34
35
|
|
|
35
36
|
def stop(self):
|
|
36
37
|
self.should_run = False
|
|
37
|
-
|
|
38
|
+
|
|
39
|
+
with suppress(RuntimeError):
|
|
40
|
+
self.thread.join()
|
|
38
41
|
|
|
39
42
|
def script_loop(self):
|
|
40
43
|
while self.should_run:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|