The Wiki for Tale 4 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/FlaxHammock/Code"

From A Tale in the Desert
Jump to navigationJump to search
Line 3: Line 3:
 
;The AHK icon in system tray will turn red while paused.
 
;The AHK icon in system tray will turn red while paused.
 
;Ctrl+R to reload script
 
;Ctrl+R to reload script
;Date 3/17/2010
+
;Date: 10/27/2010
;Last Update: 12/13/2010
+
;Last Update: 12/03/2010
 +
;Author: Cegaiel
  
 +
;Info from Wiki:
 +
;Alcyone - Topaz
 +
;Celeano - Emerald
 +
;Maia - Ruby
 +
;Merope - Sapphire
 +
;Sterope - Quartz
 +
;Taygete - Opal
 +
;Sinai - Diamond
  
;Wheat is not supported due to the way it brings up a menu and makes you manually select which wheat you are drying
 
  
;This is the times based on using 1 hammock. However, the more hammocks you have, the less seconds you will need
+
;Make sure the OK.PNG file, included in the zip, is located in the same folder (directory) as the macro.
;The reason is because the timer doesn't start until the last hammock is loaded.
 
;If you have 20 hammocks, then it might take 10 seconds to load them all. In that case it would be 10 seconds less
 
  
;Rotten flax = 2 Teppy Mins (2:13 real time / 133 seconds)
 
;Grass = 10 Teppy Mins (11:06 real time / 666 seconds)
 
;Papy = 4 Teppy Mins (4:26 real time / 266 seconds)
 
  
  
;Time in seconds,
 
sFlax = 133
 
sGrass = 666
 
sPapy = 266
 
  
 +
; // START CONFIGURATION AREA
  
 +
;Set the speed in microseconds (100 = 1/10th second, 1000 = 1 second, etc)
 +
;If you got a slower computer or lag, then try raising it 50 or 100 at a time, ie 200, 250, 300
  
 +
;This is the speed that it selects/highlights your ore stones
 +
;If you fail to see all the stones getting selected, or getting "Ore Busy" popup messages, etc
  
 +
Delay = 125  ;Safe (lag) is 200+, Fast is 100 (fast computer, no lag) - I use 125 personally.
  
// CONFIGURATION
 
  
 +
;If you have problems with it not closing the popup, then try adjusting this number higher.
  
;Set Delay to 100-150 for fast computer/not much lag. 250 for slower computer.
+
PopUpDelay = 250  ;Safe (lag) is 250+, Fast is 150 (fast computer, no lag)
  
Delay = 125
 
  
  
  
;Set PopupDelay to 150-200 for fast computer, about 250+ for slower computers (or lots of lag)
+
; // END CONFIGURATION AREA
  
PoupDelay = 200
 
  
  
// END CONFIGURATION
+
IfWinExist eGenesis Client
 +
{
 +
 
 +
WinActivate, eGenesis Client
 +
WinWait, eGenesis Client
 +
WinGetActiveStats, win_Title, Xmax, Ymax, win_Xpos, win_Ypos
 +
 
 +
;Get coordinates, for your resolutions'  X,Y location of the popups (OK button) that will occur
  
 +
later.
 +
CenterX := Floor(Xmax/2)
 +
CenterY := Floor(Ymax/2)+103
  
  
 +
;Offsets the search coordinates for OK popup for the imagesearch in Popup sub.
 +
;ImageSearch method (Popup sub)
 +
ClickPopX1 := CenterX - 40
 +
ClickPopY1 := CenterY - 30
  
 +
ClickPopX2 := CenterX + 30
 +
ClickPopY2 := CenterY + 30
 +
 +
 +
} else {
 +
BlockInput, MouseMoveOff
 +
MsgBox, eGenesis Client not running, aborting...
 +
Exit
 +
}
  
;Get coordinates, for your resolutions'  X,Y location of the popups (OK button) that will occur
 
  
later.
 
CenterX := Floor(Xmax/2)
 
CenterY := Floor(Ymax/2)+105
 
  
 +
Start:
 +
MineNum := 0
 +
BlockInput, MouseMoveOff
  
 +
Start2:
  
IfWinExist eGenesis Client
+
BlockInput, MouseMoveOff
{
 
WinActivate
 
 
Gui, +AlwaysOnTop +ToolWindow
 
Gui, +AlwaysOnTop +ToolWindow
Gui, Add, Text,, What are you drying?
+
Gui, Font, bold
Gui, Add, DropDownList, vWord Choose1, Grass|Rotten Flax|Fertile Papyrus|Sterile Papyrus
+
Gui, Add, Text,, Choose Pattern:
Gui, Add, Text,, Qty you have in inventory:
+
Gui, Font, norm
Gui, Add, Edit, vQty wp number,
 
Gui, Add, Text,, `nHammock Max capacity:
 
Gui, Add, Text,, Grass: 200  (2 Teppy Min max)`nPapyrus: 20  (4 Teppy Min max)`nRotten Flax: 10  (2 Teppy Min
 
  
max)`n
+
Gui, Add, DropDownList, vPattern Choose1,Select one|6 Color (1 Pair)|5 Color (2 Pair)|4 Color (3 Pair)|5 Color
Gui, Add, Button, gRecord, Next
 
Gui, Show, x0 y25
 
return
 
  
 +
(Triple)|4 Color (Triple + Pair)|4 Color (Quadruple)|3 Color (Quad + Pair)|3 Color (Quintuple)|7 Color
  
Record:
 
Gui, Submit
 
Gui, Destroy
 
Gui, +AlwaysOnTop +ToolWindow
 
 
Gui, Font, bold
 
Gui, Font, bold
Gui, Add, Text, vMineNumText, Record hammock locations
+
Gui, Add, Text, vMineNumText, `n%MineNum% of 7 ore stones captured
 
Gui, Font, norm
 
Gui, Font, norm
 +
 +
 +
 
Gui, Add, Text,,
 
Gui, Add, Text,,
 
( LTrim
 
( LTrim
Hover and middle-click (Click mouse-wheel) on each hammock, one by one,
+
Hover and Middle Click (Mouse Wheel) over all your ore stones.
until you've clicked on all the hammocks you want to use. Then click the OK button.
+
 
 +
Choose highest number of matching colored ore stones First!
 +
Click Help for a detailed explanation.
 +
)
 +
 
  
(Drag this box out of the way if any hammocks are hidden)
 
  
Make sure you chat is minimized and that your screen is locked (Alt+L)
 
  
AFTER setting hammock locations, Press OK...
+
if (Pattern == "")
 +
{
 +
Gui, Add, Text,,Last Pattern: N/A`nTime: N/A  (Current Delay: %Delay%)`nSets: N/A`n
 +
} else {
 +
perSet := Round(seconds / sets ,2)
 +
Seconds := Round(Seconds,2)
 +
Gui, Add, Text,,Last Pattern: %Pattern%`nPattern Time: %seconds%s (%perSet%s per set)  @ %Delay% delay`nPattern
  
)
+
Sets: %Sets%`n
  
Gui, Add, Button, default gMineSetLoops, OK
+
;The program might stop working after 15 or so pulls. Not sure what causes this. Has to be a problem with ahk.
Gui, Show, x0 y25
+
;When it does happen, the Pattern Time shows 0.00s, so in this case, we reload script
 +
;You will know when this reload occurs, because the values of Last Pattern, Pattern Time and sets will show N/A
  
MineNum = 0
+
if (Seconds = 0)
PerCycle = 0
+
{
Dried = 0
+
Msgbox, Debug Mode: Program freeze detected, Reloading script...
 +
RELOAD
 +
}
  
SetDefaultMouseSpeed, 0
+
}
 +
 
 +
Gui, Add, Button, default gMineSetLoops, START
 +
 
 +
Gui, Add, Button, gHelp, HELP
 +
Gui, Add, Button, gOops, Oops
 +
 
 +
;GUI Upper Left Corner
 +
;Gui, Show, x0 y25
 +
;GUI Upper Right Corner at 1280x1024
 +
Gui, Show, x952 y25
 +
 
 +
WinActivate, eGenesis Client
  
  
Line 110: Line 151:
 
KeyWait, MButton
 
KeyWait, MButton
 
MouseGetPos, TestX, TestY, WinHandle
 
MouseGetPos, TestX, TestY, WinHandle
 +
 
if (WinHandle = GameWinHandle)
 
if (WinHandle = GameWinHandle)
 
{
 
{
Line 121: Line 163:
 
}
 
}
 
return
 
return
 +
  
 
MineRecord:
 
MineRecord:
 
MineNum++
 
MineNum++
 
MouseGetPos, MineX%MineNum%, MineY%MineNum%
 
MouseGetPos, MineX%MineNum%, MineY%MineNum%
GuiControl, Text, MineNumText, %MineNum% hammocks captured
+
if MineNum > 7
TotalHammocks := MineNum
+
{
 +
Gui, Destroy
 +
BlockInput, MouseMoveOff
 +
Msgbox, You have selected too many stones. 7 is the maximum.`n`nTo ensure you did not make a mistake, the script
 +
 
 +
will now be reloaded...`n`nYou must start over, click OK to reload script.
 +
RELOAD
 +
}
 +
 
 +
GuiControl, Text, MineNumText, `n%MineNum% of 7 ore stones captured
 
return
 
return
 +
 +
 +
 +
 +
Oops:
 +
 +
Pattern := LastPattern
 +
Gui, Destroy
 +
Gosub, Main
 +
 +
  
  
Line 133: Line 196:
  
 
MineSetLoops:
 
MineSetLoops:
 +
 +
 +
 +
if (MineNum <> 7)
 +
{
 +
Gui, Destroy
 +
BlockInput, MouseMoveOff
 +
Msgbox, Not enough ore stones. Sandmining requires 7 ore stones.`n`nTo ensure you did not make a mistake, the
 +
 +
script will now be reloaded...`n`nYou must start over, click OK to reload script.
 +
RELOAD
 +
} else {
 
Gui, Submit
 
Gui, Submit
 
Gui, Destroy
 
Gui, Destroy
 +
}
  
Msgbox, Make sure your chat is MINIMIZED!`n`nAfter verifying chat is minimized, Click OK to proceed...
+
  
Gui, +AlwaysOnTop +ToolWindow
 
Gui, Font, bold
 
  
Gui, Add, Text, vMineCycleText, 5 seconds countdown to drag this window out of way`n`n`n`n
+
 
Gui, Show, x0 y25
+
Main:
GuiControl, Text, MineCycleText, 5 seconds countdown to drag this window out of way`n`n`n`n
+
 
  
  
StartDelay = 5
 
;You got 5 seconds to drag the status window out of the way
 
Loop, %StartDelay%
 
{
 
GuiControl, Text, MineCycleText, %StartDelay%s countdown to drag this window out of way`n`n`n`n
 
Delay --
 
Sleep 1000
 
}
 
  
 
SetDefaultMouseSpeed, 0
 
SetDefaultMouseSpeed, 0
  
  
 +
 +
LastPattern := Pattern
 +
Seconds := 0
 +
Counter := 0
 +
 +
SetTimer, Counter, 10
 +
 +
 +
Stone4 = 0
 +
Stone5 = 0
 +
Stone6 = 0
 +
Stone7 = 0
 +
 +
 +
 +
 +
 +
BlockInput, MouseMove
 +
 +
 +
 +
;All of the if / else if statements of the 10 possible color combos...
 +
 +
 +
if (pattern == "7 Color")
 +
{
 +
;KEY:
 +
;A:1
 +
;B:2
 +
;C:3
 +
;D:4
 +
;E:5
 +
;F:6
 +
;G:7
 +
 +
 +
Sets := 8
 +
;Set1: A, B, C, D, E, F
 +
Stone1 := 1
 +
Stone2 := 2
 +
Stone3 := 3
 +
Stone4 := 4
 +
Stone5 := 5
 +
Stone6 := 6
 +
GoSub, PatternSet
 +
 +
;Set2: A, B, C, D, E, G
 +
Stone1 := 1
 +
Stone2 := 2
 +
Stone3 := 3
 +
Stone4 := 4
 +
Stone5 := 5
 +
Stone6 := 7
 +
GoSub, PatternSet
 +
 +
;Set3: A, B, C, D, F, G
 +
Stone1 := 1
 +
Stone2 := 2
 +
Stone3 := 3
 +
Stone4 := 4
 +
Stone5 := 6
 +
Stone6 := 7
 +
GoSub, PatternSet
 +
 +
;Set4: A, B, C, E, F, G
 +
Stone1 := 1
 +
Stone2 := 2
 +
Stone3 := 3
 +
Stone4 := 5
 +
Stone5 := 6
 +
Stone6 := 7
 +
GoSub, PatternSet
 +
 +
;Set5: A, B, D, E, F, G
 +
Stone1 := 1
 +
Stone2 := 2
 +
Stone3 := 4
 +
Stone4 := 5
 +
Stone5 := 6
 +
Stone6 := 7
 +
GoSub, PatternSet
 +
 +
;Set6: A, C, D, E, F, G
 +
Stone1 := 1
 +
Stone2 := 3
 +
Stone3 := 4
 +
Stone4 := 5
 +
Stone5 := 6
 +
Stone6 := 7
 +
GoSub, PatternSet
 +
 +
;Set7: B, C, D, E, F, G
 +
Stone1 := 2
 +
Stone2 := 3
 +
Stone3 := 4
 +
Stone4 := 5
 +
Stone5 := 6
 +
Stone6 := 7
 +
GoSub, PatternSet
 +
 +
;Set8: A, B, C, D, E, F, G Breaks all 7 stones
 +
Stone1 := 1
 +
Stone2 := 2
 +
Stone3 := 3
 +
Stone4 := 4
 +
Stone5 := 5
 +
Stone6 := 6
 +
Stone7 := 7
 +
GoSub, PatternSet
 +
}
 +
 +
 +
 +
else if (pattern == "6 Color (1 Pair)")
 +
{
 +
;KEY: Got 100%
 +
;A-1 = 1
 +
;A-2 = 2
 +
;B = 3
 +
;C = 4
 +
;D = 5
 +
;E = 6
 +
;F = 7
 +
 +
Sets := 14
 +
 +
;Set1: A-1, B, C, F
 +
Stone1 := 1
 +
Stone2 := 3
 +
Stone3 := 4
 +
Stone4 := 7
 +
GoSub, PatternSet
 +
 +
;Set2: A-1, D, E
 +
Stone1 := 1
 +
Stone2 := 5
 +
Stone3 := 6
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set3: A-1, C, D, E
 +
Stone1 := 1
 +
Stone2 := 4
 +
Stone3 := 5
 +
Stone4 := 6
 +
GoSub, PatternSet
 +
 +
;Set4: A-1, B, F
 +
Stone1 := 1
 +
Stone2 := 3
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set5: A-1, D, E, F
 +
Stone1 := 1
 +
Stone2 := 5
 +
Stone3 := 6
 +
Stone4 := 7
 +
GoSub, PatternSet
 +
 +
;Set6: A-1, B, C
 +
Stone1 := 1
 +
Stone2 := 3
 +
Stone3 := 4
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set7: A-1, B, E, F This workload will crumble stone A-1
 +
Stone1 := 1
 +
Stone2 := 3
 +
Stone3 := 6
 +
Stone4 := 7
 +
GoSub, PatternSet
 +
 +
;Set8: A-2, C, D
 +
Stone1 := 2
 +
Stone2 := 4
 +
Stone3 := 5
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set9: A-2, D, E
 +
Stone1 := 2
 +
Stone2 := 5
 +
Stone3 := 6
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set10: A-2, B, C, F
 +
Stone1 := 2
 +
Stone2 := 3
 +
Stone3 := 4
 +
Stone4 := 7
 +
GoSub, PatternSet
 +
 +
;Set11: A-2, C, F
 +
Stone1 := 2
 +
Stone2 := 4
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set12: A-2, B, E, D
 +
Stone1 := 2
 +
Stone2 := 3
 +
Stone3 := 6
 +
Stone4 := 5
 +
GoSub, PatternSet
 +
 +
;Set13: A-2, B, E This workload will crumble stone B & E
 +
Stone1 := 2
 +
Stone2 := 3
 +
Stone3 := 6
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set14: A-2, C, D, F This workload will crumble the remaining stones
 +
Stone1 := 2
 +
Stone2 := 4
 +
Stone3 := 5
 +
Stone4 := 7
 +
GoSub, PatternSet
 +
}
 +
 +
 +
 +
else if (pattern == "5 Color (2 Pair)")
 +
{
 +
;KEY: Hit 100%
 +
;A-1: 1
 +
;A-2: 2
 +
;B-1: 3
 +
;B-2: 4
 +
;C: 5
 +
;D: 6
 +
;E: 7
 +
 +
Sets := 15
 +
 +
;Set1: C, D, E
 +
Stone1 := 5
 +
Stone2 := 6
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set2: C, A-1, B-1
 +
Stone1 := 5
 +
Stone2 := 1
 +
Stone3 := 3
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set3: C, A-1, B-2
 +
Stone1 := 5
 +
Stone2 := 1
 +
Stone3 := 4
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set4: C, A-2, B-1
 +
Stone1 := 5
 +
Stone2 := 2
 +
Stone3 := 3
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set5: C, A-2, B-2
 +
Stone1 := 5
 +
Stone2 := 2
 +
Stone3 := 4
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set6: D, A-1, B-1
 +
Stone1 := 6
 +
Stone2 := 1
 +
Stone3 := 3
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set7: D, A-1, B-2
 +
Stone1 := 6
 +
Stone2 := 1
 +
Stone3 := 4
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set8: D, A-2, B-1
 +
Stone1 := 6
 +
Stone2 := 2
 +
Stone3 := 3
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set9: D, A-2, B-2
 +
Stone1 := 6
 +
Stone2 := 2
 +
Stone3 := 4
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set10: E, A-1, B-1
 +
Stone1 := 7
 +
Stone2 := 1
 +
Stone3 := 3
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set11: E, A-1, B-2
 +
Stone1 := 7
 +
Stone2 := 1
 +
Stone3 := 4
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set12: E, A-2, B-1
 +
Stone1 := 7
 +
Stone2 := 2
 +
Stone3 := 3
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set13: E, A-2, B-2
 +
Stone1 := 7
 +
Stone2 := 2
 +
Stone3 := 4
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set14: A-1, B-1, C, D, E Breaks A-1 & B-1
 +
Stone1 := 1
 +
Stone2 := 3
 +
Stone3 := 5
 +
Stone4 := 6
 +
Stone5 := 7
 +
GoSub, PatternSet
 +
 +
;Set15: A-2, B-2, C, D, E Breaks the remaining 5 stones
 +
Stone1 := 2
 +
Stone2 := 4
 +
Stone3 := 5
 +
Stone4 := 6
 +
Stone5 := 7
 +
GoSub, PatternSet
 +
}
 +
 +
 +
else if (pattern == "5 Color (Triple)")
 +
{
 +
;KEY:
 +
;A-1: 1
 +
;A-2: 2
 +
;A-3: 3
 +
;B: 4
 +
;C: 5
 +
;D: 6
 +
;E: 7
 +
 +
Sets := 14
 +
 +
;Set1: A-1, B, C
 +
Stone1 := 1
 +
Stone2 := 4
 +
Stone3 := 5
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set2: A-1, B, D
 +
Stone1 := 1
 +
Stone2 := 4
 +
Stone3 := 6
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set3: A-1, B, E
 +
Stone1 := 1
 +
Stone2 := 4
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set4: A-1, C, D
 +
Stone1 := 1
 +
Stone2 := 5
 +
Stone3 := 6
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set5: A-1, C, E
 +
Stone1 := 1
 +
Stone2 := 5
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set6: A-1, D, E
 +
Stone1 := 1
 +
Stone2 := 6
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set7: A-2, B, C
 +
Stone1 := 2
 +
Stone2 := 4
 +
Stone3 := 5
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set8: A-2, B, D
 +
Stone1 := 2
 +
Stone2 := 4
 +
Stone3 := 6
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set9: A-2, B, E
 +
Stone1 := 2
 +
Stone2 := 4
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set10: A-2, C, D
 +
Stone1 := 2
 +
Stone2 := 5
 +
Stone3 := 6
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set11: A-2, C, E
 +
Stone1 := 2
 +
Stone2 := 5
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set12: A-2, D, E
 +
Stone1 := 2
 +
Stone2 := 6
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
 +
;Set13: A-1, A-2, A-3 Breaks A-1 and A-2
 +
Stone1 := 1
 +
Stone2 := 2
 +
Stone3 := 3
 +
Stone4 := 0
 +
Stone5 := 0
 +
GoSub, PatternSet
 +
 +
;Set14: A-3, B, C, D, E Breaks B, C, D, and E
 +
Stone1 := 3
 +
Stone2 := 4
 +
Stone3 := 5
 +
Stone4 := 6
 +
Stone5 := 7
 +
GoSub, PatternSet
 +
}
 +
 +
 +
else if (pattern == "4 Color (3 Pair)")
 +
{
 +
;KEY:
 +
;A-1 = 1
 +
;A-2 = 2
 +
;B-1 = 3
 +
;B-2 = 4
 +
;C-1 = 5
 +
;C-2 = 6
 +
;D = 7
 +
 +
Sets := 15
 +
 +
;Set1: A-1, B-1, C-1
 +
Stone1 := 1
 +
Stone2 := 3
 +
Stone3 := 5
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set2: A-2, B-2, C-2, D
 +
Stone1 := 2
 +
Stone2 := 4
 +
Stone3 := 6
 +
Stone4 := 7
 +
GoSub, PatternSet
 +
 +
;Set3: A-1, B-1, C-2
 +
Stone1 := 1
 +
Stone2 := 3
 +
Stone3 := 6
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set4: A-2, B-2, C-1, D
 +
Stone1 := 2
 +
Stone2 := 4
 +
Stone3 := 5
 +
Stone4 := 7
 +
GoSub, PatternSet
 +
 +
;Set5: A-1, B-2, C-1
 +
Stone1 := 1
 +
Stone2 := 4
 +
Stone3 := 5
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set6: A-2, B-1, C-2, D
 +
Stone1 := 2
 +
Stone2 := 3
 +
Stone3 := 6
 +
Stone4 := 7
 +
GoSub, PatternSet
 +
 +
;Set7: A-1, B-2, C-2
 +
Stone1 := 1
 +
Stone2 := 4
 +
Stone3 := 6
 +
Stone4 := 0
 +
 +
;Set8: A-2, B-1, C-1, D
 +
Stone1 := 2
 +
Stone2 := 3
 +
Stone3 := 5
 +
Stone4 := 7
 +
GoSub, PatternSet
 +
 +
;Set9: A-2, B-1, C-1
 +
Stone1 := 2
 +
Stone2 := 3
 +
Stone3 := 5
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set10: A-1, B-2, C-2, D
 +
Stone1 := 1
 +
Stone2 := 4
 +
Stone3 := 6
 +
Stone4 := 7
 +
GoSub, PatternSet
 +
 +
;Set11: A-2, B-1, C-2
 +
Stone1 := 2
 +
Stone2 := 3
 +
Stone3 := 6
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set12: A-1, B-2, C-1, D
 +
Stone1 := 1
 +
Stone2 := 4
 +
Stone3 := 5
 +
Stone4 := 7
 +
GoSub, PatternSet
 +
 +
;Set13: A-2, B-2, C-1
 +
Stone1 := 2
 +
Stone2 := 4
 +
Stone3 := 5
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set14: A-1, B-1, C-2, D
 +
Stone1 := 1
 +
Stone2 := 3
 +
Stone3 := 6
 +
Stone4 := 7
 +
GoSub, PatternSet
 +
 +
 +
 +
;New (15th) pattern to break last 3 stones, wiki was partially incorrect. Thanks Setheri for discovering this :)
 +
;Set15: A-1, B-2, C-2
 +
Stone1 := 1
 +
Stone2 := 4
 +
Stone3 := 6
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
}
 +
 +
 +
 +
 +
else if (pattern == "4 Color (Triple + Pair)")
 +
{
 +
;KEY:
 +
;A-1: 1
 +
;A-2: 2
 +
;A-3: 3
 +
;B-1: 4
 +
;B-2: 5
 +
;C: 6
 +
;D: 7
 +
 +
 +
Sets := 12
 +
 +
;Set1: A-1, A-2, A-3
 +
Stone1 := 1
 +
Stone2 := 2
 +
Stone3 := 3
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set2: A-1, B-1, C
 +
Stone1 := 1
 +
Stone2 := 4
 +
Stone3 := 6
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set3: A-1, B-1, D
 +
Stone1 := 1
 +
Stone2 := 4
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set4: A-1, B-2, C
 +
Stone1 := 1
 +
Stone2 := 5
 +
Stone3 := 6
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set5: A-1, B-2, D
 +
Stone1 := 1
 +
Stone2 := 5
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set6: A-1, C, D
 +
Stone1 := 1
 +
Stone2 := 6
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set7: A-2, B-1, C
 +
Stone1 := 2
 +
Stone2 := 4
 +
Stone3 := 6
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set8: A-2, B-1, D
 +
Stone1 := 2
 +
Stone2 := 4
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set9: A-3, B-1, C
 +
Stone1 := 3
 +
Stone2 := 4
 +
Stone3 := 6
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set10: A-3, B-1, D
 +
Stone1 := 3
 +
Stone2 := 4
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set11: A-2, C, D
 +
Stone1 := 2
 +
Stone2 := 6
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set12: A-1, B-1, C, D Breaks these 4 stones
 +
Stone1 := 1
 +
Stone2 := 4
 +
Stone3 := 6
 +
Stone4 := 7
 +
GoSub, PatternSet
 +
}
 +
 +
 +
else if (pattern == "4 Color (Quadruple)")
 +
{
 +
;KEY:
 +
;A-1: 1
 +
;A-2: 2
 +
;A-3: 3
 +
;A-4: 4
 +
;B: 5
 +
;C: 6
 +
;D: 7
 +
 +
 +
Sets := 15
 +
 +
;Set1: A-1, B, C
 +
Stone1 := 1
 +
Stone2 := 5
 +
Stone3 := 6
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set2: A-1, B, D
 +
Stone1 := 1
 +
Stone2 := 5
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set3: A-1, C, D
 +
Stone1 := 1
 +
Stone2 := 6
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set4: A-2, B, C
 +
Stone1 := 2
 +
Stone2 := 5
 +
Stone3 := 6
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set5: A-2, B, D
 +
Stone1 := 2
 +
Stone2 := 5
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set6: A-2, C, D
 +
Stone1 := 2
 +
Stone2 := 6
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set7: A-3, B, C
 +
Stone1 := 3
 +
Stone2 := 5
 +
Stone3 := 6
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set8: A-3, B, D
 +
Stone1 := 3
 +
Stone2 := 5
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set9: A-3, C, D
 +
Stone1 := 3
 +
Stone2 := 6
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set10: A-4, B, C, D Breaks B, C, D
 +
Stone1 := 4
 +
Stone2 := 5
 +
Stone3 := 6
 +
Stone4 := 7
 +
GoSub, PatternSet
 +
 +
;Set11: A-1, A-2, A-3
 +
Stone1 := 1
 +
Stone2 := 2
 +
Stone3 := 3
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set12: A-1, A-2, A-4
 +
Stone1 := 1
 +
Stone2 := 2
 +
Stone3 := 4
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set13: A-1, A-3, A-4
 +
Stone1 := 1
 +
Stone2 := 3
 +
Stone3 := 4
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set14: A-2, A-3, A-4
 +
Stone1 := 2
 +
Stone2 := 3
 +
Stone3 := 4
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 +
;Set15: A-1, A-2, A-3, A-4 Breaks A-1, A-2, A-3
 +
Stone1 := 1
 +
Stone2 := 2
 +
Stone3 := 3
 +
Stone4 := 4
 +
GoSub, PatternSet
 +
}
  
  
if (Word == "Rotten Flax") {
+
else if (pattern == "*3 Color (Triple + 2 Pair)")
Hammock := "F"
+
{
Seconds := sFlax
+
Sets := 0
Cycles := Ceil(Qty / (10 * TotalHammocks))
+
BlockInput, MouseMoveOff
PerHammock := 10
+
Msgbox, No single stone can be worked 7 times on this pattern.`n`nConcede and just get a new workload...
minutes_eta = 2
+
}
seconds_eta = 13
+
 
 +
 
 +
 
 +
 
 +
 
 +
else if (pattern == "3 Color (Quad + Pair)")
 +
{
 +
;KEY
 +
;A-1: 1
 +
;A-2: 2
 +
;A-3: 3
 +
;A-4: 4
 +
;B-1: 5
 +
;B-2: 6
 +
;C: 7
 +
;D: 8
 +
 
 +
 
 +
Sets := 7
 +
 
 +
;Set1: A-1, B-1, C
 +
Stone1 := 1
 +
Stone2 := 5
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 
 +
;Set2: A-1, B-2, C
 +
Stone1 := 1
 +
Stone2 := 6
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 
 +
;Set3: A-2, B-1, C
 +
Stone1 := 2
 +
Stone2 := 5
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 
 +
;Set4: A-2, B-2, C
 +
Stone1 := 2
 +
Stone2 := 6
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 
 +
;Set5: A-3, B-1, C
 +
Stone1 := 3
 +
Stone2 := 5
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 
 +
;Set6: A-3, B-2, C
 +
Stone1 := 3
 +
Stone2 := 6
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
 
 +
;Set7: A-4, B-1, C
 +
Stone1 := 4
 +
Stone2 := 5
 +
Stone3 := 7
 +
Stone4 := 0
 +
GoSub, PatternSet
 +
}
 +
 
 +
 
 +
 
 +
else if (pattern == "3 Color (Quintuple)")
 +
{
 +
;5 of same color
  
} else if (Word == "Grass") {
+
;KEY:
Hammock := "S"
+
;A-1: 1
Seconds := sGrass
+
;A-2: 2
Cycles := Ceil(Qty / (200 * TotalHammocks))
+
;A-3: 3
PerHammock := 200
+
;A-4: 4
minutes_eta = 11
+
;A-5: 5
seconds_eta = 6
+
;B: 6
 +
;C: 7
  
} else if (Word == "Fertile Papyrus") {
+
Sets := 11
Hammock := "P"
 
Seconds := sPapy
 
Cycles := Ceil(Qty / (20 * TotalHammocks))
 
PerHammock := 20
 
minutes_eta = 4
 
seconds_eta = 26
 
  
 +
;Set1: A-1, A-2, A-3
 +
Stone1 := 1
 +
Stone2 := 2
 +
Stone3 := 3
 +
Stone4 := 0
 +
GoSub, PatternSet
  
} else if (Word == "Sterile Papyrus") {
+
;Set2: A-1, A-2, A-4
Hammock := "N"
+
Stone1 := 1
Seconds := sPapy
+
Stone2 := 2
Cycles := Ceil(Qty / (20 * TotalHammocks))
+
Stone3 := 4
PerHammock := 20
+
Stone4 := 0
minutes_eta = 4
+
GoSub, PatternSet
seconds_eta = 26
 
}
 
  
 +
;Set3: A-1, A-2, A-5
 +
Stone1 := 1
 +
Stone2 := 2
 +
Stone3 := 5
 +
Stone4 := 0
 +
GoSub, PatternSet
  
PerCycle := PerHammock * MineNum
+
;Set4: A-1, A-3, A-4
Remaining := Cycles
+
Stone1 := 1
 +
Stone2 := 3
 +
Stone3 := 4
 +
Stone4 := 0
 +
GoSub, PatternSet
  
loop, %Cycles%
+
;Set5: A-1, A-3, A-5
{
+
Stone1 := 1
 +
Stone2 := 3
 +
Stone3 := 5
 +
Stone4 := 0
 +
GoSub, PatternSet
  
 +
;Set6: A-1, A-4, A-5
 +
Stone1 := 1
 +
Stone2 := 4
 +
Stone3 := 5
 +
Stone4 := 0
 +
GoSub, PatternSet
  
WinActivate, eGenesis Client
+
;Set7: A-2, A-3, A-4
MineNum = 1
+
Stone1 := 2
MouseGetPos, OldMX, OldMY
+
Stone2 := 3
 +
Stone3 := 4
 +
Stone4 := 0
 +
GoSub, PatternSet
  
 +
;Set8: A-2, A-3, A-5
 +
Stone1 := 2
 +
Stone2 := 3
 +
Stone3 := 5
 +
Stone4 := 0
 +
GoSub, PatternSet
  
;Dry Hammock Loop
+
;Set9: A-2, A-4, A-5
loop, %TotalHammocks% {
+
Stone1 := 2
 +
Stone2 := 4
 +
Stone3 := 5
 +
Stone4 := 0
 +
GoSub, PatternSet
  
WinActivate, eGenesis Client
+
;Set10: A-3, A-4, A-5
 +
Stone1 := 3
 +
Stone2 := 4
 +
Stone3 := 5
 +
Stone4 := 0
 +
GoSub, PatternSet
  
;BlockInput, MouseMove
+
;Set11: A-1, A-2, A-3, A-4, A-5 Breaks A-1, A-2, A-3, A-4, A-5
GuiControl, Text, MineCycleText, Drying %Word% - Hammock: %MineNum%
+
Stone1 := 1
MinePosX := MineX%MineNum%
+
Stone2 := 2
MinePosY := MineY%MineNum%
+
Stone3 := 3
MouseMove, %MinePosX%, %MinePosY%, 0
+
Stone4 := 4
sleep %Delay%
+
Stone5 := 5
Send {%Hammock%}
 
Sleep, %Delay%
 
MineNum++
 
GoSub, Popup
 
}
 
  
 +
GoSub, PatternSet
 +
}
  
MouseMove, %OldMX%, %OldMY%, 0
 
  
SecondsCountDown := Seconds
+
else
 +
{
 +
BlockInput, MouseMoveOff
 +
Msgbox, You did not choose a valid pattern, please try again...`n`nNote your selected stones are still in memory, simply
  
loop, %Seconds% {
+
choose the pattern and immediately hit START
Gui, Font, bold
+
Gosub, Start2
GuiControl, Text, MineCycleText, %minutes_eta%m %seconds_eta%s drying time remaining
+
}
  
(%Word%)`n`n%Remaining% of %cycles% cycles remaining to process `n`nDried: %Dried% of %Qty%
 
Gui, Font, norm
 
Gui, Add, Text,,
 
( LTrim
 
 
%Remaining% cycles remaining to process: %Word%`nDried: %Dried%
 
)
 
  
;SecondsCountdown := SecondsCountdown - 1
 
sleep 1000
 
  Gosub, Timer
 
}
 
 
MineNum = 1
 
  
 +
;Bring up the Menu again (Force Restart)
 +
Gosub, Start
 +
return
  
 
  
  
;Take Dried Items
 
  
loop, %TotalHammocks% {
 
  
WinActivate, eGenesis Client
+
PatternSet:
 +
Sleep 100
 +
GoSub, Popup  ;This one checks, if another popup, beside the one at the end of this sub, exists. Likely "Ore is busy"
  
GuiControl, Text, MineCycleText, Taking %Word% -  Hammock: %MineNum%
+
popup
MinePosX := MineX%MineNum%
 
MinePosY := MineY%MineNum%
 
MouseMove, %MinePosX%, %MinePosY%, 0
 
Sleep, %Delay%
 
Send {T}
 
Sleep, %Delay%
 
GoSub, Popup
 
MineNum++
 
}
 
  
Remaining --
+
;if ErrorLevel = 0
Dried := Dried + PerCycle
+
;Msgbox, Another Popup`n`nConsider aborting the script here, this might suggest a "Ore stone busy message"?
  
;Set the minutes/seconds countdown again, for next cycle
+
MouseMove, MineX%Stone1%, MineY%Stone1%
if (Word == "Rotten Flax") {
+
Sleep %Delay%
minutes_eta = 2
+
Send {A}
seconds_eta = 13
+
Sleep %Delay%
} else if (Word == "Grass") {
 
minutes_eta = 11
 
seconds_eta = 6
 
} else if (Word == "Fertile Papyrus") {
 
minutes_eta = 4
 
seconds_eta = 26
 
} else if (Word == "Sterile Papyrus") {
 
minutes_eta = 4
 
seconds_eta = 26
 
}
 
  
 +
MouseMove, MineX%Stone2%, MineY%Stone2%
 +
Sleep %Delay%
 +
Send {A}
 +
Sleep %Delay%
  
 +
MouseMove, MineX%Stone3%, MineY%Stone3%
 +
Sleep %Delay%
 +
Send {A}
 +
Sleep %Delay%
  
  
GuiControl, Text, MineCycleText, 2s Pause, Hit Ctrl+P to STOP HAMMOCKS
+
if Stone4 > 0
Sleep 2000
+
{
 +
MouseMove, MineX%Stone4%, MineY%Stone4%
 +
Sleep %Delay%
 +
Send {A}
 +
Sleep %Delay%
 +
}
  
 +
if Stone5 > 0
 +
{
 +
MouseMove, MineX%Stone5%, MineY%Stone5%
 +
Sleep %Delay%
 +
Send {A}
 +
Sleep %Delay%
 +
}
  
}  
+
if Stone6 > 0
 +
{
 +
MouseMove, MineX%Stone6%, MineY%Stone6%
 +
Sleep %Delay%
 +
Send {A}
 +
Sleep %Delay%
 +
}
  
Gui, Destroy
+
if Stone7 > 0
Gui, Add, Text,, Middle-click on this window to end the script.
+
{
Gui, Show
+
MouseMove, MineX%Stone7%, MineY%Stone7%
return
+
Sleep %Delay%
 +
Send {A}
 +
Sleep %Delay%
 
}
 
}
 +
 +
 +
 +
Send {S}
 +
Sleep %Delay%
 +
 +
GoSub, Popup
 +
 +
return
 +
  
  
  
 
Popup:
 
Popup:
 +
 +
ImageSearch, PopX, PopY, ClickPopX1, ClickPopY1, ClickPopX2, ClickPopY2, *50 OK.PNG
 +
if ErrorLevel = 0
 +
{
 +
NewX := PopX + 3
 +
NewY := PopY + 3
 +
 +
MouseMove, %NewX%, %NewY%
 +
Sleep %PopupDelay%
 +
Click
 +
Sleep %PopupDelay%
 +
}
 +
 +
 +
Sleep 300
 +
 +
;Run this twice to ensure a laggy popup didn't get closed.
 +
ImageSearch, PopX, PopY, ClickPopX1, ClickPopY1, ClickPopX2, ClickPopY2, *50 OK.PNG
 +
if ErrorLevel = 0
 +
{
 +
NewX := PopX + 3
 +
NewY := PopY + 3
 +
 +
MouseMove, %NewX%, %NewY%
 +
Sleep %PopupDelay%
 +
Click
 +
Sleep %PopupDelay%
 +
}
 +
 +
return
 +
 +
 +
 +
 +
PopupOld:
  
 
;Search for the RBG color of 0xECDFBD (Same as HTML code: #ECDFBD)
 
;Search for the RBG color of 0xECDFBD (Same as HTML code: #ECDFBD)
 +
;Was having too much problems with Sterope public sand mine.
 +
;The shade would work one day and not the next, always adjusting and something I still kept
 +
 +
walking randomly from misclick
 +
;So this has been aborted and using imagesearch method
  
 
PixelSearch, Px, Py, %CenterX%, %CenterY%, %CenterX%, %CenterY%, 0xEBDDBB, %shade%, Fast|RGB
 
PixelSearch, Px, Py, %CenterX%, %CenterY%, %CenterX%, %CenterY%, 0xEBDDBB, %shade%, Fast|RGB
Line 312: Line 1,344:
 
if ErrorLevel = 0
 
if ErrorLevel = 0
 
{
 
{
Sleep %PopupDelay%
 
 
MouseMove, %CenterX%, %CenterY%
 
MouseMove, %CenterX%, %CenterY%
 
Sleep %PopupDelay%
 
Sleep %PopupDelay%
Line 322: Line 1,353:
  
  
Timer:
 
 
if (seconds_eta = 0) and !(minutes_eta = 0)
 
{
 
seconds_eta := 60
 
minutes_eta --
 
}
 
 
if (minutes_eta < 0)
 
minutes_eta := 0
 
  
seconds_eta --
 
return
 
  
 +
Counter:
 +
counter ++
 +
seconds := counter/100
 +
return
 +
 +
 +
Help:
 +
Gui, Destroy
 +
 +
BlockInput, MouseMoveOff
 +
Msgbox, Ctrl + R = Reload`nCtrl + P to Pause, Ctrl + P again to Resume.`n`nNote: This script disables the mouse
 +
 +
while it is running!`nIf you pause the script, while it is runing, then your mouse may stop working.`nEither resume and
 +
 +
let it finish or Ctrl+R (Reload) the script and your mouse will be enabled.`n`nOops Button: If you forgot to minimize your
 +
 +
chat (all keys were sent into chat, instead of screen),`nthen this button will repeat the last pattern and ore stone
 +
 +
locations.`nJust ignore that it says 0 of 7 stones and ignore selecting a new pattern (Leave as "Select one" is ok).`nJust
 +
 +
press the Oops button and it will run the last pattern/ore stone locations.`n`n`nConsistently has all 7 stones crumble
 +
 +
(These are most desireable):`n`n7 Color`n6 Color (1 Pair)`n5 Color (2 Pair)`n4 Color (3 Pair)`n`n`nConsistent Unbroken
 +
 +
stones:`n`n3 color (Quintiple): 2 stones`n3 Color (Quad + Pair): 6 stones`n4 Color (Quadruple): 1 stone`n4 color (Triple +
 +
 +
Pair): 3 stones`n5 color (Triple): 1 stone`n`n`n(Triple + 2 Pair) and (Double Triple) has no single stone that can be
 +
 +
worked 7 times.`n(Quadruple + Triple) fails using Quadruple pattern.`n(2 Triples) fail using Triple pattern.`nThose have
 +
 +
been excluded from "Choose Pattern" pulldown menu.`n`n`n`nWhat order to click your ore stones:`n`nClick all Quintiple or
 +
 +
Quadruple, First if any,`nClick a triple color pattern next, if any`nClick all paired colors next, if any`nThen all the
 +
 +
single colored stones, LAST!
 +
 +
 +
;Reload
 +
GoSub, Start2
 +
 +
return
  
  

Revision as of 20:14, 13 December 2010

;Ctrl+P to pause script and Ctrl+P again to resume
;The AHK icon in system tray will turn red while paused.
;Ctrl+R to reload script
;Date: 10/27/2010
;Last Update: 12/03/2010
;Author: Cegaiel

;Info from Wiki:
;Alcyone - Topaz
;Celeano - Emerald
;Maia - Ruby
;Merope - Sapphire
;Sterope - Quartz
;Taygete - Opal
;Sinai - Diamond


;Make sure the OK.PNG file, included in the zip, is located in the same folder (directory) as the macro.




;	// START CONFIGURATION AREA

	;Set the speed in microseconds (100 = 1/10th second, 1000 = 1 second, etc)
	;If you got a slower computer or lag, then try raising it 50 or 100 at a time, ie 200, 250, 300

	;This is the speed that it selects/highlights your ore stones
	;If you fail to see all the stones getting selected, or getting "Ore Busy" popup messages, etc

		Delay = 125  ;Safe (lag) is 200+, Fast is 100 (fast computer, no lag) - I use 125 personally.


	;If you have problems with it not closing the popup, then try adjusting this number higher.

		PopUpDelay = 250  ;Safe (lag) is 250+, Fast is 150 (fast computer, no lag)




;	// END CONFIGURATION AREA



			IfWinExist eGenesis Client
			{

			WinActivate, eGenesis Client
			WinWait, eGenesis Client
			WinGetActiveStats, win_Title, Xmax, Ymax, win_Xpos, win_Ypos 

			;Get coordinates, for your resolutions'  X,Y location of the popups (OK button) that will occur 

later.
			CenterX := Floor(Xmax/2)
			CenterY := Floor(Ymax/2)+103


			;Offsets the search coordinates for OK popup for the imagesearch in Popup sub.
			;ImageSearch method (Popup sub)
			ClickPopX1 := CenterX - 40
			ClickPopY1 := CenterY - 30

			ClickPopX2 := CenterX + 30
			ClickPopY2 := CenterY + 30


			} else {
			BlockInput, MouseMoveOff
			MsgBox, eGenesis Client not running, aborting...
			Exit
			}



	Start:
	MineNum := 0 
	BlockInput, MouseMoveOff

	Start2:

	BlockInput, MouseMoveOff
	Gui, +AlwaysOnTop +ToolWindow
	Gui, Font, bold
	Gui, Add, Text,, Choose Pattern:
	Gui, Font, norm

	Gui, Add, DropDownList, vPattern Choose1,Select one|6 Color (1 Pair)|5 Color (2 Pair)|4 Color (3 Pair)|5 Color 

(Triple)|4 Color (Triple + Pair)|4 Color (Quadruple)|3 Color (Quad + Pair)|3 Color (Quintuple)|7 Color

	Gui, Font, bold
	Gui, Add, Text, vMineNumText, `n%MineNum% of 7 ore stones captured
	Gui, Font, norm



	Gui, Add, Text,,
	( LTrim
	Hover and Middle Click (Mouse Wheel) over all your ore stones.

	Choose highest number of matching colored ore stones First!
	Click Help for a detailed explanation.	
)




	if (Pattern == "")
	{
	Gui, Add, Text,,Last Pattern: N/A`nTime: N/A  (Current Delay: %Delay%)`nSets: N/A`n
	} else {
	perSet := Round(seconds / sets ,2)
	Seconds := Round(Seconds,2)
	Gui, Add, Text,,Last Pattern: %Pattern%`nPattern Time: %seconds%s (%perSet%s per set)  @ %Delay% delay`nPattern 

Sets: %Sets%`n

	;The program might stop working after 15 or so pulls. Not sure what causes this. Has to be a problem with ahk.
	;When it does happen, the Pattern Time shows 0.00s, so in this case, we reload script
	;You will know when this reload occurs, because the values of Last Pattern, Pattern Time and sets will show N/A

	if (Seconds = 0)
	{
	Msgbox, Debug Mode: Program freeze detected, Reloading script...
	RELOAD
	}

	}

	Gui, Add, Button, default gMineSetLoops, START

	Gui, Add, Button, gHelp, HELP
	Gui, Add, Button, gOops, Oops

	;GUI Upper Left Corner
	;Gui, Show, x0 y25
	;GUI Upper Right Corner at 1280x1024 
	Gui, Show, x952 y25

	WinActivate, eGenesis Client


	WinGet, GameWinHandle, ID, eGenesis Client
	loop
	{
		WinActivate
		CoordMode, Mouse, Relative
		KeyWait, MButton, D
		KeyWait, MButton
		MouseGetPos, TestX, TestY, WinHandle

		if (WinHandle = GameWinHandle)
		{
			Gosub, MineRecord
		}
		else
		{
			Gui, Destroy
			break
		}
	}
	return


	MineRecord:
	MineNum++
	MouseGetPos, MineX%MineNum%, MineY%MineNum%
	if MineNum > 7 
	{
	Gui, Destroy
	BlockInput, MouseMoveOff
	Msgbox, You have selected too many stones. 7 is the maximum.`n`nTo ensure you did not make a mistake, the script 

will now be reloaded...`n`nYou must start over, click OK to reload script.
	RELOAD
	}

	GuiControl, Text, MineNumText, `n%MineNum% of 7 ore stones captured
	return




	Oops:

	Pattern := LastPattern
	Gui, Destroy
	Gosub, Main






	MineSetLoops:



	if (MineNum <> 7)
	{
	Gui, Destroy
	BlockInput, MouseMoveOff
	Msgbox, Not enough ore stones. Sandmining requires 7 ore stones.`n`nTo ensure you did not make a mistake, the 

script will now be reloaded...`n`nYou must start over, click OK to reload script.
	RELOAD
	} else {
	Gui, Submit
	Gui, Destroy
	}

	



	Main:




SetDefaultMouseSpeed, 0



LastPattern := Pattern
Seconds := 0
Counter := 0

SetTimer, Counter, 10


Stone4 = 0
Stone5 = 0
Stone6 = 0
Stone7 = 0





BlockInput, MouseMove



;All of the if / else if statements of the 10 possible color combos...


if (pattern == "7 Color")
{
;KEY:
;A:1
;B:2
;C:3
;D:4
;E:5
;F:6
;G:7


Sets := 8
;Set1: A, B, C, D, E, F 
Stone1 := 1
Stone2 := 2
Stone3 := 3
Stone4 := 4
Stone5 := 5
Stone6 := 6
GoSub, PatternSet

;Set2: A, B, C, D, E, G 
Stone1 := 1
Stone2 := 2
Stone3 := 3
Stone4 := 4
Stone5 := 5
Stone6 := 7
GoSub, PatternSet

;Set3: A, B, C, D, F, G
Stone1 := 1
Stone2 := 2
Stone3 := 3
Stone4 := 4
Stone5 := 6
Stone6 := 7
GoSub, PatternSet

;Set4: A, B, C, E, F, G
Stone1 := 1
Stone2 := 2
Stone3 := 3
Stone4 := 5
Stone5 := 6
Stone6 := 7
GoSub, PatternSet

;Set5: A, B, D, E, F, G
Stone1 := 1
Stone2 := 2
Stone3 := 4
Stone4 := 5
Stone5 := 6
Stone6 := 7
GoSub, PatternSet

;Set6: A, C, D, E, F, G
Stone1 := 1
Stone2 := 3
Stone3 := 4
Stone4 := 5
Stone5 := 6
Stone6 := 7
GoSub, PatternSet

;Set7: B, C, D, E, F, G 
Stone1 := 2
Stone2 := 3
Stone3 := 4
Stone4 := 5
Stone5 := 6
Stone6 := 7
GoSub, PatternSet

;Set8: A, B, C, D, E, F, G Breaks all 7 stones
Stone1 := 1
Stone2 := 2
Stone3 := 3
Stone4 := 4
Stone5 := 5
Stone6 := 6
Stone7 := 7
GoSub, PatternSet
}



else if (pattern == "6 Color (1 Pair)")
{
;KEY: Got 100%
;A-1 = 1
;A-2 = 2
;B = 3
;C = 4
;D = 5
;E = 6
;F = 7

Sets := 14

;Set1: A-1, B, C, F 
Stone1 := 1
Stone2 := 3
Stone3 := 4
Stone4 := 7
GoSub, PatternSet

;Set2: A-1, D, E 
Stone1 := 1
Stone2 := 5
Stone3 := 6
Stone4 := 0
GoSub, PatternSet

;Set3: A-1, C, D, E 
Stone1 := 1
Stone2 := 4
Stone3 := 5
Stone4 := 6
GoSub, PatternSet

;Set4: A-1, B, F 
Stone1 := 1
Stone2 := 3
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set5: A-1, D, E, F 
Stone1 := 1
Stone2 := 5
Stone3 := 6
Stone4 := 7
GoSub, PatternSet

;Set6: A-1, B, C 
Stone1 := 1
Stone2 := 3
Stone3 := 4
Stone4 := 0
GoSub, PatternSet

;Set7: A-1, B, E, F This workload will crumble stone A-1 
Stone1 := 1
Stone2 := 3
Stone3 := 6
Stone4 := 7
GoSub, PatternSet

;Set8: A-2, C, D
Stone1 := 2
Stone2 := 4
Stone3 := 5
Stone4 := 0
GoSub, PatternSet

;Set9: A-2, D, E 
Stone1 := 2
Stone2 := 5
Stone3 := 6
Stone4 := 0
GoSub, PatternSet

;Set10: A-2, B, C, F 
Stone1 := 2
Stone2 := 3
Stone3 := 4
Stone4 := 7
GoSub, PatternSet

;Set11: A-2, C, F 
Stone1 := 2
Stone2 := 4
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set12: A-2, B, E, D 
Stone1 := 2
Stone2 := 3
Stone3 := 6
Stone4 := 5
GoSub, PatternSet

;Set13: A-2, B, E This workload will crumble stone B & E
Stone1 := 2
Stone2 := 3
Stone3 := 6
Stone4 := 0
GoSub, PatternSet

;Set14: A-2, C, D, F This workload will crumble the remaining stones
Stone1 := 2
Stone2 := 4
Stone3 := 5
Stone4 := 7
GoSub, PatternSet
}



else if (pattern == "5 Color (2 Pair)")
{
;KEY: Hit 100%
;A-1: 1
;A-2: 2
;B-1: 3
;B-2: 4
;C: 5
;D: 6
;E: 7

Sets := 15

;Set1: C, D, E 
Stone1 := 5
Stone2 := 6
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set2: C, A-1, B-1
Stone1 := 5
Stone2 := 1
Stone3 := 3
Stone4 := 0
GoSub, PatternSet

;Set3: C, A-1, B-2 
Stone1 := 5
Stone2 := 1
Stone3 := 4
Stone4 := 0
GoSub, PatternSet

;Set4: C, A-2, B-1 
Stone1 := 5
Stone2 := 2
Stone3 := 3
Stone4 := 0
GoSub, PatternSet

;Set5: C, A-2, B-2 
Stone1 := 5
Stone2 := 2
Stone3 := 4
Stone4 := 0
GoSub, PatternSet

;Set6: D, A-1, B-1 
Stone1 := 6
Stone2 := 1
Stone3 := 3
Stone4 := 0
GoSub, PatternSet

;Set7: D, A-1, B-2 
Stone1 := 6
Stone2 := 1
Stone3 := 4
Stone4 := 0
GoSub, PatternSet

;Set8: D, A-2, B-1 
Stone1 := 6
Stone2 := 2
Stone3 := 3
Stone4 := 0
GoSub, PatternSet

;Set9: D, A-2, B-2 
Stone1 := 6
Stone2 := 2
Stone3 := 4
Stone4 := 0
GoSub, PatternSet

;Set10: E, A-1, B-1
Stone1 := 7
Stone2 := 1
Stone3 := 3
Stone4 := 0
GoSub, PatternSet

;Set11: E, A-1, B-2 
Stone1 := 7
Stone2 := 1
Stone3 := 4
Stone4 := 0
GoSub, PatternSet

;Set12: E, A-2, B-1 
Stone1 := 7
Stone2 := 2
Stone3 := 3
Stone4 := 0
GoSub, PatternSet

;Set13: E, A-2, B-2 
Stone1 := 7
Stone2 := 2
Stone3 := 4
Stone4 := 0
GoSub, PatternSet

;Set14: A-1, B-1, C, D, E Breaks A-1 & B-1 
Stone1 := 1
Stone2 := 3
Stone3 := 5
Stone4 := 6
Stone5 := 7
GoSub, PatternSet

;Set15: A-2, B-2, C, D, E Breaks the remaining 5 stones
Stone1 := 2
Stone2 := 4
Stone3 := 5
Stone4 := 6
Stone5 := 7
GoSub, PatternSet
}


else if (pattern == "5 Color (Triple)")
{
;KEY:
;A-1: 1
;A-2: 2
;A-3: 3
;B: 4
;C: 5
;D: 6
;E: 7

Sets := 14

;Set1: A-1, B, C 
Stone1 := 1
Stone2 := 4
Stone3 := 5
Stone4 := 0
GoSub, PatternSet

;Set2: A-1, B, D 
Stone1 := 1
Stone2 := 4
Stone3 := 6
Stone4 := 0
GoSub, PatternSet

;Set3: A-1, B, E
Stone1 := 1
Stone2 := 4
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set4: A-1, C, D
Stone1 := 1
Stone2 := 5
Stone3 := 6
Stone4 := 0
GoSub, PatternSet

;Set5: A-1, C, E 
Stone1 := 1
Stone2 := 5
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set6: A-1, D, E 
Stone1 := 1
Stone2 := 6
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set7: A-2, B, C 
Stone1 := 2
Stone2 := 4
Stone3 := 5
Stone4 := 0
GoSub, PatternSet

;Set8: A-2, B, D
Stone1 := 2
Stone2 := 4
Stone3 := 6
Stone4 := 0
GoSub, PatternSet

;Set9: A-2, B, E 
Stone1 := 2
Stone2 := 4
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set10: A-2, C, D
Stone1 := 2
Stone2 := 5
Stone3 := 6
Stone4 := 0
GoSub, PatternSet

;Set11: A-2, C, E 
Stone1 := 2
Stone2 := 5
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set12: A-2, D, E
Stone1 := 2
Stone2 := 6
Stone3 := 7
Stone4 := 0
GoSub, PatternSet


;Set13: A-1, A-2, A-3 Breaks A-1 and A-2 
Stone1 := 1
Stone2 := 2
Stone3 := 3
Stone4 := 0
Stone5 := 0
GoSub, PatternSet

;Set14: A-3, B, C, D, E Breaks B, C, D, and E
Stone1 := 3
Stone2 := 4
Stone3 := 5
Stone4 := 6
Stone5 := 7
GoSub, PatternSet
}


else if (pattern == "4 Color (3 Pair)")
{
;KEY:
;A-1 = 1
;A-2 = 2
;B-1 = 3
;B-2 = 4
;C-1 = 5
;C-2 = 6
;D = 7

Sets := 15

;Set1: A-1, B-1, C-1
Stone1 := 1
Stone2 := 3
Stone3 := 5
Stone4 := 0
GoSub, PatternSet

;Set2: A-2, B-2, C-2, D 
Stone1 := 2
Stone2 := 4
Stone3 := 6
Stone4 := 7
GoSub, PatternSet

;Set3: A-1, B-1, C-2 
Stone1 := 1
Stone2 := 3
Stone3 := 6
Stone4 := 0
GoSub, PatternSet

;Set4: A-2, B-2, C-1, D 
Stone1 := 2
Stone2 := 4
Stone3 := 5
Stone4 := 7
GoSub, PatternSet

;Set5: A-1, B-2, C-1 
Stone1 := 1
Stone2 := 4
Stone3 := 5
Stone4 := 0
GoSub, PatternSet

;Set6: A-2, B-1, C-2, D 
Stone1 := 2
Stone2 := 3
Stone3 := 6
Stone4 := 7
GoSub, PatternSet

;Set7: A-1, B-2, C-2 
Stone1 := 1
Stone2 := 4
Stone3 := 6
Stone4 := 0

;Set8: A-2, B-1, C-1, D 
Stone1 := 2
Stone2 := 3
Stone3 := 5
Stone4 := 7
GoSub, PatternSet

;Set9: A-2, B-1, C-1 
Stone1 := 2
Stone2 := 3
Stone3 := 5
Stone4 := 0
GoSub, PatternSet

;Set10: A-1, B-2, C-2, D 
Stone1 := 1
Stone2 := 4
Stone3 := 6
Stone4 := 7
GoSub, PatternSet

;Set11: A-2, B-1, C-2 
Stone1 := 2
Stone2 := 3
Stone3 := 6
Stone4 := 0
GoSub, PatternSet

;Set12: A-1, B-2, C-1, D 
Stone1 := 1
Stone2 := 4
Stone3 := 5
Stone4 := 7
GoSub, PatternSet

;Set13: A-2, B-2, C-1 
Stone1 := 2
Stone2 := 4
Stone3 := 5
Stone4 := 0
GoSub, PatternSet

;Set14: A-1, B-1, C-2, D
Stone1 := 1
Stone2 := 3
Stone3 := 6
Stone4 := 7
GoSub, PatternSet



;New (15th) pattern to break last 3 stones, wiki was partially incorrect. Thanks Setheri for discovering this :)
;Set15: A-1, B-2, C-2 
Stone1 := 1
Stone2 := 4
Stone3 := 6
Stone4 := 0
GoSub, PatternSet
}




else if (pattern == "4 Color (Triple + Pair)")
{
;KEY:
;A-1: 1
;A-2: 2
;A-3: 3
;B-1: 4
;B-2: 5
;C: 6
;D: 7


Sets := 12

;Set1: A-1, A-2, A-3
Stone1 := 1
Stone2 := 2
Stone3 := 3
Stone4 := 0
GoSub, PatternSet

;Set2: A-1, B-1, C 
Stone1 := 1
Stone2 := 4
Stone3 := 6
Stone4 := 0
GoSub, PatternSet

;Set3: A-1, B-1, D
Stone1 := 1
Stone2 := 4
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set4: A-1, B-2, C 
Stone1 := 1
Stone2 := 5
Stone3 := 6
Stone4 := 0
GoSub, PatternSet

;Set5: A-1, B-2, D 
Stone1 := 1
Stone2 := 5
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set6: A-1, C, D 
Stone1 := 1
Stone2 := 6
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set7: A-2, B-1, C 
Stone1 := 2
Stone2 := 4
Stone3 := 6
Stone4 := 0
GoSub, PatternSet

;Set8: A-2, B-1, D 
Stone1 := 2
Stone2 := 4
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set9: A-3, B-1, C 
Stone1 := 3
Stone2 := 4
Stone3 := 6
Stone4 := 0
GoSub, PatternSet

;Set10: A-3, B-1, D 
Stone1 := 3
Stone2 := 4
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set11: A-2, C, D 
Stone1 := 2
Stone2 := 6
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set12: A-1, B-1, C, D Breaks these 4 stones
Stone1 := 1
Stone2 := 4
Stone3 := 6
Stone4 := 7
GoSub, PatternSet
}


else if (pattern == "4 Color (Quadruple)")
{
;KEY:
;A-1: 1
;A-2: 2
;A-3: 3
;A-4: 4
;B: 5
;C: 6
;D: 7


Sets := 15

;Set1: A-1, B, C
Stone1 := 1
Stone2 := 5
Stone3 := 6
Stone4 := 0
GoSub, PatternSet

;Set2: A-1, B, D 
Stone1 := 1
Stone2 := 5
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set3: A-1, C, D 
Stone1 := 1
Stone2 := 6
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set4: A-2, B, C 
Stone1 := 2
Stone2 := 5
Stone3 := 6
Stone4 := 0
GoSub, PatternSet

;Set5: A-2, B, D 
Stone1 := 2
Stone2 := 5
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set6: A-2, C, D
Stone1 := 2
Stone2 := 6
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set7: A-3, B, C 
Stone1 := 3
Stone2 := 5
Stone3 := 6
Stone4 := 0
GoSub, PatternSet

;Set8: A-3, B, D 
Stone1 := 3
Stone2 := 5
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set9: A-3, C, D
Stone1 := 3
Stone2 := 6
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set10: A-4, B, C, D Breaks B, C, D
Stone1 := 4
Stone2 := 5
Stone3 := 6
Stone4 := 7
GoSub, PatternSet

;Set11: A-1, A-2, A-3
Stone1 := 1
Stone2 := 2
Stone3 := 3
Stone4 := 0
GoSub, PatternSet

;Set12: A-1, A-2, A-4
Stone1 := 1
Stone2 := 2
Stone3 := 4
Stone4 := 0
GoSub, PatternSet

;Set13: A-1, A-3, A-4
Stone1 := 1
Stone2 := 3
Stone3 := 4
Stone4 := 0
GoSub, PatternSet

;Set14: A-2, A-3, A-4 
Stone1 := 2
Stone2 := 3
Stone3 := 4
Stone4 := 0
GoSub, PatternSet

;Set15: A-1, A-2, A-3, A-4 Breaks A-1, A-2, A-3
Stone1 := 1
Stone2 := 2
Stone3 := 3
Stone4 := 4
GoSub, PatternSet
}


else if (pattern == "*3 Color (Triple + 2 Pair)")
{
Sets := 0
BlockInput, MouseMoveOff
Msgbox, No single stone can be worked 7 times on this pattern.`n`nConcede and just get a new workload...
}





else if (pattern == "3 Color (Quad + Pair)")
{
;KEY
;A-1: 1
;A-2: 2
;A-3: 3
;A-4: 4
;B-1: 5
;B-2: 6
;C: 7
;D: 8


Sets := 7

;Set1: A-1, B-1, C 
Stone1 := 1
Stone2 := 5
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set2: A-1, B-2, C 
Stone1 := 1
Stone2 := 6
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set3: A-2, B-1, C 
Stone1 := 2
Stone2 := 5
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set4: A-2, B-2, C 
Stone1 := 2
Stone2 := 6
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set5: A-3, B-1, C
Stone1 := 3
Stone2 := 5
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set6: A-3, B-2, C 
Stone1 := 3
Stone2 := 6
Stone3 := 7
Stone4 := 0
GoSub, PatternSet

;Set7: A-4, B-1, C
Stone1 := 4
Stone2 := 5
Stone3 := 7
Stone4 := 0
GoSub, PatternSet
}



else if (pattern == "3 Color (Quintuple)")
{
;5 of same color

;KEY:
;A-1: 1
;A-2: 2
;A-3: 3
;A-4: 4
;A-5: 5
;B: 6
;C: 7

Sets := 11

;Set1: A-1, A-2, A-3 
Stone1 := 1
Stone2 := 2
Stone3 := 3
Stone4 := 0
GoSub, PatternSet

;Set2: A-1, A-2, A-4 
Stone1 := 1
Stone2 := 2
Stone3 := 4
Stone4 := 0
GoSub, PatternSet

;Set3: A-1, A-2, A-5
Stone1 := 1
Stone2 := 2
Stone3 := 5
Stone4 := 0
GoSub, PatternSet

;Set4: A-1, A-3, A-4 
Stone1 := 1
Stone2 := 3
Stone3 := 4
Stone4 := 0
GoSub, PatternSet

;Set5: A-1, A-3, A-5
Stone1 := 1
Stone2 := 3
Stone3 := 5
Stone4 := 0
GoSub, PatternSet

;Set6: A-1, A-4, A-5 
Stone1 := 1
Stone2 := 4
Stone3 := 5
Stone4 := 0
GoSub, PatternSet

;Set7: A-2, A-3, A-4 
Stone1 := 2
Stone2 := 3
Stone3 := 4
Stone4 := 0
GoSub, PatternSet

;Set8: A-2, A-3, A-5 
Stone1 := 2
Stone2 := 3
Stone3 := 5
Stone4 := 0
GoSub, PatternSet

;Set9: A-2, A-4, A-5
Stone1 := 2
Stone2 := 4
Stone3 := 5
Stone4 := 0
GoSub, PatternSet

;Set10: A-3, A-4, A-5 
Stone1 := 3
Stone2 := 4
Stone3 := 5
Stone4 := 0
GoSub, PatternSet

;Set11: A-1, A-2, A-3, A-4, A-5 Breaks A-1, A-2, A-3, A-4, A-5
Stone1 := 1
Stone2 := 2
Stone3 := 3
Stone4 := 4
Stone5 := 5

GoSub, PatternSet
}


else
{
BlockInput, MouseMoveOff
Msgbox, You did not choose a valid pattern, please try again...`n`nNote your selected stones are still in memory, simply 

choose the pattern and immediately hit START
Gosub, Start2
}



;Bring up the Menu again (Force Restart)
Gosub, Start
return





PatternSet:
Sleep 100
GoSub, Popup  ;This one checks, if another popup, beside the one at the end of this sub, exists. Likely "Ore is busy" 

popup

;if ErrorLevel = 0
;Msgbox, Another Popup`n`nConsider aborting the script here, this might suggest a "Ore stone busy message"?

MouseMove, MineX%Stone1%, MineY%Stone1%
Sleep %Delay%
Send {A}
Sleep %Delay%

MouseMove, MineX%Stone2%, MineY%Stone2%
Sleep %Delay%
Send {A}
Sleep %Delay%

MouseMove, MineX%Stone3%, MineY%Stone3%
Sleep %Delay%
Send {A}
Sleep %Delay%


if Stone4 > 0
{
MouseMove, MineX%Stone4%, MineY%Stone4%
Sleep %Delay%
Send {A}
Sleep %Delay%
}

if Stone5 > 0
{
MouseMove, MineX%Stone5%, MineY%Stone5%
Sleep %Delay%
Send {A}
Sleep %Delay%
}

if Stone6 > 0
{
MouseMove, MineX%Stone6%, MineY%Stone6%
Sleep %Delay%
Send {A}
Sleep %Delay%
}

if Stone7 > 0
{
MouseMove, MineX%Stone7%, MineY%Stone7%
Sleep %Delay%
Send {A}
Sleep %Delay%
}



Send {S}
Sleep %Delay%

GoSub, Popup

return




			Popup:

			ImageSearch, PopX, PopY, ClickPopX1, ClickPopY1, ClickPopX2, ClickPopY2, *50 OK.PNG
			if ErrorLevel = 0
			{
			NewX := PopX + 3
			NewY := PopY + 3

			MouseMove, %NewX%, %NewY%
			Sleep %PopupDelay%
			Click
			Sleep %PopupDelay%
			}


			Sleep 300

			;Run this twice to ensure a laggy popup didn't get closed.
			ImageSearch, PopX, PopY, ClickPopX1, ClickPopY1, ClickPopX2, ClickPopY2, *50 OK.PNG
			if ErrorLevel = 0
			{
			NewX := PopX + 3
			NewY := PopY + 3

			MouseMove, %NewX%, %NewY%
			Sleep %PopupDelay%
			Click
			Sleep %PopupDelay%
			}

			return




			PopupOld:

			;Search for the RBG color of 0xECDFBD (Same as HTML code: #ECDFBD)
			;Was having too much problems with Sterope public sand mine.
			;The shade would work one day and not the next, always adjusting and something I still kept 

walking randomly from misclick
			;So this has been aborted and using imagesearch method

			PixelSearch, Px, Py, %CenterX%, %CenterY%, %CenterX%, %CenterY%, 0xEBDDBB, %shade%, Fast|RGB

			if ErrorLevel = 0
			{
			MouseMove, %CenterX%, %CenterY%
			Sleep %PopupDelay%
			Click
			Sleep %PopupDelay%
			}
			return





			Counter:
			counter ++
			seconds := counter/100
			return


	Help:
	Gui, Destroy

	BlockInput, MouseMoveOff
	Msgbox, Ctrl + R = Reload`nCtrl + P to Pause, Ctrl + P again to Resume.`n`nNote: This script disables the mouse 

while it is running!`nIf you pause the script, while it is runing, then your mouse may stop working.`nEither resume and 

let it finish or Ctrl+R (Reload) the script and your mouse will be enabled.`n`nOops Button: If you forgot to minimize your 

chat (all keys were sent into chat, instead of screen),`nthen this button will repeat the last pattern and ore stone 

locations.`nJust ignore that it says 0 of 7 stones and ignore selecting a new pattern (Leave as "Select one" is ok).`nJust 

press the Oops button and it will run the last pattern/ore stone locations.`n`n`nConsistently has all 7 stones crumble 

(These are most desireable):`n`n7 Color`n6 Color (1 Pair)`n5 Color (2 Pair)`n4 Color (3 Pair)`n`n`nConsistent Unbroken 

stones:`n`n3 color (Quintiple): 2 stones`n3 Color (Quad + Pair): 6 stones`n4 Color (Quadruple): 1 stone`n4 color (Triple + 

Pair): 3 stones`n5 color (Triple): 1 stone`n`n`n(Triple + 2 Pair) and (Double Triple) has no single stone that can be 

worked 7 times.`n(Quadruple + Triple) fails using Quadruple pattern.`n(2 Triples) fail using Triple pattern.`nThose have 

been excluded from "Choose Pattern" pulldown menu.`n`n`n`nWhat order to click your ore stones:`n`nClick all Quintiple or 

Quadruple, First if any,`nClick a triple color pattern next, if any`nClick all paired colors next, if any`nThen all the 

single colored stones, LAST!


	;Reload
	GoSub, Start2

	return


^r::reload
^p::Pause