Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local movie_name = "Mario Kart 64 (USA)_CM Gauntlet_v3_CONSOLE_VERIFIED.bk2"
- local controller_number = 1;
- if (movie_name == "") then
- local last_slash = string.find(movie.filename(),"\\")
- local previous = last_slash
- while (last_slash ~= nil) do
- previous = last_slash;
- last_slash = string.find(movie.filename(),"\\",last_slash+1)
- end
- previous = previous + 1
- movie_name = string.sub(movie.filename(),previous)
- end
- local handle = io.open(movie_name .. "." .. controller_number .. ".input", "w");
- handle:close()
- local mnemonic_positions = {{5,34},{36,65},{67,96},{98,127}};
- local input_used = false;
- function not_lag_frame()
- input_used = true
- end
- event.oninputpoll(not_lag_frame);
- while true do
- if (movie.mode() == "PLAY") then
- if (input_used == true) then
- local button_data = movie.getinputasmnemonic(emu.framecount()-1)
- local handle = io.open(movie_name .. "." .. controller_number .. ".input", "a");
- handle:write(string.sub(button_data,mnemonic_positions[controller_number][1],mnemonic_positions[controller_number][2]))
- handle:write("\n");
- handle:close()
- end
- end
- input_used = false;
- emu.frameadvance()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement