Created
October 15, 2022 23:13
-
-
Save kism/ded7773c5a254da4bcae865c2cdfa459 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function main() | |
-- Settings | |
local saveinterval = 7200 | |
local path = "C:\\Temp\\" -- Use double backslash \\ instead of backslash \ | |
-- Dont touch | |
local frame = 0 | |
local filename = "" | |
local gamename = gameinfo.getromname() | |
console.log("Starting auto savestate script") | |
console.log("Saving to: " .. path) | |
console.log("Saving every: " .. saveinterval .. " frames") | |
console.log("This should be every: " .. tostring(saveinterval / 3600) .. " minutes") | |
while true do | |
frame = frame + 1 | |
if frame > saveinterval then | |
-- console.log(joypad.get(1)['Start']) | |
filename = path .. gamename .. os.date(" %Y-%m-%d %H-%M-%S") .. ".state" | |
console.log(filename) | |
savestate.save(filename) | |
frame = 0 | |
end | |
emu.frameadvance() | |
end | |
end | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment