Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local pauses = 100
- local iterator = 0
- local iterations_save = 0
- local total_iterations = 0
- local iterations_before_resave = 50
- -- File to write to
- local outfile = assert(io.open("pauserng.txt", "w"));
- -- Savestate to be loaded
- local state = savestate.create();
- savestate.save(state);
- local i = 0
- while total_iterations < pauses do
- total_iterations = iterator + iterations_save;
- gui.text(0, 50, "On iteration: " .. total_iterations);
- savestate.load(state);
- l = 0;
- -- Do the number of pauses required
- while l < iterator do
- pcsx.frameadvance()
- pcsx.frameadvance()
- joypad.set(1, { ["start"] = true })
- pcsx.frameadvance()
- pcsx.frameadvance()
- joypad.set(1, { ["start"] = false })
- l = l + 1;
- end
- if iterator == iterations_before_resave then
- iterations_save = iterations_save + iterator;
- savestate.save(state);
- iterator = 0;
- end
- -- Advance 1 frame, then hit circle
- pcsx.frameadvance();
- joypad.set(1, { ["circle"] = true });
- pcsx.frameadvance();
- joypad.set(1, { ["circle"] = false });
- w = 0;
- -- Frame advance 20 times
- if memory.readbyte(0x000F5CCD) < 2 then
- done = 1;
- end
- outfile:write(total_iterations .. " pause: " .. memory.readword(0x000F99EC) .. memory.readbyte(0x000F99E8) "\n");
- iterator = iterator + 1;
- end
- assert(outfile:close());
- pcsx.pause();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement