Advertisement
Guest User

Untitled

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