Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- countFrames = 0
- doSubtractFrames = 0
- function CalculateTime(frames)
- local hour = math.floor(frames / 216000)
- local minute = math.floor(frames / 3600 - hour * 60)
- local sec = math.floor(frames / 60 - hour * 3600 - minute * 60)
- local mil = frames - hour * 216000 - minute * 3600 - sec * 60
- mil = math.floor(mil * 100 / 60)
- return minute, sec, mil
- end
- while true do
- local inLevel = mainmemory.read_u8(0x64B)
- if inLevel == 0 and countFrames > 0 and doSubtractFrames == 0 then
- countFrames = countFrames - 39
- doSubtractFrames = 1
- end
- if inLevel == 1 then
- if doSubtractFrames == 1 then
- countFrames = 0
- doSubtractFrames = 0
- end
- countFrames = countFrames + 1
- end
- local minute, sec, mil = CalculateTime(countFrames)
- gui.pixelText(1, 216, string.format("%d", minute) .. ":" .. string.format("%02d", sec) .. "." .. string.format("%02d", mil), 0xFF00FF00, 0x00000000);
- emu.frameadvance()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement