Last active
October 16, 2018 17:42
-
-
Save InfinityBMX/ea6dedaa3e610358e1fa9b1588273f2d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;LEVEL DETECTOR GEM FARM | |
;This script is designed to farm gems and boss chest drops by automatically progressing through low level areas, then resetting and starting over the same mission | |
;It achieves this by levelling click damage and clicking automatically to kill enemies as fast as possible. To ensure the fastest boss kills, and to pick up | |
;item drops, it utilizes a pixel-color detector to determine when the game is changing levels. This allows it to know when it is 'safe' to level champions | |
;or click damage without missing anything, and allows it to click in the right place to pick up items as they drop and to open the boss loot bag as soon | |
;as it reaches the middle of the screen. Overall this allows for a sub 11 minute run, with no down time; the script resets as soon as it reaches area 31. | |
;Settings: Set your adventure map to show all, including completed adventures (though the script should handle this). Set level up mode to UPG (though the script should handle this), | |
;turn on autoprogress (though the script has limited ability to correct for autoprogress), and close the chat window if needed (the level up function will not scroll the roster, | |
;so if the chat covers a champion that will be used, it needs to be closed). | |
; this is the point the transition test will occur at | |
; if you need to change it, pick at point as close to the left edge of the screen as possible and below the bottom-most champion | |
; to ensure that it doesn't pick up the champions transitioning into the screen | |
global familiarcount := 6 | |
global transx := 33 | |
global transy := 579 | |
global campselectx := 111 ; horizontal location of the tomb and tour buttons at the upper left of the screen | |
global tombselecty := 194 ; vertical location of the tomb button | |
global grandselecty := 132 ; vertical location of the tour button | |
global campx := 932 ; horizontal location of the camp | |
global campy := 585 ; vertical location of the camp | |
; variables pertaining to manipulating the adventure list | |
global listx := 565 ; horizontal location of the adventure list | |
global listy := 550 ; vertical location of desired adventure in list after scrolling | |
global campstartx := 970 ; horizontal location of adventure start button | |
global campstarty := 674 ; vertical location of adventure start button | |
; variables pertaining to manipulating the champion roster (and click damage upgrade) | |
global rosterx := 195 ; horizontal location of the middle of the click damage button | |
global rostery := 900 ; vertical location of the middle of the click damage button | |
global rosterinterval := 143 ; distance between the middle of the click damage button and the middle of bruenors level up button | |
; variables pertaining to the formation presets | |
global formx := 25 ; horizontal location of formation preset buttons | |
global formy1 := 786 ; vertical location of formation preset 1 | |
global formy2 := 822 ; vertical location of formation preset 2 | |
global formy3 := 858 ; vertical location of formation preset 3 | |
; variables for the field, defining cursor movements to pick up gold and items (including gems) | |
global sweepright := 1500 ; horizontal location of the default spawn zone (right edge of the screen) | |
global sweepport := 1280 ; horizontal location of the portal spawn zone | |
global sweepvert := 305 ; vertical location of the upper spawn zone | |
global sweepleft := 800 ; horizontal location of the middle of the screen | |
global sweeplow := 630 ; vertical location of the lower spawn zone | |
global bagclick := 480 ; vertical position of boss loot bag | |
; error detection. these variable help the program determine if autoprogress is off or if bruenor's | |
; selector has been opened and allows the program to resolve the issue | |
global whitearrowx := 1562 ; horizontal location of a white pixel in the autoprogress arrow | |
global whitearrowy := 160 ; vertical location of a white pixel in the autoprogress arrow | |
global greyx := 1025 ; horizontal location of grey space in specialization window (ensure your hex code matches the color of the pixel) | |
global greyy := 582 ; vertical location of grey space in specialization window | |
global greyc := 0x191919 ; color of the location the specialization window check checks | |
global whitexx := 1053 ; horizontal location of a white pixel in the x button to close specialization window | |
global whitexy := 227 ; vertical location of a white pixel in the x button to close specialization window | |
global upgx := 21 ; horizontal location of a white pixel in the level up selector | |
global upgy := 896 ; vertical location of a white pixel in the level up selector | |
global upgcolor := 0xFEFEFE ; color of a white pixel in the level up selector | |
global greencheckcolor := 0x00D442 ; color of a green pixel in the checkmarks for "hide completed" and "hide locked" | |
global hidey := 751 ; vertical location of a green pixel in the checkmarks for "hide completed" and "hide locked" | |
global hidecompletedx := 537 ; horizontal location of a green pixel in the checkmark for "hide completed" | |
global hidelockedx := 682 ; horizontal location of a green pixel in the checkmark for "hide locked" | |
global dpsblack := 0x1F1F1F ; color of a black pixel in the bar under the formation DPS | |
global dpsblackx := 342 ; horizontal location of a black pixel in the bar under the formation DPS | |
global dpsblacky := 60 ; vertical location of a black pixel in the bar under the formation DPS | |
; variables pertaining to using the complete adventure button and subsequent actions to reset the adventure | |
global completex := 394 ; horizontal location of complete adventure button | |
global completey := 130 ; vertical location of complete adventure button | |
global confirmx := 727 ; horizontal location of confirm button | |
global confirmy := 610 ; vertical location of confirm button | |
global altconfirmy := 660 ; vertical location of confirm button with bonus objective | |
global continuex := 780 ; horizontal location of continue button | |
global continuey := 762 ; vertical location of continue button | |
; variables pertaining to swapping out bruenor for deekin | |
global swapslotx := 283 ; horizontal location of 1st slot swap arrows | |
global swapsloty := 748 ; vertical location of 1st slot swap arrows | |
global swapbuttonx := 450 ; horizontal location of 1st slot swap button | |
global swapbuttony := 657 ; vertical location of 1st slot swap button | |
; variables pertaining to familiars | |
global deffamiliarboxx := 830 ; horizontal location of the familiar box (if search fails) | |
global deffamiliarboxy := 706 ; vertical location of the familiar box (if search fails) | |
global familiarrowx1 := 695 ; left extreme of where familiar box may be. keep small if possible (for search) | |
global familiarrowx2 := 960 ; right extreme of where familiar box may be. keep small if possible (for search) | |
global familiarrowy1 := 714 ; middle of benched familiar count (red box, white number) (for search) | |
global familiarrowy2 += familiarrowy1 ; keeping search as small as possible | |
global leftfamslotx := 1092 ; horizontal location of leftmost familiar line | |
global midfamslotx := 1175 ; horizontal location of middle familiar line | |
global rightfamslotx := 1260 ; horizontal location of right familiar line | |
global topfamsloty := 336 ; vertical location of top familiar slot | |
global secfamsloty := 422 ; vertical location of 2nd-from-top familiar slot | |
global thifamsloty := 505 ; vertical location of 3rd-from-top familiar slot | |
global botfamsloty := 588 ; vertical location of bottom familiar slot | |
global slot1clicks := 15 ;Deekin | |
global slot2clicks := 11 ;Celeste | |
global slot3clicks := 20 ;Binwin | |
global slot4clicks := 9 ;Jar | |
global slot5clicks := 7 ;Calliope | |
global slot6clicks := 18 ;Evelyn | |
global slot7clicks := 13 ;Catti | |
global slot8clicks := 7 ;Hitch | |
global tooltipx :=600 | |
global tooltipy := 50 | |
`:: ; Press ` to Exit the program | |
Send {Shift Up} | |
Send {Alt Up} | |
exitapp | |
^r::Reload ; Soft Reset. Reloads the script, which will exit all current threads without exiting the program | |
; Main program. Opens the Mad Wizard free play from the main map, then progresses through the adventure to reset after level 30 | |
; Levels champions and click damage at the start of levels and chooses and autoclick mode based on the current level | |
^g:: | |
Main: | |
{ | |
ToolTip, Main Gem Loop, tooltipx, tooltipy | |
PixelGetColor, colour, dpsblackx, dpsblacky | |
IfEqual, colour, %dpsblack% | |
{ | |
GoSub Reset | |
GoSub TransWait | |
Sleep 3000 | |
} | |
Loop | |
{ | |
GoSub CampStart ;Starts Campaign | |
;Area 1 | |
Loop 5 ; Adjusted to 10 just in case because loading times were slow sometimes | |
{ | |
GoSub NoPortSweep | |
Level(0) | |
} | |
GoSub PlaceFamiliars ; Place familiars in clicking | |
Sleep 200 | |
FormationSet(1) | |
Level(1, 9) | |
GoSub Autoprogress | |
GoSub UpgradeSelect | |
Loop | |
{ | |
GoSub NoPortSweep | |
If TransitionTest() | |
Break | |
Level(0) | |
If TransitionTest() | |
Break | |
} | |
GoSub TransWait | |
;Area 2 | |
Level(0, 2) | |
Zone(1) | |
GoSub TransWait | |
;Area 3 | |
Level(0, 2) | |
Level(1) | |
Level(2) | |
Level(3, 2) | |
Level(4) | |
Zone(3) | |
GoSub TransWait | |
;Area 4 | |
Level(0,2) | |
Zone(3) | |
GoSub TransWait | |
;Area 5 | |
Level (0, 2) | |
Level(1) | |
Level(2) | |
Level(3, 5) | |
Level(4) | |
Sleep 100 ;Script tends to miss later champions, Level() is too fast | |
Level(5) ;Champions far to the right must be levelled on a delay to give the screen time to clear | |
Zone(5) | |
GoSub TransWait | |
;Area 6 | |
Level(0, 2) | |
Zone(1) | |
GoSub TransWait | |
;Area 7 | |
Level(0) | |
Zone(2) ;Note, moving level with items | |
GoSub TransWait | |
;Area 8 | |
Level(0) | |
Zone(3) ;Ward not portal, single item drop | |
GoSub TransWait | |
;Area 9 | |
Level(0) | |
Zone(1) | |
GoSub TransWait | |
;Area 10 | |
Level (0, 2) | |
Level(1) | |
Level(2) | |
Level(3, 5) | |
Level(4) | |
Sleep 100 ;Script tends to miss later champions, Level() is too fast | |
Level(5) ;Champions far to the right must be levelled on a delay to give the screen time to clear | |
;Level(6) ;Commenting for now, Asharra is getting clicked twice for some reason | |
Zone(5) | |
GoSub TransWait | |
;Area 11 | |
Level (0) | |
Zone(1) | |
GoSub TransWait | |
;Area 12 | |
Level(0) | |
Zone(1) | |
GoSub TransWait | |
;Area 13 | |
Level(0) | |
Zone(1) | |
GoSub TransWait | |
;Area 14 | |
Level(0, 2) | |
Level(1) | |
Level(2) | |
Level(3, 2) | |
Level(4) | |
Sleep 100 ;Script tends to miss later champions, Level() is too fast | |
Level(5) ;Champions far to the right must be levelled on a delay to give the screen time to clear | |
Level(7) | |
FormationSet(1) | |
Zone(3) ;Strange Orb. Champion levels needed | |
GoSub TransWait | |
;Area 15 | |
Level(0, 2) | |
Zone(5) | |
GoSub TransWait | |
;Area 16 | |
Level (0, 2) | |
Zone(3) ;first portal with item drops | |
GoSub TransWait | |
;Area 17 | |
Level(0, 2) | |
Zone(2) ;Note, moving level with items | |
GoSub TransWait | |
;Area 18 | |
Level(0, 2) | |
Zone(1) | |
GoSub TransWait | |
;Area 19 | |
Level(0, 2) | |
Zone(1) | |
GoSub TransWait | |
;Area 20 | |
Level(0, 2) | |
Zone(5) | |
GoSub TransWait | |
;Area 21 | |
Level (0, 2) | |
Zone(1) | |
GoSub TransWait | |
;Area 22 | |
Level(0, 2) | |
Zone(3) | |
GoSub TransWait | |
;Area 23 | |
Level(0, 2) | |
Zone(3) | |
GoSub TransWait | |
;Area 24 | |
Level(0, 2) | |
Zone(3) | |
GoSub TransWait | |
;Area 25 | |
Level(0, 2) | |
Zone(5) | |
GoSub TransWait | |
;Area 26 | |
Level (0, 2) | |
Zone(3) | |
GoSub TransWait | |
;Area 27 | |
Level(0, 2) | |
Zone(3) | |
GoSub TransWait | |
;Area 28 | |
Level(0, 2) | |
Zone(3) | |
GoSub TransWait | |
;Area 29 | |
Level(0, 2) | |
Zone(3) | |
GoSub TransWait | |
;Area 30 | |
Level(0, 2) | |
Zone(5) | |
GoSub TransWait | |
;Area 31 | |
GoSub Reset | |
GoSub TransWait | |
Sleep 3000 | |
} | |
Return | |
} | |
; Action length tester | |
; Starts a timer, calls subroutines and functions, then calls TransitionTest, then reports the total time elapsed | |
; In order to ensure proper testing function, time elapsed must be under 900 milliseconds | |
^m:: | |
{ | |
starttime := A_TickCount | |
Loop 1 | |
{ | |
; GoSub BossClick | |
; GoSub NoPortSweep | |
; Level(7) | |
; FormationSet(1) | |
; GoSub Reset | |
; GoSub CampStart | |
; Level(0, 5) | |
; Level(1, 2) | |
;GoSub SwitchToDeekin | |
GoSub PlaceFamiliars | |
} | |
; carenot := TransitionTest() | |
; wipelength := A_TickCount - starttime | |
; MsgBox, Loop length %wipelength% milliseconds | |
Return | |
} | |
; Transition detector loop test | |
; Runs a loop of a function or subroutine followed by TransitionTest until a transition is detected | |
; To test, turn off autoprogress and go to a level besides your current highets. | |
; Activate the macro, then hit g to start a level transition. | |
; Use this function then initiate a level transition to ensure the function/subroutine being tested remains under time | |
^t:: | |
{ | |
slot1 := 1 | |
slot2 := 0 | |
currentLevel := 0 | |
Loop { | |
Level(0,3) | |
if Mod(currentLevel, 1) = 0 | |
{ | |
if (slot1 < slot1clicks) | |
{ | |
Level(1) | |
slot1++ | |
} | |
if (slot2 < slot2clicks) | |
{ | |
Level(2) | |
slot2++ | |
} | |
} | |
ToolTip, Current Level: %currentLevel% slot1: %slot1% slot1clicks: %slot1clicks%, tooltipx, tooltipy | |
currentLevel++ | |
} | |
} | |
CampStart: ; Starts the campaign from the map screen | |
{ | |
Loop 15 ; Zooms out campaign map | |
{ | |
MouseClick, WheelDown, %campx%, %campy% | |
Sleep 5 | |
} | |
Sleep 200 | |
Click %campselectx%, %tombselecty% ; Select Tomb of Annihilation | |
Sleep 200 | |
Click %campselectx%, %grandselecty% ; Select A Grand Tour | |
Sleep 200 | |
Click %campx%, %campy% ; Click the campaign icon | |
Sleep 200 | |
Click | |
Sleep 200 | |
GoSub Unhide | |
Sleep 200 | |
Loop 15 ; Makes sure campaign list is at the top | |
{ ; Hide completed and hide locked are OFF | |
MouseClick, WheelUp, listx, listy | |
Sleep 55 | |
} | |
Loop 5 ; Scrolls down until Mad Wizard Free Play is visible | |
{ | |
MouseClick, WheelDown, listx, listy | |
Sleep 55 | |
} | |
MouseMove %listx%, %listy% ; Clicks Mad Wizard | |
Sleep 200 | |
Click %listx%, %listy% | |
Sleep 200 | |
MouseMove campstartx, campstarty ; Clicks campaign start | |
Sleep 200 | |
Click %campstartx%, %campstarty% | |
Sleep 200 | |
Return | |
} | |
Unhide: ; Ensures "Hide Completed" and "Hide Locked" are not checked | |
{ | |
Sleep 500 | |
PixelGetColor, colour, hidecompletedx, hidey | |
IfEqual, colour, %greencheckcolor% | |
{ | |
MouseMove hidecompletedx, hidey | |
Sleep 5 | |
Click %hidecompletedx%, %hidey% | |
} | |
PixelGetColor, colour, hidelockedx, hidey | |
IfEqual, colour, %greencheckcolor% | |
{ | |
MouseMove hidelockedx, hidey | |
Sleep 5 | |
Click %hidelockedx%, %hidey% | |
} | |
} | |
Autoprogress: | |
{ | |
PixelGetColor, colour, whitearrowx, whitearrowy | |
IfEqual, colour, 0xFFFFFF | |
{ | |
send, g | |
Return | |
} | |
Else | |
Return | |
} | |
UpgradeSelect: | |
{ | |
Loop | |
{ | |
PixelGetColor, colour, upgx, upgy | |
IfEqual, colour, %upgcolor% | |
{ | |
Return | |
} | |
Else | |
MouseMove upgx, upgy | |
Sleep 5 | |
Click %upgx%, %upgy% | |
Sleep 500 | |
} | |
} | |
Reset: | |
{ | |
MouseMove completex, completey, 0 ; Clicks complete adventure button | |
PixelGetColor, colour, completex, completey ; Checks to make sure a level transition is not in progress before attempting to reset | |
IfEqual, colour, 0x000000 | |
Sleep 3500 | |
Sleep 200 | |
Click | |
Sleep 600 | |
MouseMove confirmx, confirmy, 0 ; Clicks confirm | |
Sleep 200 | |
Click | |
Sleep 200 | |
Click | |
Sleep 200 ; Longer to allow for animation | |
MouseMove confirmx, altconfirmy, 0 ; Just in case their are objectives | |
Sleep 100 | |
Click | |
Sleep 100 | |
Click | |
MouseMove continuex, continuey, 0 ; Clicks continue | |
Loop | |
{ | |
Click | |
If TransitionTest() | |
Break | |
Sleep 55 | |
} | |
Return | |
} | |
ResetAlternate: | |
{ | |
MouseMove completex, completey, 0 ; Clicks complete adventure button | |
PixelGetColor, colour, completex, completey ; Checks to make sure a level transition is not in progress before attempting to reset | |
IfEqual, colour, 0x000000 | |
Sleep 3500 | |
Sleep 200 | |
Click | |
Sleep 600 | |
MouseMove confirmx, altconfirmy, 0 ; Clicks confirm | |
Sleep 300 | |
Click | |
Sleep 300 | |
Click | |
Sleep 300 ; Longer to allow for animation | |
MouseMove continuex, continuey, 0 ; Clicks continue | |
Loop | |
{ | |
Click | |
If TransitionTest() | |
Break | |
Sleep 55 | |
} | |
Return | |
} | |
; Autoclicker for boss levels. Clicks in the middle of the screen where the bag will spawn and jiggles the cursor to pick up gems. | |
BossClick: | |
{ | |
MouseMove sweepleft, bagclick | |
Sleep 50 | |
Loop 4 | |
{ | |
Click | |
Sleep 50 | |
} | |
MouseMove sweepleft, bagclick + 5 | |
Sleep 50 | |
Loop 4 | |
{ | |
Click | |
Sleep 50 | |
} | |
Return | |
} | |
; Autoclicker for non-boss levels that don't have a portal. Clicks at the right edge of the screen and progresses the cursor up and down to pick up drops | |
NoPortSweep: | |
{ | |
interval := ( sweeplow - sweepvert ) / 4 | |
sweepy := sweepvert | |
MouseMove sweepright, sweepvert | |
Loop 5 | |
{ | |
MouseMove %sweepright%, %sweepy% | |
sweepy := sweepy + interval | |
Sleep 50 | |
} | |
Return | |
} | |
; Autoclicker levels where the stage moves and items spawn. Offsets the clicker slightly from the NoPortSweep baseline to ensure drops aren't missed | |
RollItemSweep: | |
{ | |
interval := ( sweeplow - sweepvert ) / 4 | |
sweepy := sweepvert | |
sweepx := sweepright - 10 | |
MouseMove sweepright, sweepvert | |
Loop 5 | |
{ | |
MouseMove %sweepx%, %sweepy% | |
sweepy := sweepy + interval | |
Sleep 50 | |
} | |
Return | |
} | |
; Autoclicker for non-boss levels that have a portal. Clicks a a little to left of the portal and progresses the cursor up and down to pick up drops | |
PortSweep: | |
{ | |
interval := ( sweeplow - sweepvert ) / 4 | |
sweepy := sweepvert | |
MouseMove sweepport, sweepvert | |
Loop 5 | |
{ | |
MouseMove %sweepport%, %sweepy% | |
sweepy := sweepy + interval | |
Sleep 50 | |
} | |
Return | |
} | |
Level(champ, num := 1) ; Levels/unlocks a champion or click damage | |
{ ; Recieves a number corresponding to the champion's location in the roster | |
x := rosterx + rosterinterval * champ | |
Loop 3 | |
{ | |
MouseClick, WheelUp, %x%, %rostery% ; Scrolls roster to ensure click damage is visible at the far right | |
Sleep 5 ; Script will sometime inadvertently move the roster when interacting | |
} | |
MouseMove, x, rostery, 0 | |
Sleep 200 | |
Loop %num% ; Bruenor is 1, for example. Click damage is 0 | |
{ ; Will level once by default, caller can send an integer to level more than once | |
Click %x%, %rostery% | |
Sleep 55 | |
PixelGetColor, colour, greyx, greyy ; Checks for upgrade selector window. As noted above, the roster sometime gets scrolled | |
IfEqual, colour, %greyc% ; if it does, and Bruenor gets levelled to his selector, this is needed to escape | |
{ | |
MouseMove whitexx, whiteyy | |
Sleep 55 | |
Click | |
Sleep 55 | |
Return | |
} | |
} | |
Return | |
} | |
FormationSet(number) | |
{ | |
If (number = 1) | |
y := formy1 | |
If (number = 2) | |
y := formy2 | |
If (number = 3) | |
y := formy3 | |
MouseMove formx, y | |
Sleep 200 | |
Click | |
Sleep 55 | |
Click | |
Return | |
} | |
; Locks the script until the level transition screen begins clearing | |
; Makes sure the main function passes to the next level at a more consistent timing | |
; since the Zone function has nearly a second of variability in when it detects a transition | |
TransWait: | |
{ | |
Loop | |
{ | |
if !TransitionTest() | |
Return | |
} | |
} | |
; final loop for each zone. After setup (if any), will loop the correct autoclicker and check for level completion, then return so the main function can progress | |
Zone(Type) | |
{ | |
If (Type = 5) ; Boss level loop | |
{ | |
Loop | |
{ | |
GoSub BossClick ; Always clean up after bosses. They're messy | |
If TransitionTest() | |
Return | |
} | |
} | |
If (Type = 3) ; Portal level loop | |
{ | |
Loop | |
{ | |
IfLess familiarcount, 2 ; Less than 3 familiars we need to clean up ourselves | |
GoSub PortSweep | |
If TransitionTest() | |
Return | |
} | |
} | |
If (Type = 2) ; Non portal, non boss level loop | |
{ | |
Loop | |
{ | |
IfLess familiarcount, 2 ; Less than 3 familiars we need to clean up ourselves | |
GoSub RollItemSweep | |
If TransitionTest() | |
Return | |
} | |
} | |
If (Type = 1) ; Non portal, non boss level loop | |
{ | |
Loop | |
{ | |
IfLess familiarcount, 2 ; Less than 3 familiars we need to clean up ourselves | |
GoSub NoPortSweep | |
If TransitionTest() | |
Return | |
} | |
} | |
} | |
; Checks if a level transition is in progress, returns true if so | |
; Must be called every 900 milliseconds or less in order to ensure that it catches each transition | |
TransitionTest() | |
{ | |
PixelGetColor, colour, transx, transy | |
IfEqual, colour, 0x000000 | |
Return True | |
Else | |
Return False | |
} | |
; Swap out Bruenor for Deekin and unlock Deekin | |
SwitchToDeekin: | |
{ | |
MouseMove swapslotx, swapsloty | |
Click | |
Sleep 200 | |
MouseMove swapbuttonx, swapbuttony | |
Sleep 200 | |
Click | |
Sleep 200 | |
Click | |
Sleep 200 | |
Level(1, 9) | |
Return | |
} | |
; Load up familiars | |
PlaceFamiliars: | |
{ | |
PixelSearch, familiarboxx, familiarboxy, familiarrowx1, familiarrowy1, familiarrowx2, familiarrowy2, 0x0000FF, 0, Fast | |
if(!familiarboxx) | |
familiarboxx := deffamiliarboxx | |
if(!familiarboxy) | |
familiarboxy := deffamiliarboxy | |
if(familiarcount > 0) { | |
Sleep 200 | |
Drag(familiarboxx, familiarboxy, midfamslotx, topfamsloty) | |
} | |
if(familiarcount > 1) { | |
Sleep 200 | |
Drag(familiarboxx, familiarboxy, leftfamslotx, secfamsloty) | |
} | |
if(familiarcount > 2) { | |
Sleep 200 | |
Drag(familiarboxx, familiarboxy, leftfamslotx, thifamsloty) | |
} | |
if(familiarcount > 3) { | |
Sleep 200 | |
Drag(familiarboxx, familiarboxy, midfamslotx, botfamsloty) | |
} | |
if(familiarcount > 4) { | |
Sleep 200 | |
Drag(familiarboxx, familiarboxy, rightfamslotx, secfamsloty) | |
} | |
if(familiarcount > 5) { | |
Sleep 200 | |
Drag(familiarboxx, familiarboxy, rightfamslotx, thifamsloty) | |
} | |
Sleep 200 | |
Return | |
} | |
Drag(startX, startY, endX, endY, speed := 20) | |
{ | |
MouseMove startX, startY, speed | |
Sleep 200 | |
SendEvent {Click, down} | |
Sleep 200 | |
MouseMove endX, endY, speed | |
Sleep 1000 | |
SendEvent {Click, up} | |
Sleep 100 | |
Return | |
} | |
; Alternate program. Opens the Mad Wizard free play from the main map, then progresses through the adventure to reset after level 60 | |
; Levels champions and click damage at the start of levels and chooses and autoclick mode based on the current level | |
^h:: | |
Alternate: | |
{ | |
PixelGetColor, colour, dpsblackx, dpsblacky | |
IfEqual, colour, %dpsblack% | |
{ | |
GoSub Reset | |
GoSub TransWait | |
Sleep 3000 | |
} | |
currentEnd := 60 | |
maxLevel := 90 | |
levelIncrement := 10 | |
Loop | |
{ | |
GoSub CampStart ;Starts Campaign | |
slot1 := 1 | |
slot2 := 0 | |
slot3 := 0 | |
slot4 := 0 | |
slot5 := 0 | |
slot6 := 0 | |
slot7 := 0 | |
slot8 := 0 | |
;Area 1 | |
currentLevel := 1 | |
ToolTip, Current Level: %currentLevel% Current End: %currentEnd% slot1: %slot1% slot1clicks: %slot1clicks%, tooltipx, tooltipy | |
Loop 5 | |
{ | |
GoSub NoPortSweep | |
Level(0) | |
} | |
GoSub PlaceFamiliars ; Place familiars in clicking | |
Sleep 200 | |
FormationSet(1) | |
slot1 += 9 | |
Level(1, 9) | |
GoSub Autoprogress | |
GoSub UpgradeSelect | |
GoSub TransWait | |
Loop { | |
FormationSet(1) | |
Level(0,3) | |
if Mod(currentLevel, 2) = 0 | |
{ | |
if (slot1 < slot1clicks) | |
{ | |
Level(1) | |
slot1++ | |
} | |
if (slot2 < slot2clicks) | |
{ | |
Level(2) | |
slot2++ | |
} | |
if (slot3 < slot3clicks and currentLevel > 3) | |
{ | |
Level(3) | |
slot3++ | |
} | |
if (slot4 < slot4clicks and currentLevel > 6) | |
{ | |
Level(4) | |
slot4++ | |
} | |
if (slot5 < slot5clicks and currentLevel > 9) | |
{ | |
Level(5) | |
slot5++ | |
} | |
if (slot6 < slot6clicks and currentLevel > 12) | |
{ | |
Level(6) | |
slot6++ | |
} | |
if (slot7 < slot7clicks and currentLevel > 15) | |
{ | |
Level(7) | |
slot7++ | |
} | |
if (slot8 < slot8clicks and currentLevel > 18) | |
{ | |
Level(8) | |
slot8++ | |
} | |
} | |
if currentLevel = 13 | |
Level(3, 14) | |
if currentLevel = 13 | |
slot3 += 14 | |
ToolTip, Current Level: %currentLevel% Current End: %currentEnd% slot1: %slot1% slot1clicks: %slot1clicks%, tooltipx, tooltipy | |
if Mod(currentLevel, 5) = 0 | |
Zone(5) | |
else | |
Zone(1) | |
GoSub TransWait | |
currentLevel++ | |
} Until currentLevel > currentEnd | |
currentEnd += levelIncrement | |
GoSub Reset | |
GoSub TransWait | |
Sleep 3000 | |
} Until maxLevel < currentEnd | |
Goto Main | |
} | |
ClickStuff(slot1, slot2, slot3, currentLevel) { | |
if slot1 < slot1clicks | |
{ | |
Level(1) | |
slot1++ | |
} | |
if slot2clicks > slot2 | |
{ | |
Level(2) | |
slot2++ | |
} | |
if slot3clicks > slots["slot3"] | |
{ | |
Level(3) | |
slots["slot3"]++ | |
} | |
if slot4clicks > slots["slot4"] | |
{ | |
Level(4) | |
slots["slot4"]++ | |
} | |
if slot5clicks > slots["slot5"] | |
{ | |
Level(5) | |
slots["slot5"]++ | |
} | |
if slot6clicks > slots["slot6"] | |
{ | |
Level(6) | |
slots["slot6"]++ | |
} | |
if slot7clicks > slots["slot7"] | |
{ | |
Level(7) | |
slots["slot7"]++ | |
} | |
if slot8clicks > slots["slot8"] | |
{ | |
Level(8) | |
slots["slot8"]++ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment