Communicate with the Bizhawk emulator via a Lua socket
Project description
Bizhawk Hook
Interact with Bizhawk via a socket server hosted in the Lua Console.
How to use
Bizhawk Lua
Exporting
Export all the necessary Lua components using the provided function.
from bizhook import export_lua_components
export_lua_components('/home/williamson/.bizhook')
You can either provide a path or leave it empty to have it open up a file dialogue asking for directory.
Opening socket
In Bizhawk, go to Tools > Lua Console. Select Open script and open hook.lua from the exported components.
Is it working?
If it starts successfully, you should see a text in the top-left of the emulator saying the socket is being opened. Should that not appear, try restarting the emulator until it does. This seems to be an issue with Bizhawk.
Note: Do not try to communicate with the socket before the text has disappeared, as it isn't actually opened yet. The message is there to make it clear that the script is running successfully.
Python
You can read from and write to memory by using a Memory object.
from bizhook import Memory
combined_wram = Memory('Combined WRAM')
To see the available methods, do help(Memory).
Memory domain
You can use the default memory domain by providing an empty string. However, I would advice against it and that you always do specify with which domain you want to interact. It may be that it works for you solely because, per chance, the default one happens to be the correct one.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bizhook-1.1.1.tar.gz.
File metadata
- Download URL: bizhook-1.1.1.tar.gz
- Upload date:
- Size: 174.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.10.1 Linux/5.10.89-1-MANJARO
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6463738570a59c43bb89866e302d1a689526f20e7db0c9f2c1d6b23941c1e076
|
|
| MD5 |
7ec726f2a72219a6a6a8e2725f2ebd8f
|
|
| BLAKE2b-256 |
c69bc9ce4a33a5ec0b23015a4402d30c7fd325fa79e74f57de01452781a3f743
|
File details
Details for the file bizhook-1.1.1-py3-none-any.whl.
File metadata
- Download URL: bizhook-1.1.1-py3-none-any.whl
- Upload date:
- Size: 172.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.10.1 Linux/5.10.89-1-MANJARO
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5de65d2210116a1edf565f9cc7117063f7ce1d15e901c85b2da5bc660fcb70e2
|
|
| MD5 |
1d308bee87cd92a02d961e048114dc56
|
|
| BLAKE2b-256 |
94b4357eb637cdeb65dd40f9629c1b6f8939413eba0ad764aeaaad7bb99f604f
|