The benefit of maintaining the data in an external file (here the .txt) is, that you can make additions without having to constantly change the script itself.
Here is an example which contains both variants (comment out the unwanted one) :
#include <Array.au3>
#include <File.au3>
; ====> Comment out variant 1 or 2 depending on your needs
; ----> Variant 1 : Read data from a file : --------------
;~ Global $aHWIDList, $sFilePath, $bHWIDFound, $sHWIDInput
;~ $sFilePath = @ScriptDir & "\HWIDList.txt"
;~ $bHWIDFound = False
;~ _FileReadToArray($sFilePath, $aHWIDList, $FRTA_NOCOUNT, ";")
; ----- End of Variant 1 ---------------------------------
; ----> Variant 2 : array within the script : ------------
Global $bHWIDFound, $sHWIDInput
Global $aHWIDList[4][2] = [["42421425", "mark"], _
["85738578", "monte"], _
["84885282", "heinz"], _
["98573857", "tobiData"]]
$bHWIDFound = False
; ----- End of Variant 2 ---------------------------------
_ArrayDisplay($aHWIDList, "Test : Output") ; *** just for display during test
For $i = 0 To UBound($aHWIDList) - 1
If _GetHWID() = $aHWIDList[$i][0] Then
MsgBox(0, "HWID found", "HWID=" & $aHWIDList[$i][0] & " Name=" & $aHWIDList[$i][1] & @CRLF)
$bHWIDFound = True
ExitLoop
EndIf
Next
If Not $bHWIDFound Then
$sHWIDInput = InputBox("HWID_ERROR", "Contact Support!", _GetHWID(), "", 270, 150)
If @error Then
Exit
Else
ClipPut(_GetHWID())
Exit
EndIf
EndIf
; naked function for testing :
Func _GetHWID()
Local $sHWID = ""
; ... put the real GetHWID statements here
$sHWID = "84885282" ; only for test
Return $sHWID
EndFunc