The Wiki for Tale 5 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:Makazi/Macro/Flax Assist"

From ATITD5
Jump to navigationJump to search
 
Line 19: Line 19:
 
image_name = "Harvest.png";
 
image_name = "Harvest.png";
 
end
 
end
if (lsAltHeld()) then
+
if (lsControlHeld()) then
 
image_name = "WeedAndWater.png";
 
image_name = "WeedAndWater.png";
 
end
 
end
Line 29: Line 29:
 
statusScreen("Searching for: " .. "\n" .. image_name .. "\n" .. "Press Shift for Harvest." .. "\n" ..  
 
statusScreen("Searching for: " .. "\n" .. image_name .. "\n" .. "Press Shift for Harvest." .. "\n" ..  
  
"Press Alt for Weed and Water");
+
"Press CTRL for Weed and Water");
 
lsSleep(per_click_delay);
 
lsSleep(per_click_delay);
 
else
 
else

Latest revision as of 12:44, 22 January 2011

--
-- 
--

loadfile("luaScripts/screen_reader_common.inc")();
loadfile("luaScripts/ui_utils.inc")();

per_click_delay = 90;
image_name = "WeedAndWater.png";

function doit()
	askForWindow("This script will look for Flax bed windows and press the option shown. When you start, it will search for Weed and Water, then you can switch to Harvest. Instructions of how to switch will be shown.");

		
		-- Find buttons and click them!
while 1 do		
		if (lsShiftHeld()) then
			image_name = "Harvest.png";
		end
		if (lsControlHeld()) then
			image_name = "WeedAndWater.png";
		end		
		srReadScreen();
		xyWindowSize = srGetWindowSize();
		local buttons = findAllImages(image_name);

		if #buttons == 0 then
			statusScreen("Searching for: " .. "\n" .. image_name .. "\n" .. "Press Shift for Harvest." .. "\n" .. 

"Press CTRL for Weed and Water");
			lsSleep(per_click_delay);
		else
			statusScreen("Clicking " .. #buttons .. "button(s)...");
			

			for i=1, #buttons do
				srClickMouseNoMove(buttons[i][0]+5, buttons[i][1]+3, right_click);
				lsSleep(per_click_delay);
			end


		end
	end
end