#include #Include #include #include #include #include #include #include #include #Region ### START Koda GUI section ### Form= $Main = GUICreate("Logo Finder", 615, 437, 371, 118) $ImgCount = GUICtrlCreateInput("", 216, 40, 145, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_NUMBER)) $Insert = GUICtrlCreateLabel("Insert How Many Images You Have?!", 32, 32, 176, 33, $SS_CENTERIMAGE) GUICtrlSetResizing(-1, $GUI_DOCKAUTO+$GUI_DOCKWIDTH) $Group1 = GUICtrlCreateGroup("Group1", 40, 120, 345, 177) $localCentersCheckBox = GUICtrlCreateCheckbox("Local Centers", 72, 184, 113, 25) $abroadCentersCheckBox = GUICtrlCreateCheckbox("Abroad Centers", 72, 224, 113, 25) $Checkbox3 = GUICtrlCreateCheckbox("Checkbox3", 232, 184, 113, 33) $Checkbox4 = GUICtrlCreateCheckbox("Checkbox4", 232, 232, 113, 33) GUICtrlCreateGroup("", -99, -99, 1, 1) $includeWhat = GUICtrlCreateLabel("What to include in the search", 56, 144, 137, 17) $Start = GUICtrlCreateButton("Start", 64, 344, 137, 41) $Exit = GUICtrlCreateButton("Exit", 440, 344, 137, 41) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Global $Paused HotKeySet("{space}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("^!s", "checkForImage") ;Ctrl-Alt-s global $y = 0, $x = 0 Local $ImgCount Local $value Local $finishSearch Local $editQuestion Local $s=1 ;to help the counter continue when deciding to not edit an image ;if I declared $i here, it will not get the value from $s and it will start from 0 rather than 1 which is the value of $s While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Exit Terminate() Case $Start $ImgCount= GUICtrlRead ($ImgCount) checkForImage() EndSwitch WEnd Local $i #cs when i declare $i here,, it will get the value of $s, and it will work fine until it finds a logo and i press "no" in the messagebox then it should start to search again,, here it will say that $i is used without declarattion!! #ce Func checkForImage() $i=$s ;notice here that I did not declare the variable $i, yet it's working fine for $i=$i to $ImgCount Local $FNDBOX ; the box when you click OK after finding a Logo MouseClick ("Left",870,655,1);(x,y,1,4) Sleep (1400) ToolTip ("") ToolTip ("Scanning "&$i&"/"& $ImgCount, 700, 50) ;========================= If GuiCtrlRead($localCentersCheckBox) = $GUI_CHECKED Then call ("localCenters") EndIf If GuiCtrlRead($abroadCentersCheckBox) = $GUI_CHECKED Then call ("abroadCenters") EndIf ;=========================== ToolTip ("") Sleep (200) Next SoundPlay("Assets\Trombone.mp3", 0) $finishSearch= MsgBox (0,"Done", "You're all set") if $finishSearch=1 then Call ("Terminate") EndIf EndFunc Func localCenters() Local $search = _ImageSearch('Assets\Aknan.bmp', 1, $x, $y, 100) ; 1- If $search = 1 Then MouseMove($x, $y, 10) SoundPlay("Assets\Found.mp3", 0) $editQuestion= MsgBox(4+32,"Aknan", "You found Aknan Logo,, Do you want to edit??", 90) Select Case $editQuestion=6 call ("TogglePause") Case $editQuestion =7 $s=$i+1 SoundPlay ("") Call ("CheckForImage") EndSelect EndIf Local $search = _ImageSearch('Assets\Maidan.bmp', 1, $x, $y, 100) ;2- If $search = 1 Then MouseMove($x, $y, 10) SoundPlay("Assets\Found.mp3", 0) $editQuestion= MsgBox(4+32,"Maidan", "You found Maidan Logo,, Do you want to edit??", 90) Select case $editQuestion=6 call ("TogglePause") Case $editQuestion =7 $s=$i+1 SoundPlay ("") Call ("CheckForImage") EndSelect EndIf EndFunc Func abroadCenters() Local $search = _ImageSearch('Assets\Majestic.bmp', 1, $x, $y, 100) ;3- If $search = 1 Then MouseMove($x, $y, 10) SoundPlay("Assets\Found.mp3", 0) $editQuestion= MsgBox(4+32,"Majestic", "You found Majestic Logo,, Do you want to edit??", 90) Select case $editQuestion=6 call ("TogglePause") Case $editQuestion =7 $s=$i+1 SoundPlay ("") Call ("CheckForImage") EndSelect EndIf Local $search = _ImageSearch('Assets\Diamond.bmp', 1, $x, $y, 100) ;4- If $search = 1 Then MouseMove($x, $y, 10) SoundPlay("Assets\Found.mp3", 0) $editQuestion= MsgBox(4+32,"Diamond", "You found Diamond Logo,, Do you want to edit??", 90) Select case $editQuestion=6 call ("TogglePause") Case $editQuestion =7 $s=$i+1 SoundPlay ("") Call ("CheckForImage") EndSelect EndIf EndFunc while 1 sleep(200) WEnd Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc