User File #32172505606083811

Upload All User Files

#32172505606083811 - DW4-SingleActionManipulation

DW4-SingleActionManipulation.lua
1141 downloads
Uploaded 7/10/2016 9:07 PM by adelikat (see all 20)
sometimes you don't have the luxury of having previous actions to start a manipulation from. This script is the last resort technique. You start it on the lag frame before the action. The logic is that it will mash random buttons such that it will delay the ability to press a button to scroll to the next action. Then it delays a frame and presses a random button. There's a max of about 30 frames that you can delay this way. There's not a lot of RNG variance either. But this script can get decent results when there are no other options.
-----------------
-- Settings
-----------------
maxDelay = 15; --Max amount of delay to use during delayable moments
reportFrequency = 1; -- 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;

	-- Loop
	--------------------------------------	
	delay = math.random(1, maxDelay);
	for i = 0, delay, 1 do
		c.RndAtLeastOne();
	end

	c.WaitFor(1);
	c.PushA();

	c.WaitFor(24);
	c.WaitFor(24);

	c.RandomFor(10);
	c.WaitFor(20);

	--------------------------------------
	c.attempts = c.attempts + 1
	--------------------------------------
	--dmg = memory.readbyte(0x7361);
	--if dmg >= 38 then c.done = true; end
	--c.LogProgress(c.done, c.attempts, delay, 'dmg: ' .. dmg);

	hp = memory.readbyte(0x605c);
	if hp == 110 then c.done = true; end
	c.LogProgress(c.done, c.attempts, delay, 'hp: ' .. hp);

	--------------------------------------
end

c.Finish();