I posted my Neighbor-help-code some days ago.
Here again, with a few changes:
HotKeySet("{H}", "HelpNeighbor")
HotKeySet("{S}", "Stop")
While 1
Sleep(100)
WEnd
Func HelpNeighbor()
WinWaitActive("FarmVille")
While True
$coord=0
$coord = PixelSearch( 450, 300, 671, 380, 0x4A925A)
$step=1
If Not @error Then
$coord2 = PixelSearch( 450, 300, 671, 380, 0x104D18)
If Not @error Then
;msgbox(0,"", $coord[0] & $coord[1])
MouseMove($coord[0] ,$coord[1])
$step=2
MouseClick("left", $coord[0], $coord[1])
$step=3
Sleep(30000)
$step=4
MouseMove(417,499)
$coord1 = PixelSearch( 400, 450, 500, 600, 0x31CB42)
$step=5
While @error
$step=6
MouseMove(417,499)
MouseMove(420,505)
$coord1 = PixelSearch( 400, 450, 500, 600, 0x31CB42)
WEnd
$step=7
MouseMove($coord1[0]+ 10 ,$coord1[1]+10)
$step=8
MouseClick("left",$coord1[0]+ 10 ,$coord1[1]+10)
$step=9
Sleep(500)
$step=10
MouseClick("left",$coord1[0]+ 10 ,$coord1[1]+10)
$step=11
Sleep(1000)
$step=12
MouseMove(343,220)
$step=13
MouseClick("left",343,220)
$step=14
Sleep(10000)
$step=15
Else
;msgbox (0,"","Nicht gefunden!")
Send("{F5}")
$step=17
Sleep(10000)
$step=18
EndIf
EndIf
WEnd
EndFunc
Func Stop()
Exit
EndFunc
2 Problems remain:
1. If there is another info above the Free gifts | Play | My Neighbors the script won´t work (finding Free gifts), so there is to to some config dialog
1b. Same Prob for other resolutions
2. If there is no Go To XYZ´s Farm button, I need to press F5 manually, cause it finds the specified pixels, without the Button being there...
Anyone could help?