Last active
July 13, 2022 12:35
-
-
Save RaycatWhoDat/4a52cb239bccda54f2f68a4a6618c9c9 to your computer and use it in GitHub Desktop.
Ironmon BizHawk Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PATH_TO_ROMS = "../.." | |
NAME_OF_ROM_WITHOUT_NUMBER = "FireRed" | |
KEY_TO_ADVANCE = "N" | |
KEY_TO_PREVIOUS = "O" | |
NAME_OF_SEED_FILE = "current_seed.txt" | |
file = io.open(NAME_OF_SEED_FILE, "r") | |
INITIAL_SEED_NUMBER = tonumber(file:read("*number")) | |
file:close() | |
function changeseed(direction) | |
seednumber = userdata.get("seednumber") | |
if seednumber ~= nil then | |
seednumber = seednumber + direction | |
else | |
seednumber = INITIAL_SEED_NUMBER + direction | |
end | |
userdata.set("seednumber", seednumber) | |
console.log("Opening seed #" .. seednumber .. "...") | |
client.closerom() | |
client.openrom(PATH_TO_ROMS .. "/" .. NAME_OF_ROM_WITHOUT_NUMBER .. seednumber .. ".gba") | |
file = io.open("current_seed.txt", "w") | |
file:write(seednumber) | |
file:close() | |
end | |
while true do | |
if input.get()[KEY_TO_ADVANCE] == true then | |
changeseed(1) | |
end | |
if input.get()[KEY_TO_PREVIOUS] == true then | |
changeseed(-1) | |
end | |
emu.frameadvance() | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment