Guest User

Untitled

a guest
Jun 25th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.69 KB | None | 0 0
  1. #cs ----------------------------------------------------------------------------
  2.  
  3. AutoIt Version: 3.3.8.1
  4. GWA² Version: 3.5.11
  5. Author: God Of Fissures
  6.  
  7. Script Function:
  8. Database for which zones are connected to which zones.
  9.  
  10. #ce ----------------------------------------------------------------------------
  11.  
  12. ; SCRIPT START.
  13.  
  14. ; INCLUDES.
  15. #include <GWA².au3> ; API to connect to Guild Wars memory.
  16.  
  17. ;****************************
  18. ;ARE START AND END CONNECTED?
  19. ;****************************
  20. Func AreConnected()
  21.  
  22. ; This first finds the explorable area you just ran from.
  23. ; Then it checks to see if the destination matches one of the exits from that explorable area.
  24. ; If it matches, then the zone you ran through is connected to the zone you ended up in.
  25. ; If not, it means that the user map traveled to another outpost.
  26.  
  27. ;****************************
  28. ; Droknar's Forge Run
  29. ;****************************
  30. ; Lornar's Pass
  31. If ($previousTemp = "Lornar's Pass") Then ; If the zone traveled trhough is Lornar's Pass.
  32. Local $numExits = 2 ; The number of possible exits from this explorable area is two.
  33. Local $exits[$numExits] = ["Beacon's Perch", "Dreadnought's Drift"] ; These are the two exits from Lornar's Pass.
  34. EndIf
  35. ; Dreadnought's Drift
  36. If ($previousTemp = "Dreadnought's Drift") Then
  37. Local $numExits = 2
  38. Local $exits[$numExits] = ["Lornar's Pass", "Snake Dance"]
  39. EndIf
  40. ; Snake Dance
  41. If ($previousTemp = "Snake Dance") Then
  42. Local $numExits = 3
  43. Local $exits[$numExits] = ["Dreadnought's Drift", "Grenth's Footprint", "Camp Rankor"]
  44. EndIf
  45. ; Talus Chute
  46. If ($previousTemp = "Talus Chute") Then
  47. Local $numExits = 4
  48. Local $exits[$numExits] = ["Camp Rankor", "Droknar's Forge", "Ice Caves of Sorrow", "Icedome"]
  49. EndIf
  50.  
  51. ;****************************
  52. ; Ruins of Ascalon
  53. ;****************************
  54. ; Old Ascalon
  55. If ($previousTemp = "Old Ascalon") Then
  56. Local $numExits = 4
  57. Local $exits[$numExits] = ["Ascalon City", "Sardelac Sanitarium", "The Breach", "Regent Valley"]
  58. EndIf
  59.  
  60. ; Regent Valley
  61. If ($previousTemp = "Regent Valley") Then
  62. Local $numExits = 3
  63. Local $exits[$numExits] = ["Old Ascalon", "Pockmark Flats", "Fort Ranik"]
  64. EndIf
  65.  
  66.  
  67. If (CheckIfConnected($numExits, $exits) = True) Then ; If the zone traveled through and the destination are connected.
  68. MsgBox(0, "", "ZONES ARE CONNECTED!") ; Congratulate the user!
  69. Return True ; Tell the program that the zones are indeed connected.
  70. Else ; If the zone traveled through and the destination are NOT connected.
  71. MsgBox(0, "", "ZONES ARE NOT CONNECTED..AWH!!") ; The user gets a big thumbs down.
  72. Return False ; Tell the program that the zones are not connected...
  73. EndIf
  74.  
  75. EndFunc
  76.  
  77. ;****************************
  78. ; CHECK THE CONNECTION
  79. ;****************************
  80. Func CheckIfConnected($numExits, $exits)
  81.  
  82. ; This checks to see if the destination equals one of the exits from the explorable area.
  83.  
  84. Local $connected = False ; It has not yet been proven if the zones are indeed connected.
  85. Local $i = 0 ; Counter. Will be used to go travel through the array.
  86.  
  87. While ($i < $numExits) ; Loop that continues until all elements in the array have been compared.
  88. If ($exits[$i] = $currentZone) Then ; If the current zone equals one of the exits.
  89. $connected = True ; The zones are indeed connected.
  90. Return $connected ; Tell the program that the zones are connected
  91. Else ; If a match was not found at first.
  92. $i += 1 ; Increment the counter to try the next element in the array.
  93. EndIf
  94. WEnd
  95.  
  96. If ($connected = False) Then ; If at the end nothing is found.
  97. Return $connected ; Return that the zones are not connected.
  98. EndIf
  99.  
  100. EndFunc
  101.  
  102. ; SCRIPT END.
Add Comment
Please, Sign In to add comment