After finding out about Dpadhero, from
this post, I made a script that beats every stage perfectly. It also counts how many balls you hit of each type.
If you want to try out the script, run it at the very start of the level, when your score is still 0.
while true do
local function displayer()
points = memory.readbyte(0x06F) + 256*memory.readbyte(0x070) + 65536*memory.readbyte(0x071)
y = {[0]= 0x3FA, 0x3FF, 0x404, 0x3FA, 0x409, 0x40E, 0x413, 0x418, 0x41D, 0x422, 0x427, 0x42C, 0x431, 0x436, 0x43B, 0x440, 0x445, 0x44A}
t = {[0]= 0x3F9, 0x3FE, 0x403, 0x3F9, 0x408, 0x40D, 0x412, 0x417, 0x41C, 0x421, 0x426, 0x42B, 0x430, 0x435, 0x43A, 0x43F, 0x444, 0x449}
v = {[0]= 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
q = {[0]= "B", "B>", "B<", "Bv", "B^", "A", "A>", "A<", "Av", "A^"}
if points==0 then
h={[0]= 0,0,0,0,0,0,0,0,0,0}
end
for i=0,17,1 do
if memory.readbyte(y[i])==174 then v[i]=1 r=i end
end
w = math.max(v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7], v[8], v[9], v[10], v[11], v[12], v[13], v[14], v[15], v[16], v[17])
if w==1 then
if memory.readbyte(t[r])==0 then val={B=true} h[0]=h[0]+1
elseif memory.readbyte(t[r])==1 then val={B=true, right=true} h[1]=h[1]+1
elseif memory.readbyte(t[r])==2 then val={B=true, left=true} h[2]=h[2]+1
elseif memory.readbyte(t[r])==3 then val={B=true, down=true} h[3]=h[3]+1
elseif memory.readbyte(t[r])==4 then val={B=true, up=true} h[4]=h[4]+1
elseif memory.readbyte(t[r])==8 then val={A=true} h[5]=h[5]+1
elseif memory.readbyte(t[r])==9 then val={A=true, right=true} h[6]=h[6]+1
elseif memory.readbyte(t[r])==10 then val={A=true, left=true} h[7]=h[7]+1
elseif memory.readbyte(t[r])==11 then val={A=true, down=true} h[8]=h[8]+1
elseif memory.readbyte(t[r])==12 then val={A=true, up=true} h[9]=h[9]+1
else val={} end
else
val={}
end
joypad.set(1, val)
for k=0,9,1 do
gui.text(10,10+8*k,q[k] .. ": " .. h[k])
end
gui.text(10,90,"Total: " .. h[0]+h[1]+h[2]+h[3]+h[4]+h[5]+h[6]+h[7]+h[8]+h[9])
end
gui.register(displayer)
FCEU.frameadvance()
end