Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function timeformat(val)
- if val < 10 then
- val = "0" .. val
- end
- return val
- end
- local function timer()
- local start = memory.read_u16_le(0x7E2513)
- if start ~= 0 then
- if bit.band(memory.readbyte(0x7E225D),0xF) ~= 0x0C then
- local timer = memory.read_u16_le(0x7E0B19)
- if start > timer then
- timer = timer + 65536
- end
- gui.text(10,38,"Timer Started",0xFF000000, 0xFFFF0000)
- local d = timer - start
- local m = timeformat(math.floor(d / 60 / 60))
- local s = timeformat(math.floor((d / 60) % 60))
- local ms = timeformat(math.floor(d % 60))
- gui.text(10,46,"Time Passed: " .. m .. ":" .. s .. ":" .. ms)
- d = 50433 - (timer - start) -- This is only an estimate, seems to be within a 60 frame range
- local rm = timeformat(math.floor(d / 60 / 60))
- local rs = timeformat(math.floor((d / 60) % 60))
- local rms = timeformat(math.floor(d % 60))
- gui.text(10,54,"Estimated Time Remaining: " .. rm .. ":" .. rs .. ":" .. rms)
- gui.text(10,62,"Frame counter: " .. timer - start)
- gui.text(10,70,"Estimated Frames Remaining: " .. d .. " (~60 frames)")
- else
- gui.text(10,38,"Timer Ended.....Market Meeting Started","#FF0000FF")
- end
- end
- end
- while true do
- timer()
- emu.frameadvance()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement