#include #Include #include #include 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 $ImgCount= InputBox ("Image Count", "Please Input How Many Images You Have?!") $value= MsgBox (1, "Ready!!", "You Have " & $ImgCount & " Images,, Please Click OK To Start" & @LF& "Or Click Cancel to Abort") if $value = 1 then call ("checkForImage") EndIf if $value = 2 Then Call ("Terminate") EndIf 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) ;========================= 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 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 ;=========================== 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 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