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:30, 10 October 2015 by Soak (talk | contribs)
Jump to navigationJump to search

Automato Macros


Firepit V1

- The way the macro works is by checking the colors at your mouse position and stoking the flame when colors are correct. - 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;
 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");
  while true do
  
    srReadScreen();
    local pos = getMousePos();
    local pixels = pixelDiffs(pos[0], pos[1], 0);
    local status = "Pos: (" .. pos[0] .. ", " .. pos[1] .. ")\n";
    status = status .. "Color: " .. table.concat(pixels, ", ");
	status = status .. "\n Check: ".. strokeCheck ;
	status = status .. "\n Total Stoke: " .. strokes;
	
	
	-- check if pixels are correct color to stoke
	if pixels[1] == 255 then -- 1 start		
		if pixels[2] == 255 then -- 2 start
			if pixels[3] == 255 then -- 3 start			
			strokeCheck = strokeCheck + 1;
			end -- end 3		
		end -- end 2	
	end -- 1 end
	
	
	-- we reset the strokecheck if all colors dont match up
	if pixels[1] < 255 then 
			strokeCheck = 0;
end	

	if pixels[2] < 255 then 	
			strokeCheck = 0;
end	

	if pixels[3] < 255 then 
			strokeCheck = 0;
end			
		
					
				
	
	
   -- check to make sure flame is ready to be stoked 
	if strokeCheck > 3 then -- flame is ready
			srKeyEvent("s"); -- stoke the flame
			strokes = strokes +  1;
			strokeCheck = 0; -- reset value
			sleepWithStatus(36000, "Found 255, stokes " .. strokes);
	end
	sleepWithStatus(100, status);

    
  end
end