Ich habe eine Problem. Und zwar bei MonsterWorld ( Facebook Game )
Läuft Soweit auch ganz gut.
Er findet die Flaschen und Pflanzt sie.
Dann erntet er sie nach 2 Minuten ab. Bis hier hin läufts!
Nun soll er nach ein freien Feld suchen und wenn er ein gefunden hat sich wieder die Flaschen nehmen und sie Pflanzen.
Tut er aber nicht er switcht einfach zwischen den freien Feldern hin und her.
Code habe ich mal gepostet. Hoffe mir kann jemand helfen.
Code:
#include <ImageSearch.au3>
HotKeySet("{F11}", "_Go")
HotKeySet("{F10}","_beenden")
Global $timer, $x, $y, $value
Func _Go()
While 1
Do
_ImgSearch("get_lim", 9000)
Until $value = 1
_ImgSearch("pick_lim", 7000)
Do
_Seed(0, 7000)
Until $value = 1
_ImgSearch("pick_lim", 7000)
WEnd
EndFunc ;==>_Go
Func _ImgSearch($pic, $timeout)
$timer = TimerInit()
$x = 0
$y = 0
$value = 0
Do
$var = _ImageSearch(@ScriptDir & "/Data/" & $pic & ".bmp", 1, $x, $y, 15)
If $x <> 0 And $y <> 0 Then MouseClick("left", $x, $y)
Until $x <> 0 And $y <> 0 Or TimerDiff($timer) > $timeout
If TimerDiff($timer) > $timeout Then $value = 1
Return $value
EndFunc ;==>_ImgSearch
Func _Seed($plant, $timeout)
$timer = TimerInit()
$x = 0
$y = 0
$value = 0
Do
$var = _ImageSearch(@ScriptDir & "/Data/empty_field.bmp", 1, $x, $y, 15)
Until $x <> 0 And $y <> 0 Or TimerDiff($timer) > $timeout
If $x <> 0 And $y <> 0 Then MouseClick("left", $x, $y)
If TimerDiff($timer) > $timeout Then $value = 1
Return $value
EndFunc ;==>_Seed
While 1
Sleep(10)
WEnd
Func _beenden()
Exit
EndFunc






