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.

Difference between revisions of "User:Soak/Macro"

From ATITD7
Jump to navigationJump to search
Line 7: Line 7:
 
<p>- pin the firepit for macro to stoke.</p>
 
<p>- pin the firepit for macro to stoke.</p>
 
<p>- only works for 1 firepit</p>
 
<p>- only works for 1 firepit</p>
 +
<p>- uses img to stoke </p>
 
<p>- save as lua</p>
 
<p>- save as lua</p>
 +
<p>- this is the img I use  [[File:stoke2.png]]  ,save the image under automao>games>ATITD>images </p>
 +
  
 
<pre>
 
<pre>
Line 16: Line 19:
 
function doit()
 
function doit()
 
  strokes = 0;
 
  strokes = 0;
strokeCheck = 0;
 
strokeCheck2 = 0;
 
 
  strokeColor = 0xFFFFFF;
 
  strokeColor = 0xFFFFFF;
 
  strokeOffset = makePoint(0, 0);
 
  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");
 
   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();
+
   
 +
 +
  sleepWithStatus(4000, "getting mouse spot 1 " .. strokes);
 +
  mouseLoc1 = getMousePos();
 +
  sleepWithStatus(4000, "getting mouse spot 2 " .. strokes);
 +
  mouseLoc2 = getMousePos();
 +
  sleepWithStatus(4000, "getting mouse spot 3 " .. strokes);
 +
  mouseLoc3 = getMousePos();
 +
 
 
   while true do
 
   while true do
 
    
 
    
 
     srReadScreen();
 
     srReadScreen();
 
 
local result2 = pixelMatch(MouseXY, strokeOffset, strokeColor, 0);
+
local stokeTime = pixelMatch(mouseLoc1, strokeOffset, strokeColor, 5);
 
+
     local pixels = pixelDiffs(MouseXY[0], MouseXY[1], 0);
+
local stokeTime2 = pixelMatch(mouseLoc2, strokeOffset, strokeColor, 5);
 
+
     local status = "Pos: (" .. MouseXY[0] .. ", " .. MouseXY[1] .. ")\n";
+
local stokeTime3 = pixelMatch(mouseLoc3, strokeOffset, strokeColor, 5);
 
+
 +
     local pixels = pixelDiffs(mouseLoc1[0], mouseLoc1[1], 0);
 +
local pixels2 = pixelDiffs(mouseLoc2[0], mouseLoc2[1], 0);
 +
local pixels3 = pixelDiffs(mouseLoc3[0], mouseLoc3[1], 0);
 +
     local status = "Pos: (" .. mouseLoc1[0] .. ", " .. mouseLoc1[1] .. ")\n";
 +
status = status .. "Pos2: (" .. mouseLoc2[0] .. ", " .. mouseLoc2[1] .. ")\n";
 +
status = status .. "Pos3: (" .. mouseLoc3[0] .. ", " .. mouseLoc3[1] .. ")\n";
 
     status = status .. "Color: " .. table.concat(pixels, ", ");
 
     status = status .. "Color: " .. table.concat(pixels, ", ");
+
status = status .. "\nColor2: " .. table.concat(pixels2, ", ");
status = status .. "\nCheck: ".. strokeCheck .. " extra: " ..strokeCheck2  ;
+
status = status .. "\nColor3: " .. table.concat(pixels3, ", ");
 
status = status .. "\nTotal Stoke: " .. strokes ;
 
status = status .. "\nTotal Stoke: " .. strokes ;
 
 
 +
 
 
+
if stokeTime and stokeTime2 and stokeTime3 then
if result2 then
 
strokeCheck2 = strokeCheck2 +1;
 
strokeCheck = strokeCheck +1;
 
if strokeCheck > 2 then
 
 
clickAllImages("This.png"); -- update the firepit UI
 
clickAllImages("This.png"); -- update the firepit UI
 
sleepWithStatus(150, "refrshing UI");
 
sleepWithStatus(150, "refrshing UI");
Line 48: Line 60:
 
sleepWithStatus(500, "clicking");
 
sleepWithStatus(500, "clicking");
 
strokes = strokes +  1;
 
strokes = strokes +  1;
strokeCheck = 0; -- reset value
 
strokeCheck2 = 0;
 
 
sleepWithStatus(32000, "Found 255, stokes " .. strokes);
 
sleepWithStatus(32000, "Found 255, stokes " .. strokes);
end
+
end
else
 
strokeCheck = 0;
 
 
end
 
 
 
if strokes > 60 then
 
break;
 
end
 
 
 
 
  sleepWithStatus(200, status);
+
  sleepWithStatus(150, status);
  
 
      
 
      
 
   end
 
   end
 
end
 
end
 +
 
</pre>
 
</pre>
  

Revision as of 17:13, 24 October 2015

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

- uses img to stoke

- save as lua

- this is the img I use Stoke2.png ,save the image under automao>games>ATITD>images


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;
 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");
 
 
  sleepWithStatus(4000, "getting mouse spot 1 " .. strokes);
  mouseLoc1 = getMousePos();
  sleepWithStatus(4000, "getting mouse spot 2 " .. strokes);
  mouseLoc2 = getMousePos();
  sleepWithStatus(4000, "getting mouse spot 3 " .. strokes);
  mouseLoc3 = getMousePos();
  
  while true do
  
    srReadScreen();
	
	local stokeTime = pixelMatch(mouseLoc1, strokeOffset, strokeColor, 5);
	
	local stokeTime2 = pixelMatch(mouseLoc2, strokeOffset, strokeColor, 5);
	
	local stokeTime3 = pixelMatch(mouseLoc3, strokeOffset, strokeColor, 5);
	
    local pixels = pixelDiffs(mouseLoc1[0], mouseLoc1[1], 0);
	local pixels2 = pixelDiffs(mouseLoc2[0], mouseLoc2[1], 0);
	local pixels3 = pixelDiffs(mouseLoc3[0], mouseLoc3[1], 0);
    local status = "Pos: (" .. mouseLoc1[0] .. ", " .. mouseLoc1[1] .. ")\n";
	 status = status .. "Pos2: (" .. mouseLoc2[0] .. ", " .. mouseLoc2[1] .. ")\n";
	 status = status .. "Pos3: (" .. mouseLoc3[0] .. ", " .. mouseLoc3[1] .. ")\n";
    status = status .. "Color: " .. table.concat(pixels, ", ");
	status = status .. "\nColor2: " .. table.concat(pixels2, ", ");
	status = status .. "\nColor3: " .. table.concat(pixels3, ", ");
	status = status .. "\nTotal Stoke: " .. strokes ;
	

	
	if stokeTime and stokeTime2 and stokeTime3 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;
		sleepWithStatus(32000, "Found 255, stokes " .. strokes);
	 end			
		
 sleepWithStatus(150, status);

    
  end
end