Pour vous faciliter la tache, voici le code d'un script qui analyse votre script pour vérifier si il ne manque pas d'Include.
Merci à monoceres pour ce code bien pratique.
Code : Tout sélectionner
; Post original : http://www.autoitscript.com/forum/index.php?showtopic=70902&view=findpost&p=519264
; Créateur : monoceres (Du forum Anglais).
;
#include <Array.au3>
#include <File.au3>
$script = FileOpenDialog("Choisissez le script à modifier.", @ScriptDir, "au3 (*.au3)")
$autoitdir = @ProgramFilesDir & "\AutoIt3\Include"
;FileSelectFolder("Répertoire Include Autoit","")
If $autoitdir = "" Then Exit
If $script = "" Then Exit
Global $includelines, $scriptdata
Global $includestoadd[1], $count = 0
$scriptdata = FileRead($script)
$includes = _FileListToArray($autoitdir, "*Constants*.au3")
For $i = 1 To UBound($includes) - 1
_FileReadToArray($autoitdir & "\" & $includes[$i], $includelines)
For $j = 1 To UBound($includelines) - 1
If StringLeft($includelines[$j], 12) = "Global Const" Then
$const = StringMid($includelines[$j], StringInStr($includelines[$j], "$"), StringInStr($includelines[$j], '=') - StringInStr($includelines[$j], "$") - 1)
If StringInStr($scriptdata, $const) Then
_ArrayAdd($includestoadd, $includes[$i])
ExitLoop
EndIf
EndIf
Next
Next
For $a = 1 To UBound($includestoadd) - 1
If StringInStr($scriptdata, "#include <" & $includestoadd[$a] & ">") = 0 And StringInStr($scriptdata, "#include<" & $includestoadd[$a] & ">") = 0 And $includestoadd[$a] <> "GUIConstants.au3" Then
_FileWriteToLine($script, 1, "#include <" & $includestoadd[$a] & ">")
$count += 1
EndIf
Next
MsgBox(0, "Resultat", $count & " Include(s) ont été ajouté(s)")