Skip to main content

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

bizhook-1.1.0.tar.gz (174.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bizhook-1.1.0-py3-none-any.whl (172.0 kB view details)

Uploaded Python 3

File details

Details for the file bizhook-1.1.0.tar.gz.

File metadata

  • Download URL: bizhook-1.1.0.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

Hashes for bizhook-1.1.0.tar.gz
Algorithm Hash digest
SHA256 520a4876d34ff0628d6e945fe6670de1ac8c62e87a667fbe936efdf1f121f06b
MD5 84df44ff9cf600db5bae22eda30f58c8
BLAKE2b-256 1bba259bd3550af16b26460f75d99a4eddd8bba4f560872d4597535d7e351f96

See more details on using hashes here.

File details

Details for the file bizhook-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: bizhook-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 172.0 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

Hashes for bizhook-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c8955fb8c0db3edf3d4f82f386d1f3308a8638d43d06b47c10e4a69f5081af9e
MD5 8a30a9d48403858794f3e49871d543d0
BLAKE2b-256 8f2ea7ad811c5e3338953a9694660fc244ed8d6c027e3b4d6c4a95d156541f34

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page