The Wiki for Tale 8 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:Cegaiel/Macros"

From A Wiki in the Desert
Jump to navigation Jump to search
Line 10: Line 10:
 
local done = false
 
local done = false
 
 
 +
askForWindow("This will always click OK or Yes whenever found. Typical when someone is teaching you lessons.") ;
  
 +
while not done do
  
askForWindow("This will always click OK or Yes whenever found. Typical when someone is teaching you lessons.") ;
 
 
while not done
 
do
 
 
sleepWithStatus(100, "Looking for Yes/OK");
 
sleepWithStatus(100, "Looking for Yes/OK");
 
srReadScreen();
 
srReadScreen();
Line 22: Line 20:
 
if (pos) then
 
if (pos) then
 
safeClick(pos[0] + 1, pos[1] + 1);
 
safeClick(pos[0] + 1, pos[1] + 1);
sleepWithStatus(1000,"Found and clicked Yes!");
+
                        sleepWithStatus(1000,"Found and clicked Yes!");
 
end
 
end
  
Line 28: Line 26:
 
if (pos2) then
 
if (pos2) then
 
safeClick(pos2[0] + 1, pos2[1] + 1);
 
safeClick(pos2[0] + 1, pos2[1] + 1);
sleepWithStatus(1000,"Found and clicked OK!");
+
                        sleepWithStatus(1000,"Found and clicked OK!");
 
 
 
end
 
end
  
 
+
        lsSleep(200);
lsSleep(200);
 
 
 
 
 
 
end
 
end
 
 
end
 
end
 
</pre>
 
</pre>
Line 52: Line 45:
  
 
timer = 900000; --  15 mins
 
timer = 900000; --  15 mins
 
 
 
  
 
function doit()
 
function doit()

Revision as of 18:05, 16 June 2018

Go Back

  • LearnLessons.lua - Useful if someone is teaching you lessons and you're slow to pay attention. Will click the Yes and OK popups as they appear so lesson can continue in a timely manner.
dofile("common.inc");


function doit()
	local done = false
	
	askForWindow("This will always click OK or Yes whenever found. Typical when someone is teaching you lessons.") ;

	while not done do

		sleepWithStatus(100, "Looking for Yes/OK");
		srReadScreen();

		local pos = srFindImage("yes3.png");
		if (pos) then
			safeClick(pos[0] + 1, pos[1] + 1);
                        sleepWithStatus(1000,"Found and clicked Yes!");
		end

		local pos2 = srFindImage("OK.png");
		if (pos2) then
			safeClick(pos2[0] + 1, pos2[1] + 1);
                        sleepWithStatus(1000,"Found and clicked OK!");
		end

         lsSleep(200);
	end
end


  • Screenshot.lua - Sends Alt+C to the game at intervals to take a screenshot. The frame000,001,002,etc.png file will appear in your ATITD GAME folder.
dofile("common.inc");
dofile("constants.inc");


askText = "Presses Alt+C to create .png in ATITD folder";

timer = 900000; --  15 mins

function doit()
	askForWindow(askText);


	while 1 do
	  sleepWithStatus(timer,"Waiting to take screenshot...");
	  srKeyDown2(VK_MENU);
	  lsSleep(100);
	  srKeyEvent('c');
	  lsSleep(100);
	  srKeyUp2(VK_MENU);
	end
end