User File #32172349239565591

Upload All User Files

#32172349239565591 - DW4-ManipCritical

DW4-ManipCritical.lua
1321 downloads
Uploaded 7/10/2016 8:57 PM by adelikat (see all 20)
This file was used to manipulate critical hits in typical situations, where they were not the first action in a round. The wait options at the top were based on how many previous (non-luck manipulated) scroll moments there were. The further back you could start the bot, the better the results. This file uses the DW-4ManipCore file
-----------------
-- 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();