EDIT:
Hi, I modified a bit with the Farm_Bot and now I have a problem with the ImageSearch.
It should search an Image in the taskbar, a browser icon, but it dont find it, but why?
How it seems to me, the ImageSearch function work from 0,0 to DesktopHeight,DesktopWidth, so it must find something in the taskbar too or not?
Code:
Func CheckFor($directory,$img,$tolerance=50,$startX=0,$startY=0,$endX=@DesktopWidth,$endY=@DesktopHeight,$seconds=$defaultCheckRate)
$c = 0
MouseMove($sX,$sY,0)
$string = $bmpLocation & "\" & $directory & "\" & $img & ".bmp"
$updateString = $img
ToolTip("Checking for " & $updateString,0,0)
$tolerance = 70
If $tolFail > 0 Then
$tolerance += $tolFail
EndIf
Do
$c += 1
Sleep(100)
If $c > ($seconds * 10) Then
Return False
EndIf
;Until _ImageSearchArea($string,1,$startX,$startY,$endX,$endY,$gX,$gY,$tolerance)
Until _ImageSearchArea($string,1,216,180,1723,1002,$gX,$gY,$tolerance)
If $img = "farmsign" Then
$sX = $gX
$sY = $gY
EndIf
Sleep(500)
Return True
EndFunc
Func ClickImage($directory,$img,$tolerance=50,$startX=0,$startY=0,$endX=@DesktopWidth,$endY=@DesktopHeight,$seconds=$defaultCheckRate)
If CheckFor($directory,$img,$tolerance,$startX,$startY,$endX,$endY,$seconds) Then
MouseClick("left",$gX,$gY,1,0)
Return True
Else
Return False
EndIf
EndFunc