trainerbase 4.6.3__tar.gz → 4.6.5__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 (41) hide show
  1. {trainerbase-4.6.3 → trainerbase-4.6.5}/PKG-INFO +26 -26
  2. {trainerbase-4.6.3 → trainerbase-4.6.5}/README.md +1 -1
  3. {trainerbase-4.6.3 → trainerbase-4.6.5}/pyproject.toml +22 -19
  4. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/common/teleport.py +2 -2
  5. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/config.py +2 -1
  6. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/gui/objects.py +1 -1
  7. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/logger.py +19 -1
  8. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/speedhack.py +1 -1
  9. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/tts.py +6 -6
  10. {trainerbase-4.6.3/trainerbase_vendor → trainerbase-4.6.5/trainerbase/vendor}/FASM.EXE +0 -0
  11. trainerbase-4.6.3/.gitignore +0 -170
  12. trainerbase-4.6.3/LICENSE +0 -22
  13. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/__init__.py +0 -0
  14. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/abc.py +0 -0
  15. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/codeinjection.py +0 -0
  16. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/common/__init__.py +0 -0
  17. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/common/abc.py +0 -0
  18. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/common/helpers.py +0 -0
  19. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/common/keyboard.py +0 -0
  20. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/common/rainbow.py +0 -0
  21. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/common/tapper.py +0 -0
  22. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/gameobject.py +0 -0
  23. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/gui/__init__.py +0 -0
  24. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/gui/helpers.py +0 -0
  25. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/gui/injections.py +0 -0
  26. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/gui/misc.py +0 -0
  27. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/gui/rainbow.py +0 -0
  28. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/gui/scripts.py +0 -0
  29. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/gui/speedhack.py +0 -0
  30. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/gui/tapper.py +0 -0
  31. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/gui/teleport.py +0 -0
  32. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/gui/types.py +0 -0
  33. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/main.py +0 -0
  34. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/memory.py +0 -0
  35. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/process.py +0 -0
  36. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/py.typed +0 -0
  37. {trainerbase-4.6.3 → trainerbase-4.6.5}/trainerbase/scriptengine.py +0 -0
  38. {trainerbase-4.6.3/trainerbase_vendor → trainerbase-4.6.5/trainerbase/vendor}/big_logo.png +0 -0
  39. {trainerbase-4.6.3/trainerbase_vendor → trainerbase-4.6.5/trainerbase/vendor}/speedhack32.dll +0 -0
  40. {trainerbase-4.6.3/trainerbase_vendor → trainerbase-4.6.5/trainerbase/vendor}/speedhack64.dll +0 -0
  41. {trainerbase-4.6.3/trainerbase_vendor → trainerbase-4.6.5/trainerbase/vendor}/trainerbase.ico +0 -0
@@ -1,38 +1,38 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trainerbase
3
- Version: 4.6.3
3
+ Version: 4.6.5
4
4
  Summary: Framework for creating game trainers/mods
5
- Project-URL: Homepage, https://gitlab.com/python-trainers/
6
- Project-URL: Repository, https://gitlab.com/python-trainers/trainer-base
5
+ Author: v01d, doomayka
7
6
  Author-email: v01d <v01d@v01d.ru>, doomayka <zd@doomayka.ru>
8
7
  License-Expression: MIT
9
- License-File: LICENSE
10
- Classifier: Programming Language :: Python :: 3.13
11
8
  Classifier: Programming Language :: Python :: Implementation :: CPython
12
- Requires-Python: >=3.13
13
- Requires-Dist: dearpygui>=2.1.0
9
+ Classifier: Programming Language :: Python :: 3.14
10
+ Requires-Dist: dearpygui>=2.1.1
14
11
  Requires-Dist: keyboard>=0.13.5
15
12
  Requires-Dist: mouse>=0.7.1
16
- Requires-Dist: psutil>=7.0.0
17
- Requires-Dist: pydantic>=2.11.7
13
+ Requires-Dist: psutil>=7.1.3
14
+ Requires-Dist: pydantic>=2.12.5
18
15
  Requires-Dist: pymem>=1.14.0
19
16
  Requires-Dist: pyttsx3>=2.99
20
- Requires-Dist: trainerbase-injector>=1.0.0
17
+ Requires-Dist: trainerbase-injector>=1.0.1
18
+ Requires-Python: >=3.14
19
+ Project-URL: Homepage, https://gitlab.com/python-trainers/
20
+ Project-URL: Repository, https://gitlab.com/python-trainers/trainer-base
21
21
  Description-Content-Type: text/markdown
22
22
 
23
- # Trainer Base
24
-
25
- [![PyPI version](https://badge.fury.io/py/TrainerBase.svg)](https://badge.fury.io/py/TrainerBase)
26
- [![Downloads](https://static.pepy.tech/badge/trainerbase)](https://pepy.tech/project/trainerbase)
27
-
28
- ![Logo](./trainerbase_vendor/big_logo.png)
29
-
30
- ## To create project from template using cookiecutter
31
-
32
- ```bash
33
- cookiecutter https://gitlab.com/v01d-gl/basic-project-template.git --checkout trainerbase
34
- ```
35
-
36
- ## Examples
37
-
38
- [Python Trainers](https://gitlab.com/python-trainers)
23
+ # Trainer Base
24
+
25
+ [![PyPI version](https://badge.fury.io/py/TrainerBase.svg)](https://badge.fury.io/py/TrainerBase)
26
+ [![Downloads](https://static.pepy.tech/badge/trainerbase)](https://pepy.tech/project/trainerbase)
27
+
28
+ ![Logo](https://gitlab.com/python-trainers/trainer-base/-/raw/main/trainerbase/vendor/big_logo.png)
29
+
30
+ ## To create project from template using cookiecutter
31
+
32
+ ```bash
33
+ cookiecutter https://gitlab.com/v01d-gl/basic-project-template.git --checkout trainerbase
34
+ ```
35
+
36
+ ## Examples
37
+
38
+ [Python Trainers](https://gitlab.com/python-trainers)
@@ -3,7 +3,7 @@
3
3
  [![PyPI version](https://badge.fury.io/py/TrainerBase.svg)](https://badge.fury.io/py/TrainerBase)
4
4
  [![Downloads](https://static.pepy.tech/badge/trainerbase)](https://pepy.tech/project/trainerbase)
5
5
 
6
- ![Logo](./trainerbase_vendor/big_logo.png)
6
+ ![Logo](https://gitlab.com/python-trainers/trainer-base/-/raw/main/trainerbase/vendor/big_logo.png)
7
7
 
8
8
  ## To create project from template using cookiecutter
9
9
 
@@ -1,28 +1,28 @@
1
1
  [project]
2
2
  name = "trainerbase"
3
- version = "4.6.3"
3
+ version = "4.6.5"
4
4
  description = "Framework for creating game trainers/mods"
5
5
  license = "MIT"
6
6
  authors = [
7
7
  { name = "v01d", email = "v01d@v01d.ru" },
8
8
  { name = "doomayka", email = "zd@doomayka.ru" },
9
9
  ]
10
- requires-python = ">=3.13"
10
+ requires-python = ">=3.14"
11
11
  readme = "README.md"
12
12
  dependencies = [
13
- "dearpygui>=2.1.0",
13
+ "dearpygui>=2.1.1",
14
14
  "keyboard>=0.13.5",
15
15
  "mouse>=0.7.1",
16
- "psutil>=7.0.0",
17
- "pydantic>=2.11.7",
16
+ "psutil>=7.1.3",
17
+ "pydantic>=2.12.5",
18
18
  "pymem>=1.14.0",
19
19
  "pyttsx3>=2.99",
20
- "trainerbase-injector>=1.0.0",
20
+ "trainerbase-injector>=1.0.1",
21
21
  ]
22
22
 
23
23
  classifiers = [
24
24
  "Programming Language :: Python :: Implementation :: CPython",
25
- "Programming Language :: Python :: 3.13",
25
+ "Programming Language :: Python :: 3.14",
26
26
  ]
27
27
 
28
28
  [project.urls]
@@ -56,23 +56,26 @@ lines-after-imports = 2
56
56
  [tool.ruff.format]
57
57
  line-ending = "lf"
58
58
 
59
- [tool.hatch.build.targets.sdist]
60
- include = [
61
- "trainerbase/",
62
- "trainerbase_vendor/",
59
+ [tool.pyright]
60
+ include = ["trainerbase"]
61
+ typeCheckingMode = "standard"
62
+ pythonPlatform = "All"
63
+ pythonVersion = "3.14"
64
+ executionEnvironments = [
65
+ { root = ".", extraPaths = ["src"] }
63
66
  ]
64
67
 
65
- [tool.hatch.build.targets.wheel]
66
- include = [
67
- "trainerbase/",
68
- "trainerbase_vendor/",
69
- ]
68
+ [tool.uv.build-backend]
69
+ module-name = "trainerbase"
70
+ module-root = ""
70
71
 
71
72
  [build-system]
72
- requires = ["hatchling"]
73
- build-backend = "hatchling.build"
73
+ requires = ["uv_build>=0.9.16"]
74
+ build-backend = "uv_build"
74
75
 
75
76
  [dependency-groups]
76
77
  dev = [
77
- "ruff>=0.12.11",
78
+ "invoke>=2.2.1",
79
+ "pyright>=1.1.407",
80
+ "ruff>=0.14.8",
78
81
  ]
@@ -1,5 +1,5 @@
1
1
  from collections.abc import Hashable
2
- from itertools import repeat, starmap
2
+ from itertools import repeat
3
3
  from math import sqrt
4
4
  from operator import add, mul
5
5
  from typing import Self
@@ -40,7 +40,7 @@ class Vector3:
40
40
  elif not isinstance(other, self.__class__):
41
41
  raise TypeError(f"Can't apply function {function}. Wrong type: {type(other)}")
42
42
 
43
- return self.__class__(*starmap(function, zip(self, other, strict=False)))
43
+ return self.__class__(*map(function, self, other, strict=False))
44
44
 
45
45
  @classmethod
46
46
  def from_coords(cls, x1, y1, z1, x2, y2, z2) -> Self:
@@ -8,7 +8,7 @@ from pydantic import AliasChoices, BaseModel, Field
8
8
  CONFIG_FILE: Final[Path] = Path("./trainerbase.toml")
9
9
 
10
10
  DEFAULT_VENDOR_FOLDER_PATHS: Final[list[Path]] = [
11
- Path(__file__).resolve().parent.parent / "trainerbase_vendor",
11
+ Path(__file__).resolve().parent / "vendor",
12
12
  Path().resolve() / "trainerbase_vendor",
13
13
  ]
14
14
 
@@ -47,6 +47,7 @@ class Config(BaseModel):
47
47
  process: Process = Field(validation_alias=AliasChoices("process", "pymem"))
48
48
  vendor: Vendor = Vendor()
49
49
  logging: dict[str, Any] | None = None # Must be managed by logging.dictConfig
50
+ hook_exceptions: bool = True
50
51
 
51
52
 
52
53
  with CONFIG_FILE.resolve().open("rb") as trainerbase_toml:
@@ -114,7 +114,7 @@ class GameObjectUI(AbstractUIComponent):
114
114
  | GameUnsignedLongLong()
115
115
  ):
116
116
  # There is no input for integers that are not simple `signed long int`.
117
- # TODO: Use better input component if it's already added to dpg. Remove this crutch.
117
+ # TODO: Use better input component if it's already added to dpg. Remove this crutch. # noqa: FIX002
118
118
 
119
119
  assert GameInt.value_range is not None, "GameInt must have value_range"
120
120
  min_value = default_kwargs.pop("min_value", GameInt.value_range[0])
@@ -1,3 +1,5 @@
1
+ import sys
2
+ import threading
1
3
  from logging import ERROR, getLogger
2
4
  from logging.config import dictConfig
3
5
 
@@ -35,6 +37,22 @@ dictConfig(logging_config)
35
37
  getLogger("comtypes").setLevel(ERROR)
36
38
 
37
39
  logger = getLogger("TrainerBase")
38
-
39
40
  if using_default_config:
40
41
  logger.debug(f"No logging config in {CONFIG_FILE}! Using default one.")
42
+
43
+
44
+ def _exception_hook(*args):
45
+ if len(args) == 3:
46
+ exc_type, exc_value, exc_traceback = args
47
+ else:
48
+ except_hook_args = args[0]
49
+ exc_type = except_hook_args.exc_type
50
+ exc_value = except_hook_args.exc_value
51
+ exc_traceback = except_hook_args.exc_traceback
52
+
53
+ logger.critical("Uncaught exception", exc_info=(exc_type, exc_value, exc_traceback))
54
+
55
+
56
+ if config.hook_exceptions:
57
+ sys.excepthook = _exception_hook
58
+ threading.excepthook = _exception_hook
@@ -2,8 +2,8 @@ from contextlib import suppress
2
2
  from pathlib import Path
3
3
  from typing import Final, Self, cast
4
4
 
5
- from pyinjector import inject
6
5
  from pymem.exception import MemoryWriteError
6
+ from trainerbase_injector import inject
7
7
 
8
8
  from trainerbase.config import config
9
9
  from trainerbase.gameobject import GameDouble
@@ -1,14 +1,13 @@
1
1
  from collections import deque
2
2
  from typing import override
3
3
 
4
- from pyttsx3 import init as init_tts_engine
4
+ from pyttsx3 import init as create_tts_engine
5
5
 
6
6
  from trainerbase.scriptengine import AbstractBaseScript
7
7
 
8
8
 
9
9
  class TTSManager(AbstractBaseScript):
10
10
  def __init__(self, queue_length_limit: int = 10):
11
- self.__engine = init_tts_engine()
12
11
  self.__queue = deque(maxlen=queue_length_limit)
13
12
 
14
13
  @override
@@ -24,10 +23,11 @@ class TTSManager(AbstractBaseScript):
24
23
  self.__queue.popleft()
25
24
 
26
25
  def __say_sync(self, text: str, rate: int = 210, volume: float = 1.0):
27
- self.__engine.setProperty("rate", rate)
28
- self.__engine.setProperty("volume", volume)
29
- self.__engine.say(text)
30
- self.__engine.runAndWait()
26
+ engine = create_tts_engine()
27
+ engine.setProperty("rate", rate)
28
+ engine.setProperty("volume", volume)
29
+ engine.say(text)
30
+ engine.runAndWait()
31
31
 
32
32
  @property
33
33
  def queue_length_limit(self):
@@ -1,170 +0,0 @@
1
- # Local
2
- .vscode/
3
- .idea/
4
-
5
- # PDM
6
- .pdm-python
7
- __pypackages__/
8
-
9
- # Byte-compiled / optimized / DLL files
10
- __pycache__/
11
- *.py[cod]
12
- *$py.class
13
-
14
- # C extensions
15
- *.so
16
-
17
- # Distribution / packaging
18
- .Python
19
- build/
20
- develop-eggs/
21
- dist/
22
- downloads/
23
- eggs/
24
- .eggs/
25
- lib/
26
- lib64/
27
- parts/
28
- sdist/
29
- var/
30
- wheels/
31
- share/python-wheels/
32
- *.egg-info/
33
- .installed.cfg
34
- *.egg
35
- MANIFEST
36
-
37
- # PyInstaller
38
- # Usually these files are written by a python script from a template
39
- # before PyInstaller builds the exe, so as to inject date/other infos into it.
40
- *.manifest
41
- *.spec
42
-
43
- # Installer logs
44
- pip-log.txt
45
- pip-delete-this-directory.txt
46
-
47
- # Unit test / coverage reports
48
- htmlcov/
49
- .tox/
50
- .nox/
51
- .coverage
52
- .coverage.*
53
- .cache
54
- nosetests.xml
55
- coverage.xml
56
- *.cover
57
- *.py,cover
58
- .hypothesis/
59
- .pytest_cache/
60
- cover/
61
-
62
- # Translations
63
- *.mo
64
- *.pot
65
-
66
- # Django stuff:
67
- *.log
68
- local_settings.py
69
- db.sqlite3
70
- db.sqlite3-journal
71
-
72
- # Flask stuff:
73
- instance/
74
- .webassets-cache
75
-
76
- # Scrapy stuff:
77
- .scrapy
78
-
79
- # Sphinx documentation
80
- docs/_build/
81
-
82
- # PyBuilder
83
- .pybuilder/
84
- target/
85
-
86
- # Jupyter Notebook
87
- .ipynb_checkpoints
88
-
89
- # IPython
90
- profile_default/
91
- ipython_config.py
92
-
93
- # pyenv
94
- # For a library or package, you might want to ignore these files since the code is
95
- # intended to run in multiple environments; otherwise, check them in:
96
- .python-version
97
-
98
- # pipenv
99
- # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
100
- # However, in case of collaboration, if having platform-specific dependencies or dependencies
101
- # having no cross-platform support, pipenv may install dependencies that don't work, or not
102
- # install all needed dependencies.
103
- #Pipfile.lock
104
-
105
- # poetry
106
- # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
107
- # This is especially recommended for binary packages to ensure reproducibility, and is more
108
- # commonly ignored for libraries.
109
- # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
110
- #poetry.lock
111
-
112
- # pdm
113
- # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
114
- #pdm.lock
115
- # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
116
- # in version control.
117
- # https://pdm.fming.dev/#use-with-ide
118
- .pdm.toml
119
- .pdm-python
120
- .pdm-build/
121
-
122
- # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
123
- __pypackages__/
124
-
125
- # Celery stuff
126
- celerybeat-schedule
127
- celerybeat.pid
128
-
129
- # SageMath parsed files
130
- *.sage.py
131
-
132
- # Environments
133
- .env
134
- .venv
135
- env/
136
- venv/
137
- ENV/
138
- env.bak/
139
- venv.bak/
140
-
141
- # Spyder project settings
142
- .spyderproject
143
- .spyproject
144
-
145
- # Rope project settings
146
- .ropeproject
147
-
148
- # mkdocs documentation
149
- /site
150
-
151
- # mypy
152
- .mypy_cache/
153
- .dmypy.json
154
- dmypy.json
155
-
156
- # Pyre type checker
157
- .pyre/
158
-
159
- # pytype static type analyzer
160
- .pytype/
161
-
162
- # Cython debug symbols
163
- cython_debug/
164
-
165
- # PyCharm
166
- # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
167
- # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
168
- # and can be added to the global gitignore or merged into this file. For a more nuclear
169
- # option (not recommended) you can uncomment the following to ignore the entire idea folder.
170
- #.idea/
trainerbase-4.6.3/LICENSE DELETED
@@ -1,22 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 - 2025 v01d
4
- Copyright (c) 2022 - 2025 doomayka
5
-
6
- Permission is hereby granted, free of charge, to any person obtaining a copy
7
- of this software and associated documentation files (the "Software"), to deal
8
- in the Software without restriction, including without limitation the rights
9
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- copies of the Software, and to permit persons to whom the Software is
11
- furnished to do so, subject to the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be included in all
14
- copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- SOFTWARE.