Shakesphere

bah! my style

Oct 5th, 2011
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 67.45 KB | None | 0 0
  1. ;The Scipt Begins !!!
  2.  
  3. Global $topLeft[2]
  4. Global $bottomRight[2]
  5.  
  6. Global $paused
  7. HotKeySet("{ESC}", "Terminate")
  8. HotKeySet("{PAUSE}","_pause")
  9. HotKeySet("{Tab}","Sleep_")
  10. HotKeySet("{F6}","At3")
  11. Func _pause()
  12.   $paused = NOT $paused
  13.   While $paused
  14.        Sleep(100)
  15.   Wend
  16. EndFunc
  17.  
  18. Global $coord[2]
  19. Global $coord2[2]
  20. Global $exitCoord[2]
  21. Global $ArenaCoord[2]
  22. Global $battleCoord[2]
  23. Global $genericCoord[2]
  24. Global $GenericEntrance[2]
  25. Global $newGenCoord[2]
  26. Global $waitCoord[2]
  27. Global $TotalRunCount
  28. Global $AttackColor1
  29. Global $AttackColor2
  30. Global $BlankColor1
  31. Global $BlankPixel
  32.     ; checks HP for Tsulas2 grind - about 66%
  33. Global $BlankPixel2
  34.     ; checks HP for NewbGrind - about 90%
  35. Global $BlankPixel3
  36.     ; checks HP for NewbGrind - about 99%
  37. Global $xCoord
  38. Global $yCoord
  39. Global $AttackLoop
  40. Global $AttackPixel
  41. Global $AttackPixelCount
  42. Global $BattleCheckSum
  43. Global $DungeonCheckSum
  44. Global $xPos
  45. Global $yPos
  46. Global $checkPixel
  47. Global $battleCheck
  48. Global $GenericContinue
  49. Global $ArenaContinue
  50. Global $NumberOfBattles
  51. Global $TsulasHP
  52. Global $TotalXP
  53. Global $EntireXP
  54. Global $startTime
  55. Global $entireTime
  56. Global $timeElapsed
  57. Global $CheckTimer
  58. ; CWA
  59. Global $CWACoord[2]
  60. Global $CWAContinue
  61. Global $NewCWACoord[2]
  62. ; UWA
  63. Global $UWACoord[2]
  64. Global $UWAContinue
  65. Global $NewUWACoord[2]
  66. ; Death check
  67. Global $DeathColor
  68. Global $DeathPixel
  69.  
  70. Global $ArenaXP[10][100]
  71.  
  72. ; FF, SVA, BWA, DFA, BRA, CWA, UWA, PGA, BI3
  73. Global $ArenaNumberOfBattles[10]=[0,96,96,97,94,89,22,33,87,33]
  74. ; FFXP - correct values and placement
  75. 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]
  76. ; SVAXP - correct values and placement
  77. Global $SVAXP[97]=[0,72,75,90,40,117,66,76,87,111,156,66,90,60,120,190,99,213,180,50,240,130,190,244,224,50,105,150,19,100,270,330,180,80,205,150,88,149,179,386,501,320,243,510,305,350,225,510,895,380,320,330,570,450,610,190,400,900,900,910,430,1065,520,900,390,745,1500,1530,1950,1100,1700,830,1180,1300,1760,452,2400,800,3075,1950,1100,1315,930,1350,3060,1315,1250,1550,830,1350,2925,4,950,490,980,1425,160]
  78. ; BWAXP - correct values and placement
  79. Global $BWAXP[98]=[0,110,110,150,140,70,100,180,200,320,99,80,220,100,270,270,550,1750,825,938,1360,54,397,1375,150,1845,1800,180,775,300,1300,2138,900,1300,830,1200,450,921,475,2000,600,950,1350,998,65,160,465,240,650,490,80,1560,1720,1130,400,1695,500,160,80,1260,1560,500,480,2400,1300,690,2720,1490,1380,500,2235,500,1440,2980,1050,1440,720,1220,500,1490,2160,1220,2235,500,1000,3450,2930,1360,3480,1200,1560,3120,2400,1000,2340,2160,2235,3000]
  80. ; DFAXP - correct values and placement
  81. Global $DFAXP[95]=[0,300,205,102,305,535,410,525,494,220,540,700,170,230,190,180,422,430,265,500,750,735,285,740,355,855,975,765,780,745,1020,1410,1175,675,287,305,1600,520,856,375,825,1249,1540,1234,1825,1005,1145,1430,330,725,1665,1360,1300,870,610,970,1310,1290,1285,3260,2875,906,7200,270,1979,2660,1320,3342,1194,1756,2046,4076,7426,992,4450,504,5972,2912,6916,2200,5432,968,6363,1300,3300,3257,1761,5824,7524,4354,6614,12848,7624,3801,11452]
  82. ; BRAXP - correct values - placement checked to here ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  83. Global $BRAXP[90]=[0,905,605,1150,280,3020,950,500,2390,1800,4125,730,3725,2340,465,3014,2016,2634,1920,3008,1560,2218,3240,1500,828,4410,1512,3020,450,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]
  84. ; CWAXP - correct values - placement not checked
  85. Global $CWAXP[23]=[0,1800,1800,1800,6350,5950,5850,7000,6700,6200,6700,7500,7850,7250,8000,12500,12500,15500,13333,13333,4444,9222,3472]
  86. ; UWAXP - correct values - placement not checked
  87. Global $UWAXP[34]=[0,2373,2373,2373,2373,2373,2373,2373,2373,2373,2373,7573,10400,13000,13000,15600,7573,10606,9574,10606,11514,6807,11200,11200,12432,8433,14000,16800,19000,25000,26400,14000,9464,36032]
  88. ; PGAXP - correct values - placement not checked
  89. Global $PGAXP[88]=[0,4800,3800,7884,8164,5210,7064,6400,2000,7000,10898,11146,7350,2600,5950,8850,9100,10100,8900,6900,11264,8100,6400,7500,8500,6273,5824,5996,6160,9900,11250,13400,13400,13600,8800,6650,8973,7673,13400,13110,16044,15664,8776,13368,13408,12465,14514,9941,10785,15947,12114,12233,14467,7885,20406,17318,14383,12088,15320,18066,15905,13379,13138,15980,14033,13300,16550,18227,15021,15236,11643,14526,13879,14537,19600,17707,18637,17386,25338,30117,12956,17530,15747,30888,32238,45038,56138,62138]
  90.  
  91. Global $guiExit
  92.  
  93. Global $ArenaExit[15]=[0, 225, 90, 130, 401, 417, 186, 586, 126, 705, 185, 705, 450, 633, 102]
  94. Global $ArenaRoomCount
  95. 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]
  96.  
  97. Global $grind_choice
  98.  
  99. Global $battleTextFind[2]
  100. Global $BattleFound
  101. $AttackColor1 = Dec("FFFFFF")
  102. $AttackColor2 = Dec("FFFEFF")
  103. $BlankColor1 = Dec("333333")
  104. $BattleTextColor = 0xFFFFFF
  105. $PadColor1 = 0xFC4744
  106. $PadColor2 = 0xFD4743
  107. $PadColor3 = 0xFB4744
  108. $ExitColor1 = 0xF8F6EA
  109. $DeathColor = Dec("86A89C")
  110. $UWEXitColor1 = 0x6DFCF6
  111.  
  112. Opt("WinTitleMatchMode", 2)
  113.  
  114. ;IE7/8
  115. WinActivate("[CLASS:IEFrame]", "")
  116. ;Firefox3
  117. WinActivate("CLASS:MozillaUIWindowClass]", "")
  118. ;Firefox4
  119. WinActivate("[CLASS:MozillaWindowClass]", "")
  120. ;Opera
  121. WinActivate("[CLASS:aPluginWinClass]", "")
  122. ;Opera
  123. WinActivate("[CLASS:OperaWindowClass]", "")
  124. ;Chrome
  125. WinActivate("[CLASS:Chrome_WidgetWin_0]", "")
  126.  
  127. WinGetPos(" [CLASS:NativeWindowClass] ", "")
  128.  
  129. ; generic coordinate finder
  130. $GCF1 = PixelSearch(1, 1, 2000, 2000, 0x333333, 10)
  131. $topLeft[0] = 10
  132. $topLeft[1] = 87
  133. $bottomRight[0] = $topLeft[0] + 739
  134. $bottomRight[1] = $topLeft[1] + 599
  135.  
  136. ;populate XP values
  137. For $xloop = 1 to 96
  138.     $ArenaXP[1][$xloop]=$FFXP[$xloop]
  139. Next
  140.  
  141. For $xloop = 1 to 96
  142.     $ArenaXP[2][$xloop]=$SVAXP[$xloop]
  143. Next
  144.  
  145. For $xloop = 1 to 97
  146.     $ArenaXP[3][$xloop]=$BWAXP[$xloop]
  147. Next
  148.  
  149. For $xloop = 1 to 94
  150.     $ArenaXP[4][$xloop]=$DFAXP[$xloop]
  151. Next
  152.  
  153. For $xloop = 1 to 89
  154.     $ArenaXP[5][$xloop]=$BRAXP[$xloop]
  155. Next
  156.  
  157. For $xloop = 1 to 22
  158.     $ArenaXP[6][$xloop]=$CWAXP[$xloop]
  159. Next
  160.  
  161. For $xloop = 1 to 33
  162.     $ArenaXP[7][$xloop]=$UWAXP[$xloop]
  163. Next
  164.  
  165. For $xloop = 1 to 87
  166.     $ArenaXP[8][$xloop]=$PGAXP[$xloop]
  167. Next
  168.  
  169.  
  170. $TotalRunCount=0
  171.  
  172. $screenWidth = $bottomRight[0] - $topLeft[0]
  173. $screenHeight = $bottomRight[1] - $topLeft[1]
  174.  
  175. $repeatagain = 1
  176.  
  177. ; GUI starts here
  178. #include <GUIConstantsEx.au3>
  179. #include <EditConstants.au3>
  180.  
  181. GUICreate("Sacred Seasons Bot", 800, 600)
  182.  
  183. Opt ("GUIResizeMode", 1)
  184.  
  185. Opt("GUICloseOnESC", 1)
  186.  
  187. GUICtrlCreateLabel("Top Left", 10, 10)
  188. $InputSize1 = GUICtrlCreateInput($topLeft[0], 10, 25, 100, 20)
  189. GUICtrlCreateLabel("Top Left", 140, 10)
  190. $InputSize2 = GUICtrlCreateInput($topLeft[1], 140, 25, 100, 20)
  191. GUICtrlCreateLabel("Bottom Right", 10, 50)
  192. $InputSize3 = GUICtrlCreateInput($bottomRight[0], 10, 65, 100, 20)
  193. GUICtrlCreateLabel("Bottom Right", 140, 50)
  194. $InputSize4 = GUICtrlCreateInput($bottomRight[1], 140, 65, 100, 20)
  195. GUICtrlCreateLabel("Window width", 10, 90)
  196. $InputSize5 = GUICtrlCreateInput($screenWidth, 10, 105, 100, 20, $ES_READONLY)
  197. GUICtrlCreateLabel("Window height", 140, 90)
  198. $InputSize6 = GUICtrlCreateInput($screenHeight, 140, 105, 100, 20, $ES_READONLY)
  199.  
  200. GUICtrlCreateLabel("The above coordinates are what the script found automatically.  If the values are zero or blank, 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 all browsers - IE7, IE8, Firefox 3, and Firefox 4, Opera, and Chrome.  If it doesn't work - please let me know.)", 10, 145, 260, 120)
  201.  
  202. 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)
  203.  
  204. $ContinueButton1 = GUICtrlCreateButton("Continue", 300, 550, 100)
  205.  
  206. GUICtrlCreateGroup("Select a option to grind:", 310, 10, 480, 250)
  207.  
  208. $choice_1 = GUICtrlCreateRadio("Newbie Grind", 330, 25, 210, 20)
  209. $choice_2 = GUICtrlCreateRadio("Flo's", 330, 45, 210, 20)
  210. $choice_3 = GUICtrlCreateRadio("Dunes F1", 330, 65, 210, 20)
  211. $choice_4 = GUICtrlCreateRadio("Snappers", 330, 105, 210, 20)
  212. $choice_5 = GUICtrlCreateRadio("Underworld D2 (Worm/Octogum/Frogs)", 330, 125, 210, 20)
  213. $choice_6 = GUICtrlCreateRadio("Underworld F4 (Charlotte / Choppers)", 330, 145, 210, 20)
  214. $choice_7 = GUICtrlCreateRadio("Dunes E3 (Mumma)", 330, 165, 240, 20)
  215. $choice_8 = GUICtrlCreateRadio("Underworld A3 (Green Dragons / Bubblers)", 330, 185, 210, 20)
  216. $choice_9 = GUICtrlCreateRadio("Underworld C2", 330, 205, 210, 20)
  217. $choice_10 = GUICtrlCreateRadio("Generic", 330, 225, 210, 20)
  218. $choice_11 = GUICtrlCreateRadio("Arena - FF", 600, 25, 180, 20)
  219. $choice_12 = GUICtrlCreateRadio("Arena - SVA", 600, 45, 180, 20)
  220. $choice_13 = GUICtrlCreateRadio("Arena - BWA", 600, 65, 180, 20)
  221. $choice_14 = GUICtrlCreateRadio("Arena - DFA", 600, 85, 180, 20)
  222. $choice_15 = GUICtrlCreateRadio("Arena - BRA", 600, 105, 180, 20)
  223. $choice_16 = GUICtrlCreateRadio("Arena - CWA", 600, 125, 180, 20)
  224. $choice_17 = GUICtrlCreateRadio("Arena - UWA", 600, 145, 180, 20)
  225. $choice_18 = GUICtrlCreateRadio("Dunes D3 (Scrabs)", 330, 85, 240, 20)
  226.  
  227. $choice_text = GUICtrlCreateLabel("", 310, 270, 450, 60)
  228.  
  229. $grind_choice = 0
  230.  
  231. $BuffBox = GUICtrlCreateCheckbox("Check to use buff at start of battle", 10, 325, 200, 20)
  232.  
  233. GUICtrlCreateLabel("Buff Spell to use first in battle (1 - 21) ", 55, 355)
  234. $BuffSpell1 = GUICtrlCreateInput("", 10, 350, 40, 20)
  235. GUICtrlCreateLabel("Maximum times to cast spell", 55, 380)
  236. $BuffCast1 = GUICtrlCreateInput("0", 10, 375, 40, 20)
  237.  
  238. $AttackBox = GUICtrlCreateCheckbox("Check to use attack at start of battle", 260, 325, 200, 20)
  239.  
  240. GUICtrlCreateLabel("Attack Spell to use first in battle (1 - 21) ", 305, 355)
  241. $AttackSpell1 = GUICtrlCreateInput("", 260, 350, 40, 20)
  242. GUICtrlCreateLabel("Maximum times to cast spell", 305, 380)
  243. $AttackCast1 = GUICtrlCreateInput("0", 260, 375, 40, 20)
  244.  
  245. $HealBox = GUICtrlCreateCheckbox("Check to use healing spell when HP is low", 510, 325, 250, 20)
  246.  
  247. GUICtrlCreateLabel("Healing spell to use in battle (1 - 21) ", 555, 355)
  248. $HealSpell1 = GUICtrlCreateInput("", 510, 350, 40, 20)
  249. GUICtrlCreateLabel("Cast spell when HP falls below %", 555, 380)
  250. $HealHPCast1 = GUICtrlCreateInput("33", 510, 375, 40, 20)
  251. GUICtrlCreateLabel("Only cast when SP is above %", 555, 405)
  252. $HealSPCast1 = GUICtrlCreateInput("33", 510, 400, 40, 20)
  253.  
  254. $TurboBox = GUICtrlCreateCheckBox("Check to use 'turbo' mode - can speed up script but may affect stability", 10, 450, 400, 20)
  255.  
  256. GUICtrlCreateGroup("", -99, -99, 1, 1)
  257.  
  258. GUISetState(@SW_SHOW)
  259.  
  260. While $guiExit <> 1
  261.     $msg = GUIGetMsg()
  262.     If $msg = $GUI_EVENT_CLOSE Then
  263.         Exit
  264.     EndIF
  265.     If $msg = $InputSize1 Then
  266.         $topLeft[0] = GUICtrlRead($InputSize1)
  267.         $screenWidth = $bottomRight[0] - $topLeft[0]
  268.         $screenHeight = $bottomRight[1] - $topLeft[1]
  269.         GUICtrlSetData($InputSize5, $screenWidth)
  270.     EndIf
  271.     If $msg = $InputSize2 Then
  272.         $topLeft[1] = GUICtrlRead($InputSize2)
  273.         $screenWidth = $bottomRight[0] - $topLeft[0]
  274.         $screenHeight = $bottomRight[1] - $topLeft[1]
  275.         GUICtrlSetData($InputSize6, $screenHeight)
  276.     EndIf
  277.     If $msg = $InputSize3 Then
  278.         $bottomRight[0] = GUICtrlRead($InputSize3)
  279.         $screenWidth = $bottomRight[0] - $topLeft[0]
  280.         $screenHeight = $bottomRight[1] - $topLeft[1]
  281.         GUICtrlSetData($InputSize5, $screenWidth)
  282.     EndIf
  283.     If $msg = $InputSize4 Then
  284.         $bottomRight[1] = GUICtrlRead($InputSize4)
  285.         $screenWidth = $bottomRight[0] - $topLeft[0]
  286.         $screenHeight = $bottomRight[1] - $topLeft[1]
  287.         GUICtrlSetData($InputSize6, $screenHeight)
  288.     EndIf
  289.     If $msg = $choice_1 Then
  290.         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.")
  291.         $grind_choice=1
  292.     EndIf
  293.     If $msg = $choice_2 Then
  294.         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.")
  295.         $grind_choice=2
  296.     EndIf
  297.     If $msg = $choice_3 Then
  298.         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.")
  299.         $grind_choice=3
  300.     EndIf
  301.     If $msg = $choice_4 Then
  302.         GUICtrlSetData($choice_text, "Move your character to Dunes F1 (Hector / Choppers) away from the entrance.  Your character must be able to complete the battles without dying or the script will fail.")
  303.         $grind_choice=4
  304.     EndIf
  305.     If $msg = $choice_5 Then
  306.         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.")
  307.         $grind_choice=5
  308.     EndIf
  309.     If $msg = $choice_6 Then
  310.         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.")
  311.         $grind_choice=6
  312.     EndIf
  313.     If $msg = $choice_7 Then
  314.         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.")
  315.         $grind_choice=7
  316.     EndIf
  317.     If $msg = $choice_8 Then
  318.         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.")
  319.         $grind_choice=8
  320.     EndIf
  321.     If $msg = $choice_9 Then
  322.         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.")
  323.         $grind_choice=9
  324.     EndIf
  325.     If $msg = $choice_10 Then
  326.         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.")
  327.         $grind_choice=10
  328.     EndIf
  329.     If $msg = $choice_11 Then
  330.         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.")
  331.         $grind_choice=11
  332.     EndIf
  333.     If $msg = $choice_12 Then
  334.         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.")
  335.         $grind_choice=12
  336.     EndIf
  337.     If $msg = $choice_13 Then
  338.         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.")
  339.         $grind_choice=13
  340.     EndIf
  341.     If $msg = $choice_14 Then
  342.         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.")
  343.         $grind_choice=14
  344.     EndIf
  345.     If $msg = $choice_15 Then
  346.         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.)")
  347.         $grind_choice=15
  348.     EndIf
  349.     If $msg = $choice_16 Then
  350.         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.")
  351.         $grind_choice=16
  352.     EndIf
  353.     If $msg = $choice_17 Then
  354.         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.")
  355.         $grind_choice=17
  356.     EndIf
  357.     If $msg = $choice_18 Then
  358.         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.")
  359.         $grind_choice=18
  360.     EndIf
  361. ;   If $msg = $choice_19 Then
  362. ;       GUICtrlSetData($choice_text, "Arena - PGA.  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.")
  363. ;       $grind_choice=19
  364. ;   EndIf
  365.     If ($msg = $ContinueButton1) AND ($grind_choice <> 0) Then
  366.         ; check if buff is checked
  367.         $BuffCheck = BitAnd(GUICtrlRead($BuffBox),$GUI_CHECKED)
  368.         If $BuffCheck = 1 Then
  369.             ; check to make sure spell # is between 1 - 21
  370.             $BuffSpellNumber = GUICtrlRead($BuffSpell1)
  371.             If ($BuffSpellNumber > 0) AND ($BuffSpellNumber < 22) Then
  372.                 $guiExit = 1
  373.             Else
  374.                 ; need to display some sort of error - NOT DONE YET
  375.                 $BuffDisplayError = 1
  376.             EndIf
  377.         Else
  378.             $guiExit = 1
  379.         EndIf
  380.         ; check if attack is checked
  381.         $AttackCheck = BitAnd(GUICtrlRead($AttackBox),$GUI_CHECKED)
  382.         If $AttackCheck = 1 Then
  383.             ; check to make sure spell # is between 1 - 21
  384.             $AttackSpellNumber = GUICtrlRead($AttackSpell1)
  385.             If ($AttackSpellNumber > 0) AND ($AttackSpellNumber < 22) Then
  386.                 $guiExit = 1
  387.             Else
  388.                 ; need to display some sort of error - NOT DONE YET
  389.                 $BuffDisplayError = 1
  390.             EndIf
  391.         Else
  392.             $guiExit = 1
  393.         EndIf
  394.         ; check if heal is checked
  395.         $HealCheck = BitAnd(GUICtrlRead($HealBox),$GUI_CHECKED)
  396.         If $HealCheck = 1 Then
  397.             ; check to make sure spell # is between 1 - 21
  398.             $HealSpellNumber = GUICtrlRead($HealSpell1)
  399.             If ($HealSpellNumber > 0) AND ($HealSpellNumber < 22) Then
  400.                 $guiExit = 1
  401.             Else
  402.                 ; need to display some sort of error - NOT DONE YET
  403.                 $BuffDisplayError = 1
  404.             EndIf
  405.             ; check that HP level is between 1 - 100
  406.             $HealHPCast = GUICtrlRead($HealHPCast1)
  407.             If ($HealHPCast > 0) AND ($HealHPCast < 100) Then
  408.                 $guiExit = 1
  409.             Else
  410.                 ; need to display some sort of error - NOT DONE YET
  411.                 $BuffDisplayError = 1
  412.             EndIf
  413.             ; check that SP level is between 1 - 100
  414.             $HealSPCast = GUICtrlRead($HealSPCast1)
  415.             If ($HealSPCast > 0) AND ($HealSPCast < 100) Then
  416.                 $guiExit = 1
  417.             Else
  418.                 ; need to display some sort of error - NOT DONE YET
  419.                 $BuffDisplayError = 1
  420.             EndIf
  421.         Else
  422.             $guiExit = 1
  423.         EndIf
  424.     EndIf
  425.     Sleep(50)
  426. WEnd
  427.  
  428. GUISetState(@SW_HIDE)
  429.  
  430. ; 0 if not checked, 1 if checked
  431. $BuffCheck = BitAnd(GUICtrlRead($BuffBox),$GUI_CHECKED)
  432. $AttackCheck = BitAnd(GUICtrlRead($AttackBox),$GUI_CHECKED)
  433. $HealCheck = BitAnd(GUICtrlRead($HealBox),$GUI_CHECKED)
  434. $TurboCheck = BitAnd(GUICtrlRead($TurboBox),$GUI_CHECKED)
  435.  
  436. $BuffMaxCast = GUICtrlRead($BuffCast1)
  437. $AttackMaxCast = GUICtrlRead($AttackCast1)
  438. $HealHPCast = GUICtrlRead($HealHPCast1)
  439. $HealSPCast = GUICtrlRead($HealSPCast1)
  440. $HealHPCoord = int ((($topLeft[0] + (139 * ($HealHPCast * .01))) + 88))
  441. $HealSPCoord = int ((($topLeft[0] + (139 * ($HealSPCast * .01))) + 245))
  442.  
  443.  
  444. WinActivate ("[CLASS:IEFrame]", "")
  445. WinActivate ("[CLASS:MozillaUIWindowClass]", "")
  446. WinActivate ("[CLASS:MozillaWindowClass]", "")
  447.  
  448. $entireTime = TimerInit()
  449.  
  450. While $repeatagain < 6000
  451. $startTime = TimerInit()
  452. $TotalXP=0
  453.  
  454. ; for casting spells only a certain number of times
  455. $BuffRemain = $BuffMaxCast
  456. $AttackRemain = $AttackMaxCast
  457.  
  458. If $grind_choice=1 Then
  459.     NewbGrind()
  460. EndIf
  461. If $grind_choice=2 Then
  462.     GrindBW_A3()
  463. EndIf
  464. If $grind_choice=3 Then
  465.     GrindDD_F1()
  466. EndIf
  467. If $grind_choice=4 Then
  468.     GrindDD_A5()
  469. EndIf
  470. If $grind_choice=5 Then
  471.     GrindUW_D2()
  472. EndIf
  473. If $grind_choice=6 Then
  474.     GrindUW_F4()
  475. EndIf
  476. If $grind_choice=7 Then
  477.     GrindDD_E3()
  478. EndIf
  479. If $grind_choice=8 Then
  480.     GrindUW_B4()
  481. EndIf
  482. If $grind_choice=9 Then
  483.     GrindUW_C2()
  484. EndIf
  485. If $grind_choice=10 Then
  486.     Generic()
  487. EndIf
  488. If $grind_choice=11 Then
  489.     $ArenaNumber = 1
  490.     ArenaGrind2()
  491. EndIf
  492. If $grind_choice=12 Then
  493.     $ArenaNumber = 2
  494.     ArenaGrind2()
  495. EndIf
  496. If $grind_choice=13 Then
  497.     $ArenaNumber = 3
  498.     ArenaGrind2()
  499. EndIf
  500. If $grind_choice=14 Then
  501.     $ArenaNumber = 4
  502.     ArenaGrind2()
  503. EndIf
  504. If $grind_choice=15 Then
  505.     $ArenaNumber = 5
  506.     ArenaGrind2()
  507. EndIf
  508. If $grind_choice=16 Then
  509.     $ArenaNumber = 6
  510.     ArenaCWA()
  511. EndIf
  512. If $grind_choice=17 Then
  513.     $ArenaNumber = 7
  514.     ArenaUWA()
  515. EndIf
  516. If $grind_choice=18 Then
  517.     GrindDD_D3()
  518. EndIf
  519. If $grind_choice=19 Then
  520.     $ArenaNumber = 8
  521.     ArenaGrind2()
  522. EndIf
  523.  
  524.  
  525. $EntireXP = $EntireXP + $TotalXP
  526. $timeElapsed = TimerDiff($startTime)
  527. $entireTimeElapsed = TimerDiff($entireTime)
  528. $TotalRunCount = $TotalRunCount + 1
  529. ;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)
  530. ;ConsoleWrite("TotalXP=" & $TotalXP & @CRLF)
  531. ;ConsoleWrite("EntireXP=" & $EntireXP & @CRLF & @CRLF)
  532. If $TurboCheck = 0 Then
  533.     MsgBox(160, "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)
  534. Else
  535.     MsgBox(160, "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, 2)
  536. EndIf
  537.  
  538.  
  539. $repeatagain = $repeatagain + 1
  540. WEnd
  541.  
  542.  
  543.  
  544. Func AttackGrid()
  545.    
  546.     ; top left
  547.     Attack(449, 190)
  548.    
  549.     ; middle left
  550.     Attack (500, 290)
  551.    
  552.    
  553.     ; bottom left
  554.     Attack (548, 390)
  555.    
  556.  
  557.     ; bottom right
  558.     Attack (703, 385)
  559.  
  560.     ; middle right
  561.     Attack (667, 300)
  562.    
  563.    
  564.     ; top right
  565.     Attack (616, 205)
  566.    
  567.    
  568.    
  569.     ;additional
  570.     ;Attack (667, 330)
  571.    
  572.     ;additioanl;Attack (616, 225)
  573.  
  574.    
  575. EndFunc
  576.  
  577. Func Attack($x, $y)
  578.     MouseMove(($topLeft[0]+$x), ($topLeft[1]+$y), 0)
  579.     MouseClick("left")
  580. EndFunc
  581.  
  582.  
  583. Func findAttack2()
  584.     $coord2 = PixelSearch($topLeft[0]+333, $topLeft[1]+200, $topLeft[0]+338, $topLeft[1]+343, $AttackColor1, 10)
  585.     If @error=1 Then
  586.         $coord[0]=1
  587.         $coord[1]=1
  588.         If $TurboCheck = 0 Then
  589.             Sleep(200)
  590.         Else
  591.             Sleep(20)
  592.         EndIf
  593.         Return ($coord)
  594.     EndIf
  595.     ; search again in case it found pixels in mid-search
  596.     Sleep(300)
  597.     $coord2 = PixelSearch($topLeft[0]+333, $topLeft[1]+200, $topLeft[0]+338, $topLeft[1]+343, $AttackColor1, 10)
  598.     If @error=1 Then
  599.         $coord[0]=1
  600.         $coord[1]=1
  601.         If $TurboCheck = 0 Then
  602.             Sleep(200)
  603.         Else
  604.             Sleep(20)
  605.         EndIf
  606.         Return ($coord)
  607.     EndIf
  608.     $coord[0] = $topLeft[0] + 345
  609.     $coord[1] = $coord2[1] + 30
  610.     Return($coord)
  611. EndFunc
  612.  
  613. Func Terminate()
  614.     Exit
  615. EndFunc
  616.  
  617. Func Battle($x, $y)
  618.     ; first - make sure pad is there
  619.     $padwait = 0
  620.     While $padwait = 0
  621.         $waitCoord = PixelSearch($x - 10,$y - 10,$x + 10,$y + 10,$PadColor1, 5)
  622.         If @error <> 1 Then
  623.             $padwait=1
  624.         EndIf
  625.         Sleep(100)
  626.     WEnd
  627.     ; get section to check for screen change
  628.     $BattleCheckSum = PixelChecksum(($topLeft[0]+658),($topLeft[1]+478),($topLeft[0]+725),($topLeft[1]+493))
  629.     ; now enter battle
  630.     MouseMove($x, $y, 3)
  631.     ; this helps with lag stability - 11/06
  632.     If $TurboCheck = 0 Then
  633.         Sleep(1000)
  634.     Else
  635.         Sleep(50)
  636.     EndIf
  637.     MouseClick("left")
  638.     If $TurboCheck = 0 Then
  639.         Sleep(100)
  640.     Else
  641.         Sleep(10)
  642.     EndIf
  643.     ; click on character check
  644.     While CharClickCheck() = 1
  645.         MouseMove($x, $y ,3)
  646.         If $TurboCheck = 0 Then
  647.             Sleep(100)
  648.         EndIf
  649.         MouseClick("left")
  650.         If $TurboCheck = 0 Then
  651.             Sleep(100)
  652.         EndIf
  653.     WEnd
  654.  
  655.     ; if battle hasn't started after 3 seconds, maybe battle pad
  656.     ; wasn't clicked - click it again
  657.     $EnterBattleCheck = 0
  658.     While $BattleCheckSum = PixelChecksum(($topLeft[0]+658),($topLeft[1]+478),($topLeft[0]+725),($topLeft[1]+493))
  659.         Sleep(100)
  660.         $EnterBattleCheck = $EnterBattleCheck + 1
  661.         If $EnterBattleCheck > 40 Then
  662.             ; search for pad in vicinity of where you previously clicked
  663.             $BattleCheckCoord = PixelSearch($x-50,$y-40,$x+5,$y+5,$PadColor2, 5)
  664.             ;Battle($ArenaCoord[0]+3, $ArenaCoord[1]+13)
  665.             MouseMove($BattleCheckCoord[0]+3, $BattleCheckCoord[1]+13, 3)
  666.             Sleep(100)
  667.             MouseClick("left")
  668.             Sleep(500)
  669.         EndIf
  670.     WEnd
  671.     ; this section checks to see if you immediately exit a battle
  672.     ; for multiplayer - the battle is already over
  673.     ; sleep is necessary so we skip screen change to blank
  674.     Sleep(1000)
  675.     If $BattleCheckSum = PixelChecksum(($topLeft[0]+658),($topLeft[1]+478),($topLeft[0]+725),($topLeft[1]+493)) Then
  676.         $NumberOfBattles=$NumberOfBattles+1
  677.         Return
  678.     EndIf
  679.     ; kill all creatures
  680.     ;$BattleCheckSum = PixelCheckSum(186,400,205,414)
  681.     $BattleCheckSum = PixelCheckSum(($topLeft[0]+75),($topLeft[1]+253),($topLeft[0]+94),($topLeft[1]+267))
  682.  
  683.     ; buff spells
  684.     $BuffRemain = $BuffRemain - 1
  685.     If ($BuffCheck = 1) AND ($BuffRemain >= 0) Then
  686.  
  687.         ; do findattack2 until battlecoord > 1
  688.         $battleCoord[0] = 1
  689.         While $battleCoord[0] = 1
  690.             $battleCoord = findAttack2()
  691.         WEnd
  692.         $battleCoord[1] = $battleCoord[1] + 22
  693.         ; click on skill
  694.         MouseMove($battleCoord[0], $battleCoord[1], 1)
  695.         If $TurboCheck = 0 Then
  696.             Sleep(200)
  697.         Else
  698.             Sleep(20)
  699.         EndIf
  700.         MouseClick("left")
  701.         ; click on astral travel 3 / skill of choice
  702.         If $TurboCheck = 0 Then
  703.             Sleep(500)
  704.         Else
  705.             Sleep(50)
  706.         EndIf
  707.         MouseMove($topLeft[0]+$BuffCoords[(($BuffSpellNumber*2)-1)],$topLeft[1]+$BuffCoords[(($BuffSpellNumber*2))], 1)
  708.         If $TurboCheck = 0 Then
  709.             Sleep(200)
  710.         Else
  711.             Sleep(20)
  712.         EndIf
  713.         MouseClick("left")
  714.         ; click on character
  715.         If $TurboCheck = 0 Then
  716.             Sleep(200)
  717.         Else
  718.             Sleep(20)
  719.         EndIf
  720.         MouseMove($topLeft[0]+213, $topLeft[1]+200, 1)
  721.         If $TurboCheck = 0 Then
  722.             Sleep(200)
  723.         Else
  724.             Sleep(20)
  725.         EndIf
  726.         MouseClick("left")
  727.         ; click on cancel (if not enough sp)
  728.         MouseMove($topLeft[0]+368, $topLeft[1]+415, 1)
  729.         If $TurboCheck = 0 Then
  730.             Sleep(200)
  731.         Else
  732.             Sleep(20)
  733.         EndIf
  734.         MouseClick("left")
  735.         If $TurboCheck = 0 Then
  736.             Sleep(200)
  737.         Else
  738.             Sleep(20)
  739.         EndIf
  740.  
  741.         ; end buff
  742.     EndIf
  743.  
  744.     ; attack spells
  745.     $AttackRemain = $AttackRemain - 1
  746.     If ($AttackCheck = 1) AND ($AttackRemain >= 0) Then
  747.  
  748.         ; do findattack2 until battlecoord > 1
  749.         $battleCoord[0] = 1
  750.         While $battleCoord[0] = 1
  751.             $battleCoord = findAttack2()
  752.         WEnd
  753.         $battleCoord[1] = $battleCoord[1] + 22
  754.         ; click on skill
  755.         MouseMove($battleCoord[0], $battleCoord[1], 1)
  756.         If $TurboCheck = 0 Then
  757.             Sleep(200)
  758.         Else
  759.             Sleep(20)
  760.         EndIf
  761.         MouseClick("left")
  762.         ; click on attack skill of choice
  763.         If $TurboCheck = 0 Then
  764.             Sleep(500)
  765.         Else
  766.             Sleep(50)
  767.         EndIf
  768.         MouseMove($topLeft[0]+$BuffCoords[(($AttackSpellNumber*2)-1)],$topLeft[1]+$BuffCoords[(($AttackSpellNumber*2))], 1)
  769.         If $TurboCheck = 0 Then
  770.             Sleep(200)
  771.         Else
  772.             Sleep(20)
  773.         EndIf
  774.         MouseClick("left")
  775.         ; click on enemies
  776.         If $TurboCheck = 0 Then
  777.             Sleep(200)
  778.         Else
  779.             Sleep(20)
  780.         EndIf
  781.         AttackGrid()
  782.         ; click on cancel (if not enough sp)
  783.         MouseMove($topLeft[0]+368, $topLeft[1]+415, 1)
  784.         If $TurboCheck = 0 Then
  785.             Sleep(200)
  786.         Else
  787.             Sleep(20)
  788.         EndIf
  789.         MouseClick("left")
  790.         If $TurboCheck = 0 Then
  791.             Sleep(200)
  792.         Else
  793.             Sleep(20)
  794.         EndIf
  795.  
  796.         ; end buff
  797.     EndIf
  798.    
  799.     ChatActivate()
  800.    
  801.     $AttackPanic1Time = TimerInit()
  802.     ; $BattleIsDone - set to 1 if BattleCheckSum confirms battle is over
  803.     $BattleIsDone = 0
  804.     ;While $BattleCheckSum = PixelCheckSum(($topLeft[0]+75),($topLeft[1]+253),($topLeft[0]+94),($topLeft[1]+267))
  805.     While $BattleIsDone = 0
  806.         ; first check for healing
  807.         ; check for health below HealHPCoord
  808.         If ($HealCheck = 1) Then
  809.  
  810.         $HealCheckPixel = PixelGetColor(($HealHPCoord), ($topLeft[1]+458))
  811.         $SpellCheckPixel = PixelGetColor(($HealSPCoord), ($topLeft[1]+458))
  812.         If $HealCheckPixel = $BlankColor1 Then
  813.             If $SpellCheckPixel <> $BlankColor1 Then
  814.                 ; do findattack2 until battlecoord > 1
  815.                 $battleCoord[0] = 1
  816.                 While $battleCoord[0] = 1
  817.                     $battleCoord = findAttack2()
  818.                 WEnd
  819.                 $battleCoord[1] = $battleCoord[1] + 22
  820.                 ; click on skill
  821.                 MouseMove($battleCoord[0], $battleCoord[1], 1)
  822.                 If $TurboCheck = 0 Then
  823.                     Sleep(200)
  824.                 Else
  825.                     Sleep(20)
  826.                 EndIf
  827.                 MouseClick("left")
  828.                 ; click on heal skill of choice
  829.                 If $TurboCheck = 0 Then
  830.                     Sleep(500)
  831.                 Else
  832.                     Sleep(50)
  833.                 EndIf
  834.                 MouseMove($topLeft[0]+$BuffCoords[(($HealSpellNumber*2)-1)],$topLeft[1]+$BuffCoords[(($HealSpellNumber*2))], 1)
  835.                 If $TurboCheck = 0 Then
  836.                     Sleep(200)
  837.                 Else
  838.                     Sleep(20)
  839.                 EndIf
  840.                 MouseClick("left")
  841.                 ; click on character
  842.                 If $TurboCheck = 0 Then
  843.                     Sleep(200)
  844.                 Else
  845.                     Sleep(20)
  846.                 EndIf
  847.                 MouseMove($topLeft[0]+213, $topLeft[1]+200, 1)
  848.                 If $TurboCheck = 0 Then
  849.                     Sleep(200)
  850.                 Else
  851.                     Sleep(20)
  852.                 EndIf
  853.                 MouseClick("left")
  854.                 ; getting lag problems so lets click twice
  855.                 Sleep (100)
  856.                 MouseClick("left")
  857.                 ; click on cancel (if not enough sp)
  858.                 MouseMove($topLeft[0]+368, $topLeft[1]+415, 1)
  859.                 If $TurboCheck = 0 Then
  860.                     Sleep(200)
  861.                 Else
  862.                     Sleep(20)
  863.                 EndIf
  864.                 MouseClick("left")
  865.                 If $TurboCheck = 0 Then
  866.                     Sleep(200)
  867.                 Else
  868.                     Sleep(20)
  869.                 EndIf
  870.  
  871.                 ; end heal
  872.             EndIf
  873.         EndIf
  874.  
  875.         EndIf
  876.  
  877.         ; then do attack
  878.         $battleCoord = findAttack2()
  879.         If $battleCoord[0] > 1 Then
  880.             MouseMove($battleCoord[0], $battleCoord[1], 0)
  881.             Sleep(20)
  882.             MouseClick("Left")
  883.             AttackGrid()
  884.             $AttackPanic1Time = TimerInit()
  885.         EndIf
  886.         $AttackPanic2Time = TimerDiff($AttackPanic1Time)
  887.         If $AttackPanic2Time > 12000 Then
  888.             ; first - click on cancel
  889.             MouseMove($topLeft[0]+368, $topLeft[1]+415, 1)
  890.             Sleep(200)
  891.             MouseClick("left")
  892.             ; then attack again
  893.             AttackGrid()
  894.             $AttackPanic1Time = TimerInit()
  895.         EndIf
  896.         ;$BattleCheckSum = PixelCheckSum(($topLeft[0]+75),($topLeft[1]+253),($topLeft[0]+94),($topLeft[1]+267))
  897.         If $BattleCheckSum <> PixelCheckSum(($topLeft[0]+75),($topLeft[1]+253),($topLeft[0]+94),($topLeft[1]+267)) Then
  898.             Sleep(500)
  899.             If $BattleCheckSum <> PixelCheckSum(($topLeft[0]+75),($topLeft[1]+253),($topLeft[0]+94),($topLeft[1]+267)) Then
  900.                 $BattleIsDone=1
  901.             EndIf
  902.         EndIf
  903.     WEnd
  904.     ; fight over - click box
  905.     ; check HP first
  906.     $BlankPixel = PixelGetColor(($topLeft[0]+182), ($topLeft[1]+458))
  907.     $BlankPixel2 = PixelGetColor(($topLeft[0]+216), ($topLeft[1]+458))
  908.     $BlankPixel3 = PixelGetColor(($topLeft[0]+226), ($topLeft[1]+458))
  909.     MouseMove(($topLeft[0]+372),($topLeft[1]+364),1)
  910.     ; a little pause to see your stats
  911.     If $TurboCheck = 0 Then
  912.         Sleep(2000)
  913.     EndIf
  914.     $BattleCheckSum = PixelCheckSum(($topLeft[0]+75),($topLeft[1]+253),($topLeft[0]+94),($topLeft[1]+267))
  915.     MouseClick("left")
  916.     ; another death check
  917.     If (DeathCheck() = 1) Then
  918.         $continue=2
  919.         ;MsgBox(8192, "You died! (battle check)", "You died!", 1)
  920.     Else
  921.         While $BattleCheckSum = PixelCheckSum(($topLeft[0]+75),($topLeft[1]+253),($topLeft[0]+94),($topLeft[1]+267))
  922.             Sleep(100)
  923.         WEnd
  924.         ; this helps with lag stability - 11/06
  925.         If $TurboCheck = 0 Then
  926.             Sleep(500)
  927.         Else
  928.             Sleep(50)
  929.         EndIf
  930.     EndIf
  931.     $NumberOfBattles=$NumberOfBattles+1
  932. EndFunc
  933.  
  934. Func DungeonPad($x, $y)
  935.     ; checks for changes in bottom right corner
  936.     MouseMove($x, $y ,1)
  937.     Sleep(100)
  938.     $DungeonCheckSum = PixelChecksum(($topLeft[0]+658),($topLeft[1]+474),($topLeft[0]+725),($topLeft[1]+493))
  939.     MouseClick("left")
  940.     Sleep(100)
  941.     While CharClickCheck() = 1
  942.         MouseMove($x, $y, 3)
  943.         Sleep(100)
  944.         MouseClick("left")
  945.         Sleep(100)
  946.     WEnd
  947.     While $DungeonCheckSum = PixelChecksum(($topLeft[0]+658),($topLeft[1]+474),($topLeft[0]+725),($topLeft[1]+493))
  948.         If $TurboCheck = 0 Then
  949.             Sleep(1000)
  950.         Else
  951.             Sleep(50)
  952.         EndIf
  953.     WEnd
  954. EndFunc
  955.  
  956. Func DungeonPad2($x, $y)
  957.     ; checks for changes in top right corner
  958.     MouseMove($x, $y ,2)
  959.     Sleep(100)
  960.     $DungeonCheckSum = PixelChecksum(($topLeft[0]+384),($topLeft[1]+216),($topLeft[0]+673),($topLeft[1]+63),($topLeft[0]+709),($topLeft[1]+83))
  961.     MouseClick("left")
  962.     Sleep(100)
  963.     While CharClickCheck() = 1
  964.         MouseMove($x, $y, 3)
  965.         Sleep(100)
  966.         MouseClick("left")
  967.         Sleep(100)
  968.     WEnd
  969.     While $DungeonCheckSum = PixelChecksum(($topLeft[0]+384),($topLeft[1]+216), ($topLeft[0]+673),($topLeft[1]+63), ($topLeft[0]+709),($topLeft[1]+83))
  970.         If $TurboCheck = 0 Then
  971.             Sleep(1000)
  972.         Else
  973.             Sleep(50)
  974.         EndIf
  975.     WEnd
  976. EndFunc
  977.  
  978. Func WaitForPads()
  979.     $padwait=1
  980.     While $padwait < 2
  981.         ; death check
  982.         If (DeathCheck() = 1) Then
  983.             $continue = 2
  984.             $padwait=$padwait+1
  985.             MsgBox(8192, "You died! (Padcheck)", "You died!", 1)
  986.         EndIf
  987.         ; 117 avoids the non play area, 177 avoids entrance in arenas
  988.         ; these should probably be 117?
  989.         ; UW needs to be 117 for DD_E3
  990.         $waitCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-177,$ExitColor1, 5)
  991.         If @error <> 1 Then
  992.             $padwait=$padwait+1
  993.         EndIf
  994.  
  995.         $waitCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-177,$PadColor1, 5)
  996.         If @error <> 1 Then
  997.             $padwait=$padwait+1
  998.         EndIf
  999.         $waitCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-117,$UWExitColor1, 5)
  1000.         If @error <> 1 Then
  1001.             $padwait=$padwait+1
  1002.         EndIf
  1003.         If $TurboCheck = 0 Then
  1004.             Sleep(500)
  1005.         Else
  1006.             Sleep(50)
  1007.         EndIf
  1008.     WEnd
  1009.  
  1010. EndFunc
  1011.  
  1012. Func GrindTsulas2()
  1013.     $TsulasHP = 1
  1014.     While $TsulasHP = 1
  1015.         ; enter Tsulas
  1016.         DungeonPad(($topLeft[0]+369),($topLeft[1]+283))
  1017.         WaitForPads()
  1018.  
  1019.         ; enter first battle - bottom - 4 creatures
  1020.         Battle(($topLeft[0]+278),($topLeft[1]+410))
  1021.         WaitForPads()
  1022.         $TotalXP=$TotalXP+950
  1023.  
  1024.         ;$BlankPixel = PixelGetColor(($topLeft[0]+176), ($topLeft[1]+455))
  1025.         If ($BlankPixel = $BlankColor1) Then
  1026.             $TsulasHP = 2
  1027.         Else
  1028.             ; click to exit Tsulas
  1029.             ;DungeonPad(676, 316)
  1030.             DungeonPad(($topLeft[0]+565),($topLeft[1]+169))
  1031.  
  1032.             ; move away from Tsulas
  1033.             CharMove(($topLeft[0]+444),($topLeft[1]+406))
  1034.             If $TurboCheck = 0 Then
  1035.                 Sleep(1000)
  1036.             Else
  1037.                 Sleep(50)
  1038.             EndIf
  1039.         EndIf
  1040.     WEnd
  1041.  
  1042.     ; enter second battle - 4 creatures
  1043.     Battle(($topLeft[0]+228),($topLeft[1]+217))
  1044.     WaitForPads()
  1045.  
  1046.     ; click to exit Tsulas
  1047.     DungeonPad(($topLeft[0]+565),($topLeft[1]+169))
  1048.  
  1049.     ; move away from Tsulas
  1050.     CharMove(($topLeft[0]+444),($topLeft[1]+406))
  1051.     If $TurboCheck = 0 Then
  1052.         Sleep(1000)
  1053.     Else
  1054.         Sleep(50)
  1055.     EndIf
  1056.     $TotalXP=$TotalXP+550
  1057. EndFunc
  1058.  
  1059. Func GrindBW_A3()
  1060.     ; enter Bleakwoods A3
  1061.     DungeonPad(($topLeft[0]+490),($topLeft[1]+251))
  1062.     WaitForPads()
  1063.  
  1064.     ; enter first battle - right
  1065.     Battle(($topLeft[0]+514),($topLeft[1]+263))
  1066.     WaitForPads()
  1067.  
  1068.     ; enter second battle - left
  1069.     Battle(($topLeft[0]+225),($topLeft[1]+215))
  1070.     WaitForPads()
  1071.  
  1072.     ; click to exit Bleakwoods A3
  1073.     DungeonPad(($topLeft[0]+609),($topLeft[1]+407))
  1074.     WaitForPads()
  1075.  
  1076.     ; move away from Bleakwoods A3
  1077.     CharMove(($topLeft[0]+396),($topLeft[1]+296))
  1078.     If $TurboCheck = 0 Then
  1079.         Sleep(1000)
  1080.     Else
  1081.         Sleep(50)
  1082.     EndIf
  1083.     $TotalXP=$TotalXP+1617
  1084. EndFunc
  1085.  
  1086. Func GrindUW_C2()
  1087.     ; enter Dunes F1
  1088.     DungeonPad(($topLeft[0]+370),($topLeft[1]+264))
  1089.     WaitForPads()
  1090.  
  1091.     ; enter first battle - right
  1092.     Battle(($topLeft[0]+538),($topLeft[1]+157))
  1093.     WaitForPads()
  1094.  
  1095.     CharMove(($topLeft[0]+412),($topLeft[1]+266))
  1096.    
  1097.     ; enter second battle - left
  1098.     Battle(($topLeft[0]+298),($topLeft[1]+181))
  1099.     WaitForPads()
  1100.    
  1101.     ; enter last battle - up
  1102.     Battle(($topLeft[0]+417),($topLeft[1]+168))
  1103.  
  1104.     ; click to exit Dunes F1
  1105.     DungeonPad(($topLeft[0]+202), ($topLeft[1]+445))
  1106.     WaitForPads()
  1107.  
  1108.     ; move away from Dunes  F1
  1109.     CharMove(($topLeft[0]+368),($topLeft[1]+357))
  1110.     If $TurboCheck = 0 Then
  1111.         Sleep(1000)
  1112.     Else
  1113.         Sleep(50)
  1114.     EndIf
  1115.     $TotalXP=$TotalXP+1617
  1116. EndFunc
  1117.  
  1118. Func GrindUW_D2()
  1119.     ; enter Underworld D2
  1120.     DungeonPad(($topLeft[0]+369),($topLeft[1]+431))
  1121.     WaitForPads()
  1122.  
  1123.     ; enter third battle
  1124.     Battle(($topLeft[0]+562),($topLeft[1]+263))
  1125.     WaitForPads()
  1126.  
  1127.     ; enter first battle
  1128.     Battle(($topLeft[0]+395),($topLeft[1]+347))
  1129.     WaitForPads()
  1130.  
  1131.     ; enter second battle
  1132.     Battle(($topLeft[0]+203),($topLeft[1]+180))
  1133.     WaitForPads()
  1134.  
  1135.     ; exit Underworld D2
  1136.     DungeonPad(($topLeft[0]+57),($topLeft[1]+467))
  1137.  
  1138.     ; move away from Underworld D2
  1139.     CharMove(($topLeft[0]+279),($topLeft[1]+377))
  1140.     If $TurboCheck = 0 Then
  1141.         Sleep(1000)
  1142.     Else
  1143.         Sleep(50)
  1144.     EndIf
  1145.     $TotalXP=$TotalXP+3610
  1146. EndFunc
  1147.  
  1148. Func GrindUW_F4()
  1149.     ; enter Underworld F4
  1150.     DungeonPad(($topLeft[0]+657), ($topLeft[1]+335))
  1151.     WaitForPads()
  1152.  
  1153.     ; enter first battle
  1154.     Battle(($topLeft[0]+394), ($topLeft[1]+203))
  1155.     WaitForPads()
  1156.  
  1157.     ; enter second battle
  1158.     Battle(($topLeft[0]+514), ($topLeft[1]+287))
  1159.     WaitForPads()
  1160.  
  1161.     ; enter third battle
  1162.     Battle(($topLeft[0]+466), ($topLeft[1]+311))
  1163.     WaitForPads()
  1164.  
  1165.     ; exit Underworld F4
  1166.     DungeonPad(($topLeft[0]+177), ($topLeft[1]+382))
  1167.  
  1168.     ; move away from Underworld F4
  1169.     CharMove(($topLeft[0]+540), ($topLeft[1]+309))
  1170.     If $TurboCheck = 0 Then
  1171.         Sleep(1000)
  1172.     Else
  1173.         Sleep(50)
  1174.     EndIf
  1175.     $TotalXP=$TotalXP+4787
  1176. EndFunc
  1177.  
  1178. Func Generic()
  1179.     ; enter dungeon
  1180.     ; Find pad
  1181.     $GenericContinue = 1
  1182.     $genericCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$PadColor2, 5)
  1183.     If @error=1 Then
  1184.         MouseMove(($topLeft[0]+433), ($topLeft[1]+390), 1)
  1185.         If $TurboCheck = 0 Then
  1186.             Sleep(100)
  1187.         Else
  1188.             Sleep(20)
  1189.         EndIf
  1190.         MouseClick("left")
  1191.         If $TurboCheck = 0 Then
  1192.             Sleep(1000)
  1193.         Else
  1194.             Sleep(50)
  1195.         EndIf
  1196.         $genericCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$PadColor2, 5)
  1197.     EndIf
  1198.     $GenericEntrance[0] = $genericCoord[0]
  1199.     $GenericEntrance[1] = $genericCoord[1]
  1200.  
  1201.     DungeonPad($genericCoord[0]+3, $genericCoord[1]+13)
  1202.     WaitForPads()
  1203.  
  1204.     ; Find Battle
  1205.     While $GenericContinue = 1
  1206.         sleep(500)
  1207.         $genericCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$PadColor2, 5)
  1208.         $CheckPixel = PixelSearch($genericCoord[0], $genericCoord[1]+39, $genericCoord[0],$genericCoord[1]+38,0xFFFFFF, 5)
  1209.         If @error = 0 Then
  1210.             Battle($genericCoord[0]+3, $genericCoord[1]+13)
  1211.             WaitForPads()
  1212.         Else
  1213.             $newGenCoord[0]=$genericCoord[0]
  1214.             $newGenCoord[1]=$genericCoord[1]
  1215.             $genericCoord = PixelSearch($topLeft[0],$newGenCoord[1]+40,$bottomRight[0],$bottomRight[1]-119,$PadColor2, 5)
  1216.             If @error=1 Then
  1217.                 $GenericContinue = 2
  1218.             Else
  1219.                 Battle($genericCoord[0]+3, $genericCoord[1]+13)
  1220.                 WaitForPads()
  1221.             EndIf
  1222.         EndIf
  1223.     WEnd
  1224.  
  1225.     ; exit dungeon
  1226.     $genericCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$PadColor2, 5)
  1227.     DungeonPad($genericCoord[0]+3, $genericCoord[1]+13)
  1228.  
  1229.     WaitForPads()
  1230.     ; move away from dungeon
  1231.  
  1232.     CharMove(($GenericEntrance[0]+50), ($GenericEntrance[1]))
  1233.     CharMove(($GenericEntrance[0]), ($GenericEntrance[1]-50))
  1234.     CharMove(($GenericEntrance[0]-50), ($GenericEntrance[1]))
  1235.     CharMove(($GenericEntrance[0]-50), ($GenericEntrance[1]+50))
  1236.     If $TurboCheck = 0 Then
  1237.         Sleep(1000)
  1238.     Else
  1239.         Sleep(50)
  1240.     EndIf
  1241.     $TotalXP=$TotalXP+1
  1242. EndFunc
  1243.  
  1244. Func ArenaCWA()
  1245.     ; start script in arena in first room with battles (not in lobby)
  1246.     ; if you die, you will return to the arena and start over
  1247.     ; if you make it through, you need to stop the script!
  1248.     ; this one is different so you do NOT need to be able to
  1249.     ;   survive through the first room!
  1250.     ;
  1251.  
  1252.     ; ability to repeat this arena not working yet
  1253.  
  1254.     $continue = 1
  1255.  
  1256.     ; Find Battle
  1257.     While $continue = 1
  1258.         ; **** This section may need some work
  1259.         CharMove(($topLeft[0]+374), ($topLeft[1]+256))
  1260.         CharMove(($topLeft[0]+389), ($topLeft[1]+313))
  1261.         ; find white pad
  1262.         WaitForPads()
  1263.         $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$ExitColor1)
  1264.         If @error=1 Then
  1265.             $exitCoord[0] = $topLeft[0]
  1266.             $exitCoord[1] = $topLeft[1]
  1267.         Else
  1268.             $exitCoord[0]=$arenaCoord[0]
  1269.             $exitCoord[1]=$arenaCoord[1]
  1270.         EndIf
  1271.  
  1272.         $battleCheck = 1
  1273.  
  1274.         While $battleCheck = 1
  1275.             ; next search for battle pads
  1276.             WaitForPads()
  1277.             $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$PadColor1)
  1278.             If @error=1 Then
  1279.                 $battleCheck = 2
  1280.             Else
  1281.                 Battle($arenaCoord[0], $arenaCoord[1])
  1282.                 WaitForPads()
  1283.                 $TotalXP=$TotalXP+$CWAXP[$NumberOfBattles]
  1284.             EndIf
  1285.         Wend
  1286.         WaitForPads()
  1287.         ; death check
  1288.         If (DeathCheck() = 1) Then
  1289.             $continue = 2
  1290.             MsgBox(8192, "You died! (arena check 1)", "You died!", 1)
  1291.         Else
  1292.             $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$ExitColor1)
  1293.             If (($arenaCoord[0] = $exitCoord[0]) and ($arenaCoord[1] = $exitCoord[1])) Then
  1294.                 $arenaCoord = PixelSearch($topLeft[0],$exitCoord[1]+3,$bottomRight[0],$bottomRight[1]-119,$ExitColor1)
  1295.                 DungeonPad($arenaCoord[0],$arenaCoord[1])
  1296.             Else
  1297.                 DungeonPad($arenaCoord[0],$arenaCoord[1])
  1298.             EndIf
  1299.         EndIf
  1300.         ; might need to check more than once
  1301.         If (DeathCheck() = 1) Then
  1302.             $continue = 2
  1303.             MsgBox(8192, "You died! (arena check 2)", "You died!", 1)
  1304.         EndIf
  1305.     WEnd
  1306.  
  1307.     ; died - remove last battle XP
  1308.     $TotalXP=$TotalXP-$CWAXP[$NumberOfBattles]
  1309.  
  1310.     ReturnToArena()
  1311.  
  1312. EndFunc
  1313.  
  1314. Func ArenaUWA()
  1315.     ; start script in arena in first room with battles (not in lobby)
  1316.     ; if you die, you will return to the arena and start over
  1317.     ; if you make it through, you need to stop the script!
  1318.     ; this one is different so you do NOT need to be able to
  1319.     ;   survive through the first room!
  1320.     ;
  1321.     ; first room
  1322.  
  1323.     ; ability to repeat this arena not working yet
  1324.  
  1325.     $continue = 1
  1326.  
  1327.     ; Find Battle
  1328.     While $continue = 1
  1329.         ; **** This section may need some work
  1330.         CharMove(($topLeft[0]+374), ($topLeft[1]+256))
  1331.         CharMove(($topLeft[0]+389), ($topLeft[1]+313))
  1332.         ; find white pad
  1333.         WaitForPads()
  1334.         $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$ExitColor1)
  1335.         If @error=1 Then
  1336.             $exitCoord[0] = $topLeft[0]
  1337.             $exitCoord[1] = $topLeft[1]
  1338.         Else
  1339.             $exitCoord[0]=$arenaCoord[0]
  1340.             $exitCoord[1]=$arenaCoord[1]
  1341.         EndIf
  1342.  
  1343.         $battleCheck = 1
  1344.  
  1345.         While $battleCheck = 1
  1346.             ; next search for battle pads
  1347.             WaitForPads()
  1348.             $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$PadColor1)
  1349.             If @error=1 Then
  1350.                 $battleCheck = 2
  1351.             Else
  1352.                 Battle($arenaCoord[0], $arenaCoord[1])
  1353.                 WaitForPads()
  1354.                 $TotalXP=$TotalXP+$UWAXP[$NumberOfBattles]
  1355.             EndIf
  1356.         Wend
  1357.         WaitForPads()
  1358.         ; death check
  1359.         If (DeathCheck() = 1) Then
  1360.             $continue = 2
  1361.             MsgBox(8192, "You died! (arena check 1)", "You died!", 1)
  1362.         Else
  1363.             $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-119,$ExitColor1)
  1364.             If (($arenaCoord[0] = $exitCoord[0]) and ($arenaCoord[1] = $exitCoord[1])) Then
  1365.                 $arenaCoord = PixelSearch($topLeft[0],$exitCoord[1]+3,$bottomRight[0],$bottomRight[1]-119,$ExitColor1)
  1366.                 DungeonPad($arenaCoord[0],$arenaCoord[1])
  1367.             Else
  1368.                 DungeonPad($arenaCoord[0],$arenaCoord[1])
  1369.             EndIf
  1370.         EndIf
  1371.         ; might need to check more than once
  1372.         If (DeathCheck() = 1) Then
  1373.             $continue = 2
  1374.             MsgBox(8192, "You died! (arena check 2)", "You died!", 1)
  1375.         EndIf
  1376.     WEnd
  1377.  
  1378.     ; died - remove last battle XP
  1379.     $TotalXP=$TotalXP-$UWAXP[$NumberOfBattles]
  1380.  
  1381.     ReturnToArena()
  1382. EndFunc
  1383.  
  1384. Func NewbGrind()
  1385.     ; start script in Shikaakwa
  1386.     ;
  1387.     DungeonPad2(($topLeft[0]+706),($topLeft[1]+432))
  1388.  
  1389.     ;go to A3
  1390.     DungeonPad2(($topLeft[0]+154),($topLeft[1]+106))
  1391.     ;go to A2
  1392.     DungeonPad2(($topLeft[0]+226),($topLeft[1]+95))
  1393.  
  1394.     ; grind A2 until HP is 100% when done
  1395.     $NewbHP=2
  1396.     While $NewbHP > 1
  1397.         $NewbHP = 1
  1398.         ; enter Bellroot A2
  1399.         DungeonPad(($topLeft[0]+201),($topLeft[1]+372))
  1400.         WaitForPads()
  1401.  
  1402.         ; enter first battle - left
  1403.         Battle(($topLeft[0]+178),($topLeft[1]+336))
  1404.         WaitForPads()
  1405.  
  1406.         If ($BlankPixel3 = $BlankColor1) Then
  1407.             $NewbHP = $NewbHP + 1
  1408.         EndIf
  1409.  
  1410.         ; enter 2nd battle - middle
  1411.         Battle(($topLeft[0]+297),($topLeft[1]+227))
  1412.         WaitForPads()
  1413.  
  1414.         If ($BlankPixel3 = $BlankColor1) Then
  1415.             $NewbHP = $NewbHP + 1
  1416.         EndIf
  1417.  
  1418.         ; enter 3rd battle - right
  1419.         Battle(($topLeft[0]+513),($topLeft[1]+287))
  1420.         WaitForPads()
  1421.  
  1422.         If ($BlankPixel3 = $BlankColor1) Then
  1423.             $NewbHP = $NewbHP + 1
  1424.         EndIf
  1425.  
  1426.         ; click to exit A2
  1427.         DungeonPad(($topLeft[0]+609),($topLeft[1]+408))
  1428.  
  1429.         ; move away from A2
  1430.         CharMove(($topLeft[0]+431),($topLeft[1]+361))
  1431.         If $TurboCheck = 0 Then
  1432.             Sleep(1000)
  1433.         Else
  1434.             Sleep(50)
  1435.         EndIf
  1436.     WEnd
  1437.  
  1438.     ; go to A1
  1439.     DungeonPad2(($topLeft[0]+417),($topLeft[1]+95))
  1440.  
  1441.     ; grind A1 until HP is 100% when done
  1442.     $NewbHP=2
  1443.     While $NewbHP > 1
  1444.         $NewbHP = 1
  1445.         ; enter Bellroot A1
  1446.         DungeonPad(($topLeft[0]+585),($topLeft[1]+181))
  1447.         WaitForPads()
  1448.  
  1449.         ; enter first battle
  1450.         Battle(($topLeft[0]+250),($topLeft[1]+276))
  1451.         WaitForPads()
  1452.  
  1453.         If ($BlankPixel2 = $BlankColor1) Then
  1454.             $NewbHP = $NewbHP + 1
  1455.         EndIf
  1456.  
  1457.         ; enter 2nd battle
  1458.         Battle(($topLeft[0]+465),($topLeft[1]+264))
  1459.         WaitForPads()
  1460.  
  1461.         If ($BlankPixel2 = $BlankColor1) Then
  1462.             $NewbHP = $NewbHP + 1
  1463.         EndIf
  1464.  
  1465.         ; enter 3rd battle
  1466.         Battle(($topLeft[0]+442),($topLeft[1]+348))
  1467.         WaitForPads()
  1468.  
  1469.         If ($BlankPixel3 = $BlankColor1) Then
  1470.             $NewbHP = $NewbHP + 1
  1471.         EndIf
  1472.  
  1473.         ; click to exit A1
  1474.         DungeonPad(($topLeft[0]+177),($topLeft[1]+408))
  1475.  
  1476.         ; move away from A1
  1477.         CharMove(($topLeft[0]+684),($topLeft[1]+172))
  1478.         If $TurboCheck = 0 Then
  1479.             Sleep(1000)
  1480.         Else
  1481.             Sleep(50)
  1482.         EndIf
  1483.     WEnd
  1484.  
  1485.     ; go to B2
  1486.     DungeonPad2(($topLeft[0]+585),($topLeft[1]+467))
  1487.  
  1488.     DungeonPad2(($topLeft[0]+704),($topLeft[1]+383))
  1489.  
  1490.     ; grind B2 until HP is 100% when done
  1491.     $NewbHP = 2
  1492.     While $NewbHP > 1
  1493.         $NewbHP = 1
  1494.         ; grind 2nd battle until HP is low
  1495.         $RepeatB2 = 1
  1496.         While $RepeatB2 = 1
  1497.             ; enter Bellroot B2
  1498.             DungeonPad(($topLeft[0]+418),($topLeft[1]+358))
  1499.             WaitForPads()
  1500.  
  1501.             ; enter 2nd battle
  1502.             Battle(($topLeft[0]+466),($topLeft[1]+264))
  1503.             WaitForPads()
  1504.  
  1505.             If ($BlankPixel3 <> $BlankColor1) Then
  1506.                 $RepeatB2 = 2
  1507.             Else
  1508.                 If ($BlankPixel = $BlankColor1) Then
  1509.                     $RepeatB2 = 2
  1510.                 Else
  1511.                     ; click to exit B2
  1512.                     DungeonPad(($topLeft[0]+177),($topLeft[1]+407))
  1513.  
  1514.                     ; move away from B2
  1515.                     CharMove(($topLeft[0]+525),($topLeft[1]+322))
  1516.                     If $TurboCheck = 0 Then
  1517.                         Sleep(1000)
  1518.                     Else
  1519.                         Sleep(50)
  1520.                     EndIf
  1521.                 EndIf
  1522.             EndIf
  1523.         WEnd
  1524.  
  1525.         ; enter first battle
  1526.         Battle(($topLeft[0]+226),($topLeft[1]+312))
  1527.         WaitForPads()
  1528.  
  1529.         If ($BlankPixel3 = $BlankColor1) Then
  1530.             $NewbHP = $NewbHP + 1
  1531.         EndIf
  1532.  
  1533.         ; enter 3rd battle
  1534.         Battle(($topLeft[0]+442),($topLeft[1]+347))
  1535.         WaitForPads()
  1536.  
  1537.         If ($BlankPixel3 = $BlankColor1) Then
  1538.             $NewbHP = $NewbHP + 1
  1539.         EndIf
  1540.  
  1541.         ; click to exit B2
  1542.         DungeonPad(($topLeft[0]+177),($topLeft[1]+407))
  1543.  
  1544.         ; move away from B2
  1545.         CharMove(($topLeft[0]+525),($topLeft[1]+322))
  1546.         If $TurboCheck = 0 Then
  1547.             Sleep(1000)
  1548.         Else
  1549.             Sleep(50)
  1550.         EndIf
  1551.     WEnd
  1552.  
  1553.     ;return to Shik
  1554.     DungeonPad(($topLeft[0]+33),($topLeft[1]+262))
  1555.  
  1556.     DungeonPad(($topLeft[0]+346),($topLeft[1]+467))
  1557.  
  1558.     DungeonPad(($topLeft[0]+346),($topLeft[1]+467))
  1559.  
  1560.     DungeonPad(($topLeft[0]+32),($topLeft[1]+455))
  1561.  
  1562.     ; go to Summerville
  1563.     DungeonPad(($topLeft[0]+226),($topLeft[1]+142))
  1564.  
  1565.     DungeonPad(($topLeft[0]+249),($topLeft[1]+466))
  1566.  
  1567.     DungeonPad(($topLeft[0]+34),($topLeft[1]+334))
  1568.  
  1569.     ; grind D1 until HP is 100% when done
  1570.     $NewbHP=2
  1571.     While $NewbHP > 1
  1572.         $NewbHP = 1
  1573.         ; enter Summerville D1
  1574.         DungeonPad(($topLeft[0]+514),($topLeft[1]+240))
  1575.         WaitForPads()
  1576.  
  1577.         ; enter first battle
  1578.         Battle(($topLeft[0]+297),($topLeft[1]+251))
  1579.         WaitForPads()
  1580.  
  1581.         If ($BlankPixel3 = $BlankColor1) Then
  1582.             $NewbHP = $NewbHP + 1
  1583.         EndIf
  1584.  
  1585.         ; enter 2nd battle
  1586.         Battle(($topLeft[0]+514),($topLeft[1]+216))
  1587.         WaitForPads()
  1588.  
  1589.         If ($BlankPixel3 = $BlankColor1) Then
  1590.             $NewbHP = $NewbHP + 1
  1591.         EndIf
  1592.  
  1593.         ; enter 3rd battle
  1594.         Battle(($topLeft[0]+442),($topLeft[1]+324))
  1595.         WaitForPads()
  1596.  
  1597.         If ($BlankPixel3 = $BlankColor1) Then
  1598.             $NewbHP = $NewbHP + 1
  1599.         EndIf
  1600.  
  1601.         ; click to exit D1
  1602.         DungeonPad(($topLeft[0]+225),($topLeft[1]+382))
  1603.  
  1604.         ; move away from D1
  1605.         CharMove(($topLeft[0]+447),($topLeft[1]+324))
  1606.         If $TurboCheck = 0 Then
  1607.             Sleep(1000)
  1608.         Else
  1609.             Sleep(50)
  1610.         EndIf
  1611.     WEnd
  1612.  
  1613.     ; go to C4
  1614.     DungeonPad(($topLeft[0]+394),($topLeft[1]+466))
  1615.  
  1616.     DungeonPad(($topLeft[0]+538),($topLeft[1]+467))
  1617.  
  1618.     DungeonPad(($topLeft[0]+346),($topLeft[1]+468))
  1619.  
  1620.     DungeonPad(($topLeft[0]+33),($topLeft[1]+334))
  1621.  
  1622.     ; grind C4 until HP is 100% when done
  1623.     $NewbHP=2
  1624.     While $NewbHP > 1
  1625.         $NewbHP = 1
  1626.         ; enter Summerville C4
  1627.         DungeonPad(($topLeft[0]+298),($topLeft[1]+323))
  1628.         WaitForPads()
  1629.  
  1630.         ; enter first battle
  1631.         Battle(($topLeft[0]+274),($topLeft[1]+264))
  1632.         WaitForPads()
  1633.  
  1634.         If ($BlankPixel3 = $BlankColor1) Then
  1635.             $NewbHP = $NewbHP + 1
  1636.         EndIf
  1637.  
  1638.         ; enter 2nd battle
  1639.         Battle(($topLeft[0]+441),($topLeft[1]+204))
  1640.         WaitForPads()
  1641.  
  1642.         If ($BlankPixel3 = $BlankColor1) Then
  1643.             $NewbHP = $NewbHP + 1
  1644.         EndIf
  1645.  
  1646.         ; click to exit C4
  1647.         DungeonPad(($topLeft[0]+177),($topLeft[1]+407))
  1648.  
  1649.         ; move away from C4
  1650.         CharMove(($topLeft[0]+173),($topLeft[1]+296))
  1651.         If $TurboCheck = 0 Then
  1652.             Sleep(1000)
  1653.         Else
  1654.             Sleep(50)
  1655.         EndIf
  1656.     WEnd
  1657.  
  1658.     ; go to West Hills E1
  1659.     DungeonPad2(($topLeft[0]+273),($topLeft[1]+97))
  1660.  
  1661.     DungeonPad2(($topLeft[0]+705),($topLeft[1]+240))
  1662.  
  1663.     DungeonPad2(($topLeft[0]+321),($topLeft[1]+95))
  1664.  
  1665.     DungeonPad2(($topLeft[0]+369),($topLeft[1]+95))
  1666.  
  1667.     DungeonPad2(($topLeft[0]+705),($topLeft[1]+215))
  1668.  
  1669.     DungeonPad2(($topLeft[0]+321),($topLeft[1]+95))
  1670.  
  1671.     DungeonPad2(($topLeft[0]+370),($topLeft[1]+95))
  1672.  
  1673.     DungeonPad2(($topLeft[0]+57),($topLeft[1]+106))
  1674.  
  1675.     DungeonPad2(($topLeft[0]+33),($topLeft[1]+234))
  1676.  
  1677.     DungeonPad(($topLeft[0]+129),($topLeft[1]+89))
  1678.  
  1679.     DungeonPad2(($topLeft[0]+369),($topLeft[1]+90))
  1680.  
  1681.     DungeonPad2(($topLeft[0]+465),($topLeft[1]+89))
  1682.  
  1683.     DungeonPad2(($topLeft[0]+369),($topLeft[1]+90))
  1684.  
  1685.     DungeonPad2(($topLeft[0]+705),($topLeft[1]+379))
  1686.  
  1687.     ; grind E1 until HP is 100% when done
  1688.     $NewbHP=2
  1689.     While $NewbHP > 1
  1690.         $NewbHP = 1
  1691.         ; enter West Hills E1
  1692.         DungeonPad(($topLeft[0]+416),($topLeft[1]+312))
  1693.         WaitForPads()
  1694.  
  1695.         ; enter first battle
  1696.         Battle(($topLeft[0]+250),($topLeft[1]+203))
  1697.         WaitForPads()
  1698.  
  1699.         If ($BlankPixel3 = $BlankColor1) Then
  1700.             $NewbHP = $NewbHP + 1
  1701.         EndIf
  1702.  
  1703.         ; enter 2nd battle
  1704.         Battle(($topLeft[0]+608),($topLeft[1]+263))
  1705.         WaitForPads()
  1706.  
  1707.         If ($BlankPixel3 = $BlankColor1) Then
  1708.             $NewbHP = $NewbHP + 1
  1709.         EndIf
  1710.  
  1711.         ; click to exit E1
  1712.         DungeonPad(($topLeft[0]+201),($topLeft[1]+396))
  1713.  
  1714.         ; move away from E1
  1715.         CharMove(($topLeft[0]+305),($topLeft[1]+310))
  1716.         If $TurboCheck = 0 Then
  1717.             Sleep(1000)
  1718.         Else
  1719.             Sleep(50)
  1720.         EndIf
  1721.     WEnd
  1722.  
  1723.     ; go to bleakwoods H3
  1724.     DungeonPad2(($topLeft[0]+34),($topLeft[1]+330))
  1725.  
  1726.     DungeonPad2(($topLeft[0]+585),($topLeft[1]+463))
  1727.  
  1728.     DungeonPad2(($topLeft[0]+153),($topLeft[1]+462))
  1729.  
  1730.     DungeonPad2(($topLeft[0]+393),($topLeft[1]+463))
  1731.  
  1732.     DungeonPad2(($topLeft[0]+81),($topLeft[1]+450))
  1733.  
  1734.     DungeonPad(($topLeft[0]+706),($topLeft[1]+209))
  1735.  
  1736.     DungeonPad2(($topLeft[0]+704),($topLeft[1]+330))
  1737.  
  1738.     DungeonPad(($topLeft[0]+705),($topLeft[1]+312))
  1739.  
  1740.     DungeonPad(($topLeft[0]+345),($topLeft[1]+106))
  1741.  
  1742.     DungeonPad(($topLeft[0]+514),($topLeft[1]+94))
  1743.  
  1744.     DungeonPad(($topLeft[0]+416),($topLeft[1]+95))
  1745.  
  1746.     DungeonPad(($topLeft[0]+416),($topLeft[1]+95))
  1747.  
  1748.     DungeonPad(($topLeft[0]+416),($topLeft[1]+95))
  1749.  
  1750.     DungeonPad(($topLeft[0]+416),($topLeft[1]+95))
  1751.  
  1752.     DungeonPad(($topLeft[0]+657),($topLeft[1]+94))
  1753.  
  1754.     DungeonPad(($topLeft[0]+33),($topLeft[1]+383))
  1755.  
  1756.     DungeonPad(($topLeft[0]+369),($topLeft[1]+96))
  1757.  
  1758.     ; grind H3 until HP is 80% when done
  1759.     $NewbHP=2
  1760.     While $NewbHP > 1
  1761.         $NewbHP = 1
  1762.         ; enter Bleakwoods H3
  1763.         DungeonPad(($topLeft[0]+177),($topLeft[1]+359))
  1764.         WaitForPads()
  1765.  
  1766.         ; enter first battle
  1767.         Battle(($topLeft[0]+225),($topLeft[1]+286))
  1768.         WaitForPads()
  1769.  
  1770.         If ($BlankPixel2 = $BlankColor1) Then
  1771.             $NewbHP = $NewbHP + 1
  1772.         EndIf
  1773.  
  1774.         ; enter 2nd battle
  1775.         Battle(($topLeft[0]+441),($topLeft[1]+203))
  1776.         WaitForPads()
  1777.  
  1778.         If ($BlankPixel2 = $BlankColor1) Then
  1779.             $NewbHP = $NewbHP + 1
  1780.         EndIf
  1781.  
  1782.         ; enter 3rd battle
  1783.         Battle(($topLeft[0]+394),($topLeft[1]+395))
  1784.         WaitForPads()
  1785.  
  1786.         If ($BlankPixel2 = $BlankColor1) Then
  1787.             $NewbHP = $NewbHP + 1
  1788.         EndIf
  1789.  
  1790.         ; click to exit H3
  1791.         DungeonPad(($topLeft[0]+176),($topLeft[1]+407))
  1792.  
  1793.         ; move away from H3
  1794.         CharMove(($topLeft[0]+269),($topLeft[1]+423))
  1795.         If $TurboCheck = 0 Then
  1796.             Sleep(1000)
  1797.         Else
  1798.             Sleep(50)
  1799.         EndIf
  1800.     WEnd
  1801.  
  1802.     ; go to Tsulas
  1803.     DungeonPad(($topLeft[0]+346),($topLeft[1]+467))
  1804.  
  1805.     DungeonPad(($topLeft[0]+33),($topLeft[1]+384))
  1806.  
  1807.     DungeonPad(($topLeft[0]+32),($topLeft[1]+382))
  1808.  
  1809.     DungeonPad(($topLeft[0]+33),($topLeft[1]+407))
  1810.  
  1811.     DungeonPad(($topLeft[0]+154),($topLeft[1]+275))
  1812.  
  1813.     ; this should start Tsulas grind
  1814.     $grind_choice=2
  1815. EndFunc
  1816.  
  1817. Func GrindDD_E3()
  1818.    
  1819.     ; enter Dunes E3
  1820.     DungeonPad(($topLeft[0]+228), ($topLeft[1]+288))
  1821.     WaitForPads()
  1822.    
  1823.     CharMove(($topLeft[0]+339), ($topLeft[1]+205))
  1824.    
  1825.     ; enter third battle
  1826.     Battle(($topLeft[0]+395), ($topLeft[1]+227))
  1827.     WaitForPads()
  1828.    
  1829.     ; enter first battle
  1830.     Battle(($topLeft[0]+372), ($topLeft[1]+266))
  1831.     WaitForPads()
  1832.    
  1833.     ; enter fourth battle
  1834.     Battle(($topLeft[0]+443), ($topLeft[1]+181))
  1835.     WaitForPads()
  1836.    
  1837.     ; enter second battle
  1838.     Battle(($topLeft[0]+515), ($topLeft[1]+288))
  1839.     WaitForPads()
  1840.     ; exit Dunes E3
  1841.    
  1842.     DungeonPad(($topLeft[0]+206), ($topLeft[1]+398))
  1843.     WaitForPads()
  1844.  
  1845.     ; move away from Dunes E3
  1846.     CharMove(($topLeft[0]+185), ($topLeft[1]+307))
  1847.     If $TurboCheck = 0 Then
  1848.         Sleep(1000)
  1849.     Else
  1850.         Sleep(50)
  1851.     EndIf
  1852.     $TotalXP=$TotalXP+5756
  1853. EndFunc
  1854.  
  1855. Func GrindUW_B4()
  1856.     ; enter Underworld B4
  1857.     DungeonPad(($topLeft[0]+82), ($topLeft[1]+193))
  1858.     WaitForPads()
  1859.  
  1860.     ; enter first battle
  1861.     Battle(($topLeft[0]+321), ($topLeft[1]+383))
  1862.     WaitForPads()
  1863.  
  1864.     ; enter second battle
  1865.     Battle(($topLeft[0]+273), ($topLeft[1]+239))
  1866.     WaitForPads()
  1867.  
  1868.     ; enter third battle
  1869.     Battle(($topLeft[0]+465), ($topLeft[1]+288))
  1870.     WaitForPads()
  1871.  
  1872.     ; enter fourth battle
  1873.     Battle(($topLeft[0]+513), ($topLeft[1]+311))
  1874.     WaitForPads()
  1875.  
  1876.     ; exit Underworld B4
  1877.     DungeonPad(($topLeft[0]+562), ($topLeft[1]+408))
  1878.     WaitForPads()
  1879.  
  1880.     ; move away from Underworld B4
  1881.     CharMove(($topLeft[0]+244), ($topLeft[1]+173))
  1882.     If $TurboCheck = 0 Then
  1883.         Sleep(1000)
  1884.     Else
  1885.         Sleep(50)
  1886.     EndIf
  1887.     $TotalXP=$TotalXP+7559
  1888. EndFunc
  1889.  
  1890. Func GrindDD_A5()
  1891.     ; enter Underworld C2
  1892.     DungeonPad(($topLeft[0]+537), ($topLeft[1]+156))
  1893.     WaitForPads()
  1894.  
  1895.     ; enter first battle
  1896.     Battle(($topLeft[0]+130), ($topLeft[1]+336))
  1897.     WaitForPads()
  1898.  
  1899.     ; enter third battle
  1900.     Battle(($topLeft[0]+488), ($topLeft[1]+155))
  1901.     WaitForPads()
  1902.  
  1903.     ; enter second battle
  1904.     Battle(($topLeft[0]+201), ($topLeft[1]+179))
  1905.     WaitForPads()
  1906.  
  1907.     ; exit Underworld C2
  1908.     DungeonPad(($topLeft[0]+57), ($topLeft[1]+467))
  1909.  
  1910.     ; move away from Underworld C2
  1911.     CharMove(($topLeft[0]+395), ($topLeft[1]+177))
  1912.     If $TurboCheck = 0 Then
  1913.         Sleep(1000)
  1914.     Else
  1915.         Sleep(50)
  1916.     EndIf
  1917.     $TotalXP=$TotalXP+2280
  1918. EndFunc
  1919.  
  1920. Func GrindDD_D3()
  1921.     ; enter Dunes D3
  1922.     DungeonPad(($topLeft[0]+299), ($topLeft[1]+372))
  1923.     WaitForPads()
  1924.  
  1925.     ; enter first battle
  1926.     Battle(($topLeft[0]+250), ($topLeft[1]+251))
  1927.     WaitForPads()
  1928.  
  1929.     ; enter second battle
  1930.     Battle(($topLeft[0]+418), ($topLeft[1]+167))
  1931.     WaitForPads()
  1932.  
  1933.     ; enter third battle
  1934.     Battle(($topLeft[0]+562), ($topLeft[1]+264))
  1935.     WaitForPads()
  1936.  
  1937.     ; exit Dunes D3
  1938.     DungeonPad(($topLeft[0]+202), ($topLeft[1]+395))
  1939.  
  1940.     ; move away from Dunes D3
  1941.     CharMove(($topLeft[0]+238), ($topLeft[1]+431))
  1942.     If $TurboCheck = 0 Then
  1943.         Sleep(1000)
  1944.     Else
  1945.         Sleep(50)
  1946.     EndIf
  1947.     $TotalXP=$TotalXP+9370
  1948. EndFunc
  1949.  
  1950. Func DeathCheck()
  1951.     $DeathYes=0
  1952.     $DeathNo=0
  1953.     ;$chimneycheck = 0xE2D6C3
  1954.     $chimneycheck = PixelGetColor($topLeft[0]+267, $topLeft[1]+311)
  1955.     If $chimneycheck < 0xB00000 Then
  1956.         Return(0)
  1957.     EndIf
  1958.     For $DeathX = 267 to 277
  1959.         For $DeathY = 311 to 321
  1960.             $chimneycheck2 = PixelGetColor($topLeft[0]+$DeathX, $topLeft[1]+$DeathY)
  1961.             If $chimneycheck2 = $chimneycheck Then
  1962.                 $DeathYes=$DeathYes+1
  1963.             Else
  1964.                 $DeathNo=$DeathNo+1
  1965.                 ; not chimney - not dead - return 0
  1966.                 If $DeathNo > 10 Then
  1967.                     Return(0)
  1968.                 EndIf
  1969.             EndIf
  1970.         Next
  1971.     Next
  1972.     ; thats the chimney - they dead
  1973.     Return(1)
  1974. EndFunc
  1975.  
  1976. Func ArenaGrind2()
  1977.     ; start script in arena in first room with battles (not in lobby)
  1978.     ; if you die, you will return to the arena and start over
  1979.     $NumberOfBattles=0
  1980.     $ArenaContinue = 1
  1981.     $RoomsCleared = 0
  1982.     $ArenaRoomCount = 1
  1983.     $continue = 1
  1984.  
  1985.     ; Find Battle
  1986.     While $continue = 1
  1987.         ; need to move away from pad first - maybe not necessary?
  1988.         ; 09/01 - I decided this is necessary again
  1989.         ; 11/06 - good delay while we wait for pads
  1990.         MouseMove(($topLeft[0]+374), ($topLeft[1]+256), 3)
  1991.         MouseClick("left")
  1992.         sleep(500)
  1993.  
  1994.         ; click on character check
  1995.         While CharClickCheck() = 1
  1996.             MouseMove(($topLeft[0]+374), ($topLeft[1]+256), 3)
  1997.             Sleep(100)
  1998.             MouseClick("left")
  1999.             Sleep(100)
  2000.         WEnd
  2001.  
  2002.         ; find white pad
  2003.         WaitForPads()
  2004.         $battleCheck = 1
  2005.         While $battleCheck = 1
  2006.             ; next search for battle pads
  2007.             WaitForPads()
  2008.             ; need this code so it doesn't think 7-7 exit is a battle
  2009.             If $NumberOfBattles < $ArenaNumberOfBattles[$ArenaNumber] Then
  2010.                 ; -177 avoids the non play area and the entrance at the start of an arena
  2011.                 $ArenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-177,$PadColor2, 5)
  2012.                 If @error=1 Then
  2013.                     ; for battle pad server delay - lets check twice
  2014.                     Sleep(500)
  2015.                 EndIf
  2016.                 $ArenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1]-177,$PadColor2, 5)
  2017.                 If @error=1 Then
  2018.                     $battleCheck = 2
  2019.                 Else
  2020.                     Battle($ArenaCoord[0]+3, $ArenaCoord[1]+13)
  2021.                     WaitForPads()
  2022.                     $TotalXP=$TotalXP+$ArenaXP[$ArenaNumber][$NumberOfBattles]
  2023.                 EndIf
  2024.             Else
  2025.                 $battleCheck = 2
  2026.             EndIf
  2027.         Wend
  2028.         WaitForPads()
  2029.         ; keep count of rooms cleared - when arena is done - exit and repeat
  2030.         $RoomsCleared = $RoomsCleared + 1
  2031.         If $RoomsCleared = 49 Then
  2032.             ; find exit
  2033.             DungeonPad(($ArenaExit[$ArenaRoomCount])+$topLeft[0],($ArenaExit[$ArenaRoomCount+1])+$topLeft[1])
  2034.             CharMove(($topLeft[0]+320), ($topLeft[1]+239))
  2035.             If $TurboCheck = 0 Then
  2036.                 Sleep(2000)
  2037.             Else
  2038.                 Sleep(20)
  2039.             EndIf
  2040.             DungeonPad(($topLeft[0]+82),($topLeft[1]+97))
  2041.             Return
  2042.         EndIf
  2043.         ; death check
  2044.         If (DeathCheck() = 1) Then
  2045.             $continue = 2
  2046.             MsgBox(8192, "You died! (arena check 1)", "You died!", 1)
  2047.         Else
  2048.             ; find exit
  2049.             DungeonPad(($ArenaExit[$ArenaRoomCount])+$topLeft[0],($ArenaExit[$ArenaRoomCount+1])+$topLeft[1])
  2050.             $ArenaRoomCount = $ArenaRoomCount + 2
  2051.             If $ArenaRoomCount = 15 Then
  2052.                 $ArenaRoomCount = 1
  2053.             EndIf
  2054.         EndIf
  2055.         ; might need to check more than once
  2056.         If (DeathCheck() = 1) Then
  2057.             $continue = 2
  2058.             MsgBox(8192, "You died! (arena check 2)", "You died!", 1)
  2059.         EndIf
  2060.     WEnd
  2061.  
  2062.     ; died - remove last battle XP
  2063.     $TotalXP=$TotalXP-$ArenaXP[$ArenaNumber][$NumberOfBattles]
  2064.     ReturnToArena()
  2065. EndFunc
  2066.  
  2067.  
  2068. Func ReturnToArena()
  2069.     If $ArenaNumber = 1 Then
  2070.         ; starting from Shikaakwa - return to FF
  2071.         DungeonPad(($topLeft[0]+224),($topLeft[1]+141))
  2072.  
  2073.         DungeonPad(($topLeft[0]+370),($topLeft[1]+91))
  2074.  
  2075.         DungeonPad(($topLeft[0]+57),($topLeft[1]+105))
  2076.  
  2077.         DungeonPad(($topLeft[0]+369),($topLeft[1]+87))
  2078.  
  2079.         DungeonPad(($topLeft[0]+202),($topLeft[1]+266))
  2080.  
  2081.         DungeonPad(($topLeft[0]+81),($topLeft[1]+93))
  2082.     EndIf
  2083.  
  2084.     If $ArenaNumber = 2 Then
  2085.         ; starting from Shikaakwa - return to SVA
  2086.         DungeonPad(($topLeft[0]+224),($topLeft[1]+141))
  2087.  
  2088.         DungeonPad(($topLeft[0]+251),($topLeft[1]+465))
  2089.  
  2090.         DungeonPad(($topLeft[0]+705),($topLeft[1]+237))
  2091.  
  2092.         DungeonPad(($topLeft[0]+706),($topLeft[1]+140))
  2093.  
  2094.         DungeonPad(($topLeft[0]+322),($topLeft[1]+380))
  2095.  
  2096.         DungeonPad(($topLeft[0]+81),($topLeft[1]+94))
  2097.     EndIf
  2098.  
  2099.     If $ArenaNumber = 3 Then
  2100.         ; starting from Shikaakwa - return to BWA
  2101.         DungeonPad(($topLeft[0]+321),($topLeft[1]+92))
  2102.  
  2103.         DungeonPad(($topLeft[0]+346),($topLeft[1]+103))
  2104.  
  2105.         DungeonPad(($topLeft[0]+513),($topLeft[1]+91))
  2106.  
  2107.         DungeonPad(($topLeft[0]+416),($topLeft[1]+91))
  2108.  
  2109.         DungeonPad(($topLeft[0]+417),($topLeft[1]+92))
  2110.  
  2111.         DungeonPad(($topLeft[0]+416),($topLeft[1]+91))
  2112.  
  2113.         DungeonPad(($topLeft[0]+416),($topLeft[1]+92))
  2114.  
  2115.         DungeonPad(($topLeft[0]+657),($topLeft[1]+92))
  2116.  
  2117.         DungeonPad(($topLeft[0]+321),($topLeft[1]+92))
  2118.  
  2119.         DungeonPad(($topLeft[0]+370),($topLeft[1]+92))
  2120.  
  2121.         DungeonPad(($topLeft[0]+273),($topLeft[1]+91))
  2122.  
  2123.         DungeonPad(($topLeft[0]+298),($topLeft[1]+320))
  2124.  
  2125.         DungeonPad(($topLeft[0]+81),($topLeft[1]+91))
  2126.     EndIf
  2127.  
  2128.     If $ArenaNumber = 4 Then
  2129.         ; starting from Shikaakwa - return to DFA
  2130.         DungeonPad2(($topLeft[0]+705),($topLeft[1]+429))
  2131.  
  2132.         DungeonPad2(($topLeft[0]+586),($topLeft[1]+465))
  2133.  
  2134.         DungeonPad2(($topLeft[0]+705),($topLeft[1]+453))
  2135.  
  2136.         DungeonPad(($topLeft[0]+705),($topLeft[1]+260))
  2137.  
  2138.         DungeonPad(($topLeft[0]+704),($topLeft[1]+140))
  2139.  
  2140.         DungeonPad(($topLeft[0]+497),($topLeft[1]+440))
  2141.  
  2142.         DungeonPad(($topLeft[0]+391),($topLeft[1]+461))
  2143.  
  2144.         DungeonPad(($topLeft[0]+392),($topLeft[1]+461))
  2145.  
  2146.         DungeonPad(($topLeft[0]+439),($topLeft[1]+461))
  2147.  
  2148.         DungeonPad(($topLeft[0]+199),($topLeft[1]+462))
  2149.  
  2150.         DungeonPad(($topLeft[0]+704),($topLeft[1]+306))
  2151.  
  2152.         DungeonPad(($topLeft[0]+703),($topLeft[1]+233))
  2153.  
  2154.         DungeonPad2(($topLeft[0]+704),($topLeft[1]+401))
  2155.  
  2156.         DungeonPad(($topLeft[0]+704),($topLeft[1]+232))
  2157.  
  2158.         DungeonPad2(($topLeft[0]+711),($topLeft[1]+401))
  2159.  
  2160.         DungeonPad(($topLeft[0]+344),($topLeft[1]+221))
  2161.  
  2162.         DungeonPad(($topLeft[0]+81),($topLeft[1]+94))
  2163.     EndIf
  2164.  
  2165.     If $ArenaNumber = 5 Then
  2166.         ; starting from Shikaakwa - return to BRA
  2167.         DungeonPad2(($topLeft[0]+705),($topLeft[1]+429))
  2168.  
  2169.         DungeonPad2(($topLeft[0]+586),($topLeft[1]+465))
  2170.  
  2171.         DungeonPad2(($topLeft[0]+705),($topLeft[1]+453))
  2172.  
  2173.         DungeonPad(($topLeft[0]+705),($topLeft[1]+260))
  2174.  
  2175.         DungeonPad(($topLeft[0]+704),($topLeft[1]+140))
  2176.  
  2177.         DungeonPad(($topLeft[0]+706),($topLeft[1]+284))
  2178.  
  2179.         DungeonPad(($topLeft[0]+154),($topLeft[1]+176))
  2180.  
  2181.         DungeonPad(($topLeft[0]+81),($topLeft[1]+93))
  2182.     EndIf
  2183.  
  2184.     If $ArenaNumber = 6 Then
  2185.         ; starting from Shikaakwa - return to CWA
  2186.         DungeonPad(($topLeft[0]+321),($topLeft[1]+94))
  2187.  
  2188.         DungeonPad(($topLeft[0]+347),($topLeft[1]+105))
  2189.  
  2190.         DungeonPad2(($topLeft[0]+31),($topLeft[1]+384))
  2191.  
  2192.         DungeonPad2(($topLeft[0]+32),($topLeft[1]+214))
  2193.  
  2194.         DungeonPad2(($topLeft[0]+33),($topLeft[1]+359))
  2195.  
  2196.         DungeonPad(($topLeft[0]+465),($topLeft[1]+96))
  2197.  
  2198.         DungeonPad(($topLeft[0]+201),($topLeft[1]+300))
  2199.  
  2200.         DungeonPad(($topLeft[0]+57),($topLeft[1]+251))
  2201.     EndIf
  2202.  
  2203.     If $ArenaNumber = 7 Then
  2204.         ; starting from Shikaakwa - return to UWA
  2205.         DungeonPad2(($topLeft[0]+705),($topLeft[1]+430))
  2206.  
  2207.         DungeonPad2(($topLeft[0]+585),($topLeft[1]+467))
  2208.  
  2209.         DungeonPad2(($topLeft[0]+705),($topLeft[1]+453))
  2210.  
  2211.         DungeonPad(($topLeft[0]+705),($topLeft[1]+263))
  2212.  
  2213.         DungeonPad(($topLeft[0]+704),($topLeft[1]+142))
  2214.  
  2215.         DungeonPad(($topLeft[0]+705),($topLeft[1]+287))
  2216.  
  2217.         DungeonPad(($topLeft[0]+705),($topLeft[1]+215))
  2218.  
  2219.         DungeonPad(($topLeft[0]+177),($topLeft[1]+95))
  2220.  
  2221.         DungeonPad(($topLeft[0]+705),($topLeft[1]+166))
  2222.  
  2223.         DungeonPad(($topLeft[0]+538),($topLeft[1]+82))
  2224.  
  2225.         DungeonPad(($topLeft[0]+33),($topLeft[1]+376))
  2226.  
  2227.         DungeonPad(($topLeft[0]+33),($topLeft[1]+351))
  2228.  
  2229.         DungeonPad2(($topLeft[0]+32),($topLeft[1]+400))
  2230.  
  2231.         DungeonPad(($topLeft[0]+33),($topLeft[1]+257))
  2232.  
  2233.         DungeonPad2(($topLeft[0]+489),($topLeft[1]+460))
  2234.  
  2235.         DungeonPad(($topLeft[0]+33),($topLeft[1]+280))
  2236.  
  2237.         DungeonPad(($topLeft[0]+273),($topLeft[1]+88))
  2238.  
  2239.         DungeonPad(($topLeft[0]+32),($topLeft[1]+311))
  2240.     EndIf
  2241.  
  2242.     If $ArenaNumber = 8 Then
  2243.         ; starting from Shikaakwa - return to PGA
  2244.         ; 137, 121
  2245.         ; dungeonpad - bottom right
  2246.         ; dungeonpad2 - top right
  2247.         ;DungeonPad2(458, 216)
  2248.  
  2249.         ;DungeonPad2(482, 228)
  2250.  
  2251.         ;DungeonPad2(841, 578)
  2252.  
  2253.         ;DungeonPad2(457, 216)
  2254.  
  2255.         ;DungeonPad2(842, 505)
  2256.  
  2257.         ;DungeonPad2(601, 217)
  2258.  
  2259.         ;DungeonPad2(338, 276)
  2260.  
  2261.         ;DungeonPad2(842, 407)
  2262.  
  2263.         ;DungeonPad2(842, 384)
  2264.  
  2265.         ;DungeonPad2(841, 504)
  2266.  
  2267.         ;DungeonPad2(506, 216)
  2268.  
  2269.         ;DungeonPad2(554, 217)
  2270.  
  2271.         ;DungeonPad2(697, 217)
  2272.  
  2273.         ;DungeonPad2(602, 216)
  2274.  
  2275.         ;DungeonPad2(506, 217)
  2276.  
  2277.         ;DungeonPad2(171, 385)
  2278.  
  2279.         ;DungeonPad2(482, 589)
  2280.  
  2281.         ;DungeonPad2(530, 324)
  2282.     EndIf
  2283. EndFunc
  2284.  
  2285. Func CharClickCheck()
  2286.     ; if character box is found, clicks on cancel, returns 1
  2287.     ; if no box found, returns 0
  2288.     $cccCount = 0
  2289.     For $cccx = 40 to 90
  2290.         For $cccy = 297 to 337
  2291.             $ClickCheck = PixelGetColor($topLeft[0]+$cccx, $topLeft[1]+$cccy)
  2292.             If $ClickCheck < 15728640 Then
  2293.                 $cccCount = $cccCount + 1
  2294.                 If $cccCount > 5 Then
  2295.                     Return (0)
  2296.                     ;$cccy = 454
  2297.                     ;$cccx = 98
  2298.                 EndIf
  2299.             EndIf
  2300.         Next
  2301.     Next
  2302.     ; Click to cancel window
  2303.     MouseMove ($topLeft[0]+318,$topLeft[1]+95,1)
  2304.     MouseClick("left")
  2305.     Return (1)
  2306. EndFunc
  2307.  
  2308. Func CharMove($x, $y)
  2309.     ; clicks on a non-pad area
  2310.     ; checks for character click check
  2311.     MouseMove($x, $y, 3)
  2312.     If $TurboCheck = 0 Then
  2313.         Sleep(100)
  2314.     Else
  2315.         Sleep(20)
  2316.     EndIf
  2317.     MouseClick("left")
  2318.     While CharClickCheck() = 1
  2319.         MouseMove($x, $y, 3)
  2320.         Sleep(100)
  2321.         MouseClick("left")
  2322.         Sleep(100)
  2323.     WEnd
  2324. EndFunc
  2325.  
  2326. Func Sleep_()
  2327.     Sleep(5000)
  2328. EndFunc
  2329.  
  2330.  
  2331. Break(0)
  2332.  
  2333.  
  2334. Func ChatActivate()
  2335.     MouseMove(($topLeft[0]+415), ($topLeft[1]+588), 0)
  2336.     Sleep(100)
  2337.     MouseClick("Left")
  2338.     Sleep(100)
  2339. EndFunc
  2340.  
  2341. Func GrindDD_F1()
  2342.     ; enter Dunes F1
  2343.     DungeonPad(($topLeft[0]+370),($topLeft[1]+119))
  2344.     WaitForPads()
  2345.  
  2346.     ; enter first battle - right
  2347.     Battle(($topLeft[0]+466),($topLeft[1]+261))
  2348.     WaitForPads()
  2349.  
  2350.     ; enter second battle - left
  2351.     Battle(($topLeft[0]+323),($topLeft[1]+262))
  2352.     WaitForPads()
  2353.    
  2354.     ; enter last battle - up
  2355.     Battle(($topLeft[0]+419),($topLeft[1]+190))
  2356.     Sleep(500)
  2357.  
  2358.     ; click to exit Dunes F1
  2359.     DungeonPad(($topLeft[0]+202), ($topLeft[1]+444))
  2360.     WaitForPads()
  2361.  
  2362.     ; move away from Dunes  F1
  2363.     CharMove(($topLeft[0]+302),($topLeft[1]+152))
  2364.     If $TurboCheck = 0 Then
  2365.         Sleep(1000)
  2366.     Else
  2367.         Sleep(50)
  2368.     EndIf
  2369.     $TotalXP=$TotalXP+1617
  2370. EndFunc
  2371.  
  2372. $AT = 17
  2373.  
  2374. Func At3()
  2375.         MouseMove($battleCoord[0], $battleCoord[1], 1)
  2376.         If $TurboCheck = 0 Then
  2377.             Sleep(200)
  2378.         Else
  2379.             Sleep(20)
  2380.         EndIf
  2381.         MouseClick("left")
  2382.         ; click on astral travel 3 / skill of choice
  2383.         Sleep(50)
  2384.         MouseMove($topLeft[0]+$BuffCoords[(($AT*2)-1)],$topLeft[1]+$BuffCoords[(($AT*2))], 1)
  2385.         If $TurboCheck = 0 Then
  2386.             Sleep(200)
  2387.         Else
  2388.             Sleep(20)
  2389.         EndIf
  2390.         MouseClick("left")
  2391.         ; click on character
  2392.         If $TurboCheck = 0 Then
  2393.             Sleep(200)
  2394.         Else
  2395.             Sleep(20)
  2396.         EndIf
  2397.         MouseMove($topLeft[0]+213, $topLeft[1]+200, 1)
  2398.         If $TurboCheck = 0 Then
  2399.             Sleep(200)
  2400.         Else
  2401.             Sleep(20)
  2402.         EndIf
  2403.         MouseClick("left")
  2404.         ; click on cancel (if not enough sp)
  2405.         MouseMove($topLeft[0]+368, $topLeft[1]+415, 1)
  2406.         If $TurboCheck = 0 Then
  2407.             Sleep(200)
  2408.         Else
  2409.             Sleep(20)
  2410.         EndIf
  2411.         MouseClick("left")
  2412.         If $TurboCheck = 0 Then
  2413.             Sleep(200)
  2414.         Else
  2415.             Sleep(20)
  2416.         EndIf
  2417. EndFunc
  2418.  
  2419.  
Advertisement
Add Comment
Please, Sign In to add comment