I sent Hetfield90 the following script which he said worked.
This script uses a special key to skip forward two frames. The space key is used as the special key; you
can edit it to whatever you normally use as frame advance. For this to work, the actual frame advance key has to be set to something other than space. Note that the special key cannot be held down for key repeat.
Language: lua
local key="Space"
local t={}
local s=emu.framecount()
local monitor=false
local buttonheld=false
while true do
t=input.get()
if t[key] and not buttonheld then
s=emu.framecount()
client.unpause()
buttonheld=true
monitor=true
end
if not t[key] and buttonheld then
buttonheld=false
end
if emu.framecount()>=s+2 and monitor then
client.pause()
monitor=false
end
emu.yield()
end
Note that emu.yield() instead of emu.frameadvance() allows the while loop to run even when emulation is paused.
Please also remember that emu.frameadvance() does not advance emulation by one frame; it halts lua script execution until the next frame. This is an easy misunderstanding to make.