I have no idea what went wrong, but for some reason on DeSmuME 0.9.9:
Download display.luaLanguage: lua
day = 0x212DE58
player = {x = 0x21347FC, y = 0x2134804, camx = 0x2134820, camy = 0x2134822} --camx in terms of upright view; same for camy. so camx looks up/down
regret1 = {x = 0x2133828, y = 0x2133830, angle = 0x213384C}
regret2 = {x = 0x2133AD8, y = 0x2133AE0, angle = 0x2133AFC}
--the following when moving forward
--camy = 12.000 x decreases
--camy = 4.000 x increases
--camy = 8.000 y decreases
--camy = 0.000 y increases
tempx = 0
tempy = 0
bestx = 0
besty = 0
--Declarations here
function fn()
playerx = memory.readlongsigned(player.x)/4096.0
playery = memory.readlongsigned(player.y)/4096.0
playercamx = memory.readshort(player.camx)/4096.0
playercamy = memory.readshort(player.camy)/4096.0
regret1x = memory.readlongsigned(regret1.x)/4096.0
regret1y = memory.readlongsigned(regret1.y)/4096.0
regret2x = memory.readlongsigned(regret2.x)/4096.0
regret2y = memory.readlongsigned(regret2.y)/4096.0
frame = movie.framecount()+17 --since dsm header is 17 lines
gui.drawtext(0,0,"Player: ("..string.format('%.6f',playerx)..","..string.format('%.6f',playery)..")")
gui.drawtext(0,10,"Camera: ("..string.format('%.6f',playercamx)..","..string.format('%.6f',playercamy)..")")
gui.drawtext(0,20,"Regret 1: ("..string.format('%.6f',regret1x)..","..string.format('%.6f',regret1y)..")")
gui.drawtext(0,30,"Regret 2: ("..string.format('%.6f',regret2x)..","..string.format('%.6f',regret2y)..")")
gui.drawtext(0,40,"Frame: .dsm "..frame)
stylus.set({x=127,y=95,touch=true})
if (frame-17 == 31940 and tempx ~= playerx) then --change to playery if needed; same with frame
tempx = playerx
tempy = playery
end
if (frame-17 == 31940 and (tempx < bestx or bestx == 0)) then --change to playery if needed; same with frame; same with sign
bestx = tempx
besty = tempy
end
gui.drawtext(0,50,"Player best: ("..string.format('%.6f',bestx)..","..string.format('%.6f',besty)..")")
gui.drawtext(0,60,"Player now: ("..string.format('%.6f',tempx)..","..string.format('%.6f',tempy)..")")
end
gui.register(fn)
Around every 5-15 frames, stylus.set({x=127,y=95,touch=true}) doesn't touch the screen for 1 frame. How do I make it hold forever?