Refresh character list button not working

05/06/2024 12:14 ATbs#1
I'm getting this error and I can't catch why

ReDim $CharName UBound($charname) +1

ReDim used without an array variable error.

This is the code asociated with the button:


Func RefreshInterface()
Local $CharName[1]
Local $lWinList = ProcessList("gw.exe")

Switch $lWinList[0][0]
Case 0
MsgBox(16, "Please open Guild Wars and log into a character before running this program.")
Exit
Case Else
For $i = 1 To $lWinList[0][0]
MemoryOpen($lWinList[$i][1])
$lOpenProcess = DllCall($mKernelHandle, 'int', 'OpenProcess', 'int', 0x1F0FFF, 'int', 1, 'int', $lWinList[$i][1])
$GWHandle = $lOpenProcess[0]
If $GWHandle Then
$CharName = ScanForCharname()
If IsString($CharName) Then
ReDim $CharName[UBound($CharName) + 1]
$CharName[$i] = $CharName
EndIf
EndIf
$GWHandle = 0
Next
GUICtrlSetData($CharInput, _ArrayToString($CharName, "|"), $CharName[1])
EndSwitch
EndFunc

I checked from other bots in which it works, and it's all the same, but for some reason here doesn't.

Any ideas?
05/10/2024 06:26 ATbs#2
Figured it out... was missing #include <Array.au3>
Question is, I don't have Array.au3 in the list of bot files. Where is it detecting it from?
05/13/2024 10:56 t7tcrusher#3
Quote:
Originally Posted by ATbs View Post
Figured it out... was missing #include <Array.au3>
Question is, I don't have Array.au3 in the list of bot files. Where is it detecting it from?
A lot of includes are in the autoit program directory containing functions that allow you to get a working script.