The Wiki for Tale 7 is in read-only mode and is available for archival and reference purposes only. Please visit the current Tale 11 Wiki in the meantime.

If you have any issues with this Wiki, please post in #wiki-editing on Discord or contact Brad in-game.

User:Soak/Macro

From ATITD7
< User:Soak
Revision as of 19:48, 16 October 2015 by Soak (talk | contribs)
Jump to navigationJump to search

Automato Macros


Firepit V1.2

- The way the macro works is by checking the colors at your mouse position when starting macro, and stoking the flame when colors are correct. - pin the firepit for macro to stoke. - only works for 1 firepit - save as lua

dofile("common.inc");
-- firepit macro by soak
-- light the firepit and put mouse over the flame
-- when firepit is at 255,255,255 color will stoke the flame using hotkeys
function doit()
 strokes = 0;
 strokeCheck = 0;
 strokeCheck2 = 0;
 strokeColor = 0xFFFFFF;
 strokeOffset = makePoint(0, 0);
  askForWindow(" Start the firepit and keep mouse over the firepit, the macro only checks at your mouse position. Press shift over ATITD window to continue. Macro by Soak");
 MouseXY = getMousePos();
  while true do
  
    srReadScreen();
	
	local result2 = pixelMatch(MouseXY, strokeOffset, strokeColor, 0);

    local pixels = pixelDiffs(MouseXY[0], MouseXY[1], 0);

    local status = "Pos: (" .. MouseXY[0] .. ", " .. MouseXY[1] .. ")\n";

    status = status .. "Color: " .. table.concat(pixels, ", ");
	
	status = status .. "\nCheck: ".. strokeCheck .. " extra: " ..strokeCheck2  ;
	status = status .. "\nTotal Stoke: " .. strokes ;
	
	
	
	if result2 then
	strokeCheck2 = strokeCheck2 +1;
	strokeCheck = strokeCheck +1;
	if strokeCheck > 2 then
		clickAllImages("This.png"); -- update the firepit UI
		sleepWithStatus(150, "refrshing UI");
		clickAllImages("stoke2.png"); -- clicking the stoke option
		sleepWithStatus(500, "clicking");
		strokes = strokes +  1;
		strokeCheck = 0; -- reset value
		strokeCheck2 = 0;
		sleepWithStatus(32000, "Found 255, stokes " .. strokes);
	 end
	 else
	 strokeCheck = 0;		
	 
	end
	
	 	
	if strokes > 60 then
		break;
	end	
	
		
 sleepWithStatus(200, status);

    
  end
end