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.
The dialogue window may not work on all systems. If an error occurs, you'll simply have to provide the path as an argument.
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.
Release files for bizhook 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bizhook-1.2.1.tar.gz | 174.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bizhook-1.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 346.6 kB
Release files / bizhook-1.2.1.tar.gz
| Download URL | bizhook-1.2.1.tar.gz |
|---|---|
| Size | 174.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
65ed78f1a8dbcbfeafa7a6a89a51e164f7ef5719653a80589041c379828b7aae
|
|
BLAKE2b-256 checksum How to use checksums |
c8418252680a095844ddae3c141f74854f0a30893cffa7930e6d0f12550fba37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.10.5 Linux/5.10.126-1-MANJARO
|
Release files / bizhook-1.2.1-py3-none-any.whl
| Download URL | bizhook-1.2.1-py3-none-any.whl |
|---|---|
| Size | 172.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2fe3fed24d3e5b3fa51b12393f6559b9d8fd10df0370979c88b8b5106cb543fc
|
|
BLAKE2b-256 checksum How to use checksums |
c7538e65154a5c6b8172287251fee64bdad9ff4ae76094253aa677f0166ca2e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.10.5 Linux/5.10.126-1-MANJARO
|