Browse files

Increased per_click_delay from 0 to 100, plus added a 200 delay in be…

…tween Search Method 1 and 2. This will help prevent extra clicks near other critical locations, such as the 'pyramid icon'. Example: closing windows near the pyramid icon when using the thistle_new layout. Windows that are close to the pyramid icon could cause it to click the pyramid icon many times and in between each click lag will cause a severe reaction, game locking up.
  • Loading branch information...
1 parent 310bcd5 commit fb036bfdf65de77f103e55155adc149527970a2c @Cegaiel Cegaiel committed Apr 16, 2012
Showing with 11 additions and 7 deletions.
  1. +11 −7 VeggieTales/luaScripts/window_unpin.lua
@@ -1,17 +1,18 @@
-- Macro by Cegaiel
--- This will right click all windows, in an attempt to unpin and close them all.
--- It searches for windows with BOTH 'ThisIs.png' and 'Unpin.png' to ensure nothing is missed.
--- This script does nothing more than right click on windows. If they are pinned, a right click will close them all (as intended).
--- If any or all of your windows exist, but not pinned , then this macro would pin them (not intended), keep that in mind!
+-- This will right click all windows found (both searchImage1 or searchImage2), in an attempt to unpin and close all pinned windows.
+-- It right clicks (closes) every open window that currently shows on screen, in one pass.. If it finds any windows to click then:
+ --Repeat and search for more windows and close all found in another pass again, repeat.
+ -- The purpose of repeating is in case you had any windows were hidden behind other windows from the previous right clicks/close windows.
+ -- Repeat above until no more windows are found. Then do Search Method 2 (another .png) for expired windows (ie. flax bed that turned to seed and window turned blank)
+-- Repeat same pattern for Method 2, until no more windows are found, then exit.
right_click = true; -- Set this boolean to 'true' to do right clicks. If this was blank or false, then it would do left clicks.
-per_click_delay = 0; -- Time is in ms
+per_click_delay = 150; -- Time is in ms
searchImage1 = "ThisIs.png" -- Method 1
@@ -32,6 +33,8 @@ function doit()
--Keep looking for and closing windows with Image2 until no more found, then done.
while repeatMethod2 == 1 do
@@ -59,7 +62,8 @@ function closeMethod1()
repeatMethod1 = 0
for i=#buttons, 1, -1 do
srClickMouseNoMove(buttons[i][0]+5, buttons[i][1]+3, right_click);

0 comments on commit fb036bf

Please sign in to comment.