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:Obol/Macros"

From ATITD7
Jump to navigationJump to search
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Cut Stone Macro ==
+
== Fixed VeggieTales Macros ==
<pre>
+
In Automato (previously known as VeggieTales) once you get to the list of scripts you will see a button Open Folder.  Click it and find the script name that matches one of the following.  It is best that you copy it and make a new file so you have a back up before you change it.  Open the file with an editor, I suggest [https://notepad-plus-plus.org/repository/6.x/6.8.5/npp.6.8.5.Installer.exe notepad++], it is a free editor, has line numbers and syntax highlighting. Clicking on one of the following links will take you to a page where you can copy the contents in the white box and paste it into the script replacing what ever is there.  Save the script and give it a try.  Hopefully it will work for you too.
-- Open windows with window_opener.lua
 
-- Arrange them with winder_arranger.lua in rock saw mode
 
-- Run this
 
-- Profit!
 
  
dofile("screen_reader_common.inc");
+
* This one is needed for all scripts. please do it first.
dofile("ui_utils.inc");
+
** [[User:Obol/common_window.mac|common_window.inc]]
  
--local expected_windows = 40; -- Just to double check you don't have any extra windows open that it'll try to click on
+
* This had a simple fix
 +
** [[User:Obol/cut_stone_mac|cut_stones.lua]]<br>
  
expected_windows = promptNumber("How many Rock Saws?", 1);
+
*Currently the Flax script only recognizes these seeds: "Symphony Ridge Gold", "Jacob", "Constitution", "Nile Green", "Old Dog", "Old Egypt", "SunsetPond" Some of them go to seed quickly so I suggest you limit the beds to 4X4
take_locs = 0;
+
** [[User:Obol/flax_stable_mac|flax_stable.lua]]
  
local per_click_delay = 0;
+
* This had a menu resize issue
 
+
** [[User:Obol/glass_mac|glass.lua]]<br>
function setWaitSpot(x0, y0)
 
setWaitSpot_x = x0;
 
setWaitSpot_y = y0;
 
setWaitSpot_px = srReadPixel(x0, y0);
 
 
srSetMousePos(setWaitSpot_x, setWaitSpot_y);
 
end
 
 
 
function waitForChange()
 
local c=0;
 
while srReadPixel(setWaitSpot_x, setWaitSpot_y) == setWaitSpot_px do
 
lsSleep(1);
 
c = c+1;
 
if (lsShiftHeld() and lsControlHeld()) then
 
error 'broke out of loop from Shift+Ctrl';
 
end
 
end
 
-- lsPrintln('Waited ' .. c .. 'ms for pixel to change.');
 
end
 
 
 
function clickAll(image_name, up)
 
-- Find buttons and click them!
 
srReadScreen();
 
xyWindowSize = srGetWindowSize();
 
local buttons = findAllImages(image_name);
 
 
if #buttons == 0 then
 
error 'Could not find any \'Rock Saw\' windows.'
 
--statusScreen("Could not find specified buttons...");
 
--lsSleep(1500);
 
else
 
statusScreen("Clicking " .. #buttons .. "button(s)...");
 
if up then
 
for i=#buttons, 1, -1  do
 
srClickMouseNoMove(buttons[i][0]+5, buttons[i][1]+3);
 
lsSleep(per_click_delay);
 
end
 
else
 
for i=1, #buttons  do
 
srClickMouseNoMove(buttons[i][0]+5, buttons[i][1]+3);
 
lsSleep(per_click_delay);
 
end
 
end
 
statusScreen("Done clicking (" .. #buttons .. " clicks).");
 
lsSleep(100);
 
end
 
end
 
 
 
function refocus()
 
statusScreen("Refocusing...");
 
for i=2, #window_locs do
 
setWaitSpot(window_locs[i][0], window_locs[i][1]);
 
srClickMouseNoMove(window_locs[i][0] + 321, window_locs[i][1] + 74);
 
waitForChange();
 
end
 
end
 
 
 
function doit()
 
askForWindow("Open, pin, and arrange rock saws with window_opener/window_arranger first.");
 
srReadScreen();
 
while true do
 
window_locs = findAllImages("This.png");
 
if not (#window_locs == expected_windows) then
 
error ("Did not find expected number of windows (found " .. #window_locs .. " expected " .. expected_windows .. ")");
 
end
 
 
 
-- refresh windows
 
--lsPrintln('Found ' .. #window_locs .. ' saws.');
 
clickAll("This.png", 1);
 
lsSleep(200);
 
 
-- take everything
 
window_locs = findAllImages("Take.png");
 
--lsPrintln('Found ' .. #window_locs .. ' Takes.');
 
if not (#window_locs == 0) then
 
clickAll("Take.png", 1);
 
lsSleep(200);
 
 
clickAll("Everything.png", 1);
 
lsSleep(200);
 
end
 
--refocus();
 
 
clickAll("MakeACutStone.png", 1);
 
lsSleep(200);
 
 
--refocus();
 
 
sleepWithStatus(245*1000, "Waiting for stones to finish");
 
end
 
end
 
</pre>
 

Latest revision as of 22:09, 15 November 2015

Fixed VeggieTales Macros

In Automato (previously known as VeggieTales) once you get to the list of scripts you will see a button Open Folder. Click it and find the script name that matches one of the following. It is best that you copy it and make a new file so you have a back up before you change it. Open the file with an editor, I suggest notepad++, it is a free editor, has line numbers and syntax highlighting. Clicking on one of the following links will take you to a page where you can copy the contents in the white box and paste it into the script replacing what ever is there. Save the script and give it a try. Hopefully it will work for you too.

  • Currently the Flax script only recognizes these seeds: "Symphony Ridge Gold", "Jacob", "Constitution", "Nile Green", "Old Dog", "Old Egypt", "SunsetPond" Some of them go to seed quickly so I suggest you limit the beds to 4X4