I use to colet resources this script
The images are 10x10 pixel from coin and drops. mouse click not collectors, but appeared coin and drops images. My resolution is 1240x1080.
Works, Then collectors are not in horizontal line. Some time, dont locate top or bottom collector.
func _CollectAll()
Local $result
Local $ii, $iii
Local $xnext
Local $mouseSpeed = 50
$ii = 0
$xnext= 115
For $ii = 0 To 9 Step 1
$result= _ImageSearchArea('elix1.bmp', 1, 200, $xnext, 1050, 800, $x, $y, 90)
if $result=1 Then
mouseclick("left" ,$x, $y,1,1)
$xnext = $y+2
sleep($mouseSpeed)
Else
ToolTip('elix not found' & $ii & $xnext,0,0)
sleep($mouseSpeed)
$xnext= 115
EndIf
Next
$iii = 0
ToolTip('looking gold',0,0)
For $iii = 0 To 7 Step 1
$result=_ImageSearchArea('gold1.bmp', 1, 200, $xnext, 1050, 800, $x, $y, 60)
if $result=1 Then
mouseclick("left" ,$x, $y,1,1)
$xnext = $y+2
sleep($mouseSpeed)
Else
ToolTip('gold not found' & $iii& $xnext,0,0)
sleep($mouseSpeed)
$xnext= 115
EndIf
Next
ToolTip('looking dark',0,0)
For $iii = 0 To 4 Step 1
$result=_ImageSearchArea('dark1.bmp', 1, 200, $xnext, 1050, 800, $x, $y, 60)
if $result=1 Then
mouseclick("left" ,$x, $y,1,1)
$xnext = $y+2
sleep($mouseSpeed)
Else
ToolTip('dark not found' & $iii& $xnext,0,0)
sleep($mouseSpeed)
$xnext= 115
EndIf
Next
MouseMove ( $x, $y, 3)
EndFunc
The images are 10x10 pixel from coin and drops. mouse click not collectors, but appeared coin and drops images. My resolution is 1240x1080.
Works, Then collectors are not in horizontal line. Some time, dont locate top or bottom collector.
func _CollectAll()
Local $result
Local $ii, $iii
Local $xnext
Local $mouseSpeed = 50
$ii = 0
$xnext= 115
For $ii = 0 To 9 Step 1
$result= _ImageSearchArea('elix1.bmp', 1, 200, $xnext, 1050, 800, $x, $y, 90)
if $result=1 Then
mouseclick("left" ,$x, $y,1,1)
$xnext = $y+2
sleep($mouseSpeed)
Else
ToolTip('elix not found' & $ii & $xnext,0,0)
sleep($mouseSpeed)
$xnext= 115
EndIf
Next
$iii = 0
ToolTip('looking gold',0,0)
For $iii = 0 To 7 Step 1
$result=_ImageSearchArea('gold1.bmp', 1, 200, $xnext, 1050, 800, $x, $y, 60)
if $result=1 Then
mouseclick("left" ,$x, $y,1,1)
$xnext = $y+2
sleep($mouseSpeed)
Else
ToolTip('gold not found' & $iii& $xnext,0,0)
sleep($mouseSpeed)
$xnext= 115
EndIf
Next
ToolTip('looking dark',0,0)
For $iii = 0 To 4 Step 1
$result=_ImageSearchArea('dark1.bmp', 1, 200, $xnext, 1050, 800, $x, $y, 60)
if $result=1 Then
mouseclick("left" ,$x, $y,1,1)
$xnext = $y+2
sleep($mouseSpeed)
Else
ToolTip('dark not found' & $iii& $xnext,0,0)
sleep($mouseSpeed)
$xnext= 115
EndIf
Next
MouseMove ( $x, $y, 3)
EndFunc