Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example basic_mod.md is out of date #5

Open
cakebread opened this issue Aug 27, 2024 · 2 comments
Open

Example basic_mod.md is out of date #5

cakebread opened this issue Aug 27, 2024 · 2 comments

Comments

@cakebread
Copy link

I'm trying to run the basic_mod example, but it seems out of date.

https://github.com/monkeyman192/NMS.py/tree/master/docs/examples/basic_mod.md

I changed the first line:

import nmspy.data.function_hooks as hooks

to:

import nmspy.data.functions.hooks as hooks

I can't figure out what 'main_loop' in the second line has been renamed to:
from pymhf.core.hooking import disable, main_loop, on_key_pressed, on_key_release

>>> import pymhf.core.hooking
>>> dir(pymhf.core.hooking)
['Any', 'CFUNCTYPE', 'CFuncPtr', 'Callable', 'DetourTime', 'FUNCDEF', 'FuncHook', 'HookFactory', 'HookManager', 'HookProtocol', 'ManualHookProtocol', 'ORIGINAL_MAPPING', 'Optional', 'Type', '__annotations__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', '_detour_is_valid', '_internal', 'ast', 'cast', 'cyminhook', 'disable', 'find_pattern_in_binary', 'hook_logger', 'hook_manager', 'inspect', 'logging', 'manual_hook', 'module_data', 'on_key_pressed', 'on_key_release', 'one_shot', 'partial', 'pattern_cache', 'traceback']

Getting to line three, I'm stumped:

from nmspy.memutils import map_struct

Thanks!

@cakebread
Copy link
Author

I fixed up all the imports so there are no errors, added in TestModState, and it runs with no errors, but exits immediately without printing anything to stdout/stderr.
basicmod.md

@monkeyman192
Copy link
Owner

monkeyman192 commented Aug 27, 2024

Hi sorry, I haven't had too much time to properly fix up the documentation. I will get to fixing it up soon!

Edit: In fact, actually the example mods will probably actually be moved out of the documentation itself and into a separate folder where they can actually just be run directly.
The reason the docs and examples are a bit behind/lacking is because there has been a decent amount of work behind the scenes to migrate NMS.py to use pyMHF, and so I'm still just getting all that finished and into a good state so that it's usable. This is very close so I think it's almost in a state where we can start having some good example mods and start working on improving the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
@cakebread @monkeyman192 and others