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