Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require("shapedefs");
- --Add splits here
- --position
- --bottom y=224
- --top y=0
- y = 224;
- x = 220;
- n = 0; s = 0; m = 0;
- fr = 0; pg = 0;
- bow = 0;
- hit = 0;
- once = 0;
- s_final = 0; m_final = 0;
- lvl1 = 0; lvl2 = 0;
- oldlvl1 = 0; oldlvl2 = 0;
- split = 0;
- lvltime = 0;
- lvltimefinal = 0;
- lvltimesum = 0;
- pb = 0;
- pbs = 0;
- function round(num, idp)
- local mult = 10^(idp or 0)
- return math.floor(num * mult) / mult
- end
- while (true) do
- -- reset
- if movie.framecount() < 196 then
- n = 0; s = 0; m = 0;
- fr = 0; pg = 0;
- bow = 0;
- hit = 0;
- once = 0;
- s_final = 0; m_final = 0;
- lvl1 = 0; lvl2 = 0;
- oldlvl1 = -1; oldlvl2 = -1;
- split = 0;
- lvltime = 0;
- lvltimefinal = 0;
- lvltimesum = 0;
- pb = 0;
- pbs = 0;
- end;
- -- timer
- n = (movie.framecount()-196)/(39375000/655171);
- s = n % 60;
- m = math.floor(n / 60);
- if s < 10 then
- gui.text(x-6,y,string.format("%.0f",m)..":0"..string.format("%0.10f",s));
- end;
- if s >= 10 then
- gui.text(x-6,y,string.format("%.0f",m)..":"..string.format("%0.10f",s));
- end;
- if movie.framecount() < 197 then
- gui.text(x-6,y,"0:00.000");
- end;
- -- stop timer
- ----detects if you hit the switch and locks the timer's values
- if memory.readbyte(0x001D) == 3 and once == 0 then
- hit = 1;
- once = 1;
- s_final = round(s, 3);
- m_final = m;
- end;
- ----timer with locked values
- if hit == 1 then
- if s_final < 10 then
- gui.text(x-6,y,string.format("%.0f",m_final)..":0"..string.format("%0.10f",s_final));
- end;
- if s_final >= 10 then
- gui.text(x-6,y,string.format("%.0f",m_final)..":"..string.format("%0.10f",s_final));
- end;
- end;
- FCEU.frameadvance();
- end;
Add Comment
Please, Sign In to add comment