Advertisement
Guest User

Sacred Seasons 1 grind script bot

a guest
Sep 20th, 2010
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 50.21 KB | None | 0 0
  1. ; Sacred seasons grind script.
  2. ; http://sacredscript.blogspot.com
  3. ; http://madscripter.wordpress.com
  4. ; inspired and based on the work of rbrbran277
  5. ; v0.002 - attacks all in Tsulas and BW A3 - 08/27/2010
  6. ; v0.003 - put in your own coordinates and it should work on SS and Kong
  7. ; v0.004 - added UW E4
  8. ; v0.005 - code cleanup - added UW D2
  9. ; v0.006 - first attempt at generic dungeon grinder
  10. ; v0.007 - added UW F4
  11. ; v0.008 - generic grinder working well - lets try entire arena grind!
  12. ; v0.009 - cleaning up code - ff arena grind works
  13. ; v0.010 - SVA arena grind works
  14. ; v0.011 - changes I made for arena grind didn't work with dungeon grind
  15. ; fixed
  16. ; generic grinder didn't work at all
  17. ; fixed - but only lightly tested
  18. ; v0.012 - adding BRA grind and making BRA repeat after you die
  19. ; v0.013 - making SVA repeat after you die (gotta level my alt!)
  20. ; v0.014 - added FF repeat after you die - I'm not sure why you would want
  21. ; to do that but oh well - also some code cleanup (09/01/10)
  22. ; v0.015 - added BWA grind and repeat
  23. ; v0.016 - added more safeguards against server delay in displaying
  24. ; battle and exit pads
  25. ; v0.017 - not sure previous fixes work but adding DFA anyway
  26. ; v0.018 - added display timer to show how long each iteration took -
  27. ; good for figuring out how much XP/min you're getting (09/02)
  28. ; v0.019 - removing some death checks and seeing if it still works -
  29. ; found a tricky bug that would hang program while walking across map
  30. ; v0.020 - Trying to calculate XP/Min stats for each grind choice
  31. ; v0.021 - still getting XP/Min stats
  32. ; v0.022 - added CWA, UWA,
  33. ; v0.023 - added WaitForPads to dungeon grinds
  34. ; v0.024 - adding HP checking to Tsulas
  35. ; v0.025 - adding HP checking to UW_D2 - no improvement
  36. ; v0.026 - testing attack speed improvements
  37. ; v0.027 - tracked down a bug - might be coincidence but I think SS changed
  38. ; something to try and stop my script - fixed!
  39. ;
  40. ; todo - PGA - add silver info, finish checking XP info
  41. ; retest everything
  42. ;
  43. ; Misc documentation:
  44. ; This is a work in progress - lots of ugly code, commented debugging
  45. ; code and other nonsense.
  46. ;
  47. ; There is currently no way for the script to buff or heal you automatically
  48. ; so this script works best on dungeons you can finish with only attacks.
  49. ; But the pause key will pause the script so you can buff/heal/whatever and
  50. ; then press pause again and the script should resume.
  51. ;
  52. ; For arena runs - checking to see if you died occurs in multiple places and
  53. ; can result in multiple 'you died!' messages once you actually die. It's
  54. ; not a bug - it's a feature. Comment them out if they annoy you.
  55. ;
  56. ; I'm thinking that running arenas is less conspicuous than running a
  57. ; dungeon over and over. Figuring out which arena gets you the best XP/min
  58. ; is up to you. But make sure you can finish the first room of the arena
  59. ; or else the script will bomb. I should fix that - but it's a low
  60. ; priority right now.
  61. ;
  62. ; Script will calculate and display XP/Min that you are getting.
  63. ; These numbers assume that you are grinding solo - if not, the numbers
  64. ; are wrong. Also, numbers will be completely wrong if you are using
  65. ; the generic dungeon grind function.
  66. ;
  67. ; There are many ways to slightly increase the speed of this script but I
  68. ; went for stability instead of speed. It still glitches sometimes but its
  69. ; also run for over 10 hours unattended - your mileage may vary
  70. ;
  71. ; This is an AutoIT3 script
  72. ; Get AutoIT at http://www.autoitscript.com/autoit3/index.shtml
  73. ;
  74. ; How to use this:
  75. ; 1 - Use AutoIt Window Info to get the coordinates of the top left and
  76. ; bottom right corners of your SS screen and put them in below in
  77. ; the topLeft, bottomRight area
  78. ; 2 - uncomment one of the sections starting at line 214 to run one of the
  79. ; script functions - Tsulas, Underworld, Arena, etc
  80. ;
  81. ; As the script runs, it will pop up a window telling you how many times it
  82. ; has run that section and how long it took. This is purely informative and
  83. ; can be commented out if you don't like it.
  84.  
  85. Global $topLeft[2]
  86. Global $bottomRight[2]
  87.  
  88. $topLeft[0] = 117
  89. $topLeft[1] = 150
  90. $bottomRight[0] = 854
  91. $bottomRight[1] = 748
  92.  
  93. Global $paused
  94. HotKeySet("{ESC}", "Terminate")
  95. HotKeySet("{PAUSE}","_pause")
  96.  
  97. Func _pause()
  98. $paused = NOT $paused
  99. While $paused
  100. Sleep(100)
  101. Wend
  102. EndFunc
  103.  
  104. Global $coord[2]
  105. Global $newCoord[2]
  106. Global $exitCoord[2]
  107. Global $arenaCoord[2]
  108. Global $battleCoord[2]
  109. Global $genericCoord[2]
  110. Global $newGenCoord[2]
  111. Global $waitCoord[2]
  112. Global $TotalRunCount
  113. Global $AttackColor1
  114. Global $AttackColor2
  115. Global $BlankColor1
  116. Global $BlankPixel
  117. Global $xCoord
  118. Global $yCoord
  119. Global $AttackLoop
  120. Global $AttackPixel
  121. Global $AttackPixelCount
  122. Global $GrindCheckSum
  123. Global $oldCheckSum
  124. Global $BattleCheckSum
  125. Global $DungeonCheckSum
  126. Global $DeathCheckSum
  127. Global $Death
  128. Global $xPos
  129. Global $yPos
  130. Global $healgrind
  131. Global $checkPixel
  132. Global $battleCheck
  133. Global $GenericContinue
  134. Global $ArenaContinue
  135. Global $NumberOfBattles
  136. Global $TsulasHP
  137. Global $CheckHP
  138. Global $TotalXP
  139. Global $EntireXP
  140. Global $startTime
  141. Global $entireTime
  142. Global $timeElapsed
  143. Global $CheckTimer
  144. Global $TimerDone
  145. Global $totalTimeElapsed
  146. ; FF
  147. Global $FFCoord[2]
  148. Global $FFContinue
  149. Global $NewFFCoord[2]
  150. ; SVA
  151. Global $SVACoord[2]
  152. Global $SVAContinue
  153. Global $NewSVACoord[2]
  154. ; BRA
  155. Global $BRACoord[2]
  156. Global $BRAContinue
  157. Global $NewBRACoord[2]
  158. ; BWA
  159. Global $BWACoord[2]
  160. Global $BWAContinue
  161. Global $NewBWACoord[2]
  162. ; DFA
  163. Global $DFACoord[2]
  164. Global $DFAContinue
  165. Global $NewDFACoord[2]
  166. ; CWA
  167. Global $CWACoord[2]
  168. Global $CWAContinue
  169. Global $NewCWACoord[2]
  170. ; UWA
  171. Global $UWACoord[2]
  172. Global $UWAContinue
  173. Global $NewUWACoord[2]
  174. ; Death check
  175. Global $DeathColor
  176. Global $DeathPixel
  177. ; FFXP - correct values and checked
  178. 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]
  179. ; SVAXP - correct values - placement not checked
  180. Global $SVAXP[97]=[0,72,75,90,40,117,66,76,87,111,156,60,66,90,120,190,99,213,180,50,240,130,190,244,244,50,19,105,150,100,270,330,180,80,205,150,88,149,179,386,501,320,243,510,305,350,225,510,895,380,320,330,570,610,450,900,190,400,900,910,430,1065,520,900,390,745,1500,1950,1530,1100,830,1700,1180,1300,1760,452,2400,800,3075,1950,1100,1315,930,1315,1350,3060,1250,1550,830,1350,2925,4,950,490,1425,980,160]
  181. ; BWAXP - correct values - placement not checked
  182. Global $BWAXP[98]=[0,110,110,150,100,70,140,180,200,320,99,80,220,270,100,270,550,1750,825,938,1360,54,397,1375,150,1845,1800,300,180,775,1300,2138,900,1300,830,1200,450,921,2000,475,1350,600,950,998,65,160,465,240,650,490,80,1560,1720,1130,400,1695,500,160,80,1260,1560,480,500,2400,1300,690,2720,1490,1380,500,2235,500,1440,2980,1440,1050,720,1220,500,1490,2160,500,2235,1220,1000,2930,3450,1360,3480,1200,1560,3120,2400,1000,2340,2160,2235,3000]
  183. ; DFAXP - correct values - placement not checked
  184. Global $DFAXP[96]=[0,205,300,102,535,305,410,525,494,220,540,700,170,230,190,180,422,430,750,265,500,735,285,740,355,855,975,765,780,1020,745,1410,1175,675,287,305,1600,856,520,825,375,1249,1540,1234,1825,1145,1005,1430,330,725,1665,1360,870,610,1300,970,1310,1290,1285,3260,2875,906,7200,270,1320,1979,2660,1194,3342,1756,2046,4076,7426,992,4450,504,5972,2912,6916,2200,968,5432,6363,1300,3300,3257,1761,5824,7524,4354,6614,7624,12848,3801,11452]
  185. ; BRAXP - correct values - placement not checked
  186. Global $BRAXP[90]=[0,905,605,1150,280,3020,950,500,2390,1800,4125,2340,730,3725,465,3014,2016,2634,1920,3008,1560,2218,3240,1500,828,4410,450,1512,3020,1756,360,1844,2994,992,1560,2040,1386,500,3588,1630,1331,700,585,4278,1264,3584,7155,2528,306,2235,3534,4002,3792,5724,3400,3792,90,4416,270,3830,4293,2862,1996,6075,5924,6140,2862,4342,1245,5602,8476,2994,1242,5528,9204,7119,3764,15056,5500,4308,2307,10596,15518,11292,11340,6000,12132,5184,9030,6792]
  187. ; CWAXP - incorrect
  188. Global $CWAXP[90]=[0,905,605,1150,280,3020,950,500,2390,1800,4125,2340,730,3725,465,3014,2016,2634,1920,3008,1560,2218,3240,1500,828,4410,450,1512,3020,1756,360,1844,2994,992,1560,2040,1386,500,3588,1630,1331,700,585,4278,1264,3584,7155,2528,306,2235,3534,4002,3792,5724,3400,3792,90,4416,270,3830,4293,2862,1996,6075,5924,6140,2862,4342,1245,5602,8476,2994,1242,5528,9204,7119,3764,15056,5500,4308,2307,10596,15518,11292,11340,6000,12132,5184,9030,6792]
  189. ; UWAXP - incorrect
  190. Global $UWAXP[90]=[0,905,605,1150,280,3020,950,500,2390,1800,4125,2340,730,3725,465,3014,2016,2634,1920,3008,1560,2218,3240,1500,828,4410,450,1512,3020,1756,360,1844,2994,992,1560,2040,1386,500,3588,1630,1331,700,585,4278,1264,3584,7155,2528,306,2235,3534,4002,3792,5724,3400,3792,90,4416,270,3830,4293,2862,1996,6075,5924,6140,2862,4342,1245,5602,8476,2994,1242,5528,9204,7119,3764,15056,5500,4308,2307,10596,15518,11292,11340,6000,12132,5184,9030,6792]
  191.  
  192. $AttackColor1 = Dec("FFFFFF")
  193. $AttackColor2 = Dec("FFFEFF")
  194. $BlankColor1 = Dec("333333")
  195. $BattleTextColor = 0xFFFFFF
  196. $PadColor1 = 0xFC4744
  197. $ExitColor1 = 0xF8F6EA
  198. $DeathColor = Dec("86A89C")
  199.  
  200. $TotalRunCount=0
  201.  
  202. $screenWidth = $bottomRight[0] - $topLeft[0]
  203. $screenHeight = $bottomRight[1] - $topLeft[1]
  204.  
  205. $repeatagain = 1
  206.  
  207. $entireTime = TimerInit()
  208.  
  209. While $repeatagain < 6000
  210. $startTime = TimerInit()
  211. $TotalXP=0
  212. ; ***** UNCOMMENT ONE (AND ONLY ONE) OF THESE TO RUN
  213. ; These are various functions you can run.
  214. ; GrindTsulas()
  215. ; GrindTsulas2()
  216. ; GrindBW_A3()
  217. ; GrindUW_E4()
  218. ; GrindUW_D2()
  219. ; GrindUW_F4()
  220. ; Generic()
  221. ; ArenaFF()
  222. ; ArenaSVA()
  223. ; ArenaBWA()
  224. ; ArenaDFA()
  225. ArenaBRA()
  226. ; ArenaCWA()
  227. ; ArenaUWA()
  228.  
  229. $EntireXP = $EntireXP + $TotalXP
  230. $timeElapsed = TimerDiff($startTime)
  231. $entireTimeElapsed = TimerDiff($entireTime)
  232. $TotalRunCount = $TotalRunCount + 1
  233. MsgBox(8192, "Total Runs " & $TotalRunCount, "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 , 5)
  234. 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)
  235. ConsoleWrite("TotalXP=" & $TotalXP & @CRLF)
  236. ConsoleWrite("EntireXP=" & $EntireXP & @CRLF & @CRLF)
  237.  
  238. $repeatagain = $repeatagain + 1
  239. WEnd
  240.  
  241.  
  242. Func AttackGrid($menu)
  243. ; these settings are working for me - adjust them if you need to
  244. ; bottom left
  245. ; (659, 524) - old value
  246. ; Attack(0.733, 0.626)
  247. ; (659, 537) - new value
  248. Attack (0.733, 0.646)
  249.  
  250. ; 6th (bottom right) monster - appears so rarely its hard to get
  251. ; a good fix on its position - this may need to be tweaked
  252. ; (814, 532)
  253. Attack(0.943, 0.638)
  254.  
  255. ; middle right
  256. ; (778, 446)
  257. Attack(0.894, 0.494)
  258.  
  259. ; middle left
  260. ; (611, 432) - old value
  261. ; Attack(0.668, 0.471)
  262. ; (611, 437) - new value
  263. Attack(0.668, 0.480)
  264.  
  265. ; top right
  266. ; (727, 352)
  267. Attack(0.825, 0.337)
  268.  
  269. ; top left
  270. ; (560, 334) - old value
  271. ; Attack(0.600, 0.308)
  272. ; (560, 337) - new value
  273. Attack (0.600, 0.313)
  274.  
  275. EndFunc
  276.  
  277. Func Attack($x, $y)
  278. $xPos = $topLeft[0] + ($screenWidth * $x)
  279. $yPos = $topLeft[1] + ($screenHeight * $y)
  280. MouseMove($xPos, $yPos, 0)
  281. MouseClick("left")
  282. EndFunc
  283.  
  284. Func findAttack()
  285. ;$xCoord=456
  286. $xCoord=$topLeft[0]+339
  287. ;$yCoord=371
  288. $yCoord=$topLeft[1]+221
  289. MouseMove($xCoord,($yCoord-40), 1)
  290. ;For $yCoord = 371 to 489
  291. For $yCoord = ($topLeft[1]+221) to ($topLeft[1]+339)
  292. $AttackPixelCount=0
  293. ; moving the mouse here is not necessary and slows things down
  294. ; a bit but it makes the script more stable
  295. ; - and it looks cool - uncomment it and see how it runs for you
  296. ;MouseMove($xCoord,$yCoord, 1)
  297. For $AttackLoop = 0 to 9
  298. $AttackPixel = PixelGetColor($xCoord + $AttackLoop,$yCoord)
  299. ;If ($AttackPixel = $AttackColor1) or ($AttackPixel = $AttackColor2) Then
  300. If ($AttackPixel > 16646144) Then
  301. $AttackPixelCount = $AttackPixelCount + 1
  302. ;MsgBox(8192, $AttackPixelCount, $AttackPixelCount, 1)
  303. Else
  304. $AttackLoop=9
  305. EndIf
  306. Next
  307. If $AttackPixelCount > 9 Then
  308. MouseMove($xCoord,$yCoord, 1)
  309. $coord[0]=$xCoord
  310. $coord[1]=$yCoord
  311. ;ConsoleWrite("y=" & $yCoord & @CRLF)
  312. Return ($coord)
  313. EndIf
  314. Next
  315. $coord[0]=1
  316. $coord[1]=1
  317. Sleep(500)
  318. Return ($coord)
  319. EndFunc
  320.  
  321. Func Terminate()
  322. Exit
  323. EndFunc
  324.  
  325. Func Battle($x, $y)
  326. ;$BattleCheckSum = PixelChecksum(230,213,250,225) - old
  327. ;$BattleCheckSum = PixelChecksum(769, 625, 836, 640)
  328. $BattleCheckSum = PixelChecksum(($topLeft[0]+652),($topLeft[1]+475),($topLeft[0]+719),($topLeft[1]+490))
  329. MouseMove($x, $y, 3)
  330. Sleep(1000)
  331. MouseClick("left")
  332. While $BattleCheckSum = PixelChecksum(($topLeft[0]+652),($topLeft[1]+475),($topLeft[0]+719),($topLeft[1]+490))
  333. Sleep(100)
  334. WEnd
  335. ; kill all creatures
  336. ;$BattleCheckSum = PixelCheckSum(186,400,205,414)
  337. $BattleCheckSum = PixelCheckSum(($topLeft[0]+69),($topLeft[1]+250),($topLeft[0]+88),($topLeft[1]+264))
  338. While $BattleCheckSum = PixelCheckSum(($topLeft[0]+69),($topLeft[1]+250),($topLeft[0]+88),($topLeft[1]+264))
  339. $battleCoord = findAttack()
  340. If $battleCoord[0] > 1 Then
  341. MouseMove($battleCoord[0], $battleCoord[1], 3)
  342. ; Attack every possible position.
  343. Sleep(200)
  344. MouseClick("left")
  345. Sleep(200)
  346. AttackGrid($battleCoord)
  347. EndIf
  348. WEnd
  349. ; fight over - click box
  350. ; check HP first
  351. $BlankPixel = PixelGetColor(($topLeft[0]+176), ($topLeft[1]+455))
  352. ;ConsoleWrite("BlankPixel = " & $BlankPixel & @CRLF & "BlankColor =" & $BlankColor1 & @CRLF)
  353. ;MouseMove(483, 511, 3)
  354. MouseMove(($topLeft[0]+366),($topLeft[1]+361),3)
  355. ; a little pause to see your stats
  356. Sleep(2000)
  357. ;$BattleCheckSum = PixelChecksum(186,400,205,414)
  358. $BattleCheckSum = PixelCheckSum(($topLeft[0]+69),($topLeft[1]+250),($topLeft[0]+88),($topLeft[1]+264))
  359. MouseClick("left")
  360. ; another death check
  361. $DeathPixel = PixelGetColor(($topLeft[0]+565), ($topLeft[1]+58))
  362. If ($DeathPixel = $DeathColor) Then
  363. $continue=2
  364. MsgBox(8192, "You died! (battle check)", "You died!", 1)
  365. Else
  366. While $BattleCheckSum = PixelCheckSum(($topLeft[0]+69),($topLeft[1]+250),($topLeft[0]+88),($topLeft[1]+264))
  367. Sleep(100)
  368. WEnd
  369. Sleep(500)
  370. EndIf
  371. $NumberOfBattles=$NumberOfBattles+1
  372. EndFunc
  373.  
  374. Func DungeonPad($x, $y)
  375. ; checks for changes in bottom right corner
  376. MouseMove($x, $y ,3)
  377. Sleep(100)
  378. ;$DungeonCheckSum = PixelChecksum(769, 621, 836, 640)
  379. $DungeonCheckSum = PixelChecksum(($topLeft[0]+652),($topLeft[1]+471),($topLeft[0]+719),($topLeft[1]+490))
  380. MouseClick("left")
  381. Sleep(100)
  382. ;MouseClick("left")
  383. ;$DungeonCheckSum = PixelChecksum(769, 621, 836, 640)
  384. While $DungeonCheckSum = PixelChecksum(($topLeft[0]+652),($topLeft[1]+471),($topLeft[0]+719),($topLeft[1]+490))
  385. Sleep(1000)
  386. MouseClick("left")
  387. WEnd
  388. EndFunc
  389.  
  390. Func DungeonPad2($x, $y)
  391. ; checks for changes in top right corner
  392. MouseMove($x, $y ,3)
  393. Sleep(100)
  394. ;$DungeonCheckSum = PixelChecksum(784, 210, 820, 230)
  395. $DungeonCheckSum = PixelChecksum(($topLeft[0]+667),($topLeft[1]+60),($topLeft[0]+703),($topLeft[1]+80))
  396. MouseClick("left")
  397. Sleep(100)
  398. MouseClick("left")
  399. ;$DungeonCheckSum = PixelChecksum(784, 210, 820, 230)
  400. While $DungeonCheckSum = PixelChecksum(($topLeft[0]+667),($topLeft[1]+60),($topLeft[0]+703),($topLeft[1]+80))
  401. Sleep(1000)
  402. MouseClick("left")
  403. WEnd
  404. EndFunc
  405.  
  406. Func WaitForPads()
  407. $padwait=1
  408. While $padwait < 2
  409. ; death check
  410. ;$DeathPixel = PixelGetColor(682, 208)
  411. $DeathPixel = PixelGetColor(($topLeft[0]+565), ($topLeft[1]+58))
  412. If ($DeathPixel = $DeathColor) Then
  413. $continue = 2
  414. $padwait=$padwait+1
  415. MsgBox(8192, "You died! (Padcheck)", "You died!", 1)
  416. EndIf
  417.  
  418. $waitCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$ExitColor1)
  419. If @error <> 1 Then
  420. $padwait=$padwait+1
  421. EndIf
  422.  
  423. $waitCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$PadColor1)
  424. If @error <> 1 Then
  425. $padwait=$padwait+1
  426. EndIf
  427. Sleep(500)
  428. WEnd
  429.  
  430. EndFunc
  431.  
  432. Func GrindTsulas()
  433. ; start script outside of dungeon
  434. ;
  435. ; since it's better to just do the 950 battle over and over again
  436. ; if you can, this for loop determines how many times you do the
  437. ; 950 battle before you do both battles - and replenish your hp and sp
  438. For $healgrind=1 to 9
  439. ; enter Tsulas
  440. ;DungeonPad(480, 430)
  441. DungeonPad(($topLeft[0]+363),($topLeft[1]+280))
  442. WaitForPads()
  443.  
  444. ; enter first battle - bottom - 4 creatures
  445. ;Battle(389, 557)
  446. Battle(($topLeft[0]+272),($topLeft[1]+407))
  447. WaitForPads()
  448.  
  449. ; click to exit Tsulas
  450. ;DungeonPad(676, 316)
  451. DungeonPad(($topLeft[0]+559),($topLeft[1]+166))
  452.  
  453. ; move away from Tsulas
  454. ;MouseMove(555, 553, 3)
  455. MouseMove(($topLeft[0]+438),($topLeft[1]+403), 3)
  456. Sleep(200)
  457. MouseClick("left")
  458. Sleep(1000)
  459. $TotalXP=$TotalXP+950
  460. Next
  461.  
  462. ; enter Tsulas
  463. ;DungeonPad(480, 430)
  464. DungeonPad(($topLeft[0]+363),($topLeft[1]+280))
  465. WaitForPads()
  466.  
  467. ; enter first battle - bottom - 4 creatures
  468. ;Battle(389, 557)
  469. Battle(($topLeft[0]+272),($topLeft[1]+407))
  470. WaitForPads()
  471.  
  472. ; enter second battle - 4 creatures
  473. ;Battle(339, 364)
  474. Battle(($topLeft[0]+222),($topLeft[1]+214))
  475. WaitForPads()
  476.  
  477. ; click to exit Tsulas
  478. ;DungeonPad(676, 316)
  479. DungeonPad(($topLeft[0]+559),($topLeft[1]+166))
  480.  
  481. ; move away from Tsulas
  482. ;MouseMove(555, 553, 3)
  483. MouseMove(($topLeft[0]+438),($topLeft[1]+403), 3)
  484. Sleep(200)
  485. MouseClick("left")
  486. Sleep(1000)
  487. $TotalXP=$TotalXP+1500
  488. EndFunc
  489.  
  490. Func GrindTsulas2()
  491. ; start script outside of dungeon
  492. ;
  493. ; since it's better to just do the 950 battle over and over again
  494. ; if you can, this for loop determines how many times you do the
  495. ; 950 battle before you do both battles - and replenish your hp and sp
  496. ;
  497. ; - this version checks your HP for you and continues if greater
  498. ; than half
  499. $TsulasHP = 1
  500. While $TsulasHP = 1
  501. ; enter Tsulas
  502. ;DungeonPad(480, 430)
  503. DungeonPad(($topLeft[0]+363),($topLeft[1]+280))
  504. WaitForPads()
  505.  
  506. ; enter first battle - bottom - 4 creatures
  507. ;Battle(389, 557)
  508. Battle(($topLeft[0]+272),($topLeft[1]+407))
  509. WaitForPads()
  510. $TotalXP=$TotalXP+950
  511.  
  512. ;$BlankPixel = PixelGetColor(($topLeft[0]+176), ($topLeft[1]+455))
  513. If ($BlankPixel = $BlankColor1) Then
  514. $TsulasHP = 2
  515. Else
  516. ; click to exit Tsulas
  517. ;DungeonPad(676, 316)
  518. DungeonPad(($topLeft[0]+559),($topLeft[1]+166))
  519.  
  520. ; move away from Tsulas
  521. ;MouseMove(555, 553, 3)
  522. MouseMove(($topLeft[0]+438),($topLeft[1]+403), 3)
  523. Sleep(200)
  524. MouseClick("left")
  525. Sleep(1000)
  526. EndIf
  527. WEnd
  528.  
  529. ; enter second battle - 4 creatures
  530. ;Battle(339, 364)
  531. Battle(($topLeft[0]+222),($topLeft[1]+214))
  532. WaitForPads()
  533.  
  534. ; click to exit Tsulas
  535. ;DungeonPad(676, 316)
  536. DungeonPad(($topLeft[0]+559),($topLeft[1]+166))
  537.  
  538. ; move away from Tsulas
  539. ;MouseMove(555, 553, 3)
  540. MouseMove(($topLeft[0]+438),($topLeft[1]+403), 3)
  541. Sleep(200)
  542. MouseClick("left")
  543. Sleep(1000)
  544. $TotalXP=$TotalXP+550
  545. EndFunc
  546.  
  547. Func GrindBW_A3()
  548. ; start script outside of dungeon
  549. ;
  550. ; enter Bleakwoods A3
  551. ;DungeonPad(601, 398)
  552. DungeonPad(($topLeft[0]+484),($topLeft[1]+248))
  553. WaitForPads()
  554.  
  555. ; enter first battle - right
  556. ;Battle(625, 410)
  557. Battle(($topLeft[0]+508),($topLeft[1]+260))
  558. WaitForPads()
  559.  
  560. ; enter second battle - left
  561. ;Battle(336, 362)
  562. Battle(($topLeft[0]+219),($topLeft[1]+212))
  563. WaitForPads()
  564.  
  565. ; click to exit Bleakwoods A3
  566. ;DungeonPad(720, 554)
  567. DungeonPad(($topLeft[0]+603),($topLeft[1]+404))
  568. WaitForPads()
  569.  
  570. ; move away from Bleakwoods A3
  571. ;MouseMove(507, 443, 3)
  572. MouseMove(($topLeft[0]+390),($topLeft[1]+293),3)
  573. Sleep(100)
  574. MouseClick("left")
  575. Sleep(1000)
  576. $TotalXP=$TotalXP+1617
  577. EndFunc
  578.  
  579. Func GrindUW_E4()
  580. ; start script outside of dungeon
  581. ;
  582. ; enter Underworld E4
  583. ;DungeonPad(792, 327)
  584. DungeonPad(($topLeft[0]+675),($topLeft[1]+177))
  585. WaitForPads()
  586.  
  587. ; enter first battle
  588. ;Battle(480, 361)
  589. Battle(($topLeft[0]+363),($topLeft[1]+211))
  590. WaitForPads()
  591.  
  592. ; enter second battle
  593. ;Battle(600, 350)
  594. Battle(($topLeft[0]+483),($topLeft[1]+200))
  595. WaitForPads()
  596.  
  597. ; enter third battle
  598. ;Battle(649, 421)
  599. Battle(($topLeft[0]+532),($topLeft[1]+271))
  600.  
  601. ; exit Underworld E4
  602. ;DungeonPad(288, 531)
  603. DungeonPad(($topLeft[0]+171),($topLeft[1]+381))
  604.  
  605. ; move away from Underworld E4
  606. ;MouseMove(631, 312, 3)
  607. MouseMove(($topLeft[0]+514),($topLeft[1]+162), 3)
  608. Sleep(100)
  609. MouseClick("left")
  610. Sleep(1000)
  611. $TotalXP=$TotalXP+3710
  612. EndFunc
  613.  
  614. Func GrindUW_D2()
  615. ; start script outside of dungeon
  616. ;
  617. ; enter Underworld D2
  618. ;DungeonPad(480, 578)
  619. DungeonPad(($topLeft[0]+363),($topLeft[1]+428))
  620. WaitForPads()
  621.  
  622. ; enter first battle
  623. ;Battle(506, 494)
  624. Battle(($topLeft[0]+389),($topLeft[1]+344))
  625. WaitForPads()
  626.  
  627. ; enter second battle
  628. ;Battle(314, 327)
  629. Battle(($topLeft[0]+197),($topLeft[1]+177))
  630. WaitForPads()
  631.  
  632. ; enter third battle
  633. ;Battle(673, 410)
  634. Battle(($topLeft[0]+556),($topLeft[1]+260))
  635.  
  636. ; exit Underworld D2
  637. ;DungeonPad(168, 614)
  638. DungeonPad(($topLeft[0]+51),($topLeft[1]+464))
  639.  
  640. ; move away from Underworld D2
  641. ;MouseMove(390, 524, 3)
  642. MouseMove(($topLeft[0]+273),($topLeft[1]+374), 3)
  643. Sleep(100)
  644. MouseClick("left")
  645. Sleep(1000)
  646. $TotalXP=$TotalXP+3610
  647. EndFunc
  648.  
  649. Func GrindUW_F4()
  650. ; start script outside of dungeon
  651. ;
  652. ; enter Underworld F4
  653. ;DungeonPad(768, 482)
  654. DungeonPad(($topLeft[0]+651), ($topLeft[1]+332))
  655. WaitForPads()
  656.  
  657. ; enter first battle
  658. ;Battle(505, 350)
  659. Battle(($topLeft[0]+388), ($topLeft[1]+200))
  660. WaitForPads()
  661.  
  662. ; enter second battle
  663. ;Battle(625, 434)
  664. Battle(($topLeft[0]+508), ($topLeft[1]+284))
  665. WaitForPads()
  666.  
  667. ; enter third battle
  668. ;Battle(577, 458)
  669. Battle(($topLeft[0]+460), ($topLeft[1]+308))
  670.  
  671. ; exit Underworld F4
  672. ;DungeonPad(288, 529)
  673. DungeonPad(($topLeft[0]+171), ($topLeft[1]+379))
  674.  
  675. ; move away from Underworld F4
  676. ;MouseMove(651, 456, 3)
  677. MouseMove(($topLeft[0]+534), ($topLeft[1]+306), 3)
  678. Sleep(100)
  679. MouseClick("left")
  680. Sleep(1000)
  681. $TotalXP=$TotalXP+4787
  682. EndFunc
  683.  
  684. Func Generic()
  685. ; start script outside of dungeon
  686. ;
  687. ; enter dungeon
  688. ; Find pad
  689. $GenericContinue = 1
  690. $genericCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$PadColor1)
  691. If @error=1 Then
  692. ;MouseMove(544, 537, 3)
  693. MouseMove(($topLeft[0]+427), ($topLeft[1]+387), 3)
  694. Sleep(100)
  695. MouseClick("left")
  696. Sleep(1000)
  697. $genericCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$PadColor1)
  698. EndIf
  699. DungeonPad($genericCoord[0], $genericCoord[1])
  700. WaitForPads()
  701.  
  702. ; Find Battle
  703. While $GenericContinue = 1
  704. sleep(500)
  705. $genericCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$PadColor1)
  706. $CheckPixel = PixelGetColor($genericCoord[0],$genericCoord[1]+15)
  707. If $CheckPixel = $BattleTextColor Then
  708. Battle($genericCoord[0], $genericCoord[1])
  709. WaitForPads()
  710. Else
  711. $newGenCoord[0]=$genericCoord[0]
  712. $newGenCoord[1]=$genericCoord[1]
  713. $genericCoord = PixelSearch($topLeft[0],$newGenCoord[1]+1,$bottomRight[0],$bottomRight[1],$PadColor1)
  714. If @error=1 Then
  715. $GenericContinue = 2
  716. Else
  717. Battle($genericCoord[0], $genericCoord[1])
  718. WaitForPads()
  719. EndIf
  720. EndIf
  721. WEnd
  722.  
  723. ; exit dungeon
  724. $genericCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$PadColor1)
  725. DungeonPad($genericCoord[0], $genericCoord[1])
  726.  
  727. ; move away from dungeon
  728. ; how to make this work?
  729. ; find coords of pad and try 50 left and right?
  730. ; ^ not done yet
  731.  
  732. ;MouseMove(284, 551, 3)
  733. MouseMove(($topLeft[0]+167), ($topLeft[1]+451), 3)
  734. Sleep(100)
  735. MouseClick("left")
  736. Sleep(1000)
  737. $TotalXP=$TotalXP+1
  738. EndFunc
  739.  
  740. Func ArenaFF()
  741. ; start script in arena in first room with battles (not in lobby)
  742. ; if you die, you will return to the arena and start over
  743. ; if you make it through, you need to stop the script!
  744. ; IMPORTANT - you need to be able to survive through the first room!
  745. ;
  746. ; first room
  747.  
  748. $NumberOfBattles=0
  749. $FFContinue = 1
  750. ; First room - find and do all three battles
  751.  
  752. While $FFContinue = 1
  753. WaitForPads()
  754. $FFCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$PadColor1)
  755. $CheckPixel = PixelGetColor($FFCoord[0],$FFCoord[1]+15)
  756. If $CheckPixel = $BattleTextColor Then
  757. Battle($FFCoord[0], $FFCoord[1])
  758. $TotalXP=$TotalXP+$FFXP[$NumberOfBattles]
  759. Else
  760. $newFFCoord[0]=$FFCoord[0]
  761. $newFFCoord[1]=$FFCoord[1]
  762. $FFCoord = PixelSearch($topLeft[0]+1,$newFFCoord[1]+1,$bottomRight[0],$bottomRight[1],$PadColor1)
  763. If @error=1 Then
  764. $FFContinue = 2
  765. Else
  766. Battle($FFCoord[0], $FFCoord[1])
  767. $TotalXP=$TotalXP+$FFXP[$NumberOfBattles]
  768. EndIf
  769. EndIf
  770. WEnd
  771.  
  772. ; first room - go to exit pad
  773. WaitForPads()
  774. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$ExitColor1)
  775. DungeonPad($arenaCoord[0],$arenaCoord[1])
  776.  
  777. $continue = 1
  778.  
  779. ; Find Battle
  780. While $continue = 1
  781. ; need to move away from pad first - maybe not necessary?
  782. ; 09/01 - I decided this is necessary again
  783. MouseMove(($topLeft[0]+368), ($topLeft[1]+253), 3)
  784. MouseClick("left")
  785. sleep(500)
  786. ; find white pad
  787. WaitForPads()
  788. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$ExitColor1)
  789. If @error=1 Then
  790. $exitCoord[0] = $topLeft[0]
  791. $exitCoord[1] = $topLeft[1]
  792. Else
  793. $exitCoord[0]=$arenaCoord[0]
  794. $exitCoord[1]=$arenaCoord[1]
  795. EndIf
  796.  
  797. $battleCheck = 1
  798.  
  799. While $battleCheck = 1
  800. ; next search for battle pads
  801. WaitForPads()
  802. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$PadColor1)
  803. If @error=1 Then
  804. $battleCheck = 2
  805. Else
  806. Battle($arenaCoord[0], $arenaCoord[1])
  807. $TotalXP=$TotalXP+$FFXP[$NumberOfBattles]
  808. EndIf
  809. Wend
  810. WaitForPads()
  811. ; death check
  812. ;$DeathPixel = PixelGetColor(682, 208)
  813. $DeathPixel = PixelGetColor(($topLeft[0]+565), ($topLeft[1]+58))
  814. If ($DeathPixel = $DeathColor) Then
  815. $continue = 2
  816. MsgBox(8192, "You died! (arena check 1)", "You died!", 1)
  817. Else
  818. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$ExitColor1)
  819. If (($arenaCoord[0] = $exitCoord[0]) and ($arenaCoord[1] = $exitCoord[1])) Then
  820. $arenaCoord = PixelSearch($topLeft[0],$exitCoord[1]+3,$bottomRight[0],$bottomRight[1],$ExitColor1)
  821. DungeonPad($arenaCoord[0],$arenaCoord[1])
  822. Else
  823. DungeonPad($arenaCoord[0],$arenaCoord[1])
  824. EndIf
  825. EndIf
  826. ; might need to check more than once
  827. ;$DeathPixel = PixelGetColor(682, 208)
  828. $DeathPixel = PixelGetColor(($topLeft[0]+565), ($topLeft[1]+58))
  829. If ($DeathPixel = $DeathColor) Then
  830. $continue = 2
  831. MsgBox(8192, "You died! (arena check 2)", "You died!", 1)
  832. EndIf
  833. WEnd
  834.  
  835. ; died - remove last battle XP
  836. $TotalXP=$TotalXP-$FFXP[$NumberOfBattles]
  837.  
  838. ; starting from Shikaakwa - return to FF
  839. ;DungeonPad(335, 288)
  840. DungeonPad(($topLeft[0]+218),($topLeft[1]+138))
  841.  
  842. ;DungeonPad(481, 238)
  843. DungeonPad(($topLeft[0]+364),($topLeft[1]+88))
  844.  
  845. ;DungeonPad(168, 252)
  846. DungeonPad(($topLeft[0]+51),($topLeft[1]+102))
  847.  
  848. ;DungeonPad(480, 234)
  849. DungeonPad(($topLeft[0]+363),($topLeft[1]+84))
  850.  
  851. ;DungeonPad(313, 413)
  852. DungeonPad(($topLeft[0]+196),($topLeft[1]+263))
  853.  
  854. ;DungeonPad(192, 240)
  855. DungeonPad(($topLeft[0]+75),($topLeft[1]+90))
  856.  
  857. EndFunc
  858.  
  859. Func ArenaSVA()
  860. ; start script in arena in first room with battles (not in lobby)
  861. ; if you die, you will return to the arena and start over
  862. ; if you make it through, you need to stop the script!
  863. ; IMPORTANT - you need to be able to survive through the first room!
  864. ;
  865. ; first room
  866.  
  867. $NumberOfBattles=0
  868. $SVAContinue = 1
  869. ; First room - find and do all two battles
  870.  
  871. While $SVAContinue = 1
  872. WaitForPads()
  873. $SVACoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$PadColor1)
  874. $CheckPixel = PixelGetColor($SVACoord[0],$SVACoord[1]+15)
  875. If $CheckPixel = $BattleTextColor Then
  876. Battle($SVACoord[0], $SVACoord[1])
  877. $TotalXP=$TotalXP+$SVAXP[$NumberOfBattles]
  878. Else
  879. $newSVACoord[0]=$SVACoord[0]
  880. $newSVACoord[1]=$SVACoord[1]
  881. $SVACoord = PixelSearch($topLeft[0]+1,$newSVACoord[1]+1,$bottomRight[0],$bottomRight[1],$PadColor1)
  882. If @error=1 Then
  883. $SVAContinue = 2
  884. Else
  885. Battle($SVACoord[0], $SVACoord[1])
  886. $TotalXP=$TotalXP+$SVAXP[$NumberOfBattles]
  887. EndIf
  888. EndIf
  889. WEnd
  890.  
  891. ; first room - go to exit pad
  892. WaitForPads()
  893. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$ExitColor1)
  894. DungeonPad($arenaCoord[0],$arenaCoord[1])
  895.  
  896. $continue = 1
  897.  
  898. ; Find Battle
  899. While $continue = 1
  900. ; need to move away from pad first - maybe not necessary?
  901. ; 09/01 - I decided this is necessary again
  902. MouseMove(($topLeft[0]+368), ($topLeft[1]+253), 3)
  903. MouseClick("left")
  904. sleep(500)
  905. ; find white pad
  906. WaitForPads()
  907. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$ExitColor1)
  908. If @error=1 Then
  909. $exitCoord[0] = $topLeft[0]
  910. $exitCoord[1] = $topLeft[1]
  911. Else
  912. $exitCoord[0]=$arenaCoord[0]
  913. $exitCoord[1]=$arenaCoord[1]
  914. EndIf
  915.  
  916. $battleCheck = 1
  917.  
  918. While $battleCheck = 1
  919. ; next search for battle pads
  920. WaitForPads()
  921. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$PadColor1)
  922. If @error=1 Then
  923. $battleCheck = 2
  924. Else
  925. Battle($arenaCoord[0], $arenaCoord[1])
  926. $TotalXP=$TotalXP+$SVAXP[$NumberOfBattles]
  927. EndIf
  928. Wend
  929. WaitForPads()
  930. ; death check
  931. ;$DeathPixel = PixelGetColor(682, 208)
  932. $DeathPixel = PixelGetColor(($topLeft[0]+565), ($topLeft[1]+58))
  933. If ($DeathPixel = $DeathColor) Then
  934. $continue = 2
  935. MsgBox(8192, "You died! (arena check 1)", "You died!", 1)
  936. Else
  937. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$ExitColor1)
  938. If (($arenaCoord[0] = $exitCoord[0]) and ($arenaCoord[1] = $exitCoord[1])) Then
  939. $arenaCoord = PixelSearch($topLeft[0],$exitCoord[1]+3,$bottomRight[0],$bottomRight[1],$ExitColor1)
  940. DungeonPad($arenaCoord[0],$arenaCoord[1])
  941. Else
  942. DungeonPad($arenaCoord[0],$arenaCoord[1])
  943. EndIf
  944. EndIf
  945. ; might need to check more than once
  946. ;$DeathPixel = PixelGetColor(682, 208)
  947. $DeathPixel = PixelGetColor(($topLeft[0]+565), ($topLeft[1]+58))
  948. If ($DeathPixel = $DeathColor) Then
  949. $continue = 2
  950. MsgBox(8192, "You died! (arena check 2)", "You died!", 1)
  951. EndIf
  952. WEnd
  953.  
  954. ; died - remove last battle XP
  955. $TotalXP=$TotalXP-$SVAXP[$NumberOfBattles]
  956.  
  957. ; starting from Shikaakwa - return to SVA
  958. ;DungeonPad(335, 288)
  959. DungeonPad(($topLeft[0]+218),($topLeft[1]+138))
  960.  
  961. ;DungeonPad(362, 612)
  962. DungeonPad(($topLeft[0]+245),($topLeft[1]+462))
  963.  
  964. ;DungeonPad(816, 384)
  965. DungeonPad(($topLeft[0]+699),($topLeft[1]+234))
  966.  
  967. ;DungeonPad(817, 287)
  968. DungeonPad(($topLeft[0]+700),($topLeft[1]+137))
  969.  
  970. ;DungeonPad(433, 527)
  971. DungeonPad(($topLeft[0]+316),($topLeft[1]+377))
  972.  
  973. ;DungeonPad(192, 241)
  974. DungeonPad(($topLeft[0]+75),($topLeft[1]+91))
  975.  
  976. EndFunc
  977.  
  978. Func ArenaBRA()
  979. ; start script in arena in first room with battles (not in lobby)
  980. ; if you die, you will return to the arena and start over
  981. ; if you make it through, you need to stop the script!
  982. ; IMPORTANT - you need to be able to survive through the first room!
  983. ;
  984. ; I just read that BRA 7th floor has 2 rooms with no battles
  985. ; This might bomb this script
  986. ;
  987. ; first room
  988.  
  989. $NumberOfBattles=0
  990. $BRAContinue = 1
  991. ; First room - find and do all two battles
  992.  
  993. While $BRAContinue = 1
  994. WaitForPads()
  995. $BRACoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$PadColor1)
  996. $CheckPixel = PixelGetColor($BRACoord[0],$BRACoord[1]+15)
  997. If $CheckPixel = $BattleTextColor Then
  998. Battle($BRACoord[0], $BRACoord[1])
  999. $TotalXP=$TotalXP+$BRAXP[$NumberOfBattles]
  1000. Else
  1001. $newBRACoord[0]=$BRACoord[0]
  1002. $newBRACoord[1]=$BRACoord[1]
  1003. $BRACoord = PixelSearch($topLeft[0]+1,$newBRACoord[1]+1,$bottomRight[0],$bottomRight[1],$PadColor1)
  1004. If @error=1 Then
  1005. $BRAContinue = 2
  1006. Else
  1007. Battle($BRACoord[0], $BRACoord[1])
  1008. $TotalXP=$TotalXP+$BRAXP[$NumberOfBattles]
  1009. EndIf
  1010. EndIf
  1011. WEnd
  1012.  
  1013. ; first room - go to exit pad
  1014. WaitForPads()
  1015. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$ExitColor1)
  1016. DungeonPad($arenaCoord[0],$arenaCoord[1])
  1017.  
  1018. $continue = 1
  1019.  
  1020. ; Find Battle
  1021. While $continue = 1
  1022. ; need to move away from pad first - maybe not necessary?
  1023. ; 09/01 - I decided this is necessary again
  1024. MouseMove(($topLeft[0]+368), ($topLeft[1]+253), 3)
  1025. MouseClick("left")
  1026. sleep(500)
  1027. ; find white pad
  1028. WaitForPads()
  1029. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$ExitColor1)
  1030. If @error=1 Then
  1031. $exitCoord[0] = $topLeft[0]
  1032. $exitCoord[1] = $topLeft[1]
  1033. Else
  1034. $exitCoord[0]=$arenaCoord[0]
  1035. $exitCoord[1]=$arenaCoord[1]
  1036. EndIf
  1037.  
  1038. $battleCheck = 1
  1039.  
  1040. While $battleCheck = 1
  1041. ; next search for battle pads
  1042. WaitForPads()
  1043. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$PadColor1)
  1044. If @error=1 Then
  1045. $battleCheck = 2
  1046. Else
  1047. Battle($arenaCoord[0], $arenaCoord[1])
  1048. $TotalXP=$TotalXP+$BRAXP[$NumberOfBattles]
  1049. EndIf
  1050. Wend
  1051. WaitForPads()
  1052. ; death check
  1053. ;$DeathPixel = PixelGetColor(682, 208)
  1054. $DeathPixel = PixelGetColor(($topLeft[0]+565), ($topLeft[1]+58))
  1055. If ($DeathPixel = $DeathColor) Then
  1056. $continue = 2
  1057. MsgBox(8192, "You died! (arena check 1)", "You died!", 1)
  1058. Else
  1059. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$ExitColor1)
  1060. If (($arenaCoord[0] = $exitCoord[0]) and ($arenaCoord[1] = $exitCoord[1])) Then
  1061. $arenaCoord = PixelSearch($topLeft[0],$exitCoord[1]+3,$bottomRight[0],$bottomRight[1],$ExitColor1)
  1062. DungeonPad($arenaCoord[0],$arenaCoord[1])
  1063. Else
  1064. DungeonPad($arenaCoord[0],$arenaCoord[1])
  1065. EndIf
  1066. EndIf
  1067. ; might need to check more than once
  1068. ;$DeathPixel = PixelGetColor(682, 208)
  1069. $DeathPixel = PixelGetColor(($topLeft[0]+565), ($topLeft[1]+58))
  1070. If ($DeathPixel = $DeathColor) Then
  1071. $continue = 2
  1072. MsgBox(8192, "You died! (arena check 2)", "You died!", 1)
  1073. EndIf
  1074. WEnd
  1075.  
  1076. ; died - remove last battle XP
  1077. $TotalXP=$TotalXP-$BRAXP[$NumberOfBattles]
  1078.  
  1079. ; starting from Shikaakwa - return to BRA
  1080. ;DungeonPad(816, 576)
  1081. DungeonPad2(($topLeft[0]+699),($topLeft[1]+426))
  1082.  
  1083. ;DungeonPad(697, 612)
  1084. DungeonPad2(($topLeft[0]+580),($topLeft[1]+462))
  1085.  
  1086. ;DungeonPad(816, 600)
  1087. DungeonPad2(($topLeft[0]+699),($topLeft[1]+450))
  1088.  
  1089. ;DungeonPad(816, 407)
  1090. DungeonPad(($topLeft[0]+699),($topLeft[1]+257))
  1091.  
  1092. ;DungeonPad(815, 287)
  1093. DungeonPad(($topLeft[0]+698),($topLeft[1]+137))
  1094.  
  1095. ;DungeonPad(817, 431)
  1096. DungeonPad(($topLeft[0]+700),($topLeft[1]+281))
  1097.  
  1098. ;DungeonPad(265, 323)
  1099. DungeonPad(($topLeft[0]+148),($topLeft[1]+173))
  1100.  
  1101. ;DungeonPad(192, 240)
  1102. DungeonPad(($topLeft[0]+75),($topLeft[1]+90))
  1103.  
  1104. EndFunc
  1105.  
  1106. Func ArenaBWA()
  1107. ; start script in arena in first room with battles (not in lobby)
  1108. ; if you die, you will return to the arena and start over
  1109. ; if you make it through, you need to stop the script!
  1110. ; IMPORTANT - you need to be able to survive through the first room!
  1111. ;
  1112. ; first room
  1113.  
  1114. $NumberOfBattles=0
  1115. $BWAContinue = 1
  1116. ; First room - find and do all two battles
  1117.  
  1118. While $BWAContinue = 1
  1119. WaitForPads()
  1120. $BWACoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$PadColor1)
  1121. $CheckPixel = PixelGetColor($BWACoord[0],$BWACoord[1]+15)
  1122. If $CheckPixel = $BattleTextColor Then
  1123. Battle($BWACoord[0], $BWACoord[1])
  1124. $TotalXP=$TotalXP+$BWAXP[$NumberOfBattles]
  1125. Else
  1126. $newBWACoord[0]=$BWACoord[0]
  1127. $newBWACoord[1]=$BWACoord[1]
  1128. $BWACoord = PixelSearch($topLeft[0]+1,$newBWACoord[1]+1,$bottomRight[0],$bottomRight[1],$PadColor1)
  1129. If @error=1 Then
  1130. $BWAContinue = 2
  1131. Else
  1132. Battle($BWACoord[0], $BWACoord[1])
  1133. $TotalXP=$TotalXP+$BWAXP[$NumberOfBattles]
  1134. EndIf
  1135. EndIf
  1136. WEnd
  1137.  
  1138. ; first room - go to exit pad
  1139. WaitForPads()
  1140. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$ExitColor1)
  1141. DungeonPad($arenaCoord[0],$arenaCoord[1])
  1142.  
  1143. $continue = 1
  1144.  
  1145. ; Find Battle
  1146. While $continue = 1
  1147. ; need to move away from pad first - maybe not necessary?
  1148. ; 09/01 - I decided this is necessary again
  1149. MouseMove(($topLeft[0]+368), ($topLeft[1]+253), 3)
  1150. MouseClick("left")
  1151. sleep(500)
  1152. ; find white pad
  1153. WaitForPads()
  1154. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$ExitColor1)
  1155. If @error=1 Then
  1156. $exitCoord[0] = $topLeft[0]
  1157. $exitCoord[1] = $topLeft[1]
  1158. Else
  1159. $exitCoord[0]=$arenaCoord[0]
  1160. $exitCoord[1]=$arenaCoord[1]
  1161. EndIf
  1162.  
  1163. $battleCheck = 1
  1164.  
  1165. While $battleCheck = 1
  1166. ; next search for battle pads
  1167. WaitForPads()
  1168. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$PadColor1)
  1169. If @error=1 Then
  1170. $battleCheck = 2
  1171. Else
  1172. Battle($arenaCoord[0], $arenaCoord[1])
  1173. $TotalXP=$TotalXP+$BWAXP[$NumberOfBattles]
  1174. EndIf
  1175. Wend
  1176. WaitForPads()
  1177. ; death check
  1178. ;$DeathPixel = PixelGetColor(682, 208)
  1179. $DeathPixel = PixelGetColor(($topLeft[0]+565), ($topLeft[1]+58))
  1180. If ($DeathPixel = $DeathColor) Then
  1181. $continue = 2
  1182. MsgBox(8192, "You died! (arena check 1)", "You died!", 1)
  1183. Else
  1184. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$ExitColor1)
  1185. If (($arenaCoord[0] = $exitCoord[0]) and ($arenaCoord[1] = $exitCoord[1])) Then
  1186. $arenaCoord = PixelSearch($topLeft[0],$exitCoord[1]+3,$bottomRight[0],$bottomRight[1],$ExitColor1)
  1187. DungeonPad($arenaCoord[0],$arenaCoord[1])
  1188. Else
  1189. DungeonPad($arenaCoord[0],$arenaCoord[1])
  1190. EndIf
  1191. EndIf
  1192. ; might need to check more than once
  1193. ;$DeathPixel = PixelGetColor(682, 208)
  1194. $DeathPixel = PixelGetColor(($topLeft[0]+565), ($topLeft[1]+58))
  1195. If ($DeathPixel = $DeathColor) Then
  1196. $continue = 2
  1197. MsgBox(8192, "You died! (arena check 2)", "You died!", 1)
  1198. EndIf
  1199. WEnd
  1200.  
  1201. ; died - remove last battle XP
  1202. $TotalXP=$TotalXP-$BWAXP[$NumberOfBattles]
  1203.  
  1204. ; starting from Shikaakwa - return to BWA
  1205. ;DungeonPad(432, 239)
  1206. DungeonPad(($topLeft[0]+315),($topLeft[1]+89))
  1207.  
  1208. ;DungeonPad(457, 250)
  1209. DungeonPad(($topLeft[0]+340),($topLeft[1]+100))
  1210.  
  1211. ;DungeonPad(624, 238)
  1212. DungeonPad(($topLeft[0]+507),($topLeft[1]+88))
  1213.  
  1214. ;DungeonPad(527, 238)
  1215. DungeonPad(($topLeft[0]+410),($topLeft[1]+88))
  1216.  
  1217. ;DungeonPad(528, 239)
  1218. DungeonPad(($topLeft[0]+411),($topLeft[1]+89))
  1219.  
  1220. ;DungeonPad(527, 238)
  1221. DungeonPad(($topLeft[0]+410),($topLeft[1]+88))
  1222.  
  1223. ;DungeonPad(527, 239)
  1224. DungeonPad(($topLeft[0]+410),($topLeft[1]+89))
  1225.  
  1226. ;DungeonPad(768, 239)
  1227. DungeonPad(($topLeft[0]+651),($topLeft[1]+89))
  1228.  
  1229. ;DungeonPad(432, 239)
  1230. DungeonPad(($topLeft[0]+315),($topLeft[1]+89))
  1231.  
  1232. ;DungeonPad(481, 239)
  1233. DungeonPad(($topLeft[0]+364),($topLeft[1]+89))
  1234.  
  1235. ;DungeonPad(384, 238)
  1236. DungeonPad(($topLeft[0]+267),($topLeft[1]+88))
  1237.  
  1238. ;DungeonPad(409, 467)
  1239. DungeonPad(($topLeft[0]+292),($topLeft[1]+317))
  1240.  
  1241. ;DungeonPad(192, 238)
  1242. DungeonPad(($topLeft[0]+75),($topLeft[1]+88))
  1243.  
  1244. EndFunc
  1245.  
  1246. Func ArenaDFA()
  1247. ; start script in arena in first room with battles (not in lobby)
  1248. ; if you die, you will return to the arena and start over
  1249. ; if you make it through, you need to stop the script!
  1250. ; IMPORTANT - you need to be able to survive through the first room!
  1251. ;
  1252. ; first room
  1253.  
  1254. $NumberOfBattles=0
  1255. $DFAContinue = 1
  1256. ; First room - find and do all two battles
  1257.  
  1258. While $DFAContinue = 1
  1259. WaitForPads()
  1260. $DFACoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$PadColor1)
  1261. $CheckPixel = PixelGetColor($DFACoord[0],$DFACoord[1]+15)
  1262. If $CheckPixel = $BattleTextColor Then
  1263. Battle($DFACoord[0], $DFACoord[1])
  1264. $TotalXP=$TotalXP+$DFAXP[$NumberOfBattles]
  1265. Else
  1266. $newDFACoord[0]=$DFACoord[0]
  1267. $newDFACoord[1]=$DFACoord[1]
  1268. $DFACoord = PixelSearch($topLeft[0]+1,$newDFACoord[1]+1,$bottomRight[0],$bottomRight[1],$PadColor1)
  1269. If @error=1 Then
  1270. $DFAContinue = 2
  1271. Else
  1272. Battle($DFACoord[0], $DFACoord[1])
  1273. $TotalXP=$TotalXP+$DFAXP[$NumberOfBattles]
  1274. EndIf
  1275. EndIf
  1276. WEnd
  1277.  
  1278. ; first room - go to exit pad
  1279. WaitForPads()
  1280. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$ExitColor1)
  1281. DungeonPad($arenaCoord[0],$arenaCoord[1])
  1282.  
  1283. $continue = 1
  1284.  
  1285. ; Find Battle
  1286. While $continue = 1
  1287. ; need to move away from pad first - maybe not necessary?
  1288. ; 09/01 - I decided this is necessary again
  1289. MouseMove(($topLeft[0]+368), ($topLeft[1]+253), 3)
  1290. MouseClick("left")
  1291. sleep(500)
  1292. ; find white pad
  1293. WaitForPads()
  1294. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$ExitColor1)
  1295. If @error=1 Then
  1296. $exitCoord[0] = $topLeft[0]
  1297. $exitCoord[1] = $topLeft[1]
  1298. Else
  1299. $exitCoord[0]=$arenaCoord[0]
  1300. $exitCoord[1]=$arenaCoord[1]
  1301. EndIf
  1302.  
  1303. $battleCheck = 1
  1304.  
  1305. While $battleCheck = 1
  1306. ; next search for battle pads
  1307. WaitForPads()
  1308. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$PadColor1)
  1309. If @error=1 Then
  1310. $battleCheck = 2
  1311. Else
  1312. Battle($arenaCoord[0], $arenaCoord[1])
  1313. $TotalXP=$TotalXP+$DFAXP[$NumberOfBattles]
  1314. EndIf
  1315. Wend
  1316. WaitForPads()
  1317. ; death check
  1318. ;$DeathPixel = PixelGetColor(682, 208)
  1319. $DeathPixel = PixelGetColor(($topLeft[0]+565), ($topLeft[1]+58))
  1320. If ($DeathPixel = $DeathColor) Then
  1321. $continue = 2
  1322. MsgBox(8192, "You died! (arena check 1)", "You died!", 1)
  1323. Else
  1324. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$ExitColor1)
  1325. If (($arenaCoord[0] = $exitCoord[0]) and ($arenaCoord[1] = $exitCoord[1])) Then
  1326. $arenaCoord = PixelSearch($topLeft[0],$exitCoord[1]+3,$bottomRight[0],$bottomRight[1],$ExitColor1)
  1327. DungeonPad($arenaCoord[0],$arenaCoord[1])
  1328. Else
  1329. DungeonPad($arenaCoord[0],$arenaCoord[1])
  1330. EndIf
  1331. EndIf
  1332. ; might need to check more than once
  1333. ;$DeathPixel = PixelGetColor(682, 208)
  1334. $DeathPixel = PixelGetColor(($topLeft[0]+565), ($topLeft[1]+58))
  1335. If ($DeathPixel = $DeathColor) Then
  1336. $continue = 2
  1337. MsgBox(8192, "You died! (arena check 2)", "You died!", 1)
  1338. EndIf
  1339. WEnd
  1340.  
  1341. ; died - remove last battle XP
  1342. $TotalXP=$TotalXP-$DFAXP[$NumberOfBattles]
  1343.  
  1344. ; starting from Shikaakwa - return to DFA
  1345. ;DungeonPad(816, 576) - Shik to A4
  1346. DungeonPad2(($topLeft[0]+699),($topLeft[1]+426))
  1347.  
  1348. ;DungeonPad(697, 612) - A4 to B4
  1349. DungeonPad2(($topLeft[0]+580),($topLeft[1]+462))
  1350.  
  1351. ;DungeonPad(816, 600) - B4 to C4
  1352. DungeonPad2(($topLeft[0]+699),($topLeft[1]+450))
  1353.  
  1354. ;DungeonPad(816, 407) - C4 to D4
  1355. DungeonPad(($topLeft[0]+699),($topLeft[1]+257))
  1356.  
  1357. ;DungeonPad(815, 287)
  1358. DungeonPad(($topLeft[0]+698),($topLeft[1]+137))
  1359.  
  1360. ;DungeonPad(608, 587)
  1361. DungeonPad(($topLeft[0]+491),($topLeft[1]+437))
  1362.  
  1363. ;DungeonPad(502, 608)
  1364. DungeonPad(($topLeft[0]+385),($topLeft[1]+458))
  1365.  
  1366. ;DungeonPad(503, 608)
  1367. DungeonPad(($topLeft[0]+386),($topLeft[1]+458))
  1368.  
  1369. ;DungeonPad(550, 608)
  1370. DungeonPad(($topLeft[0]+433),($topLeft[1]+458))
  1371.  
  1372. ;DungeonPad(310, 609)
  1373. DungeonPad(($topLeft[0]+193),($topLeft[1]+459))
  1374.  
  1375. ;DungeonPad(815, 453)
  1376. DungeonPad(($topLeft[0]+698),($topLeft[1]+303))
  1377.  
  1378. ;DungeonPad(814, 380)
  1379. DungeonPad(($topLeft[0]+697),($topLeft[1]+230))
  1380.  
  1381. ;DungeonPad(815, 548)
  1382. DungeonPad2(($topLeft[0]+698),($topLeft[1]+398))
  1383.  
  1384. ;DungeonPad(815, 379)
  1385. DungeonPad(($topLeft[0]+698),($topLeft[1]+229))
  1386.  
  1387. ;DungeonPad(822, 548)
  1388. DungeonPad2(($topLeft[0]+705),($topLeft[1]+398))
  1389.  
  1390. ;DungeonPad(455, 368)
  1391. DungeonPad(($topLeft[0]+338),($topLeft[1]+218))
  1392.  
  1393. ;DungeonPad(192, 241)
  1394. DungeonPad(($topLeft[0]+75),($topLeft[1]+91))
  1395.  
  1396. EndFunc
  1397.  
  1398. Func ArenaCWA()
  1399. ; start script in arena in first room with battles (not in lobby)
  1400. ; if you die, you will return to the arena and start over
  1401. ; if you make it through, you need to stop the script!
  1402. ; this one is different so you do NOT need to be able to
  1403. ; survive through the first room!
  1404. ;
  1405.  
  1406. $continue = 1
  1407.  
  1408. ; Find Battle
  1409. While $continue = 1
  1410. ; need to move away from pad first - maybe not necessary?
  1411. ; 09/01 - I decided this is necessary again
  1412. ; **** This section may need some work
  1413. MouseMove(($topLeft[0]+368), ($topLeft[1]+253), 3)
  1414. MouseClick("left")
  1415. sleep(500)
  1416. MouseMove(($topLeft[0]+383), ($topLeft[1]+310), 3)
  1417. MouseClick("left")
  1418. sleep(500)
  1419. ; find white pad
  1420. WaitForPads()
  1421. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$ExitColor1)
  1422. If @error=1 Then
  1423. $exitCoord[0] = $topLeft[0]
  1424. $exitCoord[1] = $topLeft[1]
  1425. Else
  1426. $exitCoord[0]=$arenaCoord[0]
  1427. $exitCoord[1]=$arenaCoord[1]
  1428. EndIf
  1429.  
  1430. $battleCheck = 1
  1431.  
  1432. While $battleCheck = 1
  1433. ; next search for battle pads
  1434. WaitForPads()
  1435. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$PadColor1)
  1436. If @error=1 Then
  1437. $battleCheck = 2
  1438. Else
  1439. Battle($arenaCoord[0], $arenaCoord[1])
  1440. $TotalXP=$TotalXP+$CWAXP[$NumberOfBattles]
  1441. EndIf
  1442. Wend
  1443. WaitForPads()
  1444. ; death check
  1445. ;$DeathPixel = PixelGetColor(682, 208)
  1446. $DeathPixel = PixelGetColor(($topLeft[0]+565), ($topLeft[1]+58))
  1447. If ($DeathPixel = $DeathColor) Then
  1448. $continue = 2
  1449. MsgBox(8192, "You died! (arena check 1)", "You died!", 1)
  1450. Else
  1451. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$ExitColor1)
  1452. If (($arenaCoord[0] = $exitCoord[0]) and ($arenaCoord[1] = $exitCoord[1])) Then
  1453. $arenaCoord = PixelSearch($topLeft[0],$exitCoord[1]+3,$bottomRight[0],$bottomRight[1],$ExitColor1)
  1454. DungeonPad($arenaCoord[0],$arenaCoord[1])
  1455. Else
  1456. DungeonPad($arenaCoord[0],$arenaCoord[1])
  1457. EndIf
  1458. EndIf
  1459. ; might need to check more than once
  1460. ;$DeathPixel = PixelGetColor(682, 208)
  1461. $DeathPixel = PixelGetColor(($topLeft[0]+565), ($topLeft[1]+58))
  1462. If ($DeathPixel = $DeathColor) Then
  1463. $continue = 2
  1464. MsgBox(8192, "You died! (arena check 2)", "You died!", 1)
  1465. EndIf
  1466. WEnd
  1467.  
  1468. ; died - remove last battle XP
  1469. $TotalXP=$TotalXP-$CWAXP[$NumberOfBattles]
  1470.  
  1471. ; starting from Shikaakwa - return to CWA
  1472.  
  1473. ;DungeonPad(432, 241)
  1474. DungeonPad(($topLeft[0]+315),($topLeft[1]+91))
  1475.  
  1476. ;DungeonPad(458, 252)
  1477. DungeonPad(($topLeft[0]+341),($topLeft[1]+102))
  1478.  
  1479. ;DungeonPad2(142, 531)
  1480. DungeonPad2(($topLeft[0]+25),($topLeft[1]+381))
  1481.  
  1482. ;DungeonPad2(143, 361)
  1483. DungeonPad2(($topLeft[0]+26),($topLeft[1]+211))
  1484.  
  1485. ;DungeonPad2(144, 506)
  1486. DungeonPad2(($topLeft[0]+27),($topLeft[1]+356))
  1487.  
  1488. ;DungeonPad(576, 243)
  1489. DungeonPad(($topLeft[0]+459),($topLeft[1]+93))
  1490.  
  1491. ;DungeonPad(312, 447)
  1492. DungeonPad(($topLeft[0]+195),($topLeft[1]+297))
  1493.  
  1494. ;DungeonPad(168, 398)
  1495. DungeonPad(($topLeft[0]+51),($topLeft[1]+248))
  1496.  
  1497. EndFunc
  1498.  
  1499. Func ArenaUWA()
  1500. ; start script in arena in first room with battles (not in lobby)
  1501. ; if you die, you will return to the arena and start over
  1502. ; if you make it through, you need to stop the script!
  1503. ; this one is different so you do NOT need to be able to
  1504. ; survive through the first room!
  1505. ;
  1506. ; first room
  1507.  
  1508. $continue = 1
  1509.  
  1510. ; Find Battle
  1511. While $continue = 1
  1512. ; need to move away from pad first - maybe not necessary?
  1513. ; 09/01 - I decided this is necessary again
  1514. ; **** This section may need some work
  1515. MouseMove(($topLeft[0]+368), ($topLeft[1]+253), 3)
  1516. MouseClick("left")
  1517. sleep(500)
  1518. MouseMove(($topLeft[0]+383), ($topLeft[1]+310), 3)
  1519. MouseClick("left")
  1520. sleep(500)
  1521. ; find white pad
  1522. WaitForPads()
  1523. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$ExitColor1)
  1524. If @error=1 Then
  1525. $exitCoord[0] = $topLeft[0]
  1526. $exitCoord[1] = $topLeft[1]
  1527. Else
  1528. $exitCoord[0]=$arenaCoord[0]
  1529. $exitCoord[1]=$arenaCoord[1]
  1530. EndIf
  1531.  
  1532. $battleCheck = 1
  1533.  
  1534. While $battleCheck = 1
  1535. ; next search for battle pads
  1536. WaitForPads()
  1537. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$PadColor1)
  1538. If @error=1 Then
  1539. $battleCheck = 2
  1540. Else
  1541. Battle($arenaCoord[0], $arenaCoord[1])
  1542. $TotalXP=$TotalXP+$UWAXP[$NumberOfBattles]
  1543. EndIf
  1544. Wend
  1545. WaitForPads()
  1546. ; death check
  1547. ;$DeathPixel = PixelGetColor(682, 208)
  1548. $DeathPixel = PixelGetColor(($topLeft[0]+565), ($topLeft[1]+58))
  1549. If ($DeathPixel = $DeathColor) Then
  1550. $continue = 2
  1551. MsgBox(8192, "You died! (arena check 1)", "You died!", 1)
  1552. Else
  1553. $arenaCoord = PixelSearch($topLeft[0],$topLeft[1],$bottomRight[0],$bottomRight[1],$ExitColor1)
  1554. If (($arenaCoord[0] = $exitCoord[0]) and ($arenaCoord[1] = $exitCoord[1])) Then
  1555. $arenaCoord = PixelSearch($topLeft[0],$exitCoord[1]+3,$bottomRight[0],$bottomRight[1],$ExitColor1)
  1556. DungeonPad($arenaCoord[0],$arenaCoord[1])
  1557. Else
  1558. DungeonPad($arenaCoord[0],$arenaCoord[1])
  1559. EndIf
  1560. EndIf
  1561. ; might need to check more than once
  1562. ;$DeathPixel = PixelGetColor(682, 208)
  1563. $DeathPixel = PixelGetColor(($topLeft[0]+565), ($topLeft[1]+58))
  1564. If ($DeathPixel = $DeathColor) Then
  1565. $continue = 2
  1566. MsgBox(8192, "You died! (arena check 2)", "You died!", 1)
  1567. EndIf
  1568. WEnd
  1569.  
  1570. ; died - remove last battle XP
  1571. $TotalXP=$TotalXP-$UWAXP[$NumberOfBattles]
  1572.  
  1573. ; starting from Shikaakwa - return to UWA
  1574. ;DungeonPad2(816, 577)
  1575. DungeonPad2(($topLeft[0]+699),($topLeft[1]+427))
  1576.  
  1577. ;DungeonPad2(696, 614)
  1578. DungeonPad2(($topLeft[0]+579),($topLeft[1]+464))
  1579.  
  1580. ;DungeonPad2(816, 600)
  1581. DungeonPad2(($topLeft[0]+699),($topLeft[1]+450))
  1582.  
  1583. ;DungeonPad(816, 410)
  1584. DungeonPad(($topLeft[0]+699),($topLeft[1]+260))
  1585.  
  1586. ;DungeonPad(815, 289)
  1587. DungeonPad(($topLeft[0]+698),($topLeft[1]+139))
  1588.  
  1589. ;DungeonPad(816, 434)
  1590. DungeonPad(($topLeft[0]+699),($topLeft[1]+284))
  1591.  
  1592. ;DungeonPad(816, 362)
  1593. DungeonPad(($topLeft[0]+699),($topLeft[1]+212))
  1594.  
  1595. ;DungeonPad(288, 242)
  1596. DungeonPad(($topLeft[0]+171),($topLeft[1]+92))
  1597.  
  1598. ;DungeonPad(816, 313)
  1599. DungeonPad(($topLeft[0]+699),($topLeft[1]+163))
  1600.  
  1601. ;DungeonPad(649, 229)
  1602. DungeonPad(($topLeft[0]+532),($topLeft[1]+79))
  1603.  
  1604. ;DungeonPad(144, 523)
  1605. DungeonPad(($topLeft[0]+27),($topLeft[1]+373))
  1606.  
  1607. ;DungeonPad(144, 498)
  1608. DungeonPad(($topLeft[0]+27),($topLeft[1]+348))
  1609.  
  1610. ;DungeonPad(143, 547)
  1611. DungeonPad2(($topLeft[0]+26),($topLeft[1]+397))
  1612.  
  1613. ;DungeonPad(144, 404)
  1614. DungeonPad(($topLeft[0]+27),($topLeft[1]+254))
  1615.  
  1616. ;DungeonPad2(600, 607)
  1617. DungeonPad2(($topLeft[0]+483),($topLeft[1]+457))
  1618.  
  1619. ;DungeonPad(144, 427)
  1620. DungeonPad(($topLeft[0]+27),($topLeft[1]+277))
  1621.  
  1622. ;DungeonPad(384, 235)
  1623. DungeonPad(($topLeft[0]+267),($topLeft[1]+85))
  1624.  
  1625. ;DungeonPad(143, 458)
  1626. DungeonPad(($topLeft[0]+26),($topLeft[1]+308))
  1627.  
  1628. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement