From a35ce655e8c7c300c0075bab0c4d9624f1778c01 Mon Sep 17 00:00:00 2001 From: Michael Sharp Date: Sun, 20 May 2012 02:41:21 -0400 Subject: [PATCH 1/4] Timing and GUI tweaks. --- VeggieTales/luaScripts/mining_ore.lua | 93 +++++++++++++++------------ 1 file changed, 51 insertions(+), 42 deletions(-) diff --git a/VeggieTales/luaScripts/mining_ore.lua b/VeggieTales/luaScripts/mining_ore.lua index 8d51ef2..54b5d77 100644 --- a/VeggieTales/luaScripts/mining_ore.lua +++ b/VeggieTales/luaScripts/mining_ore.lua @@ -1,20 +1,19 @@ --- mining_ore.lua v1.2 -- by Cegaiel +-- mining_ore.lua v1.3 -- by Cegaiel -- Credits to Tallow for his Simon macro, which was used as a template to build on. -- --- Brute force method, you manually click/set every stones' location and it will work every possible 3 node/stone combinations +-- Brute force method, you manually click/set every stones' location and it will work every possible 3 node/stone combinations. -- assert(loadfile("luaScripts/common.inc"))(); askText = singleLine([[ - Ore Mining v1.2 (by Cegaiel) -- + Ore Mining v1.3 (by Cegaiel) -- Brute Force method. Will try every possible 3 node/stone combination. Make sure chat is MINIMIZED! Press Shift over ATITD window. ]]); -clickList = {}; -mineList = {}; +timesworked = 0; dropdown_values = {"Shift Key", "Ctrl Key", "Alt Key", "Mouse Wheel Click"}; dropdown_cur_value = 1; dropdown_ore_values = {"Aluminum (9)", "Antimony (14)", "Copper (8)", "Gold (12)", "Iron (7)", "Lead (9)", "Lithium (10)", "Magnesium (9)", "Platinum (12)", "Silver (10)", "Strontium (10)", "Tin (9)", "Tungsten (12)", "Zinc (10)"}; @@ -31,6 +30,7 @@ end function getMineLoc() + mineList = {}; local was_shifted = lsShiftHeld(); if (dropdown_cur_value == 1) then was_shifted = lsShiftHeld(); @@ -72,11 +72,11 @@ function getMineLoc() lsPrint(10, 10, z, 1.0, 1.0, 0xFFFFFFff, "Set Mine Location"); local y = 60; - lsPrint(5, y, z, 0.7, 0.7, 0xf0f0f0ff, "1) Lock ATITD screen (Alt+L) ."); - y = y+16; - lsPrint(5, y, z, 0.7, 0.7, 0xf0f0f0ff, "1b) Suggest F5 view, zoomed out."); - y = y+16; - lsPrint(5, y, z, 0.7, 0.7, 0xf0f0f0ff, "2) Hover and " .. key .. " over the MINE."); + lsPrint(5, y, z, 0.7, 0.7, 0xf0f0f0ff, "Lock ATITD screen (Alt+L) ."); + y = y+20; + lsPrint(5, y, z, 0.7, 0.7, 0xf0f0f0ff, "Suggest F5 view, zoomed almost all the way out."); + y = y+40; + lsPrint(5, y, z, 0.7, 0.7, 0xf0f0f0ff, "Hover and " .. key .. " over the MINE."); y = y + 30; local start = math.max(1, #mineList - 20); local index = 0; @@ -112,6 +112,7 @@ end function getPoints() + clickList = {}; if (dropdown_ore_cur_value == 1) then ore = "Aluminum"; stonecount = 9; @@ -190,7 +191,7 @@ function getPoints() was_shifted = is_shifted; checkBreak(); lsPrint(10, 10, z, 1.0, 1.0, 0xFFFFFFff, - "Set Node Locations (" .. #clickList .. ")"); + "Set Node Locations (" .. #clickList .. "/" .. stonecount .. ")"); local y = 60; if nodeError == 1 then @@ -199,21 +200,28 @@ function getPoints() y = y + 30 end - lsPrint(5, y, z, 0.7, 0.7, 0xf0f0f0ff, "1) Hover and " .. key .. " over each node."); - y = y + 16; - lsPrint(5, y, z, 0.7, 0.7, 0xf0f0f0ff, "2) Make sure chat is MINIMIZED!"); - y = y + 40; + lsPrint(5, y, z, 0.7, 0.7, 0xf0f0f0ff, "Hover and " .. key .. " over each node."); + y = y + 15; + lsPrint(5, y, z, 0.7, 0.7, 0xf0f0f0ff, "Make sure chat is MINIMIZED!"); + y = y + 30; + lsPrint(5, y, z, 0.7, 0.7, 0xf0f0f0ff, "Click Delay: " .. clickDelay.. " ms"); + y = y + 15; + lsPrint(5, y, z, 0.7, 0.7, 0xf0f0f0ff, "Popup Delay: " .. popDelay .. " ms"); + y = y + 30; lsPrint(5, y, z, 0.7, 0.7, 0xf0f0f0ff, "Mine Type: " .. ore); - y = y + 16; - lsPrint(5, y, z, 0.7, 0.7, 0xf0f0f0ff, "Select " .. nodeleft .. " more nodes to activate auto-mine!"); + y = y + 15; + lsPrint(5, y, z, 0.7, 0.7, 0xf0f0f0ff, "Mine Worked: " .. timesworked .. " times"); + y = y + 30; + lsPrint(5, y, z, 0.7, 0.7, 0xf0f0f0ff, "Select " .. nodeleft .. " more nodes to activate auto-mine!"); + y = y + 40; local start = math.max(1, #clickList - 20); local index = 0; for i=start,#clickList do local xOff = (index % 3) * 100; local yOff = (index - index%3)/2 * 15; lsPrint(20 + xOff, y + yOff, z, 0.5, 0.5, 0xffffffff, - "(" .. clickList[i][1] .. ", " .. clickList[i][2] .. ")"); + i .. ": (" .. clickList[i][1] .. ", " .. clickList[i][2] .. ")"); index = index + 1; end @@ -248,8 +256,8 @@ function fetchTotalCombos() end end end - statusScreenPause("DON\'T MOVE MOUSE !!!"); - lsSleep(750); + sleepWithStatusPause(650, "DON\'T MOVE MOUSE!"); + sleepWithStatusPause(100, "Working Nodes..."); end @@ -276,10 +284,11 @@ function clickSequence() srSetMousePos(clickList[k][1], clickList[k][2]); lsSleep(clickDelay); srKeyEvent('S'); - lsSleep(popDelay); - findClosePopUp(); statusScreenPause("[" .. worked .. "/" .. totalCombos .. "] Nodes Worked: " .. i .. ", " .. j .. ", " .. k); worked = worked + 1 + lsSleep(popDelay); + findClosePopUp(); + end end @@ -291,10 +300,8 @@ function clickSequence() srSetMousePos(mineX, mineY); lsSleep(clickDelay); srKeyEvent('W'); - sleepWithStatusPause(3000, "Working mine (Fetching new nodes)"); - --Reset the mine/node points and restart - mineList = {}; - clickList = {}; + sleepWithStatusPause(2000, "Working mine (Fetching new nodes)"); + timesworked = timesworked + 1; getPoints(); clickSequence(); end @@ -319,29 +326,29 @@ function promptDelays() while not is_done do checkBreak(); local y = 10; - lsPrint(12, y, 0, 0.8, 0.8, 0xffffffff, + lsPrint(5, y, 0, 0.8, 0.8, 0xffffffff, "Key or Mouse to Select Nodes:"); y = y + 35; lsSetCamera(0,0,lsScreenX*1.3,lsScreenY*1.3); - dropdown_cur_value = lsDropdown("ArrangerDropDown", 15, y, 0, 320, dropdown_cur_value, dropdown_values); + dropdown_cur_value = lsDropdown("ArrangerDropDown", 5, y, 0, 200, dropdown_cur_value, dropdown_values); lsSetCamera(0,0,lsScreenX*1.0,lsScreenY*1.0); - y = y + 25; - lsPrint(12, y, 0, 0.8, 0.8, 0xffffffff, - "How many Nodes? (Choose ore)"); + y = y + 20; + lsPrint(5, y, 0, 0.8, 0.8, 0xffffffff, + "How many Nodes?"); y = y + 50; lsSetCamera(0,0,lsScreenX*1.3,lsScreenY*1.3); - dropdown_ore_cur_value = lsDropdown("ArrangerDropDown2", 15, y, 0, 320, dropdown_ore_cur_value, dropdown_ore_values); + dropdown_ore_cur_value = lsDropdown("ArrangerDropDown2", 5, y, 0, 200, dropdown_ore_cur_value, dropdown_ore_values); lsSetCamera(0,0,lsScreenX*1.0,lsScreenY*1.0); - y = y + 15; - lsPrint(12, y, 0, 0.8, 0.8, 0xffffffff, + y = y + 10; + lsPrint(5, y, 0, 0.9, 0.9, 0xffffffff, "Set Delays:"); y = y + 35; - lsPrint(15, y, 0, 0.8, 0.8, 0xffffffff, "Node Delay (ms):"); - is_done, clickDelay = lsEditBox("delay", 165, y, 0, 50, 30, 1.0, 1.0, + lsPrint(5, y, 0, 0.8, 0.8, 0xffffffff, "Node Delay (ms):"); + is_done, clickDelay = lsEditBox("delay", 170, y, 0, 50, 30, 1.0, 1.0, 0x000000ff, 150); clickDelay = tonumber(clickDelay); if not clickDelay then @@ -349,9 +356,9 @@ function promptDelays() lsPrint(10, y+22, 10, 0.7, 0.7, 0xFF2020ff, "MUST BE A NUMBER"); clickDelay = 150; end - y = y + 50; - lsPrint(15, y, 0, 0.8, 0.8, 0xffffffff, "Popup Delay (ms):"); - is_done, popDelay = lsEditBox("delay2", 165, y, 0, 50, 30, 1.0, 1.0, + y = y + 40; + lsPrint(5, y, 0, 0.8, 0.8, 0xffffffff, "Popup Delay (ms):"); + is_done, popDelay = lsEditBox("delay2", 170, y, 0, 50, 30, 1.0, 1.0, 0x000000ff, 500); popDelay = tonumber(popDelay); if not popDelay then @@ -360,12 +367,14 @@ function promptDelays() popDelay = 500; end - y = y + 35; - lsPrint(5, y, 0, 0.6, 0.6, 0xffffffff, "Node Delay: Delay before selecting each node."); + y = y + 40; + lsPrint(5, y, 0, 0.6, 0.6, 0xffffffff, "Node Delay: Delay before selecting next node."); + y = y + 16; + lsPrint(5, y, 0, 0.6, 0.6, 0xffffffff, "Decrease value to run faster (try increments of 25)"); y = y + 16; lsPrint(5, y, 0, 0.6, 0.6, 0xffffffff, "Popup Delay: After Finalizing, delay to find Popup."); y = y + 16; - lsPrint(5, y, 0, 0.6, 0.6, 0xffffffff, "Decrease values to run faster (try increments of 25)"); + lsPrint(5, y, 0, 0.6, 0.6, 0xffffffff, "Change Popup Delay as last resort to fine tune."); if lsButtonText(10, lsScreenY - 30, 0, 100, 0xFFFFFFff, "Next") then is_done = 1; From a6d7ab4077f7944e71043399daf9b36eda5e3e51 Mon Sep 17 00:00:00 2001 From: Michael Sharp Date: Sun, 20 May 2012 02:42:36 -0400 Subject: [PATCH 2/4] Minor update to instructions text --- VeggieTales/luaScripts/thistle_new_mix.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VeggieTales/luaScripts/thistle_new_mix.lua b/VeggieTales/luaScripts/thistle_new_mix.lua index 7fe1dc6..e2441ad 100644 --- a/VeggieTales/luaScripts/thistle_new_mix.lua +++ b/VeggieTales/luaScripts/thistle_new_mix.lua @@ -331,7 +331,7 @@ function doit() num_loops = promptNumber("How many passes ?", 1); - askForWindow("Pin any number of thistle gardens, edit thistle_new_mix with recipe. This macro should only be used when running mixed upgraded and non upgraded thistle gardens!"); + askForWindow("Pin any number of thistle gardens, edit thistle_new_mix with recipe. This macro can run any combination of non upgraded and upgraded thistle gardens."); if not ( #instructions == 41*5) then error 'Invalid instruction length'; From a5ab8deb32601db1c0e93881b52166f3aa8720fd Mon Sep 17 00:00:00 2001 From: Michael Sharp Date: Sun, 20 May 2012 02:43:56 -0400 Subject: [PATCH 3/4] Minor update to instructions. --- VeggieTales/luaScripts/window_unpin.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/VeggieTales/luaScripts/window_unpin.lua b/VeggieTales/luaScripts/window_unpin.lua index 668b3c5..31da8cf 100644 --- a/VeggieTales/luaScripts/window_unpin.lua +++ b/VeggieTales/luaScripts/window_unpin.lua @@ -25,7 +25,7 @@ repeatMethod3 = 1; function doit() -- Pause, say something to user, wait for Shift key to continue. Give opportunity to put ATITD in focus, if needed. - askForWindow("This will right click all windows, attempting to close any pinned windows. This will also close/click any PopUp windows with 'OK' buttons. Press Shift key continue."); + askForWindow("This will right click all windows, attempting to close any pinned windows. This will also close/click any PopUp windows with 'OK' buttons. This will find any windows or popups that are hidden behind other windows, too. Press Shift key continue."); --Keep looking for and closing windows with Image1 until no more found, then move to Method 2. @@ -36,7 +36,7 @@ function doit() lsSleep(200); - --Keep looking for and closing windows with Image2 until no more found, then done. + --Keep looking for and closing windows with Image2 until no more found, then move to Method 3. while repeatMethod2 == 1 do closeMethod2(); @@ -74,8 +74,7 @@ function closeMethod1() repeatMethod1 = 0 else ---srClickMouseNoMove ---srSetMousePos + for i=#buttons, 1, -1 do srClickMouseNoMove(buttons[i][0]+5, buttons[i][1]+3, right_click); lsSleep(per_click_delay); From 551630797ebc46f17d7a3e96ab6c3fe09b77a2d8 Mon Sep 17 00:00:00 2001 From: Michael Sharp Date: Sun, 20 May 2012 02:47:40 -0400 Subject: [PATCH 4/4] Minor update to instructions. --- VeggieTales/luaScripts/mining_sand.lua | 34 +++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/VeggieTales/luaScripts/mining_sand.lua b/VeggieTales/luaScripts/mining_sand.lua index b9feba3..abbe9ba 100644 --- a/VeggieTales/luaScripts/mining_sand.lua +++ b/VeggieTales/luaScripts/mining_sand.lua @@ -317,9 +317,9 @@ function clickSequence() lsSleep(clickDelay); srKeyEvent('A'); end - findClosePopUp(); statusScreenPause("[" .. worked .. "/" .. sets .. "] " .. #set1 .. " Nodes Worked: " .. table.concat(set1, ", ")); worked = worked + 1 + findClosePopUp(); for i = 1, #set2 do @@ -328,9 +328,9 @@ function clickSequence() lsSleep(clickDelay); srKeyEvent('A'); end - findClosePopUp(); statusScreenPause("[" .. worked .. "/" .. sets .. "] " .. #set2 .. " Nodes Worked: " .. table.concat(set2, ", ")); worked = worked + 1 + findClosePopUp(); for i = 1, #set3 do @@ -339,9 +339,9 @@ function clickSequence() lsSleep(clickDelay); srKeyEvent('A'); end - findClosePopUp(); statusScreenPause("[" .. worked .. "/" .. sets .. "] " .. #set3 .. " Nodes Worked: " .. table.concat(set3, ", ")); worked = worked + 1 + findClosePopUp(); if #set4 > 0 then @@ -351,9 +351,9 @@ function clickSequence() lsSleep(clickDelay); srKeyEvent('A'); end - findClosePopUp(); statusScreenPause("[" .. worked .. "/" .. sets .. "] " .. #set4 .. " Nodes Worked: " .. table.concat(set4, ", ")); worked = worked + 1 + findClosePopUp(); end if #set5 > 0 then @@ -363,9 +363,9 @@ function clickSequence() lsSleep(clickDelay); srKeyEvent('A'); end - findClosePopUp(); statusScreenPause("[" .. worked .. "/" .. sets .. "] " .. #set5 .. " Nodes Worked: " .. table.concat(set5, ", ")); worked = worked + 1 + findClosePopUp(); end @@ -376,9 +376,9 @@ function clickSequence() lsSleep(clickDelay); srKeyEvent('A'); end - findClosePopUp(); statusScreenPause("[" .. worked .. "/" .. sets .. "] " .. #set6 .. " Nodes Worked: " .. table.concat(set6, ", ")); worked = worked + 1 + findClosePopUp(); end @@ -389,9 +389,9 @@ function clickSequence() lsSleep(clickDelay); srKeyEvent('A'); end - findClosePopUp(); statusScreenPause("[" .. worked .. "/" .. sets .. "] " .. #set7 .. " Nodes Worked: " .. table.concat(set7, ", ")); worked = worked + 1 + findClosePopUp(); end @@ -402,9 +402,9 @@ function clickSequence() lsSleep(clickDelay); srKeyEvent('A'); end - findClosePopUp(); statusScreenPause("[" .. worked .. "/" .. sets .. "] " .. #set8 .. " Nodes Worked: " .. table.concat(set8, ", ")); worked = worked + 1 + findClosePopUp(); end @@ -415,9 +415,9 @@ function clickSequence() lsSleep(clickDelay); srKeyEvent('A'); end - findClosePopUp(); statusScreenPause("[" .. worked .. "/" .. sets .. "] " .. #set9 .. " Nodes Worked: " .. table.concat(set9, ", ")); worked = worked + 1 + findClosePopUp(); end @@ -428,9 +428,9 @@ function clickSequence() lsSleep(clickDelay); srKeyEvent('A'); end - findClosePopUp(); statusScreenPause("[" .. worked .. "/" .. sets .. "] " .. #set10 .. " Nodes Worked: " .. table.concat(set10, ", ")); worked = worked + 1 + findClosePopUp(); end @@ -441,9 +441,9 @@ function clickSequence() lsSleep(clickDelay); srKeyEvent('A'); end - findClosePopUp(); statusScreenPause("[" .. worked .. "/" .. sets .. "] " .. #set11 .. " Nodes Worked: " .. table.concat(set11, ", ")); worked = worked + 1 + findClosePopUp(); end @@ -453,9 +453,9 @@ function clickSequence() lsSleep(clickDelay); srKeyEvent('A'); end - findClosePopUp(); statusScreenPause("[" .. worked .. "/" .. sets .. "] " .. #set12 .. " Nodes Worked: " .. table.concat(set12, ", ")); worked = worked + 1 + findClosePopUp(); end @@ -466,9 +466,9 @@ function clickSequence() lsSleep(clickDelay); srKeyEvent('A'); end - findClosePopUp(); statusScreenPause("[" .. worked .. "/" .. sets .. "] " .. #set13 .. " Nodes Worked: " .. table.concat(set13, ", ")); worked = worked + 1 + findClosePopUp(); end @@ -479,9 +479,9 @@ function clickSequence() lsSleep(clickDelay); srKeyEvent('A'); end - findClosePopUp(); statusScreenPause("[" .. worked .. "/" .. sets .. "] " .. #set14 .. " Nodes Worked: " .. table.concat(set14, ", ")); worked = worked + 1 + findClosePopUp(); end @@ -492,9 +492,9 @@ function clickSequence() lsSleep(clickDelay); srKeyEvent('A'); end - findClosePopUp(); statusScreenPause("[" .. worked .. "/" .. sets .. "] " .. #set15 .. " Nodes Worked: " .. table.concat(set15, ", ")); worked = worked + 1 + findClosePopUp(); end @@ -560,13 +560,13 @@ function promptDelays() end y = y + 55; - lsPrint(5, y, 0, 0.6, 0.6, 0xffffffff, "Node Delay: Delay before highlighting next node."); + lsPrint(5, y, 0, 0.6, 0.6, 0xffffffff, "Node Delay: Delay before selecting next node."); y = y + 16; lsPrint(5, y, 0, 0.6, 0.6, 0xffffffff, "Decrease value to run faster (try increments of 25)"); y = y + 16; lsPrint(5, y, 0, 0.6, 0.6, 0xffffffff, "Popup Delay: After Finalizing, delay to find Popup."); y = y + 16; - lsPrint(5, y, 0, 0.6, 0.6, 0xffffffff, "Change value as last resort to fine tune."); + lsPrint(5, y, 0, 0.6, 0.6, 0xffffffff, "Change Popup Delay as last resort to fine tune."); if lsButtonText(10, lsScreenY - 30, 0, 100, 0xFFFFFFff, "Next") then is_done = 1;