-----------------
-- Settings
-----------------
_odds = 64 --1 in x
_padding = 1;
_wait3 = 0;
_wait2 = 47; --47; --87;
_wait1 = 17; --17
minDmg = 99;
dmgAddr = 0x7361;
reportFrequency = 5; -- How many attempts before it logs a result
-------------------------
local c = require("DW4-ManipCore");
c.InitSession();
while not c.done do
savestate.loadslot(0);
delay = 0;
maxDelay = math.floor(c.attempts / _odds) + _padding;
-- Loop
--------------------------------------
if (_wait3 > 0) then
delay = delay + c.DelayUpTo(maxDelay);
c.RndAtLeastOne();
c.RandomFor(_wait3 - 2); -- Possible non-lag frames for manipulation
c.WaitFor(2);
end
if (_wait2 > 0) then
delay = delay + c.DelayUpTo(maxDelay);
c.RndAtLeastOne();
c.RandomFor(_wait2 - 2); -- Possible non-lag frames for manipulation
c.WaitFor(2);
end
delay = delay + c.DelayUpTo(maxDelay);
c.RndAtLeastOne();
c.RandomFor(_wait1 - 2); -- Possible non-lag frames for manipulation
c.WaitFor(2);
delay = delay + c.DelayUpTo(maxDelay);
c.RndAtLeastOne();
c.WaitFor(30); -- Ensure damage is calculated and in memory
c.attempts = c.attempts + 1;
-- Eval
--------------------------------------
dmg = memory.readbyte(dmgAddr);
--action = memory.readbyte(0x008B);
if dmg >= minDmg
then
c.done = true;
end
c.LogProgress(c.done, c.attempts, delay, 'dmg: ' .. dmg);
--------------------------------------
end
c.Finish();