EDIT: Now with this:
Language: lua
local function speed(name,address,x,y)
currentvalue = mainmemory.readbyte(address)
Pastvalue[1] = Pastvalue[0]
Pastvalue[0] = currentvalue
speed = Pastvalue[0] - Pastvalue[1]
gui.pixelText(x,y,name.. speed)
end
Pastvalue = {
[0] = 0,--current frame
[1] = 0 --Previous frame
}
while true do
mainmemory.writebyte(0x005B,58) --Unlimited Time
--mainmemory.writebyte(0x00FD,74) --Fixed cam position
speed(speedX:,0x043C,138,128)
emu.frameadvance() end
Throws me this:
http://imgur.com/a/PcRTB as well as the first. But at first I got a different window, So I am really confused.
EDIT: Removed the fixed problems and with now a new problem.
Language: lua
local function speedtext(name,address,x,y)
currentvalue = mainmemory.read_u16_le(address)
Pastvalue[1] = Pastvalue[0]
Pastvalue[0] = currentvalue
speed = Pastvalue[0] - Pastvalue[1]
gui.pixelText(x,y,name.. speed)
end
Pastvalue = {
[0] = 0,--current frame
[1] = 0 --Previous frame
}
while true do
mainmemory.writebyte(0x005B,58) --Unlimited Time
--mainmemory.writebyte(0x00FD,74) --Fixed cam position
speedtext("1spX:",0x043C,138,128)
speedtext("1spY:",0x043E,138,136)
emu.frameadvance() end
So I have that, but it seems that my two speeds are messed up now.