Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pcsx.speedmode("maximum")
- local file = io.open("tmp.csv","w")
- file:write("Rank, Rank2, Time, Damage, Kills, Output, Virus\n")
- --測試用
- --t={0x0E0F, 0x1C1F, 0x2A2F, 0x383F, 0x464F, 0x545F, 0x626F, 0x707F, 0x7E8F, 0x8C9F}
- --tn={"0m59s98","1m59s98","2m59s98","3m59s98",
- -- "4m59s98","5m59s98","6m59s98","7m59s98",
- -- "8m59s98","9m59s98"} --"ticktime[1]~[10]
- r={"MEH","PA","GA","SA","A","B","C","E"} --rank[1]~[8]
- t={0x0E0F, 0x1C1F, 0x464F, 0x545F}
- tn={"0m59s98","1m59s98","4m59s98","5m59s98"} --"ticktime[1]~[4]
- --$0E0F 0:59:98 $1C1F 1:59:98 $464F 4:59:98 $545F 5:59:98
- d={15, 31, 63, 64} --damage[1]~[4]
- k={39, 79, 149, 150} --kills[1]~[4]
- o={8,6,4,3} --output[1]~[4]
- v={0,1,2,3} --virus[1]~[4]
- sc={8,4,2,1} --sc[1]~[4]
- tmp=savestate.create()
- savestate.save(tmp)
- ir2=7;
- for ir = 1,8 do
- for it = 1,4 do
- for id = 1,4 do
- for ik = 1,4 do
- for io = 1,4 do
- for iv = 1,4 do
- savestate.load(tmp)
- tick=pcsx.framecount()
- memory.writebyte(0x0D3182,ir-1);--獵人等級 0D3182(X) 0D3183(Z)
- memory.writeword(0x0D3188,t[it]);--破關時間
- memory.writebyte(0x0D3190,d[id]);--受傷
- memory.writebyte(0x0D318C,k[ik]);--殺敵數
- memory.writebyte(0x0D3194,o[io]);--最大輸出
- memory.writebyte(0x0D3196,v[iv])--病毒
- while (pcsx.framecount()-tick)<(5) do
- pcsx.frameadvance()
- end
- ir2=memory.readbyte(0x0D3182)+1;--獵人等級 0D3182(X) 0D3183(Z)
- score=sc[it]+sc[id]+sc[ik]+sc[io]+sc[iv]
- --計算評價
- if ir==1 then --MEH
- if score>=32 then ir3=1
- else ir3=2
- end
- elseif ir==2 then --PA
- if score==40 then ir3=1
- elseif score>=32 then ir3=2
- else ir3=3
- end
- elseif ir==3 then --GA
- if score>=36 then ir3=2
- elseif score>=24 then ir3=3
- else ir3=4
- end
- elseif ir==4 then --SA
- if score>=32 then ir3=3
- elseif score>=20 then ir3=4
- else ir3=5
- end
- elseif ir==5 then --A
- if score>=32 then ir3=4
- elseif score>=18 then ir3=5
- else ir3=6
- end
- elseif ir==6 then --B
- if score>=28 then ir3=5
- elseif score>=15 then ir3=6
- else ir3=7
- end
- elseif ir==7 then --C
- if score>=20 then ir3=6
- elseif score>=12 then ir3=7
- else ir3=8
- end
- elseif ir==8 then --E
- if score>=16 then ir3=7
- else ir3=8
- end
- end
- if ir2==ir3 then res="TRUE"
- else res="FALSE"
- end
- str=r[ir]..","..r[ir2]..","..tn[it]..","..d[id]..","..k[ik]..","..o[io]..","..v[iv]..","..score..","..r[ir3]..","..res.."\n"
- file:write(str)
- end
- end
- end
- end
- end
- end
- file:close()
- pcsx.speedmode("turbo")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement