Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require("shapedefs");
- --Add splits here
- --4:59.956 splits
- --pb11 = 32.147;
- --pb12 = 31.481;
- --pb41 = 37.405;
- --pb42 = 29.751;
- --pb81 = 51.033;
- --pb82 = 37.405;
- --pb83 = 35.309;
- --pb84 = 45.425;
- --5:04 splits
- pb11 = 32.147;
- pb12 = 31.831;
- pb41 = 37.405;
- pb42 = 30.100;
- pb81 = 52.081;
- pb82 = 37.754;
- pb83 = 35.658;
- pb84 = 47.821;
- --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 Bowser is on the screen and you are in world 8
- for i=0,5 do
- if memory.readbyte((0x0016)+i) == 0x2d and memory.readbyte(0x075F) == 7 then
- bow = 1;
- end;
- end;
- ----detects if you hit the switch and locks the timer's values
- if bow == 1 and memory.readbyte(0x01ED) == 242 and memory.readbyte(0x03AD) > 210 and once == 0 then
- hit = 1;
- once = 1;
- split = 1;
- s_final = round(s - 655171/39375000, 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;
- --level timer
- if hit == 0 then
- lvltime = n-lvltimesum
- -- gui.text(x-69,y,string.format("%04.1f",lvltime));
- end
- --splitter
- --detects level change
- if (memory.readbyte(0x075F) ~= lvl1 or memory.readbyte(0x075C) ~= lvl2) and memory.readbyte(0x0772) == 2 then
- split = 1;
- end
- --records final level time
- if movie.framecount() > 196 and split == 1 then
- oldlvl1=lvl1;
- oldlvl2=lvl2;
- lvl1 = memory.readbyte(0x075F);
- lvl2 = memory.readbyte(0x075C);
- lvltimefinal = lvltime;
- lvltimesum = n;
- end
- --determines currecnt pb to reference
- if oldlvl1 == 0 and oldlvl2 == 0 then
- pb = pb11
- pbs = pb11
- end
- if oldlvl1 == 0 and oldlvl2 == 1 then
- pb = pb12
- pbs = pb11 + pb12
- end
- if oldlvl1 == 3 and oldlvl2 == 0 then
- pb = pb41
- pbs = pb11 + pb12 + pb41
- end
- if oldlvl1 == 3 and oldlvl2 == 1 then
- pb = pb42
- pbs = pb11 + pb12 + pb41 + pb42
- end
- if oldlvl1 == 7 and oldlvl2 == 0 then
- pb = pb81
- pbs = pb11 + pb12 + pb41 + pb42 + pb81
- end
- if oldlvl1 == 7 and oldlvl2 == 1 then
- pb = pb82
- pbs = pb11 + pb12 + pb41 + pb42 + pb81 + pb82
- end
- if oldlvl1 == 7 and oldlvl2 == 2 then
- pb = pb83
- pbs = pb11 + pb12 + pb41 + pb42 + pb81 + pb82 + pb83
- end
- if oldlvl1 == 7 and oldlvl2 == 3 then
- pb = pb84
- pbs = pb11 + pb12 + pb41 + pb42 + pb81 + pb82 + pb83 + pb84 + 655171/39375000
- end
- --splitter display
- gui.text(x-219,y,(oldlvl1+1).."-"..(oldlvl2+1));
- gui.text(x-200,y,string.format("%06.3f",lvltimefinal));
- if lvltimefinal-pb > 0 then
- gui.text(x-165,y,"+"..string.format("%4.2f",lvltimefinal-pb));
- else
- gui.text(x-165,y,string.format("%5.2f",lvltimefinal-pb));
- end
- if lvltimesum-pbs > 0 then
- gui.text(x-40,y,"+"..string.format("%4.2f",lvltimesum-pbs));
- else
- gui.text(x-40,y,string.format("%5.2f",lvltimesum-pbs));
- end
- --splitter reset
- split = 0;
- FCEU.frameadvance();
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement