Advertisement
Guest User

Untitled

a guest
Jun 4th, 2013
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.30 KB | None | 0 0
  1. local function timeformat(val)
  2.     if val < 10 then
  3.         val = "0" .. val
  4.     end
  5.     return val
  6. end
  7.  
  8.  
  9. local function timer()
  10.     local start = memory.read_u16_le(0x7E2513)
  11.     if start ~= 0 then     
  12.         if bit.band(memory.readbyte(0x7E225D),0xF) ~= 0x0C then
  13.             local timer = memory.read_u16_le(0x7E0B19)
  14.             if start > timer then
  15.                 timer = timer + 65536
  16.             end
  17.            
  18.             gui.text(10,38,"Timer Started",0xFF000000, 0xFFFF0000)
  19.             local d = timer - start
  20.             local m = timeformat(math.floor(d / 60 / 60))
  21.             local s = timeformat(math.floor((d / 60) % 60))
  22.             local ms = timeformat(math.floor(d % 60))
  23.            
  24.             gui.text(10,46,"Time Passed:                " .. m .. ":" .. s .. ":" .. ms)
  25.            
  26.             d = 50433 - (timer - start) -- This is only an estimate, seems to be within a 60 frame range
  27.             local rm = timeformat(math.floor(d / 60 / 60))
  28.             local rs = timeformat(math.floor((d / 60) % 60))
  29.             local rms = timeformat(math.floor(d % 60))
  30.                
  31.             gui.text(10,54,"Estimated Time Remaining:   " .. rm .. ":" .. rs .. ":" .. rms)
  32.            
  33.             gui.text(10,62,"Frame counter:              " .. timer - start)
  34.             gui.text(10,70,"Estimated Frames Remaining: " .. d .. "  (~60 frames)")
  35.            
  36.         else
  37.             gui.text(10,38,"Timer Ended.....Market Meeting Started","#FF0000FF")
  38.         end
  39.        
  40.     end
  41. end
  42.  
  43. while true do
  44.     timer()
  45.     emu.frameadvance()
  46. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement