Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #cs ----------------------------------------------------------------------------
- AutoIt Version: 3.3.8.1
- GWA² Version: 3.5.11
- Author: God Of Fissures
- Script Function:
- Database for which zones are connected to which zones.
- #ce ----------------------------------------------------------------------------
- ; SCRIPT START.
- ; INCLUDES.
- #include <GWA².au3> ; API to connect to Guild Wars memory.
- ;****************************
- ;ARE START AND END CONNECTED?
- ;****************************
- Func AreConnected()
- ; This first finds the explorable area you just ran from.
- ; Then it checks to see if the destination matches one of the exits from that explorable area.
- ; If it matches, then the zone you ran through is connected to the zone you ended up in.
- ; If not, it means that the user map traveled to another outpost.
- ;****************************
- ; Droknar's Forge Run
- ;****************************
- ; Lornar's Pass
- If ($previousTemp = "Lornar's Pass") Then ; If the zone traveled trhough is Lornar's Pass.
- Local $numExits = 2 ; The number of possible exits from this explorable area is two.
- Local $exits[$numExits] = ["Beacon's Perch", "Dreadnought's Drift"] ; These are the two exits from Lornar's Pass.
- EndIf
- ; Dreadnought's Drift
- If ($previousTemp = "Dreadnought's Drift") Then
- Local $numExits = 2
- Local $exits[$numExits] = ["Lornar's Pass", "Snake Dance"]
- EndIf
- ; Snake Dance
- If ($previousTemp = "Snake Dance") Then
- Local $numExits = 3
- Local $exits[$numExits] = ["Dreadnought's Drift", "Grenth's Footprint", "Camp Rankor"]
- EndIf
- ; Talus Chute
- If ($previousTemp = "Talus Chute") Then
- Local $numExits = 4
- Local $exits[$numExits] = ["Camp Rankor", "Droknar's Forge", "Ice Caves of Sorrow", "Icedome"]
- EndIf
- ;****************************
- ; Ruins of Ascalon
- ;****************************
- ; Old Ascalon
- If ($previousTemp = "Old Ascalon") Then
- Local $numExits = 4
- Local $exits[$numExits] = ["Ascalon City", "Sardelac Sanitarium", "The Breach", "Regent Valley"]
- EndIf
- ; Regent Valley
- If ($previousTemp = "Regent Valley") Then
- Local $numExits = 3
- Local $exits[$numExits] = ["Old Ascalon", "Pockmark Flats", "Fort Ranik"]
- EndIf
- If (CheckIfConnected($numExits, $exits) = True) Then ; If the zone traveled through and the destination are connected.
- MsgBox(0, "", "ZONES ARE CONNECTED!") ; Congratulate the user!
- Return True ; Tell the program that the zones are indeed connected.
- Else ; If the zone traveled through and the destination are NOT connected.
- MsgBox(0, "", "ZONES ARE NOT CONNECTED..AWH!!") ; The user gets a big thumbs down.
- Return False ; Tell the program that the zones are not connected...
- EndIf
- EndFunc
- ;****************************
- ; CHECK THE CONNECTION
- ;****************************
- Func CheckIfConnected($numExits, $exits)
- ; This checks to see if the destination equals one of the exits from the explorable area.
- Local $connected = False ; It has not yet been proven if the zones are indeed connected.
- Local $i = 0 ; Counter. Will be used to go travel through the array.
- While ($i < $numExits) ; Loop that continues until all elements in the array have been compared.
- If ($exits[$i] = $currentZone) Then ; If the current zone equals one of the exits.
- $connected = True ; The zones are indeed connected.
- Return $connected ; Tell the program that the zones are connected
- Else ; If a match was not found at first.
- $i += 1 ; Increment the counter to try the next element in the array.
- EndIf
- WEnd
- If ($connected = False) Then ; If at the end nothing is found.
- Return $connected ; Return that the zones are not connected.
- EndIf
- EndFunc
- ; SCRIPT END.
Add Comment
Please, Sign In to add comment