for $i=1 to 100
If $result > 0 Then
WinActivate("[CLASS:PuTTY]")
_Sendtext($Hwnd,"r6-disk vnc console=ttyS1,115200")
;_SendKeys($Hwnd,"{ENTER}")
sleep(3000)
Else
MsgBox(0,"Fail", "Not found!",0.5)
sleep(3000)
EndIf
Next
$hImageA =_GDIPlus_ImageLoadFromFile($fileA) ;this is the firefox icon use something else if you don't have it.
$hBitmapA = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImageA)
$x = 0
$y = 0
$result = _ImageSearch($hBitmapA, 1, $x, $y, 20, 0) ;Zero will search against your active screen
If $result > 0 Then
WinActivate("[CLASS:PuTTY]")
_Sendtext($Hwnd,"r6-disk vnc console=ttyS1,115200")
;_SendKeys($Hwnd,"{ENTER}")
sleep(3000)
ExitLoop