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.

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.

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.2.1.tar.gz (174.5 kB view hashes)

Uploaded Source

Built Distribution

bizhook-1.2.1-py3-none-any.whl (172.2 kB view hashes)

Uploaded Python 3

Supported by

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