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
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
  
Firepit V1
+
Firepit V1.2
 +
 
 +
<p>- 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.</p>
 +
<p>- pin the firepit for macro to stoke.</p>
 +
<p>- only works for 1 firepit</p>
 +
<p>- uses img to stoke </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>
 +
<p>- roughly these spot should work when grabbing mosue locations, the macro will wait 4 seconds grab the mouse location and do it 3 times total these are the spots I roughly use and have success
 +
the trick is to grab 3 different points on the flame </p>
 +
<p>[[http://www.atitd.org/wiki/tale7/images/4/4c/Firepitpoints.jpg]] </p>
  
- 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
 
  
 
<pre>
 
<pre>
Line 14: Line 22:
 
function doit()
 
function doit()
 
  strokes = 0;
 
  strokes = 0;
  strokeCheck = 0;
+
  strokeColor = 0xFFFFFF;
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");
+
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
 
   while true do
 
    
 
    
 
     srReadScreen();
 
     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;
 
 
 
 +
local stokeTime = pixelMatch(mouseLoc1, strokeOffset, strokeColor, 5);
 +
 +
local stokeTime2 = pixelMatch(mouseLoc2, strokeOffset, strokeColor, 5);
 
 
-- check if pixels are correct color to stoke
+
local stokeTime3 = pixelMatch(mouseLoc3, strokeOffset, strokeColor, 5);
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
 
 
 
 +
    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 ;
 
 
-- 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;
+
if stokeTime and stokeTime2 and stokeTime3 then
end
+
clickAllImages("This.png"); -- update the firepit UI
 
+
sleepWithStatus(150, "refrshing UI");
if pixels[3] < 255 then
+
clickAllImages("stoke2.png"); -- clicking the stoke option
strokeCheck = 0;
+
sleepWithStatus(500, "clicking");
end
+
strokes = strokes +  1;
 +
sleepWithStatus(32000, "Found 255, stokes " .. strokes);
 +
end
 
 
+
  sleepWithStatus(150, status);
 
 
 
  -- 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
 
end
 
end
 +
 
</pre>
 
</pre>
  

Latest revision as of 17:32, 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

- roughly these spot should work when grabbing mosue locations, the macro will wait 4 seconds grab the mouse location and do it 3 times total these are the spots I roughly use and have success the trick is to grab 3 different points on the flame

[[1]]


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