Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 08:37

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Help] ImageSearch

Discussion on [Help] ImageSearch within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
speedlink1986's Avatar
 
elite*gold: 11
Join Date: Aug 2011
Posts: 468
Received Thanks: 43
[Help] ImageSearch

Tag zusammen,

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
speedlink1986 is offline  
Reply


Similar Threads Similar Threads
imagesearch
02/29/2012 - C/C++ - 19 Replies
grüße, ich versuche folgende imagesearch funktion bei mir zu implementieren: char* WINAPI ImageSearch(int aLeft, int aTop, int aRight, int aBottom, char *aImageFile) // Author: ImageSearch was created by Aurelian Maga. { // Many of the following sections are similar to those in PixelSearch(), so they should be // maintained together. //Var *output_var_x = ARGVAR1; // Ok if NULL. RAW wouldn't be safe because load-time validation actually //Var *output_var_y = ARGVAR2; // requires a...
[VB]ImageSearch
10/08/2011 - .NET Languages - 0 Replies
Hi. Wie mache ich in visual basic ImageSearch? Bei Autoit ist es ja leicht: #include <imageSearch.au3> $x = 0 $y = 0
imagesearch
06/05/2011 - AutoIt - 4 Replies
Hallo, ich arbeite gerade mit imagesearch... Wenn er ein Bild gefunden hat, dann geht er ja immer in die linke obere ecke davon. Jetzt möchte ich aber das er von der oberen linken ecke, von dem gefundenen Bild, etwas nach rechts und etwas nach unten klickt, wie geht das?
ImageSearch
02/13/2011 - AutoIt - 1 Replies
Hey Leute, bei AutoIT gibt es ja _ImageSearchArea gibt es auch _ImagesSearchArea Also Area mit mehreren Bildern???
ImageSearch?
01/11/2010 - AutoIt - 4 Replies
Hey, kann einer von euch, einfach für einen Anfänger erklären, wie man mit Autoit die Funktion "ImageSearch" benutzt? Thx für eure Antworten!



All times are GMT +1. The time now is 08:38.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.