Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Sacred seasons bot / grind script v0.933 (11/26/2010)
- ; http://madscripter.wordpress.com
- ; v0.002 - attacks all in Tsulas and BW A3 - 08/27/2010
- ; v0.003 - put in your own coordinates and it should work on SS and Kong
- ; v0.004 - added UW E4
- ; v0.005 - code cleanup - added UW D2
- ; v0.006 - first attempt at generic dungeon grinder
- ; v0.007 - added UW F4
- ; v0.008 - generic grinder working well - lets try entire arena grind!
- ; v0.009 - cleaning up code - ff arena grind works
- ; v0.010 - SVA arena grind works
- ; v0.011 - changes I made for arena grind didn't work with dungeon grind
- ; fixed
- ; generic grinder didn't work at all
- ; fixed - but only lightly tested
- ; v0.012 - adding BRA grind and making BRA repeat after you die
- ; v0.013 - making SVA repeat after you die (gotta level my alt!)
- ; v0.014 - added FF repeat after you die - I'm not sure why you would want
- ; to do that but oh well - also some code cleanup (09/01/10)
- ; v0.015 - added BWA grind and repeat
- ; v0.016 - added more safeguards against server delay in displaying
- ; battle and exit pads
- ; v0.017 - not sure previous fixes work but adding DFA anyway
- ; v0.018 - added display timer to show how long each iteration took -
- ; good for figuring out how much XP/min you're getting (09/02)
- ; v0.019 - removing some death checks and seeing if it still works -
- ; found a tricky bug that would hang program while walking across map
- ; v0.020 - Trying to calculate XP/Min stats for each grind choice
- ; v0.021 - still getting XP/Min stats
- ; v0.022 - added CWA, UWA,
- ; v0.023 - added WaitForPads to dungeon grinds
- ; v0.024 - adding HP checking to Tsulas
- ; v0.025 - adding HP checking to UW_D2 - no improvement
- ; v0.026 - testing attack speed improvements
- ; v0.027 - tracked down a bug - might be coincidence but I think SS changed
- ; something to try and stop my script - fixed!
- ; v0.900 - automatically finds window coordinates
- ; v0.901 - starting work on GUI
- ; v0.902 - displays window coordinates - allows update
- ; v0.903 - fixing 902
- ; v0.904 - updated coordinates - testing
- ; v0.905 - redoing all coordinates
- ; v0.906 - more GUI work
- ; v0.907 - fixing window coordinates
- ; v0.908 - redoing find battle menu code
- ; v0.909 - adding low level character grind - not working well yet
- ; v0.910 - Adding UW A3, B4, A4
- ; v0.911 - making Arena grinds repeat when finished
- ; v0.912 - small update to newbie grind
- ; v0.913 - bugfixes to arena grind (only on DFA) - redid death check
- ; redid battle icon find and exit find
- ; v0.914 - testing new death check on BRA
- ; v0.915 - minor change in waitforpads - less color sensitive
- ; v0.916 - minor update to stats display
- ; v0.917 - additional checks so it will never click below the game area
- ; added -119 to $bottomRight[1]
- ; v0.918 - replacing deathcheck in all arenas
- ; v0.919 - fixing arena grinds repeat
- ; v0.920 - putting DFA fixes in all arenas
- ; v0.921 - rewrite/consolidation of arena code
- ; v0.922 - updating newbie grind
- ; v0.923 - redoing arena room exits
- ; v0.924 - undoing some 923 changes
- ; v0.925 - newbie grind update - repeating one battle in BR A2
- ; v0.926 - fixing generic
- ; v0.927 - I broke waitforpads - hopefully fixed it now
- ; v0.928 - Oops - I broke arena repeat - this should fix it
- ; v0.928 - cataloging battle coordinates
- ; v0.929 - adding Underworld C2
- ; v0.930 - arena exits only worked on ss site, fixed
- ; v0.931 - one line change in findattack2
- ; v0.932 - trying to add astral travel III buff, fixed error in UW_C2
- ; v0.933 - updating GUI - trying to add buffs
- ;
- ;
- ; todo - PGA - add silver info, finish checking XP info
- ; retest everything
- ; CWA and UWA might not be working right now - (11/06/10)
- ; - will examine more later
- ;
- ; Misc documentation:
- ; This is a work in progress - lots of ugly code, commented debugging
- ; code and other nonsense.
- ;
- ; There is currently no way for the script to buff or heal you automatically
- ; so this script works best on dungeons you can finish with only attacks.
- ; But the pause key will pause the script so you can buff/heal/whatever and
- ; then press pause again and the script should resume.
- ;
- ; For arena runs - checking to see if you died occurs in multiple places and
- ; can result in multiple 'you died!' messages once you actually die. It's
- ; not a bug - it's a feature. Comment them out if they annoy you.
- ;
- ; I'm thinking that running arenas is less conspicuous than running a
- ; dungeon over and over. Figuring out which arena gets you the best XP/min
- ; is up to you. But make sure you can finish the first room of the arena
- ; or else the script will bomb. I should fix that - but it's a low
- ; priority right now.
- ;
- ; Script will calculate and display XP/Min that you are getting.
- ; These numbers assume that you are grinding solo - if not, the numbers
- ; are wrong. Also, numbers will be completely wrong if you are using
- ; the generic dungeon grind function.
- ;
- ; There are many ways to slightly increase the speed of this script but I
- ; went for stability instead of speed. It still glitches sometimes but its
- ; also run for over 10 hours unattended - your mileage may vary
- ;
- ; This is an AutoIT3 script
- ; Get AutoIT at http://www.autoitscript.com/autoit3/index.shtml
- ;
- ; As the script runs, it will pop up a window telling you how many times it
- ; has run that section and how long it took. This is purely informative and
- ; can be commented out if you don't like it.
- Global $topLeft[2]
- Global $bottomRight[2]
- Global $paused
- HotKeySet("{ESC}", "Terminate")
- HotKeySet("{PAUSE}","_pause")
- Func _pause()
- $paused = NOT $paused
- While $paused
- Sleep(100)
- Wend
- EndFunc
- Global $coord[2]
- Global $coord2[2]
- Global $exitCoord[2]
- Global $newArenaCoord[2]
- Global $ArenaCoord[2]
- Global $battleCoord[2]
- Global $genericCoord[2]
- Global $GenericEntrance[2]
- Global $newGenCoord[2]
- Global $waitCoord[2]
- Global $TotalRunCount
- Global $AttackColor1
- Global $AttackColor2
- Global $BlankColor1
- Global $BlankPixel
- ; checks HP for Tsulas2 grind - about 66%
- Global $BlankPixel2
- ; checks HP for NewbGrind - about 90%
- Global $BlankPixel3
- ; checks HP for NewbGrind - about 99%
- Global $xCoord
- Global $yCoord
- Global $AttackLoop
- Global $AttackPixel
- Global $AttackPixelCount
- Global $BattleCheckSum
- Global $DungeonCheckSum
- Global $xPos
- Global $yPos
- Global $checkPixel
- Global $battleCheck
- Global $GenericContinue
- Global $ArenaContinue
- Global $NumberOfBattles
- Global $TsulasHP
- Global $TotalXP
- Global $EntireXP
- Global $startTime
- Global $entireTime
- Global $timeElapsed
- Global $CheckTimer
- ; CWA
- Global $CWACoord[2]
- Global $CWAContinue
- Global $NewCWACoord[2]
- ; UWA
- Global $UWACoord[2]
- Global $UWAContinue
- Global $NewUWACoord[2]
- ; Death check
- Global $DeathColor
- Global $DeathPixel
- Global $ArenaXP[10][100]
- Global $ArenaNumberOfBattles[10]=[0,96,96,97,94,89,22,33,87,33]
- ; FFXP - correct values and checked
- Global $FFXP[97]=[0,21,1,11,14,4,40,12,20,24,44,150,12,28,17,150,151,2,10,24,10,10,182,36,158,42,3,15,37,27,44,15,300,152,23,38,27,19,39,160,24,22,199,13,29,47,15,24,12,311,28,33,25,20,39,18,45,60,72,51,60,200,56,210,150,80,80,66,66,440,120,105,60,110,147,40,105,150,360,95,155,180,120,160,120,66,150,132,190,74,32,100,110,70,76,126,540]
- ; SVAXP - correct values - placement not checked
- Global $SVAXP[97]=[0,72,75,90,40,117,66,76,87,111,156,60,66,90,120,190,99,213,180,50,240,130,190,244,244,50,19,105,150,100,270,330,180,80,205,150,88,149,179,386,501,320,243,510,305,350,225,510,895,380,320,330,570,610,450,900,190,400,900,910,430,1065,520,900,390,745,1500,1950,1530,1100,830,1700,1180,1300,1760,452,2400,800,3075,1950,1100,1315,930,1315,1350,3060,1250,1550,830,1350,2925,4,950,490,1425,980,160]
- ; BWAXP - correct values - placement not checked
- Global $BWAXP[98]=[0,110,110,150,100,70,140,180,200,320,99,80,220,270,100,270,550,1750,825,938,1360,54,397,1375,150,1845,1800,300,180,775,1300,2138,900,1300,830,1200,450,921,2000,475,1350,600,950,998,65,160,465,240,650,490,80,1560,1720,1130,400,1695,500,160,80,1260,1560,480,500,2400,1300,690,2720,1490,1380,500,2235,500,1440,2980,1440,1050,720,1220,500,1490,2160,500,2235,1220,1000,2930,3450,1360,3480,1200,1560,3120,2400,1000,2340,2160,2235,3000]
- ; DFAXP - correct values - placement not checked
- Global $DFAXP[96]=[0,205,300,102,535,305,410,525,494,220,540,700,170,230,190,180,422,430,750,265,500,735,285,740,355,855,975,765,780,1020,745,1410,1175,675,287,305,1600,856,520,825,375,1249,1540,1234,1825,1145,1005,1430,330,725,1665,1360,870,610,1300,970,1310,1290,1285,3260,2875,906,7200,270,1320,1979,2660,1194,3342,1756,2046,4076,7426,992,4450,504,5972,2912,6916,2200,968,5432,6363,1300,3300,3257,1761,5824,7524,4354,6614,7624,12848,3801,11452]
- ; BRAXP - correct values - placement not checked
- Global $BRAXP[90]=[0,905,605,1150,280,3020,950,500,2390,1800,4125,2340,730,3725,465,3014,2016,2634,1920,3008,1560,2218,3240,1500,828,4410,450,1512,3020,1756,360,1844,2994,992,1560,2040,1386,500,3588,1630,1331,700,585,4278,1264,3584,7155,2528,306,2235,3534,4002,3792,5724,3400,3792,90,4416,270,3830,4293,2862,1996,6075,5924,6140,2862,4342,1245,5602,8476,2994,1242,5528,9204,7119,3764,15056,5500,4308,2307,10596,15518,11292,11340,6000,12132,5184,9030,6792]
- ; CWAXP - incorrect
- Global $CWAXP[90]=[0,905,605,1150,280,3020,950,500,2390,1800,4125,2340,730,3725,465,3014,2016,2634,1920,3008,1560,2218,3240,1500,828,4410,450,1512,3020,1756,360,1844,2994,992,1560,2040,1386,500,3588,1630,1331,700,585,4278,1264,3584,7155,2528,306,2235,3534,4002,3792,5724,3400,3792,90,4416,270,3830,4293,2862,1996,6075,5924,6140,2862,4342,1245,5602,8476,2994,1242,5528,9204,7119,3764,15056,5500,4308,2307,10596,15518,11292,11340,6000,12132,5184,9030,6792]
- ; UWAXP - incorrect
- Global $UWAXP[90]=[0,905,605,1150,280,3020,950,500,2390,1800,4125,2340,730,3725,465,3014,2016,2634,1920,3008,1560,2218,3240,1500,828,4410,450,1512,3020,1756,360,1844,2994,992,1560,2040,1386,500,3588,1630,1331,700,585,4278,1264,3584,7155,2528,306,2235,3534,4002,3792,5724,3400,3792,90,4416,270,3830,4293,2862,1996,6075,5924,6140,2862,4342,1245,5602,8476,2994,1242,5528,9204,7119,3764,15056,5500,4308,2307,10596,15518,11292,11340,6000,12132,5184,9030,6792]
- Global $guiExit
- Global $ArenaExit[15]=[0, 225, 90, 130, 401, 417, 186, 586, 126, 705, 185, 705, 450, 633, 102]
- Global $ArenaRoomCount
- Global $BuffCoords[43]=[0, 86, 219, 86, 240, 86, 263, 86, 287, 86, 308, 86, 331, 233, 219, 233, 240, 233, 263, 233, 287, 233, 308, 233, 331, 379, 219, 379, 240, 379, 263, 379, 287, 379, 308, 379, 331, 526, 219, 526, 240, 526, 263]
- Global $grind_choice
- Global $battleTextFind[2]
- Global $BattleFound
- $AttackColor1 = Dec("FFFFFF")
- $AttackColor2 = Dec("FFFEFF")
- $BlankColor1 = Dec("333333")
- $BattleTextColor = 0xFFFFFF
- $PadColor1 = 0xFC4744
- $PadColor2 = 0xFD4743
- $ExitColor1 = 0xF8F6EA
- $DeathColor = Dec("86A89C")
- $UWEXitColor1 = 0x6DFCF6
- Opt("WinTitleMatchMode", 2)
- ; get offsets for coordinates
- $win01 = WinGetPos("Sacred Seasons")
- If @error=1 Then
- $win01 = WinGetPos("Mozilla Firefox")
- EndIf
- $winclient = WinGetClientSize("Sacred Seasons")
- If @error=1 Then
- $winclient = WinGetClientSize("Mozilla Firefox")
- EndIf
- $border = ($win01[2] - $winclient[0])/2
- $titleoffset = $win01[3] - $winclient[1] - $border
- ; check in IE7/8
- $pos = ControlGetPos("[CLASS:IEFrame]", "", "MacromediaFlashPlayerActiveX1")
- If @error <> 1 Then
- $topLeft[0] = $pos[0] + $win01[0] + $border
- $topLeft[1] = $pos[1] + $win01[1] + $titleoffset
- $bottomRight[0] = $topLeft[0] + 740
- $bottomRight[1] = $topLeft[1] + 600
- ;MsgBox(0, "Window Stats: IE", "POS: " & $pos[0] & "," & $pos[1] & " SIZE: " & $pos[2] & "," & $pos[3] )
- EndIf
- ; check in Firefox 3
- $pos = ControlGetPos("[CLASS:MozillaUIWindowClass]", "", "GeckoPluginWindow1")
- If @error <> 1 Then
- $topLeft[0] = $pos[0] + $win01[0] + $border
- $topLeft[1] = $pos[1] + $win01[1] + $titleoffset
- $bottomRight[0] = $topLeft[0] + 740
- $bottomRight[1] = $topLeft[1] + 600
- ;MsgBox(0, "Window Stats: Firefox3", "POS: " & $pos[0] & "," & $pos[1] & " SIZE: " & $pos[2] & "," & $pos[3] )
- EndIf
- ; check in Firefox 4
- $pos = ControlGetPos("[CLASS:MozillaWindowClass]", "", "GeckoPluginWindow1")
- If @error <> 1 Then
- $topLeft[0] = $pos[0] + $win01[0] + $border
- $topLeft[1] = $pos[1] + $win01[1] + $titleoffset
- $bottomRight[0] = $topLeft[0] + 740
- $bottomRight[1] = $topLeft[1] + 600
- ;MsgBox(0, "Window Stats: Firefox4", "POS: " & $pos[0] & "," & $pos[1] & " SIZE: " & $pos[2] & "," & $pos[3] )
- EndIf
- ;populate XP values
- For $xloop = 1 to 96
- $ArenaXP[1][$xloop]=$FFXP[$xloop]
- Next
- For $xloop = 1 to 96
- $ArenaXP[2][$xloop]=$SVAXP[$xloop]
- Next
- For $xloop = 1 to 97
- $ArenaXP[3][$xloop]=$BWAXP[$xloop]
- Next
- For $xloop = 1 to 95
- $ArenaXP[4][$xloop]=$DFAXP[$xloop]
- Next
- For $xloop = 1 to 89
- $ArenaXP[5][$xloop]=$BRAXP[$xloop]
- Next
- For $xloop = 1 to 89
- $ArenaXP[6][$xloop]=$CWAXP[$xloop]
- Next
- For $xloop = 1 to 89
- $ArenaXP[7][$xloop]=$UWAXP[$xloop]
- Next
- $TotalRunCount=0
- $screenWidth = $bottomRight[0] - $topLeft[0]
- $screenHeight = $bottomRight[1] - $topLeft[1]
- $repeatagain = 1
- $entireTime = TimerInit()
- ; GUI starts here
- #include <GUIConstantsEx.au3>
- #include <EditConstants.au3>
- GUICreate("Sacred Seasons bot / grind script - http://madscripter.wordpress.com", 800, 600)
- GUICtrlCreateLabel("Top Left", 10, 10)
- $InputSize1 = GUICtrlCreateInput($topLeft[0], 10, 25, 100, 20)
- GUICtrlCreateLabel("Top Left", 140, 10)
- $InputSize2 = GUICtrlCreateInput($topLeft[1], 140, 25, 100, 20)
- GUICtrlCreateLabel("Bottom Right", 10, 50)
- $InputSize3 = GUICtrlCreateInput($bottomRight[0], 10, 65, 100, 20)
- GUICtrlCreateLabel("Bottom Right", 140, 50)
- $InputSize4 = GUICtrlCreateInput($bottomRight[1], 140, 65, 100, 20)
- GUICtrlCreateLabel("Window width", 10, 90)
- $InputSize5 = GUICtrlCreateInput($screenWidth, 10, 105, 100, 20, $ES_READONLY)
- GUICtrlCreateLabel("Window height", 140, 90)
- $InputSize6 = GUICtrlCreateInput($screenHeight, 140, 105, 100, 20, $ES_READONLY)
- GUICtrlCreateLabel("The above coordinates are what the script found automatically. If the values are zero, you need to enter the values yourself using AutoIT Window Info." & @CRLF & "The width should be 740 and the height should be 600. (Automatically finding the coordinates should work in IE7, IE8, Firefox 3, and Firefox 4. It currently doesn't work in Opera or Chrome but I'm working on it.)", 10, 145, 250, 120)
- GUICtrlCreateLabel("Make sure that Sacred Seasons is underneath this window, the coordinates are correct, select a section to grind and press continue.", 200, 510, 400, 40)
- $ContinueButton1 = GUICtrlCreateButton("Continue", 300, 550, 100)
- GUICtrlCreateGroup("Select a section to grind:", 310, 10, 480, 250)
- $choice_1 = GUICtrlCreateRadio("Newbie Grind", 330, 25, 210, 20)
- $choice_2 = GUICtrlCreateRadio("Bleakwoods D4 (Tsulas)", 330, 45, 210, 20)
- $choice_3 = GUICtrlCreateRadio("Bleakwoods A3 (Flo)", 330, 65, 210, 20)
- $choice_18 = GUICtrlCreateRadio("Underworld C2 (Octogum / Water Worm)", 330, 85, 240, 20)
- $choice_4 = GUICtrlCreateRadio("Underworld E4 (Hector / Choppers)", 330, 105, 210, 20)
- $choice_5 = GUICtrlCreateRadio("Underworld D2 (Worm/Octogum/Frogs)", 330, 125, 210, 20)
- $choice_6 = GUICtrlCreateRadio("Underworld F4 (Charlotte / Choppers)", 330, 145, 210, 20)
- $choice_7 = GUICtrlCreateRadio("Underworld A3 (Green Dragons / Bubblers)", 330, 165, 240, 20)
- $choice_8 = GUICtrlCreateRadio("Underworld B4 (Skeletons / Pirates)", 330, 185, 210, 20)
- $choice_9 = GUICtrlCreateRadio("Underworld A4 (Elementals)", 330, 205, 210, 20)
- $choice_10 = GUICtrlCreateRadio("Generic", 330, 225, 210, 20)
- $choice_11 = GUICtrlCreateRadio("Arena - FF", 600, 25, 180, 20)
- $choice_12 = GUICtrlCreateRadio("Arena - SVA", 600, 45, 180, 20)
- $choice_13 = GUICtrlCreateRadio("Arena - BWA", 600, 65, 180, 20)
- $choice_14 = GUICtrlCreateRadio("Arena - DFA", 600, 85, 180, 20)
- $choice_15 = GUICtrlCreateRadio("Arena - BRA", 600, 105, 180, 20)
- $choice_16 = GUICtrlCreateRadio("Arena - CWA", 600, 125, 180, 20)
- $choice_17 = GUICtrlCreateRadio("Arena - UWA", 600, 145, 180, 20)
- $choice_text = GUICtrlCreateLabel("", 310, 270, 450, 100)
- $grind_choice = 0
- $BuffBox = GUICtrlCreateCheckbox("Check to use buff before battle", 10, 340, 400, 20)
- GUICtrlCreateLabel("Spell to use first in battle (1 - 21) ", 40, 370)
- $BuffSpell1 = GUICtrlCreateInput("", 10, 365, 25, 20)
- GUICtrlCreateGroup("", -99, -99, 1, 1)
- GUISetState(@SW_SHOW)
- While $guiExit <> 1
- $msg = GUIGetMsg()
- If $msg = $GUI_EVENT_CLOSE Then
- Exit
- EndIF
- If $msg = $InputSize1 Then
- $topLeft[0] = GUICtrlRead($InputSize1)
- $screenWidth = $bottomRight[0] - $topLeft[0]
- $screenHeight = $bottomRight[1] - $topLeft[1]
- GUICtrlSetData($InputSize5, $screenWidth)
- EndIf
- If $msg = $InputSize2 Then
- $topLeft[1] = GUICtrlRead($InputSize2)
- $screenWidth = $bottomRight[0] - $topLeft[0]
- $screenHeight = $bottomRight[1] - $topLeft[1]
- GUICtrlSetData($InputSize6, $screenHeight)
- EndIf
- If $msg = $InputSize3 Then
- $bottomRight[0] = GUICtrlRead($InputSize3)
- $screenWidth = $bottomRight[0] - $topLeft[0]
- $screenHeight = $bottomRight[1] - $topLeft[1]
- GUICtrlSetData($InputSize5, $screenWidth)
- EndIf
- If $msg = $InputSize4 Then
- $bottomRight[1] = GUICtrlRead($InputSize4)
- $screenWidth = $bottomRight[0] - $topLeft[0]
- $screenHeight = $bottomRight[1] - $topLeft[1]
- GUICtrlSetData($InputSize6, $screenHeight)
- EndIf
- If $msg = $choice_1 Then
- GUICtrlSetData($choice_text, "Takes a low level character through increasingly harder dungeons. Good for level 1 alts. Start with your character in Shikaakwa by Jona. Only lightly tested - please give me suggestions on how to improve this.")
- $grind_choice=1
- EndIf
- If $msg = $choice_2 Then
- GUICtrlSetData($choice_text, "Move your character to Bleakwoods D4 (Tsulas) away from the entrance. Your character must be able to complete both battles once without dying or the script will fail.")
- $grind_choice=2
- EndIf
- If $msg = $choice_3 Then
- GUICtrlSetData($choice_text, "Move your character to Bleakwoods A3 (Flo) away from the entrance. Your character must be able to complete the battles without dying or the script will fail.")
- $grind_choice=3
- EndIf
- If $msg = $choice_4 Then
- GUICtrlSetData($choice_text, "Move your character to Underworld E4 (Hector / Choppers) away from the entrance. Your character must be able to complete the battles without dying or the script will fail.")
- $grind_choice=4
- EndIf
- If $msg = $choice_5 Then
- GUICtrlSetData($choice_text, "Move your character to Underworld D2 (Worms / Octogums / Frogs) away from the entrance. Your character must be able to complete the battles without dying or the script will fail.")
- $grind_choice=5
- EndIf
- If $msg = $choice_6 Then
- GUICtrlSetData($choice_text, "Move your character to Underworld F4 (Charlotte / Choppers) away from the entrance. Your character must be able to complete the battles without dying or the script will fail.")
- $grind_choice=6
- EndIf
- If $msg = $choice_7 Then
- GUICtrlSetData($choice_text, "Move your character to Underworld A3 (Octogums / Green Dragons / Bubblers) away from the entrance. Your character must be able to complete the battles without dying or the script will fail.")
- $grind_choice=7
- EndIf
- If $msg = $choice_8 Then
- GUICtrlSetData($choice_text, "Move your character to Underworld B4 (William / Skeletons / Pirates) away from the entrance. Your character must be able to complete the battles without dying or the script will fail.")
- $grind_choice=8
- EndIf
- If $msg = $choice_9 Then
- GUICtrlSetData($choice_text, "Move your character to Underworld A4 (Elementals) away from the entrance. Your character must be able to complete the battles without dying or the script will fail.")
- $grind_choice=9
- EndIf
- If $msg = $choice_10 Then
- GUICtrlSetData($choice_text, "Generic grinder. Move your character near any dungeon entrance. This routine is only lightly tested and may not work on all dungeons. Your character must be able to complete the battles without dying or the script will fail.")
- $grind_choice=10
- EndIf
- If $msg = $choice_11 Then
- GUICtrlSetData($choice_text, "Arena - FF. Move your character to the first room in the arena with battles (not the lobby). Your character must be able to complete the battles in the first room without dying or the script will fail. If your character dies after that, it will return to the arena and start it again.")
- $grind_choice=11
- EndIf
- If $msg = $choice_12 Then
- GUICtrlSetData($choice_text, "Arena - SVA. Move your character to the first room in the arena with battles (not the lobby). Your character must be able to complete the battles in the first room without dying or the script will fail. If your character dies after that, it will return to the arena and start it again.")
- $grind_choice=12
- EndIf
- If $msg = $choice_13 Then
- GUICtrlSetData($choice_text, "Arena - BWA. Move your character to the first room in the arena with battles (not the lobby). Your character must be able to complete the battles in the first room without dying or the script will fail. If your character dies after that, it will return to the arena and start it again.")
- $grind_choice=13
- EndIf
- If $msg = $choice_14 Then
- GUICtrlSetData($choice_text, "Arena - DFA. Move your character to the first room in the arena with battles (not the lobby). Your character must be able to complete the battles in the first room without dying or the script will fail. If your character dies after that, it will return to the arena and start it again.")
- $grind_choice=14
- EndIf
- If $msg = $choice_15 Then
- GUICtrlSetData($choice_text, "Arena - BRA. Move your character to the first room in the arena with battles (not the lobby). Your character must be able to complete the battles in the first room without dying or the script will fail. If your character dies after that, it will return to the arena and start it again. (The script will probably hang if you reach the 7th floor rooms with no battles.)")
- $grind_choice=15
- EndIf
- If $msg = $choice_16 Then
- GUICtrlSetData($choice_text, "Arena - CWA. Move your character to the first room in the arena with battles (not the lobby). Your character DOES NOT need to be able to complete the battles in the first room without dying. If your character dies, it will return to the arena and start it again.")
- $grind_choice=16
- EndIf
- If $msg = $choice_17 Then
- GUICtrlSetData($choice_text, "Arena - UWA. Move your character to the first room in the arena with battles (not the lobby). Your character DOES NOT need to be able to complete the battles in the first room without dying. If your character dies, it will return to the arena and start it again.")
- $grind_choice=17
- EndIf
- If $msg = $choice_18 Then
- GUICtrlSetData($choice_text, "Move your character to Underworld C2 (Octogums / Water Worms) away from the entrance. Your character must be able to complete the battles without dying or the script will fail.")
- $grind_choice=18
- EndIf
- If ($msg = $ContinueButton1) AND ($grind_choice <> 0) Then
- ; check if buff is checked
- $BuffCheck = BitAnd(GUICtrlRead($BuffBox),$GUI_CHECKED)
- If $BuffCheck = 1 Then
- ; check to make sure spell # is between 1 - 21
- $BuffSpellNumber = GUICtrlRead($BuffSpell1)
- If ($BuffSpellNumber > 0) AND ($BuffSpellNumber < 22) Then
- $guiExit = 1
- Else
- ; need to display some sort of error - NOT DONE YET
- $BuffDisplayError = 1
- EndIf
- Else
- $guiExit = 1
- EndIf
- EndIf
- Sleep(50)
- WEnd
- GUISetState(@SW_HIDE)
- ; 0 if not checked, 1 if checked
- $BuffCheck = BitAnd(GUICtrlRead($BuffBox),$GUI_CHECKED)
- WinActivate ("[CLASS:IEFrame]", "")
- WinActivate ("[CLASS:MozillaUIWindowClass]", "")
- WinActivate ("[CLASS:MozillaWindowClass]", "")
- While $repeatagain < 6000
- $startTime = TimerInit()
- $TotalXP=0
- If $grind_choice=1 Then
- NewbGrind()
- EndIf
- If $grind_choice=2 Then
- GrindTsulas2()
- EndIf
- If $grind_choice=3 Then
- GrindBW_A3()
- EndIf
- If $grind_choice=4 Then
- GrindUW_E4()
- EndIf
- If $grind_choice=5 Then
- GrindUW_D2()
- EndIf
- If $grind_choice=6 Then
- GrindUW_F4()
- EndIf
- If $grind_choice=7 Then
- GrindUW_A3()
- EndIf
- If $grind_choice=8 Then
- GrindUW_B4()
- EndIf
- If $grind_choice=9 Then
- GrindUW_A4()
- EndIf
- If $grind_choice=10 Then
- Generic()
- EndIf
- If $grind_choice=11 Then
- $ArenaNumber = 1
- ArenaGrind2()
- EndIf
- If $grind_choice=12 Then
- $ArenaNumber = 2
- ArenaGrind2()
- EndIf
- If $grind_choice=13 Then
- $ArenaNumber = 3
- ArenaGrind2()
- EndIf
- If $grind_choice=14 Then
- $ArenaNumber = 4
- ArenaGrind2()
- EndIf
- If $grind_choice=15 Then
- $ArenaNumber = 5
- ArenaGrind2()
- EndIf
- If $grind_choice=16 Then
- $ArenaNumber = 6
- ArenaCWA()
- EndIf
- If $grind_choice=17 Then
- $ArenaNumber = 7
- ArenaUWA()
- EndIf
- If $grind_choice=18 Then
- GrindUW_C2()
- EndIf
- $EntireXP = $EntireXP + $TotalXP
- $timeElapsed = TimerDiff($startTime)
- $entireTimeElapsed = TimerDiff($entireTime)
- $TotalRunCount = $TotalRunCount + 1
- MsgBox(8192, "Total Runs " & $TotalRunCount, "Total Runs=" & $TotalRunCount & @CRLF & "Run Time=" & int($timeElapsed/1000) & " seconds" & @CRLF & "Run XP/Min=" & int($TotalXP / ($timeElapsed / 60000)) & @CRLF & @CRLF & "Total Run Time=" & int($entireTimeElapsed/1000) & @CRLF & "Total XP/Min=" & int($EntireXP / ($entireTimeElapsed / 60000)) & @CRLF & @CRLF & "TotalXP=" & $TotalXP & @CRLF & "EntireXP=" & $EntireXP & @CRLF, 5)
- ;ConsoleWrite("Total Runs=" & $TotalRunCount & @CRLF & "Run Time=" & int($timeElapsed/1000) & " seconds" & @CRLF & "Run XP/Min=" & int($TotalXP / ($timeElapsed / 60000)) & @CRLF & "Total Run Time=" & int($entireTimeElapsed / 1000) & @CRLF & "Total XP/Min=" & int($EntireXP / ($entireTimeElapsed / 60000)) & @CRLF)
- ;ConsoleWrite("TotalXP=" & $TotalXP & @CRLF)
- ;ConsoleWrite("EntireXP=" & $EntireXP & @CRLF & @CRLF)
- $repeatagain = $repeatagain + 1
- WEnd
- Func AttackGrid($menu)
- ; bottom left
- ; (659, 537) - new value
- Attack (0.741, 0.650)
- ; bottom right
- ; (814, 532)
- Attack(0.950, 0.642)
- ; middle right
- ; (778, 446)
- Attack(0.902, 0.500)
- ; middle left
- ; (611, 437) - new value
- Attack(0.676, 0.483)
- ; top right
- ; (727, 352)
- Attack(0.833, 0.342)
- ; top left
- ; (560, 337) - new value
- Attack (0.607, 0.317)
- EndFunc
- Func Attack($x, $y)
- $xPos = $topLeft[0] + ($screenWidth * $x)
- $yPos = $topLeft[1] + ($screenHeight * $y)
- MouseMove($xPos, $yPos, 0)
- MouseClick("left")
- EndFunc
- Func findAttack()
- ;$xCoord=456
- $xCoord=$topLeft[0]+345
- ;$yCoord=371
- $yCoord=$topLeft[1]+224
- MouseMove($xCoord,($yCoord-40), 1)
- ;For $yCoord = 371 to 489
- For $yCoord = ($topLeft[1]+224) to ($topLeft[1]+342)
- $AttackPixelCount=0
- ; moving the mouse here is not necessary and slows things down
- ; a bit but it makes the script more stable
- ; - and it looks cool - uncomment it and see how it runs for you
- ;MouseMove($xCoord,$yCoord, 1)
- For $AttackLoop = 0 to 9
- $AttackPixel = PixelGetColor($xCoord + $AttackLoop,$yCoord)
- If ($AttackPixel > 16646144) Then
- $AttackPixelCount = $AttackPixelCount + 1
- Else
- $AttackLoop=9
- EndIf
- Next
- If $AttackPixelCount > 9 Then
- MouseMove($xCoord,$yCoord, 1)
- $coord[0]=$xCoord
- $coord[1]=$yCoord
- Return ($coord)
- EndIf
- Next
- $coord[0]=1
- $coord[1]=1
- Sleep(500)
- Return ($coord)
- EndFunc
- Func findAttack2()
- $coord2 = PixelSearch($topLeft[0]+333, $topLeft[1]+200, $topLeft[0]+338, $topLeft[1]+343, $AttackColor1, 10)
- If @error=1 Then
- $coord[0]=1
- $coord[1]=1
- Sleep(200)
- Return ($coord)
- EndIf
- ; I'm not sure why this line is here....
- ;$coord2 = PixelSearch($topLeft[0]+333, $topLeft[1]+200, $topLeft[0]+338, $topLeft[1]+343, $AttackColor1, 6)
- $coord[0] = $topLeft[0] + 345
- $coord[1] = $coord2[1] + 30
- Return($coord)
- EndFunc
- Func Terminate()
- Exit
- EndFunc
- Func Battle($x, $y)
- ;$BattleCheckSum = PixelChecksum(230,213,250,225) - old
- ;$BattleCheckSum = PixelChecksum(769, 625, 836, 640)
- $BattleCheckSum = PixelChecksum(($topLeft[0]+658),($topLeft[1]+478),($topLeft[0]+725),($topLeft[1]+493))
- MouseMove($x, $y, 3)
- ; is this long sleep still necessary? - 10/31
- ; this helps with lag stability - 11/06
- Sleep(1000)
- MouseClick("left")
- While $BattleCheckSum = PixelChecksum(($topLeft[0]+658),($topLeft[1]+478),($topLeft[0]+725),($topLeft[1]+493))
- Sleep(100)
- WEnd
- ; kill all creatures
- ;$BattleCheckSum = PixelCheckSum(186,400,205,414)
- $BattleCheckSum = PixelCheckSum(($topLeft[0]+75),($topLeft[1]+253),($topLeft[0]+94),($topLeft[1]+267))
- If $BuffCheck = 1 Then
- ; first - do astral travel buff
- ; do findattack2 until battlecoord > 1
- ; click on skill
- ; click on astral travel 2
- ; -- later, try clicking on 3, then 2
- ; click on character
- ; resume battle
- ; do findattack2 until battlecoord > 1
- $battleCoord[0] = 1
- While $battleCoord[0] = 1
- $battleCoord = findAttack2()
- WEnd
- $battleCoord[1] = $battleCoord[1] + 22
- ; click on skill
- MouseMove($battleCoord[0], $battleCoord[1], 3)
- Sleep(200)
- MouseClick("left")
- ; click on astral travel 3 / skill of choice
- Sleep(500)
- ;MouseMove(551, 359, 3)
- MouseMove($topLeft[0]+$BuffCoords[(($BuffSpellNumber*2)-1)],$topLeft[1]+$BuffCoords[(($BuffSpellNumber*2))], 3)
- Sleep(200)
- MouseClick("left")
- ; click on character
- Sleep(200)
- MouseMove($topLeft[0]+233, $topLeft[1]+190, 3)
- Sleep(200)
- MouseClick("left")
- ; click on cancel (if not enough sp)
- MouseMove($topLeft[0]+368, $topLeft[1]+415, 3)
- Sleep(200)
- MouseClick("left")
- Sleep(200)
- ; end buff
- EndIf
- While $BattleCheckSum = PixelCheckSum(($topLeft[0]+75),($topLeft[1]+253),($topLeft[0]+94),($topLeft[1]+267))
- $battleCoord = findAttack2()
- If $battleCoord[0] > 1 Then
- MouseMove($battleCoord[0], $battleCoord[1], 3)
- ; Attack every possible position.
- Sleep(200)
- MouseClick("left")
- Sleep(200)
- AttackGrid($battleCoord)
- EndIf
- WEnd
- ; fight over - click box
- ; check HP first
- $BlankPixel = PixelGetColor(($topLeft[0]+182), ($topLeft[1]+458))
- $BlankPixel2 = PixelGetColor(($topLeft[0]+216), ($topLeft[1]+458))
- $BlankPixel3 = PixelGetColor(($topLeft[0]+226), ($topLeft[1]+458))
- ;MouseMove(483, 511, 3)
- MouseMove(($topLeft[0]+372),($topLeft[1]+364),3)
- ; a little pause to see your stats
- Sleep(2000)
- ;$BattleCheckSum = PixelChecksum(186,400,205,414)
- $BattleCheckSum = PixelCheckSum(($topLeft[0]+75),($topLeft[1]+253),($topLeft[0]+94),($topLeft[1]+267))
- MouseClick("left")
- ; another death check
- If (DeathCheck() = 1) Then
- $continue=2
- MsgBox(8192, "You died! (battle check)", "You died!", 1)
- Else
- While $BattleCheckSum = PixelCheckSum(($topLeft[0]+75),($topLeft[1]+253),($topLeft[0]+94),($topLeft[1]+267))
- Sleep(100)
- WEnd
- ; is this still necessary? - 10/31
- ; this helps with lag stability - 11/06
- Sleep(500)
- EndIf
- $NumberOfBattles=$NumberOfBattles+1
- EndFunc
- Func DungeonPad($x, $y)
- ; checks for changes in bottom right corner
- MouseMove($x, $y ,3)
- Sleep(100)
- ;$DungeonCheckSum = PixelChecksum(769, 621, 836, 640)
- $DungeonCheckSum = PixelChecksum(($topLeft[0]+658),($topLeft[1]+474),($topLeft[0]+725),($topLeft[1]+493))
- MouseClick("left")
- Sleep(100)
- ;$DungeonCheckSum = PixelChecksum(769, 621, 836, 640)
- While $DungeonCheckSum = PixelChecksum(($topLeft[0]+658),($topLeft[1]+474),($topLeft[0]+725),($topLeft[1]+493))
- Sleep(1000)
- ; is this additional click necessary? 11/10
- ;MouseClick("left")
- WEnd
- EndFunc
- Func DungeonPad2($x, $y)
- ; checks for changes in top right corner
- MouseMove($x, $y ,3)
- Sleep(100)
- ;$DungeonCheckSum = PixelChecksum(784, 210, 820, 230)
- $DungeonCheckSum = PixelChecksum(($topLeft[0]+673),($topLeft[1]+63),($topLeft[0]+709),($topLeft[1]+83))
- MouseClick("left")
- Sleep(100)
- ;$DungeonCheckSum = PixelChecksum(784, 210, 820, 230)
- While $DungeonCheckSum = PixelChecksum(($topLeft[0]+673),($topLeft[1]+63),($topLeft[0]+709),($topLeft[1]+83))
- Sleep(1000)
- ;MouseClick("left")
- WEnd
- EndFunc
- Func WaitForPads()
- $padwait=1
- While $padwait < 2
- ; death check
- If (DeathCheck() = 1) Then
- $continue = 2
- $padwait=$padwait+1
- MsgBox(8192, "You died! (Padcheck)", "You died!", 1)
- EndIf
- ; 117 avoids the non play area, 177 avoids entrance in arenas
- ; these should probably be 117?
- ; UW needs to be 117 for UW_A3
- $waitCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-177,$ExitColor1, 5)
- If @error <> 1 Then
- $padwait=$padwait+1
- EndIf
- $waitCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-177,$PadColor1, 5)
- If @error <> 1 Then
- $padwait=$padwait+1
- EndIf
- $waitCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-117,$UWExitColor1, 5)
- If @error <> 1 Then
- $padwait=$padwait+1
- EndIf
- Sleep(500)
- WEnd
- EndFunc
- Func GrindTsulas2()
- ; start script outside of dungeon
- ;
- ; since it's better to just do the 950 battle over and over again
- ; if you can, this for loop determines how many times you do the
- ; 950 battle before you do both battles - and replenish your hp and sp
- ;
- ; - this version checks your HP for you and continues if greater
- ; than half
- $TsulasHP = 1
- While $TsulasHP = 1
- ; enter Tsulas
- ;DungeonPad(480, 430)
- DungeonPad(($topLeft[0]+369),($topLeft[1]+283))
- WaitForPads()
- ; enter first battle - bottom - 4 creatures
- ;Battle(389, 557)
- Battle(($topLeft[0]+278),($topLeft[1]+410))
- WaitForPads()
- $TotalXP=$TotalXP+950
- ;$BlankPixel = PixelGetColor(($topLeft[0]+176), ($topLeft[1]+455))
- If ($BlankPixel = $BlankColor1) Then
- $TsulasHP = 2
- Else
- ; click to exit Tsulas
- ;DungeonPad(676, 316)
- DungeonPad(($topLeft[0]+565),($topLeft[1]+169))
- ; move away from Tsulas
- ;MouseMove(555, 553, 3)
- MouseMove(($topLeft[0]+444),($topLeft[1]+406), 3)
- Sleep(200)
- MouseClick("left")
- Sleep(1000)
- EndIf
- WEnd
- ; enter second battle - 4 creatures
- ;Battle(339, 364)
- Battle(($topLeft[0]+228),($topLeft[1]+217))
- WaitForPads()
- ; click to exit Tsulas
- ;DungeonPad(676, 316)
- DungeonPad(($topLeft[0]+565),($topLeft[1]+169))
- ; move away from Tsulas
- ;MouseMove(555, 553, 3)
- MouseMove(($topLeft[0]+444),($topLeft[1]+406), 3)
- Sleep(200)
- MouseClick("left")
- Sleep(1000)
- $TotalXP=$TotalXP+550
- EndFunc
- Func GrindBW_A3()
- ; start script outside of dungeon
- ;
- ; enter Bleakwoods A3
- ;DungeonPad(601, 398)
- DungeonPad(($topLeft[0]+490),($topLeft[1]+251))
- WaitForPads()
- ; enter first battle - right
- ;Battle(625, 410)
- Battle(($topLeft[0]+514),($topLeft[1]+263))
- WaitForPads()
- ; enter second battle - left
- ;Battle(336, 362)
- Battle(($topLeft[0]+225),($topLeft[1]+215))
- WaitForPads()
- ; click to exit Bleakwoods A3
- ;DungeonPad(720, 554)
- DungeonPad(($topLeft[0]+609),($topLeft[1]+407))
- WaitForPads()
- ; move away from Bleakwoods A3
- ;MouseMove(507, 443, 3)
- MouseMove(($topLeft[0]+396),($topLeft[1]+296),3)
- Sleep(100)
- MouseClick("left")
- Sleep(1000)
- $TotalXP=$TotalXP+1617
- EndFunc
- Func GrindUW_E4()
- ; start script outside of dungeon
- ;
- ; enter Underworld E4
- ;DungeonPad(792, 327)
- DungeonPad(($topLeft[0]+681),($topLeft[1]+180))
- WaitForPads()
- ; enter first battle
- ;Battle(480, 361)
- Battle(($topLeft[0]+369),($topLeft[1]+214))
- WaitForPads()
- ; enter second battle
- ;Battle(600, 350)
- Battle(($topLeft[0]+489),($topLeft[1]+203))
- WaitForPads()
- ; enter third battle
- ;Battle(649, 421)
- Battle(($topLeft[0]+538),($topLeft[1]+274))
- WaitForPads()
- ; exit Underworld E4
- ;DungeonPad(288, 531)
- DungeonPad(($topLeft[0]+177),($topLeft[1]+384))
- ; move away from Underworld E4
- ;MouseMove(631, 312, 3)
- MouseMove(($topLeft[0]+520),($topLeft[1]+165), 3)
- Sleep(100)
- MouseClick("left")
- Sleep(1000)
- $TotalXP=$TotalXP+3710
- EndFunc
- Func GrindUW_D2()
- ; start script outside of dungeon
- ;
- ; enter Underworld D2
- ;DungeonPad(480, 578)
- DungeonPad(($topLeft[0]+369),($topLeft[1]+431))
- WaitForPads()
- ; enter third battle
- ;Battle(673, 410)
- Battle(($topLeft[0]+562),($topLeft[1]+263))
- WaitForPads()
- ; enter first battle
- ;Battle(506, 494)
- Battle(($topLeft[0]+395),($topLeft[1]+347))
- WaitForPads()
- ; enter second battle
- ;Battle(314, 327)
- Battle(($topLeft[0]+203),($topLeft[1]+180))
- WaitForPads()
- ; exit Underworld D2
- ;DungeonPad(168, 614)
- DungeonPad(($topLeft[0]+57),($topLeft[1]+467))
- ; move away from Underworld D2
- ;MouseMove(390, 524, 3)
- MouseMove(($topLeft[0]+279),($topLeft[1]+377), 3)
- Sleep(100)
- MouseClick("left")
- Sleep(1000)
- $TotalXP=$TotalXP+3610
- EndFunc
- Func GrindUW_F4()
- ; start script outside of dungeon
- ;
- ; enter Underworld F4
- ;DungeonPad(768, 482)
- DungeonPad(($topLeft[0]+657), ($topLeft[1]+335))
- WaitForPads()
- ; enter first battle
- ;Battle(505, 350)
- Battle(($topLeft[0]+394), ($topLeft[1]+203))
- WaitForPads()
- ; enter second battle
- ;Battle(625, 434)
- Battle(($topLeft[0]+514), ($topLeft[1]+287))
- WaitForPads()
- ; enter third battle
- ;Battle(577, 458)
- Battle(($topLeft[0]+466), ($topLeft[1]+311))
- WaitForPads()
- ; exit Underworld F4
- ;DungeonPad(288, 529)
- DungeonPad(($topLeft[0]+177), ($topLeft[1]+382))
- ; move away from Underworld F4
- ;MouseMove(651, 456, 3)
- MouseMove(($topLeft[0]+540), ($topLeft[1]+309), 3)
- Sleep(100)
- MouseClick("left")
- Sleep(1000)
- $TotalXP=$TotalXP+4787
- EndFunc
- Func Generic()
- ; start script outside of dungeon
- ;
- ; enter dungeon
- ; Find pad
- $GenericContinue = 1
- $genericCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$PadColor2, 5)
- If @error=1 Then
- ;MouseMove(544, 537, 3)
- MouseMove(($topLeft[0]+433), ($topLeft[1]+390), 3)
- Sleep(100)
- MouseClick("left")
- Sleep(1000)
- $genericCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$PadColor2, 5)
- EndIf
- $GenericEntrance[0] = $genericCoord[0]
- $GenericEntrance[1] = $genericCoord[1]
- DungeonPad($genericCoord[0]+3, $genericCoord[1]+13)
- WaitForPads()
- ; Find Battle
- While $GenericContinue = 1
- sleep(500)
- $genericCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$PadColor2, 5)
- $CheckPixel = PixelSearch($genericCoord[0],$genericCoord[1]+29,$genericCoord[0],$genericCoord[1]+38,0xFFFFFF, 5)
- If @error = 0 Then
- Battle($genericCoord[0]+3, $genericCoord[1]+13)
- WaitForPads()
- Else
- $newGenCoord[0]=$genericCoord[0]
- $newGenCoord[1]=$genericCoord[1]
- $genericCoord = PixelSearch($topLeft[0],$newGenCoord[1]+40,$bottomRight[0],$bottomRight[1]-119,$PadColor2, 5)
- If @error=1 Then
- $GenericContinue = 2
- Else
- Battle($genericCoord[0]+3, $genericCoord[1]+13)
- WaitForPads()
- EndIf
- EndIf
- WEnd
- ; exit dungeon
- $genericCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$PadColor2, 5)
- DungeonPad($genericCoord[0]+3, $genericCoord[1]+13)
- WaitForPads()
- ; move away from dungeon
- ; how to make this work?
- ; find coords of pad and try 50 left and right?
- ; ^ not done yet
- ;MouseMove(284, 551, 3)
- MouseMove(($GenericEntrance[0]+50), ($GenericEntrance[1]), 3)
- Sleep(100)
- MouseClick("left")
- MouseMove(($GenericEntrance[0]), ($GenericEntrance[1]-50), 3)
- Sleep(100)
- MouseClick("left")
- MouseMove(($GenericEntrance[0]-50), ($GenericEntrance[1]), 3)
- Sleep(100)
- MouseClick("left")
- MouseMove(($GenericEntrance[0]-50), ($GenericEntrance[1]+50), 3)
- Sleep(100)
- MouseClick("left")
- Sleep(1000)
- $TotalXP=$TotalXP+1
- EndFunc
- Func ArenaCWA()
- ; start script in arena in first room with battles (not in lobby)
- ; if you die, you will return to the arena and start over
- ; if you make it through, you need to stop the script!
- ; this one is different so you do NOT need to be able to
- ; survive through the first room!
- ;
- ; ability to repeat this arena not working yet
- $continue = 1
- ; Find Battle
- While $continue = 1
- ; need to move away from pad first - maybe not necessary?
- ; 09/01 - I decided this is necessary again
- ; **** This section may need some work
- MouseMove(($topLeft[0]+374), ($topLeft[1]+256), 3)
- MouseClick("left")
- sleep(500)
- MouseMove(($topLeft[0]+389), ($topLeft[1]+313), 3)
- MouseClick("left")
- sleep(500)
- ; find white pad
- WaitForPads()
- $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$ExitColor1)
- If @error=1 Then
- $exitCoord[0] = $topLeft[0]
- $exitCoord[1] = $topLeft[1]
- Else
- $exitCoord[0]=$arenaCoord[0]
- $exitCoord[1]=$arenaCoord[1]
- EndIf
- $battleCheck = 1
- While $battleCheck = 1
- ; next search for battle pads
- WaitForPads()
- $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$PadColor1)
- If @error=1 Then
- $battleCheck = 2
- Else
- Battle($arenaCoord[0], $arenaCoord[1])
- WaitForPads()
- $TotalXP=$TotalXP+$CWAXP[$NumberOfBattles]
- EndIf
- Wend
- WaitForPads()
- ; death check
- If (DeathCheck() = 1) Then
- $continue = 2
- MsgBox(8192, "You died! (arena check 1)", "You died!", 1)
- Else
- $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$ExitColor1)
- If (($arenaCoord[0] = $exitCoord[0]) and ($arenaCoord[1] = $exitCoord[1])) Then
- $arenaCoord = PixelSearch($topLeft[0],$exitCoord[1]+3,$bottomRight[0],$bottomRight[1]-119,$ExitColor1)
- DungeonPad($arenaCoord[0],$arenaCoord[1])
- Else
- DungeonPad($arenaCoord[0],$arenaCoord[1])
- EndIf
- EndIf
- ; might need to check more than once
- If (DeathCheck() = 1) Then
- $continue = 2
- MsgBox(8192, "You died! (arena check 2)", "You died!", 1)
- EndIf
- WEnd
- ; died - remove last battle XP
- $TotalXP=$TotalXP-$CWAXP[$NumberOfBattles]
- ReturnToArena()
- EndFunc
- Func ArenaUWA()
- ; start script in arena in first room with battles (not in lobby)
- ; if you die, you will return to the arena and start over
- ; if you make it through, you need to stop the script!
- ; this one is different so you do NOT need to be able to
- ; survive through the first room!
- ;
- ; first room
- ; ability to repeat this arena not working yet
- $continue = 1
- ; Find Battle
- While $continue = 1
- ; need to move away from pad first - maybe not necessary?
- ; 09/01 - I decided this is necessary again
- ; **** This section may need some work
- MouseMove(($topLeft[0]+374), ($topLeft[1]+256), 3)
- MouseClick("left")
- sleep(500)
- MouseMove(($topLeft[0]+389), ($topLeft[1]+313), 3)
- MouseClick("left")
- sleep(500)
- ; find white pad
- WaitForPads()
- $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$ExitColor1)
- If @error=1 Then
- $exitCoord[0] = $topLeft[0]
- $exitCoord[1] = $topLeft[1]
- Else
- $exitCoord[0]=$arenaCoord[0]
- $exitCoord[1]=$arenaCoord[1]
- EndIf
- $battleCheck = 1
- While $battleCheck = 1
- ; next search for battle pads
- WaitForPads()
- $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$PadColor1)
- If @error=1 Then
- $battleCheck = 2
- Else
- Battle($arenaCoord[0], $arenaCoord[1])
- WaitForPads()
- $TotalXP=$TotalXP+$UWAXP[$NumberOfBattles]
- EndIf
- Wend
- WaitForPads()
- ; death check
- If (DeathCheck() = 1) Then
- $continue = 2
- MsgBox(8192, "You died! (arena check 1)", "You died!", 1)
- Else
- $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$ExitColor1)
- If (($arenaCoord[0] = $exitCoord[0]) and ($arenaCoord[1] = $exitCoord[1])) Then
- $arenaCoord = PixelSearch($topLeft[0],$exitCoord[1]+3,$bottomRight[0],$bottomRight[1]-119,$ExitColor1)
- DungeonPad($arenaCoord[0],$arenaCoord[1])
- Else
- DungeonPad($arenaCoord[0],$arenaCoord[1])
- EndIf
- EndIf
- ; might need to check more than once
- If (DeathCheck() = 1) Then
- $continue = 2
- MsgBox(8192, "You died! (arena check 2)", "You died!", 1)
- EndIf
- WEnd
- ; died - remove last battle XP
- $TotalXP=$TotalXP-$UWAXP[$NumberOfBattles]
- ReturnToArena()
- EndFunc
- Func NewbGrind()
- ; start script in Shikaakwa
- ;
- ; DungeonPad(817, 578)
- DungeonPad2(($topLeft[0]+706),($topLeft[1]+432))
- ;go to A3
- ; 265, 252
- DungeonPad2(($topLeft[0]+154),($topLeft[1]+106))
- ;go to A2
- ; 337, 241
- DungeonPad2(($topLeft[0]+226),($topLeft[1]+95))
- ; grind A2 until HP is 100% when done
- $NewbHP=2
- While $NewbHP > 1
- $NewbHP = 1
- ; enter Bellroot A2
- ; 312, 518
- DungeonPad(($topLeft[0]+201),($topLeft[1]+372))
- WaitForPads()
- ; enter first battle - left
- ; 289, 482
- Battle(($topLeft[0]+178),($topLeft[1]+336))
- WaitForPads()
- If ($BlankPixel3 = $BlankColor1) Then
- $NewbHP = $NewbHP + 1
- EndIf
- ; enter 2nd battle - middle
- ; 408, 373
- Battle(($topLeft[0]+297),($topLeft[1]+227))
- WaitForPads()
- If ($BlankPixel3 = $BlankColor1) Then
- $NewbHP = $NewbHP + 1
- EndIf
- ; enter 3rd battle - right
- ; 624, 433
- Battle(($topLeft[0]+513),($topLeft[1]+287))
- WaitForPads()
- If ($BlankPixel3 = $BlankColor1) Then
- $NewbHP = $NewbHP + 1
- EndIf
- ; click to exit A2
- ; 720, 554
- DungeonPad(($topLeft[0]+609),($topLeft[1]+408))
- ; move away from A2
- ;MouseMove(542, 507, 3)
- MouseMove(($topLeft[0]+431),($topLeft[1]+361), 3)
- Sleep(200)
- MouseClick("left")
- Sleep(1000)
- WEnd
- ; go to A1
- ; 528, 241
- DungeonPad2(($topLeft[0]+417),($topLeft[1]+95))
- ; grind A1 until HP is 100% when done
- $NewbHP=2
- While $NewbHP > 1
- $NewbHP = 1
- ; enter Bellroot A1
- ; 696, 327
- DungeonPad(($topLeft[0]+585),($topLeft[1]+181))
- WaitForPads()
- ; enter first battle
- ; 361, 422
- Battle(($topLeft[0]+250),($topLeft[1]+276))
- WaitForPads()
- If ($BlankPixel2 = $BlankColor1) Then
- $NewbHP = $NewbHP + 1
- EndIf
- ; enter 2nd battle
- ; 576, 410
- Battle(($topLeft[0]+465),($topLeft[1]+264))
- WaitForPads()
- If ($BlankPixel2 = $BlankColor1) Then
- $NewbHP = $NewbHP + 1
- EndIf
- ; enter 3rd battle
- ; 553, 494
- Battle(($topLeft[0]+442),($topLeft[1]+348))
- WaitForPads()
- If ($BlankPixel3 = $BlankColor1) Then
- $NewbHP = $NewbHP + 1
- EndIf
- ; click to exit A1
- ; 288, 554
- DungeonPad(($topLeft[0]+177),($topLeft[1]+408))
- ; move away from A1
- ;MouseMove(795, 318, 3)
- MouseMove(($topLeft[0]+684),($topLeft[1]+172), 3)
- Sleep(200)
- MouseClick("left")
- Sleep(1000)
- WEnd
- ; go to B2
- ; 696, 613
- DungeonPad2(($topLeft[0]+585),($topLeft[1]+467))
- ; 815, 529
- DungeonPad2(($topLeft[0]+704),($topLeft[1]+383))
- ; grind B2 until HP is 100% when done
- $NewbHP = 2
- While $NewbHP > 1
- $NewbHP = 1
- ; grind 2nd battle until HP is low
- $RepeatB2 = 1
- While $RepeatB2 = 1
- ; enter Bellroot B2
- ; 529, 504
- DungeonPad(($topLeft[0]+418),($topLeft[1]+358))
- WaitForPads()
- ; enter 2nd battle
- ; 577, 410
- Battle(($topLeft[0]+466),($topLeft[1]+264))
- WaitForPads()
- If ($BlankPixel3 <> $BlankColor1) Then
- $RepeatB2 = 2
- Else
- If ($BlankPixel = $BlankColor1) Then
- $RepeatB2 = 2
- Else
- ; click to exit B2
- ; 288, 553
- DungeonPad(($topLeft[0]+177),($topLeft[1]+407))
- ; move away from B2
- ;MouseMove(636, 468, 3)
- MouseMove(($topLeft[0]+525),($topLeft[1]+322), 3)
- Sleep(200)
- MouseClick("left")
- Sleep(1000)
- EndIf
- EndIf
- WEnd
- ; enter first battle
- ; 337, 458
- Battle(($topLeft[0]+226),($topLeft[1]+312))
- WaitForPads()
- If ($BlankPixel3 = $BlankColor1) Then
- $NewbHP = $NewbHP + 1
- EndIf
- ; enter 3rd battle
- ; 553, 493
- Battle(($topLeft[0]+442),($topLeft[1]+347))
- WaitForPads()
- If ($BlankPixel3 = $BlankColor1) Then
- $NewbHP = $NewbHP + 1
- EndIf
- ; click to exit B2
- ; 288, 553
- DungeonPad(($topLeft[0]+177),($topLeft[1]+407))
- ; move away from B2
- ;MouseMove(636, 468, 3)
- MouseMove(($topLeft[0]+525),($topLeft[1]+322), 3)
- Sleep(200)
- MouseClick("left")
- Sleep(1000)
- WEnd
- ;return to Shik
- ; 144, 408
- DungeonPad(($topLeft[0]+33),($topLeft[1]+262))
- ; 457, 613
- DungeonPad(($topLeft[0]+346),($topLeft[1]+467))
- ; 457, 613
- DungeonPad(($topLeft[0]+346),($topLeft[1]+467))
- ; 143, 601
- DungeonPad(($topLeft[0]+32),($topLeft[1]+455))
- ; go to Summerville
- ; 337, 288
- DungeonPad(($topLeft[0]+226),($topLeft[1]+142))
- ; 360, 612
- DungeonPad(($topLeft[0]+249),($topLeft[1]+466))
- ; 145, 480
- DungeonPad(($topLeft[0]+34),($topLeft[1]+334))
- ; grind D1 until HP is 100% when done
- $NewbHP=2
- While $NewbHP > 1
- $NewbHP = 1
- ; enter Summerville D1
- ; 625, 386
- DungeonPad(($topLeft[0]+514),($topLeft[1]+240))
- WaitForPads()
- ; enter first battle
- ; 408, 397
- Battle(($topLeft[0]+297),($topLeft[1]+251))
- WaitForPads()
- If ($BlankPixel3 = $BlankColor1) Then
- $NewbHP = $NewbHP + 1
- EndIf
- ; enter 2nd battle
- ; 625, 362
- Battle(($topLeft[0]+514),($topLeft[1]+216))
- WaitForPads()
- If ($BlankPixel3 = $BlankColor1) Then
- $NewbHP = $NewbHP + 1
- EndIf
- ; enter 3rd battle
- ; 553, 470
- Battle(($topLeft[0]+442),($topLeft[1]+324))
- WaitForPads()
- If ($BlankPixel3 = $BlankColor1) Then
- $NewbHP = $NewbHP + 1
- EndIf
- ; click to exit D1
- ; 336, 528
- DungeonPad(($topLeft[0]+225),($topLeft[1]+382))
- ; move away from D1
- ;MouseMove(558, 470, 3)
- MouseMove(($topLeft[0]+447),($topLeft[1]+324), 3)
- Sleep(200)
- MouseClick("left")
- Sleep(1000)
- WEnd
- ; go to C4
- ; 505, 612
- DungeonPad(($topLeft[0]+394),($topLeft[1]+466))
- ; 649, 613
- DungeonPad(($topLeft[0]+538),($topLeft[1]+467))
- ; 457, 614
- DungeonPad(($topLeft[0]+346),($topLeft[1]+468))
- ; 144, 480
- DungeonPad(($topLeft[0]+33),($topLeft[1]+334))
- ; grind C4 until HP is 100% when done
- $NewbHP=2
- While $NewbHP > 1
- $NewbHP = 1
- ; enter Summerville C4
- ; 409, 469
- DungeonPad(($topLeft[0]+298),($topLeft[1]+323))
- WaitForPads()
- ; enter first battle
- ; 385, 410
- Battle(($topLeft[0]+274),($topLeft[1]+264))
- WaitForPads()
- If ($BlankPixel3 = $BlankColor1) Then
- $NewbHP = $NewbHP + 1
- EndIf
- ; enter 2nd battle
- ; 552, 350
- Battle(($topLeft[0]+441),($topLeft[1]+204))
- WaitForPads()
- If ($BlankPixel3 = $BlankColor1) Then
- $NewbHP = $NewbHP + 1
- EndIf
- ; click to exit C4
- ; 288, 553
- DungeonPad(($topLeft[0]+177),($topLeft[1]+407))
- ; move away from C4
- ;MouseMove(284, 462, 3)
- MouseMove(($topLeft[0]+173),($topLeft[1]+296), 3)
- Sleep(200)
- MouseClick("left")
- Sleep(1000)
- WEnd
- ; go to bleakwoods H3
- ; 384, 243
- DungeonPad(($topLeft[0]+273),($topLeft[1]+97))
- ; 816, 385
- DungeonPad(($topLeft[0]+705),($topLeft[1]+239))
- ; 431, 242
- DungeonPad(($topLeft[0]+320),($topLeft[1]+96))
- ; 479, 241
- DungeonPad(($topLeft[0]+368),($topLeft[1]+95))
- ; 816, 362
- DungeonPad(($topLeft[0]+705),($topLeft[1]+216))
- ; 433, 241
- DungeonPad(($topLeft[0]+322),($topLeft[1]+95))
- ; 480, 241
- DungeonPad(($topLeft[0]+369),($topLeft[1]+95))
- ; 816, 458
- DungeonPad(($topLeft[0]+705),($topLeft[1]+312))
- ; 456, 252
- DungeonPad(($topLeft[0]+345),($topLeft[1]+106))
- ; 625, 240
- DungeonPad(($topLeft[0]+514),($topLeft[1]+94))
- ; 527, 241
- DungeonPad(($topLeft[0]+416),($topLeft[1]+95))
- ; 527, 241
- DungeonPad(($topLeft[0]+416),($topLeft[1]+95))
- ; 527, 241
- DungeonPad(($topLeft[0]+416),($topLeft[1]+95))
- ; 527, 241
- DungeonPad(($topLeft[0]+416),($topLeft[1]+95))
- ; 768, 240
- DungeonPad(($topLeft[0]+657),($topLeft[1]+94))
- ; 144, 529
- DungeonPad(($topLeft[0]+33),($topLeft[1]+383))
- ; 480, 242
- DungeonPad(($topLeft[0]+369),($topLeft[1]+96))
- ; grind H3 until HP is 80% when done
- $NewbHP=2
- While $NewbHP > 1
- $NewbHP = 1
- ; enter Bleakwoods H3
- ; 288, 505
- DungeonPad(($topLeft[0]+177),($topLeft[1]+359))
- WaitForPads()
- ; enter first battle
- ; 336, 432
- Battle(($topLeft[0]+225),($topLeft[1]+286))
- WaitForPads()
- If ($BlankPixel2 = $BlankColor1) Then
- $NewbHP = $NewbHP + 1
- EndIf
- ; enter 2nd battle
- ; 552, 349
- Battle(($topLeft[0]+441),($topLeft[1]+203))
- WaitForPads()
- If ($BlankPixel2 = $BlankColor1) Then
- $NewbHP = $NewbHP + 1
- EndIf
- ; enter 3rd battle
- ; 505, 541
- Battle(($topLeft[0]+394),($topLeft[1]+395))
- WaitForPads()
- If ($BlankPixel2 = $BlankColor1) Then
- $NewbHP = $NewbHP + 1
- EndIf
- ; click to exit H3
- ; 287, 553
- DungeonPad(($topLeft[0]+176),($topLeft[1]+407))
- ; move away from H3
- ;MouseMove(380, 569, 3)
- MouseMove(($topLeft[0]+269),($topLeft[1]+423), 3)
- Sleep(200)
- MouseClick("left")
- Sleep(1000)
- WEnd
- ; go to Tsulas
- ; 457, 613
- DungeonPad(($topLeft[0]+346),($topLeft[1]+467))
- ; 144, 530
- DungeonPad(($topLeft[0]+33),($topLeft[1]+384))
- ; 143, 528
- DungeonPad(($topLeft[0]+32),($topLeft[1]+382))
- ; 144, 553
- DungeonPad(($topLeft[0]+33),($topLeft[1]+407))
- ; 265, 421
- DungeonPad(($topLeft[0]+154),($topLeft[1]+275))
- EndFunc
- Func GrindUW_A3()
- ; start script outside of dungeon
- ;
- ; enter Underworld A3
- ;DungeonPad(481, 359)
- DungeonPad(($topLeft[0]+370), ($topLeft[1]+215))
- WaitForPads()
- ; enter first battle
- ;Battle(239, 480)
- Battle(($topLeft[0]+128), ($topLeft[1]+336))
- WaitForPads()
- ; enter second battle
- ;Battle(504, 491)
- Battle(($topLeft[0]+393), ($topLeft[1]+347))
- WaitForPads()
- ; enter third battle
- ;Battle(312, 323)
- Battle(($topLeft[0]+201), ($topLeft[1]+179))
- WaitForPads()
- ; enter fourth battle
- ;Battle(673, 408)
- Battle(($topLeft[0]+562), ($topLeft[1]+264))
- WaitForPads()
- ; exit Underworld A3
- ;DungeonPad(168, 611)
- DungeonPad(($topLeft[0]+57), ($topLeft[1]+467))
- ; move away from Underworld A3
- ;MouseMove(592, 427, 3)
- MouseMove(($topLeft[0]+481), ($topLeft[1]+283), 3)
- Sleep(100)
- MouseClick("left")
- Sleep(1000)
- $TotalXP=$TotalXP+6544
- EndFunc
- Func GrindUW_B4()
- ; start script outside of dungeon
- ;
- ; enter Underworld B4
- ;DungeonPad(193, 337)
- DungeonPad(($topLeft[0]+82), ($topLeft[1]+193))
- WaitForPads()
- ; enter first battle
- ;Battle(432, 527)
- Battle(($topLeft[0]+321), ($topLeft[1]+383))
- WaitForPads()
- ; enter second battle
- ;Battle(384, 383)
- Battle(($topLeft[0]+273), ($topLeft[1]+239))
- WaitForPads()
- ; enter third battle
- ;Battle(576, 432)
- Battle(($topLeft[0]+465), ($topLeft[1]+288))
- WaitForPads()
- ; enter fourth battle
- ;Battle(624, 455)
- Battle(($topLeft[0]+513), ($topLeft[1]+311))
- WaitForPads()
- ; exit Underworld B4
- ;DungeonPad(673, 552)
- DungeonPad(($topLeft[0]+562), ($topLeft[1]+408))
- ; move away from Underworld B4
- ;MouseMove(355, 317, 3)
- MouseMove(($topLeft[0]+244), ($topLeft[1]+173), 3)
- Sleep(100)
- MouseClick("left")
- Sleep(1000)
- $TotalXP=$TotalXP+7559
- EndFunc
- Func GrindUW_A4()
- ; start script outside of dungeon
- ;
- ; enter Underworld A4
- ;DungeonPad(553, 564)
- DungeonPad(($topLeft[0]+442), ($topLeft[1]+420))
- WaitForPads()
- ; enter first battle
- ;Battle(240, 480)
- Battle(($topLeft[0]+129), ($topLeft[1]+336))
- WaitForPads()
- ; enter second battle
- ;Battle(504, 492)
- Battle(($topLeft[0]+393), ($topLeft[1]+348))
- WaitForPads()
- ; enter third battle
- ;Battle(312, 322)
- WaitForPads()
- Battle(($topLeft[0]+201), ($topLeft[1]+178))
- ; enter fourth battle
- ;Battle(672, 408)
- Battle(($topLeft[0]+561), ($topLeft[1]+264))
- WaitForPads()
- ; enter fifth battle
- ;Battle(600, 300)
- Battle(($topLeft[0]+489), ($topLeft[1]+156))
- WaitForPads()
- ; exit Underworld A4
- ;DungeonPad(168, 612)
- DungeonPad(($topLeft[0]+57), ($topLeft[1]+468))
- ; move away from Underworld A4
- ;MouseMove(524, 491, 3)
- MouseMove(($topLeft[0]+413), ($topLeft[1]+347), 3)
- Sleep(100)
- MouseClick("left")
- Sleep(1000)
- $TotalXP=$TotalXP+10470
- EndFunc
- Func GrindUW_C2()
- ; start script outside of dungeon
- ;
- ; enter Underworld C2
- ;DungeonPad(648, 295)
- DungeonPad(($topLeft[0]+537), ($topLeft[1]+156))
- WaitForPads()
- ; enter first battle
- ;Battle(241, 475)
- Battle(($topLeft[0]+130), ($topLeft[1]+336))
- WaitForPads()
- ; enter second battle
- ;Battle(312, 318)
- Battle(($topLeft[0]+201), ($topLeft[1]+179))
- WaitForPads()
- ; enter third battle
- ;Battle(599, 294)
- Battle(($topLeft[0]+488), ($topLeft[1]+155))
- WaitForPads()
- ; exit Underworld C2
- ;DungeonPad(168, 606)
- DungeonPad(($topLeft[0]+57), ($topLeft[1]+467))
- ; move away from Underworld C2
- ;MouseMove(506, 316, 3)
- MouseMove(($topLeft[0]+395), ($topLeft[1]+177), 3)
- Sleep(100)
- MouseClick("left")
- Sleep(1000)
- $TotalXP=$TotalXP+2280
- EndFunc
- Func DeathCheck()
- $DeathYes=0
- $DeathNo=0
- ;$chimneycheck = 0xE2D6C3
- $chimneycheck = PixelGetColor($topLeft[0]+267, $topLeft[1]+311)
- If $chimneycheck < 0xB00000 Then
- Return(0)
- EndIf
- For $DeathX = 267 to 277
- For $DeathY = 311 to 321
- $chimneycheck2 = PixelGetColor($topLeft[0]+$DeathX, $topLeft[1]+$DeathY)
- If $chimneycheck2 = $chimneycheck Then
- $DeathYes=$DeathYes+1
- Else
- $DeathNo=$DeathNo+1
- ; not chimney - not dead - return 0
- If $DeathNo > 10 Then
- Return(0)
- EndIf
- EndIf
- Next
- Next
- ; thats the chimney - they dead
- Return(1)
- EndFunc
- Func ArenaGrind()
- ; start script in arena in first room with battles (not in lobby)
- ; if you die, you will return to the arena and start over
- ; IMPORTANT - you need to be able to survive through the first room!
- ;
- ; first room
- $NumberOfBattles=0
- $ArenaContinue = 1
- $RoomsCleared = 0
- ; First room - find and do all two battles
- While $ArenaContinue = 1
- WaitForPads()
- $ArenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$PadColor2, 5)
- $BattleTextFind = PixelSearch($ArenaCoord[0],$ArenaCoord[1]+29,$ArenaCoord[0]+30,$ArenaCoord[1]+37,0xFFFFFF,5)
- ; if Y is greater than 599, then its not a battle
- If (@error=0) and ($ArenaCoord[1] < ($topLeft[1]+452)) Then
- Battle($ArenaCoord[0]+3,$ArenaCoord[1]+13)
- WaitForPads()
- $TotalXP=$TotalXP+$ArenaXP[$ArenaNumber][$NumberOfBattles]
- Else
- $newArenaCoord[0]=$ArenaCoord[0]
- $newArenaCoord[1]=$ArenaCoord[1]
- $ArenaCoord = PixelSearch($topLeft[0]+1,$newArenaCoord[1]+1,$bottomRight[0],$bottomRight[1]-119,$PadColor2, 5)
- If (@error=0) and ($ArenaCoord[1]< ($topLeft[1]+452)) Then
- Battle($ArenaCoord[0]+3, $ArenaCoord[1]+13)
- WaitForPads()
- $TotalXP=$TotalXP+$ArenaXP[$ArenaNumber][$NumberOfBattles]
- Else
- $ArenaContinue = 2
- EndIf
- EndIf
- WEnd
- $RoomsCleared = $RoomsCleared + 1
- ; first room - go to exit pad
- WaitForPads()
- $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$ExitColor1, 5)
- DungeonPad($arenaCoord[0]+3,$arenaCoord[1]+13)
- $continue = 1
- ; Find Battle
- While $continue = 1
- ; need to move away from pad first - maybe not necessary?
- ; 09/01 - I decided this is necessary again
- MouseMove(($topLeft[0]+374), ($topLeft[1]+256), 3)
- MouseClick("left")
- sleep(500)
- ; find white pad
- WaitForPads()
- $ArenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$ExitColor1, 5)
- If @error=1 Then
- $exitCoord[0] = $topLeft[0]
- $exitCoord[1] = $topLeft[1]
- Else
- $exitCoord[0]=$ArenaCoord[0]
- $exitCoord[1]=$ArenaCoord[1]
- EndIf
- $battleCheck = 1
- While $battleCheck = 1
- ; next search for battle pads
- WaitForPads()
- If $NumberOfBattles < $ArenaNumberOfBattles[$ArenaNumber] Then
- $ArenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$PadColor2, 5)
- If @error=1 Then
- $battleCheck = 2
- Else
- Battle($ArenaCoord[0]+3, $ArenaCoord[1]+13)
- WaitForPads()
- $TotalXP=$TotalXP+$ArenaXP[$ArenaNumber][$NumberOfBattles]
- EndIf
- Else
- $battleCheck = 2
- EndIF
- Wend
- WaitForPads()
- ; keep count of rooms cleared - when arena is done - exit and repeat
- $RoomsCleared = $RoomsCleared + 1
- If $RoomsCleared = 49 Then
- ; find exit
- $ArenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$PadColor1, 5)
- ; if entrance is found first - search again for exit
- If (($ArenaCoord[0] = $exitCoord[0]) and ($ArenaCoord[1] = $exitCoord[1])) Then
- $ArenaCoord = PixelSearch($topLeft[0],$exitCoord[1]+3,$bottomRight[0],$bottomRight[1]-119,$ExitColor1, 5)
- DungeonPad($ArenaCoord[0],$ArenaCoord[1])
- Else
- DungeonPad($ArenaCoord[0],$ArenaCoord[1])
- EndIf
- MouseMove(($topLeft[0]+320), ($topLeft[1]+239), 3)
- MouseClick("left")
- Sleep(2000)
- DungeonPad(($topLeft[0]+82),($topLeft[1]+97))
- Return
- EndIf
- ; death check
- If (DeathCheck() = 1) Then
- $continue = 2
- MsgBox(8192, "You died! (arena check 1)", "You died!", 1)
- Else
- ; find exit
- $ArenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$ExitColor1, 5)
- ; if entrance is found first - search again for exit
- If (($arenaCoord[0] = $exitCoord[0]) and ($arenaCoord[1] = $exitCoord[1])) Then
- If ($ArenaCoord[0] > ($topLeft[0]+505)) Then
- $ArenaCoord = PixelSearch($topLeft[0],$exitCoord[1]+40,$bottomRight[0],$bottomRight[1]-119,$ExitColor1, 5)
- DungeonPad($ArenaCoord[0]+3,$ArenaCoord[1]+13)
- Else
- $ArenaCoord = PixelSearch($exitCoord[0]+40,$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$ExitColor1, 5)
- DungeonPad($ArenaCoord[0]+3,$ArenaCoord[1]+13)
- EndIf
- Else
- DungeonPad($ArenaCoord[0]+3,$ArenaCoord[1]+13)
- EndIf
- EndIf
- ; might need to check more than once
- If (DeathCheck() = 1) Then
- $continue = 2
- MsgBox(8192, "You died! (arena check 2)", "You died!", 1)
- EndIf
- WEnd
- ; died - remove last battle XP
- $TotalXP=$TotalXP-$ArenaXP[$ArenaNumber][$NumberOfBattles]
- ReturnToArena()
- EndFunc
- Func ArenaGrind2()
- ; start script in arena in first room with battles (not in lobby)
- ; if you die, you will return to the arena and start over
- $NumberOfBattles=0
- $ArenaContinue = 1
- $RoomsCleared = 0
- $ArenaRoomCount = 1
- $continue = 1
- ; Find Battle
- While $continue = 1
- ; need to move away from pad first - maybe not necessary?
- ; 09/01 - I decided this is necessary again
- ; 11/06 - good delay while we wait for pads
- MouseMove(($topLeft[0]+374), ($topLeft[1]+256), 3)
- MouseClick("left")
- sleep(500)
- ; find white pad
- WaitForPads()
- $battleCheck = 1
- While $battleCheck = 1
- ; next search for battle pads
- WaitForPads()
- ; need this code so it doesn't think 7-7 exit is a battle
- If $NumberOfBattles < $ArenaNumberOfBattles[$ArenaNumber] Then
- ; -177 avoids the non play area and the entrance at the start of an arena
- $ArenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-177,$PadColor2, 5)
- If @error=1 Then
- $battleCheck = 2
- Else
- Battle($ArenaCoord[0]+3, $ArenaCoord[1]+13)
- WaitForPads()
- $TotalXP=$TotalXP+$ArenaXP[$ArenaNumber][$NumberOfBattles]
- EndIf
- Else
- $battleCheck = 2
- EndIf
- Wend
- WaitForPads()
- ; keep count of rooms cleared - when arena is done - exit and repeat
- $RoomsCleared = $RoomsCleared + 1
- If $RoomsCleared = 49 Then
- ; find exit
- ; ArenaCoord[0] = $ArenaExit[$ArenaRoomCount]
- ; ArenaCoord[1] = $ArenaExit[$ArenaRoomCount+1]
- DungeonPad(($ArenaExit[$ArenaRoomCount])+$topLeft[0],($ArenaExit[$ArenaRoomCount+1])+$topLeft[1])
- MouseMove(($topLeft[0]+320), ($topLeft[1]+239), 3)
- MouseClick("left")
- Sleep(2000)
- DungeonPad(($topLeft[0]+82),($topLeft[1]+97))
- Return
- EndIf
- ; death check
- If (DeathCheck() = 1) Then
- $continue = 2
- MsgBox(8192, "You died! (arena check 1)", "You died!", 1)
- Else
- ; find exit
- ; ArenaCoord[0] = $ArenaExit[$ArenaRoomCount]
- ; ArenaCoord[1] = $ArenaExit[$ArenaRoomCount+1]
- DungeonPad(($ArenaExit[$ArenaRoomCount])+$topLeft[0],($ArenaExit[$ArenaRoomCount+1])+$topLeft[1])
- $ArenaRoomCount = $ArenaRoomCount + 2
- If $ArenaRoomCount = 15 Then
- $ArenaRoomCount = 1
- EndIf
- EndIf
- ; might need to check more than once
- If (DeathCheck() = 1) Then
- $continue = 2
- MsgBox(8192, "You died! (arena check 2)", "You died!", 1)
- EndIf
- WEnd
- ; died - remove last battle XP
- $TotalXP=$TotalXP-$ArenaXP[$ArenaNumber][$NumberOfBattles]
- ReturnToArena()
- EndFunc
- Func ReturnToArena()
- If $ArenaNumber = 1 Then
- ; starting from Shikaakwa - return to FF
- ;DungeonPad(335, 288)
- DungeonPad(($topLeft[0]+224),($topLeft[1]+141))
- ;DungeonPad(481, 238)
- DungeonPad(($topLeft[0]+370),($topLeft[1]+91))
- ;DungeonPad(168, 252)
- DungeonPad(($topLeft[0]+57),($topLeft[1]+105))
- ;DungeonPad(480, 234)
- DungeonPad(($topLeft[0]+369),($topLeft[1]+87))
- ;DungeonPad(313, 413)
- DungeonPad(($topLeft[0]+202),($topLeft[1]+266))
- ;DungeonPad(192, 240)
- DungeonPad(($topLeft[0]+81),($topLeft[1]+93))
- EndIf
- If $ArenaNumber = 2 Then
- ; starting from Shikaakwa - return to SVA
- ;DungeonPad(335, 288)
- DungeonPad(($topLeft[0]+224),($topLeft[1]+141))
- ;DungeonPad(362, 612)
- DungeonPad(($topLeft[0]+251),($topLeft[1]+465))
- ;DungeonPad(816, 384)
- DungeonPad(($topLeft[0]+705),($topLeft[1]+237))
- ;DungeonPad(817, 287)
- DungeonPad(($topLeft[0]+706),($topLeft[1]+140))
- ;DungeonPad(433, 527)
- DungeonPad(($topLeft[0]+322),($topLeft[1]+380))
- ;DungeonPad(192, 241)
- DungeonPad(($topLeft[0]+81),($topLeft[1]+94))
- EndIf
- If $ArenaNumber = 3 Then
- ; starting from Shikaakwa - return to BWA
- ;DungeonPad(432, 239)
- DungeonPad(($topLeft[0]+321),($topLeft[1]+92))
- ;DungeonPad(457, 250)
- DungeonPad(($topLeft[0]+346),($topLeft[1]+103))
- ;DungeonPad(624, 238)
- DungeonPad(($topLeft[0]+513),($topLeft[1]+91))
- ;DungeonPad(527, 238)
- DungeonPad(($topLeft[0]+416),($topLeft[1]+91))
- ;DungeonPad(528, 239)
- DungeonPad(($topLeft[0]+417),($topLeft[1]+92))
- ;DungeonPad(527, 238)
- DungeonPad(($topLeft[0]+416),($topLeft[1]+91))
- ;DungeonPad(527, 239)
- DungeonPad(($topLeft[0]+416),($topLeft[1]+92))
- ;DungeonPad(768, 239)
- DungeonPad(($topLeft[0]+657),($topLeft[1]+92))
- ;DungeonPad(432, 239)
- DungeonPad(($topLeft[0]+321),($topLeft[1]+92))
- ;DungeonPad(481, 239)
- DungeonPad(($topLeft[0]+370),($topLeft[1]+92))
- ;DungeonPad(384, 238)
- DungeonPad(($topLeft[0]+273),($topLeft[1]+91))
- ;DungeonPad(409, 467)
- DungeonPad(($topLeft[0]+298),($topLeft[1]+320))
- ;DungeonPad(192, 238)
- DungeonPad(($topLeft[0]+81),($topLeft[1]+91))
- EndIf
- If $ArenaNumber = 4 Then
- ; starting from Shikaakwa - return to DFA
- ;DungeonPad(816, 576) - Shik to A4
- DungeonPad2(($topLeft[0]+705),($topLeft[1]+429))
- ;DungeonPad(697, 612) - A4 to B4
- DungeonPad2(($topLeft[0]+586),($topLeft[1]+465))
- ;DungeonPad(816, 600) - B4 to C4
- DungeonPad2(($topLeft[0]+705),($topLeft[1]+453))
- ;DungeonPad(816, 407) - C4 to D4
- DungeonPad(($topLeft[0]+705),($topLeft[1]+260))
- ;DungeonPad(815, 287)
- DungeonPad(($topLeft[0]+704),($topLeft[1]+140))
- ;DungeonPad(608, 587)
- DungeonPad(($topLeft[0]+497),($topLeft[1]+440))
- ;DungeonPad(502, 608)
- DungeonPad(($topLeft[0]+391),($topLeft[1]+461))
- ;DungeonPad(503, 608)
- DungeonPad(($topLeft[0]+392),($topLeft[1]+461))
- ;DungeonPad(550, 608)
- DungeonPad(($topLeft[0]+439),($topLeft[1]+461))
- ;DungeonPad(310, 609)
- DungeonPad(($topLeft[0]+199),($topLeft[1]+462))
- ;DungeonPad(815, 453)
- DungeonPad(($topLeft[0]+704),($topLeft[1]+306))
- ;DungeonPad(814, 380)
- DungeonPad(($topLeft[0]+703),($topLeft[1]+233))
- ;DungeonPad(815, 548)
- DungeonPad2(($topLeft[0]+704),($topLeft[1]+401))
- ;DungeonPad(815, 379)
- DungeonPad(($topLeft[0]+704),($topLeft[1]+232))
- ;DungeonPad(822, 548)
- DungeonPad2(($topLeft[0]+711),($topLeft[1]+401))
- ;DungeonPad(455, 368)
- DungeonPad(($topLeft[0]+344),($topLeft[1]+221))
- ;DungeonPad(192, 241)
- DungeonPad(($topLeft[0]+81),($topLeft[1]+94))
- EndIf
- If $ArenaNumber = 5 Then
- ; starting from Shikaakwa - return to BRA
- ;DungeonPad(816, 576)
- DungeonPad2(($topLeft[0]+705),($topLeft[1]+429))
- ;DungeonPad(697, 612)
- DungeonPad2(($topLeft[0]+586),($topLeft[1]+465))
- ;DungeonPad(816, 600)
- DungeonPad2(($topLeft[0]+705),($topLeft[1]+453))
- ;DungeonPad(816, 407)
- DungeonPad(($topLeft[0]+705),($topLeft[1]+260))
- ;DungeonPad(815, 287)
- DungeonPad(($topLeft[0]+704),($topLeft[1]+140))
- ;DungeonPad(817, 431)
- DungeonPad(($topLeft[0]+706),($topLeft[1]+284))
- ;DungeonPad(265, 323)
- DungeonPad(($topLeft[0]+154),($topLeft[1]+176))
- ;DungeonPad(192, 240)
- DungeonPad(($topLeft[0]+81),($topLeft[1]+93))
- EndIf
- If $ArenaNumber = 6 Then
- ; starting from Shikaakwa - return to CWA
- ;DungeonPad(432, 241)
- DungeonPad(($topLeft[0]+321),($topLeft[1]+94))
- ;DungeonPad(458, 252)
- DungeonPad(($topLeft[0]+347),($topLeft[1]+105))
- ;DungeonPad2(142, 531)
- DungeonPad2(($topLeft[0]+31),($topLeft[1]+384))
- ;DungeonPad2(143, 361)
- DungeonPad2(($topLeft[0]+32),($topLeft[1]+214))
- ;DungeonPad2(144, 506)
- DungeonPad2(($topLeft[0]+33),($topLeft[1]+359))
- ;DungeonPad(576, 243)
- DungeonPad(($topLeft[0]+465),($topLeft[1]+96))
- ;DungeonPad(312, 447)
- DungeonPad(($topLeft[0]+201),($topLeft[1]+300))
- ;DungeonPad(168, 398)
- DungeonPad(($topLeft[0]+57),($topLeft[1]+251))
- EndIf
- If $ArenaNumber = 7 Then
- ; starting from Shikaakwa - return to UWA
- ;DungeonPad2(816, 577)
- DungeonPad2(($topLeft[0]+705),($topLeft[1]+430))
- ;DungeonPad2(696, 614)
- DungeonPad2(($topLeft[0]+585),($topLeft[1]+467))
- ;DungeonPad2(816, 600)
- DungeonPad2(($topLeft[0]+705),($topLeft[1]+453))
- ;DungeonPad(816, 410)
- DungeonPad(($topLeft[0]+705),($topLeft[1]+263))
- ;DungeonPad(815, 289)
- DungeonPad(($topLeft[0]+704),($topLeft[1]+142))
- ;DungeonPad(816, 434)
- DungeonPad(($topLeft[0]+705),($topLeft[1]+287))
- ;DungeonPad(816, 362)
- DungeonPad(($topLeft[0]+705),($topLeft[1]+215))
- ;DungeonPad(288, 242)
- DungeonPad(($topLeft[0]+177),($topLeft[1]+95))
- ;DungeonPad(816, 313)
- DungeonPad(($topLeft[0]+705),($topLeft[1]+166))
- ;DungeonPad(649, 229)
- DungeonPad(($topLeft[0]+538),($topLeft[1]+82))
- ;DungeonPad(144, 523)
- DungeonPad(($topLeft[0]+33),($topLeft[1]+376))
- ;DungeonPad(144, 498)
- DungeonPad(($topLeft[0]+33),($topLeft[1]+351))
- ;DungeonPad(143, 547)
- DungeonPad2(($topLeft[0]+32),($topLeft[1]+400))
- ;DungeonPad(144, 404)
- DungeonPad(($topLeft[0]+33),($topLeft[1]+257))
- ;DungeonPad2(600, 607)
- DungeonPad2(($topLeft[0]+489),($topLeft[1]+460))
- ;DungeonPad(144, 427)
- DungeonPad(($topLeft[0]+33),($topLeft[1]+280))
- ;DungeonPad(384, 235)
- DungeonPad(($topLeft[0]+273),($topLeft[1]+88))
- ;DungeonPad(143, 458)
- DungeonPad(($topLeft[0]+32),($topLeft[1]+311))
- EndIf
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement