trainerbase 3.16.1__tar.gz → 3.16.3__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.
Files changed (33) hide show
  1. {trainerbase-3.16.1 → trainerbase-3.16.3}/PKG-INFO +3 -3
  2. {trainerbase-3.16.1 → trainerbase-3.16.3}/pyproject.toml +4 -4
  3. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/gui/teleport.py +6 -0
  4. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/main.py +2 -2
  5. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/process.py +3 -14
  6. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/scriptengine.py +4 -1
  7. {trainerbase-3.16.1 → trainerbase-3.16.3}/LICENSE +0 -0
  8. {trainerbase-3.16.1 → trainerbase-3.16.3}/README.md +0 -0
  9. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/__init__.py +0 -0
  10. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/codeinjection.py +0 -0
  11. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/common/__init__.py +0 -0
  12. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/common/abc.py +0 -0
  13. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/common/helpers.py +0 -0
  14. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/common/keyboard.py +0 -0
  15. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/common/rainbow.py +0 -0
  16. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/common/teleport.py +0 -0
  17. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/config.py +0 -0
  18. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/gameobject.py +0 -0
  19. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/gui/__init__.py +0 -0
  20. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/gui/helpers.py +0 -0
  21. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/gui/injections.py +0 -0
  22. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/gui/misc.py +0 -0
  23. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/gui/objects.py +0 -0
  24. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/gui/rainbow.py +0 -0
  25. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/gui/scripts.py +0 -0
  26. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/gui/speedhack.py +0 -0
  27. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/gui/types.py +0 -0
  28. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/memory.py +0 -0
  29. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/speedhack.py +0 -0
  30. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase/tts.py +0 -0
  31. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase_vendor/FASM.EXE +0 -0
  32. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase_vendor/speedhack32.dll +0 -0
  33. {trainerbase-3.16.1 → trainerbase-3.16.3}/trainerbase_vendor/speedhack64.dll +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: trainerbase
3
- Version: 3.16.1
3
+ Version: 3.16.3
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,10 +12,10 @@ 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 (>=5.9.8,<6.0.0)
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
- Requires-Dist: pyttsx3 (>=2.90,<3.0)
18
+ Requires-Dist: pyttsx3 (>=2.91,<3.0)
19
19
  Project-URL: Repository, https://gitlab.com/python-trainers/trainer-base
20
20
  Description-Content-Type: text/markdown
21
21
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "trainerbase"
3
- version = "3.16.1"
3
+ version = "3.16.3"
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.4.10"
20
+ ruff = "^0.5.7"
21
21
 
22
22
  [tool.ruff]
23
23
  src = ["trainerbase"]
@@ -51,9 +51,9 @@ python = "^3.12"
51
51
  pymem = "^1.13.1"
52
52
  dearpygui = "^1.11.1"
53
53
  keyboard = "^0.13.5"
54
- pyttsx3 = "^2.90"
54
+ pyttsx3 = "^2.91"
55
55
  pyinjector = "^1.3.0"
56
- psutil = "^5.9.8"
56
+ psutil = "^6.0.0"
57
57
 
58
58
  [build-system]
59
59
  requires = ["poetry-core"]
@@ -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
 
@@ -7,7 +7,7 @@ from trainerbase.codeinjection import safely_eject_all_code_injections
7
7
  from trainerbase.common.rainbow import gradient_updater
8
8
  from trainerbase.gameobject import update_frozen_objects
9
9
  from trainerbase.gui.objects import update_displayed_objects
10
- from trainerbase.process import show_message_and_shutdown_if_process_exited
10
+ from trainerbase.process import shutdown_if_process_exited
11
11
  from trainerbase.scriptengine import (
12
12
  Script,
13
13
  process_healthcheck_script_engine,
@@ -52,7 +52,7 @@ def run( # pylint: disable=too-complex
52
52
 
53
53
  system_script_engine.register_script(Script(update_frozen_objects, enabled=True))
54
54
  system_script_engine.register_script(Script(update_displayed_objects, enabled=True))
55
- process_healthcheck_script_engine.register_script(Script(show_message_and_shutdown_if_process_exited, enabled=True))
55
+ process_healthcheck_script_engine.register_script(Script(shutdown_if_process_exited, enabled=True))
56
56
  rainbow_script_engine.register_script(Script(gradient_updater, enabled=True))
57
57
 
58
58
  try:
@@ -6,8 +6,6 @@ from typing import cast
6
6
  from psutil import pid_exists
7
7
  from pymem import Pymem
8
8
  from pymem.exception import ProcessNotFound
9
- from win32api import MessageBox
10
- from win32con import MB_ICONERROR, MB_OK
11
9
 
12
10
  from trainerbase.config import pymem_config
13
11
 
@@ -38,18 +36,9 @@ def attach_to_process() -> Pymem:
38
36
  force_exit(0)
39
37
 
40
38
 
41
- def show_message_and_shutdown_if_process_exited():
42
- if pid_exists(cast(int, _pm.process_id)):
43
- return
44
-
45
- MessageBox(
46
- None,
47
- "Shut down trainer?",
48
- "Process Exited!",
49
- MB_ICONERROR | MB_OK,
50
- )
51
-
52
- force_exit(0)
39
+ def shutdown_if_process_exited():
40
+ if not pid_exists(cast(int, _pm.process_id)):
41
+ force_exit(0)
53
42
 
54
43
 
55
44
  _pm = attach_to_process()
@@ -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
- self.thread.join()
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