User File #57337861228820426

Upload All User Files

#57337861228820426 - NES Panic Restaurant boss fight LUA helper

Panic Restaurant.lua
529 downloads
Uploaded 8/18/2019 5:01 AM by dart193 (see all 5)
This is a LUA script for NES Panic Restaurant. It shows if you hit the boss right after its invincibility wears off or not. MISS means was not hit on the optimal frame, HIT means it was. READY means that the attack have to be started on this frame, ATTACK means that the hit must be landed on this frame.
local BossInvTimerADDR1=0x00B4;
local BossInvTimerADDR2=0x00B6;
local BossHPADDR=0x00AD;
local MusicADDR=0x0719;
local PreLastTimer=0;
local LastTimer=0, CurrentTimer, BossHP;
local temp;
local Music=0;
while true do
	BossHP=memory.read_s8(BossHPADDR);
	CurrentTimer=memory.readbyte(BossInvTimerADDR1);
	temp=memory.readbyte(BossInvTimerADDR2);
	if temp>CurrentTimer then
		CurrentTimer=temp;
	end;
	Music=memory.readbyte(MusicADDR);
	if (Music==7 or Music==8) then
		if BossHP==-1 then
			gui.text(850,190,"Hit","Green");
		elseif ((PreLastTimer==0 and LastTimer==0) and CurrentTimer==0) then
			gui.text(835,190,"Miss!","Red");
		elseif LastTimer==1 then
			gui.text(835,190,"Ready","Yellow");
		elseif PreLastTimer==1 then
			gui.text(825,190,"Attack","Yellow");
		else
			gui.text(850,190,"Hit","Green");
		end;
	end;
	PreLastTimer=LastTimer;
	LastTimer=CurrentTimer;
	emu.frameadvance();
end