You have put down Dan it at the wrong place. in your script.
Here an example where it is functioned to 100%.
Code:
; ----------------
; GWCA Chest Bot
; Started Feb 26th
; ----------------
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include "GWCAConstants.au3"
Global $cGUI = GUICreate("GWCA")
Global $runs = 0 ;Variable for number of runs completed
Global $chests = 0 ;Variable for number of chests opened
Global $maxChests = 35 ;Number of chests to run, -1 = infinity !!!!!!!!!!!!!
Global $SLOT_DWARVENSTABILITY = 1
Global $SLOT_DASH = 2
Global $SLOT_SHROUD_OF_DISTRISS = 4
GUIRegisterMsg(0x500, "WndCallback")
; ---
; BOT
; ---
$cbType = "int"
CmdCB($CA_GETMAPID)
If $cbVar[0] <> 675 Then
Debug("Not in Boreal Station! Exiting...")
Exit
EndIf
While 1
If $chests = $maxChests Then
ConsoleWrite("> Reached maximum number of chests to open! Exiting..."&@CRLF)
Exit
EndIf
Debug("Commencing new run...")
$tTimer = TimerInit()
$iRet = BotLoop()
Cmd($CA_ZONEMAP, 675)
Debug("Zoning back to Boreal Station, 675")
Do
Sleep(500)
CmdCB($CA_GETMAPLOADING)
Until $cbVar[0] = 0
Debug("Loaded into outpost")
Sleep(Random(1000,1300))
$tTimer = TimerDiff($tTimer)
Debug("Run completed!")
[COLOR="Magenta"][COLOR="Red"];#####
$dist = 1
;#####
$cbType = 'int'
Cmd($CA_ChangeDistrict, $dist, 1)
$cbVar[0] = -1
While $cbVar[0] <> 2
Sleep(100)
CmdCB($CA_GetMapLoading)
WEnd
While $cbVar[0] <> 0
Sleep(100)
CmdCB($CA_GetMapLoading)
WEnd[/COLOR][/COLOR]
$runs += 1
If $iRet Then $chests += 1
ConsoleWrite("+ CHESTBOT :: Last run time: "&Round($tTimer/1000,2)&"s, Runs = "&$runs&", Chests = "&$chests&@CRLF)
Sleep(Random(1000,1300))
WEnd