Permalink
Browse files

One less click each time you work a mine. You no longer need to click…

… 'Work' button (doesn't exist anymore) after selecting nodes each round. During setup, there is now a new pulldown menu to select the ore type you're mining. After you select the ore you are mining, it will now know how many nodes there is to the corresponding ore. Starts automatically mining after selecting the appropriate number of nodes. ie Iron is 7 nodes. Upon selecting 7 nodes, it will automatically start mining.

Slight adjustment to the PopUp box detection routine. No more recursions.
Removed delays after selecting nodes 1 and 2, and it's still safe. Significant increase to speed (doubled?). Unnecessary delays removed.
Adjusted default delays to give the best balance to laggy environments.
Various GUI status message changes
  • Loading branch information...
1 parent c4f24d1 commit 355b8a826fb3608b0f01ad4a6b53cfe1adac9ddb @Cegaiel committed May 13, 2012
Showing with 35 additions and 32 deletions.
  1. +35 −32 VeggieTales/luaScripts/mining_ore.lua
@@ -1,5 +1,5 @@
-- mining_ore.lua v1.2 -- by Cegaiel
--- Credits to Tallow for his Simon macro, which was used as a template.
+-- 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
--
@@ -17,7 +17,7 @@ clickList = {};
mineList = {};
dropdown_values = {"Shift Key", "Ctrl Key", "Alt Key", "Mouse Wheel Click"};
dropdown_cur_value = 1;
-dropdown_ore_values = {"Aluminum", "Antimony", "Copper", "Gold", "Iron", "Lead", "Lithium", "Magnesium", "Platinum", "Silver", "Strontium", "Tin", "Tungsten", "Zinc"};
+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)"};
dropdown_ore_cur_value = 1;
@@ -72,7 +72,9 @@ 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).");
+ 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.");
y = y + 30;
@@ -201,7 +203,7 @@ function getPoints()
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, "Ore: " .. ore);
+ 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 + 30;
@@ -215,6 +217,9 @@ function getPoints()
index = index + 1;
end
+
+ -- Old way (v1.0-1.1), now it doesn't need you to click the button to continue.
+ --Now it automatically detects if you've clicked the correct amount of nodes.
--if #clickList >= 7 then
--if lsButtonText(10, lsScreenY - 30, z, 100, 0x80ff80ff, "Work") then
--is_done = 1;
@@ -254,27 +259,25 @@ function clickSequence()
for i=1,#clickList do
for j=i+1,#clickList do
for k=j+1,#clickList do
- checkBreak();
-- 1st Node
+ checkBreak();
srSetMousePos(clickList[i][1], clickList[i][2]);
lsSleep(clickDelay);
srKeyEvent('A');
- lsSleep(clickDelay);
-
-- 2nd Node
+ checkBreak();
srSetMousePos(clickList[j][1], clickList[j][2]);
lsSleep(clickDelay);
srKeyEvent('A');
- lsSleep(clickDelay);
-
-- 3rd Node
+ checkBreak();
srSetMousePos(clickList[k][1], clickList[k][2]);
lsSleep(clickDelay);
srKeyEvent('S');
- lsSleep(clickDelay);
- PopUp();
+ lsSleep(popDelay);
+ findClosePopUp();
statusScreenPause("[" .. worked .. "/" .. totalCombos .. "] Nodes Worked: " .. i .. ", " .. j .. ", " .. k);
worked = worked + 1
end
@@ -283,49 +286,49 @@ function clickSequence()
end
-
- --Click 'Work the mine'!
+ checkBreak();
+ --Send 'W' key over Mine to Work it (Get new nodes)
srSetMousePos(mineX, mineY);
lsSleep(clickDelay);
srKeyEvent('W');
- sleepWithStatusPause(2500, "Working mine (New nodes)...");
+ sleepWithStatusPause(3000, "Working mine (Fetching new nodes)");
--Reset the mine/node points and restart
mineList = {};
clickList = {};
getPoints();
clickSequence();
end
-function PopUp()
- while 1 do -- Keep repeating to make sure popup was closed, in case of long lag spike.
- lsSleep(popDelay);
- srReadScreen();
- OK = srFindImage("OK.png");
- if OK then
- srClickMouseNoMove(OK[0]+2,OK[1]+2, true);
- else
- break;
- end
- end
+function findClosePopUp()
+ while 1 do
+ checkBreak();
+ srReadScreen();
+ OK = srFindImage("OK.png");
+ if OK then
+ srClickMouseNoMove(OK[0]+2,OK[1]+2, true);
+ lsSleep(clickDelay);
+ else
+ break;
+ end
+ end
end
-
function promptDelays()
local is_done = false;
local count = 1;
while not is_done do
checkBreak();
local y = 10;
lsPrint(12, y, 0, 0.8, 0.8, 0xffffffff,
- "Key / Click to Select Nodes:");
+ "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);
lsSetCamera(0,0,lsScreenX*1.0,lsScreenY*1.0);
y = y + 25;
lsPrint(12, y, 0, 0.8, 0.8, 0xffffffff,
- "What are you mining?");
+ "How many Nodes? (Choose ore)");
y = y + 50;
lsSetCamera(0,0,lsScreenX*1.3,lsScreenY*1.3);
@@ -339,7 +342,7 @@ function promptDelays()
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,
- 0x000000ff, 150);
+ 0x000000ff, 100);
clickDelay = tonumber(clickDelay);
if not clickDelay then
is_done = false;
@@ -349,7 +352,7 @@ function promptDelays()
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,
- 0x000000ff, 300);
+ 0x000000ff, 500);
popDelay = tonumber(popDelay);
if not popDelay then
is_done = false;
@@ -358,9 +361,9 @@ function promptDelays()
end
y = y + 35;
- lsPrint(5, y, 0, 0.6, 0.6, 0xffffffff, "Node Delay: Hover / Select each node delay.");
+ lsPrint(5, y, 0, 0.6, 0.6, 0xffffffff, "Node Delay: Delay before selecting each node.");
y = y + 16;
- lsPrint(5, y, 0, 0.6, 0.6, 0xffffffff, "Popup Delay: Wait for / Close Popup delay.");
+ 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)");

0 comments on commit 355b8a8

Please sign in to comment.