Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 02:13

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

Advertisement



Hilfe bei ImageSearch

Discussion on Hilfe bei ImageSearch within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1


 
Moneypulation's Avatar
 
elite*gold: 138
Join Date: Apr 2012
Posts: 3,495
Received Thanks: 1,769
Hilfe bei ImageSearch

Hallo ich brauche Hilfe bei der ImageSearch funktion. Unzwar bekomm ich immer diese Fehlermeldung wenn ich eine Funktion starte die den ImageSearch beinhaltet:



Davor hatte ich keine PixelSearch.au3 Datei. hab sie vom internet gedownloadet und auch die .dll datei dafür. Trotzdem scheint was mit der Datei nicht zu stimmen...

Also beim StartUp läuft noch alles gut, auch das beenden geht. Aber wenn ich g drücke und somit die Funktion _Start , dann kommt der error

Hoffe auf eine gute Antwort


lg
Moneypulation is offline  
Old 07/16/2014, 22:10   #2
 
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,147
In der Meldung steht doch alles was du wissen musst: Der Fehler tritt in Zeile 45 der ImageSearch.au3 auf. Da wirst du wohl eine fehlerhafte Version gedownloadet haben.
Ändere die Zeile in
Code:
If IsArray($result) And $result[0] = 0 Then Return 0
oder suche dir eine korrekte .au3. Ich kann nicht genau sagen, wie sich die Änderung der Zeile auswirken wird. Sollte das Array noch einmal verwendet werden musst du vorher prüfen, ob $result überhaupt ein Array ist. Umschließe den Block einfach mit der IsArray() Abfrage.
KDeluxe is offline  
Thanks
1 User
Old 07/16/2014, 22:24   #3


 
Moneypulation's Avatar
 
elite*gold: 138
Join Date: Apr 2012
Posts: 3,495
Received Thanks: 1,769
Quote:
Originally Posted by KDeluxe View Post
In der Meldung steht doch alles was du wissen musst: Der Fehler tritt in Zeile 45 der ImageSearch.au3 auf. Da wirst du wohl eine fehlerhafte Version gedownloadet haben.
Ändere die Zeile in
Code:
If IsArray($result) And $result[0] = 0 Then Return 0
oder suche dir eine korrekte .au3. Ich kann nicht genau sagen, wie sich die Änderung der Zeile auswirken wird. Sollte das Array noch einmal verwendet werden musst du vorher prüfen, ob $result überhaupt ein Array ist. Umschließe den Block einfach mit der IsArray() Abfrage.
Ich kenn mich leider noch nicht so gut aus mit AutoIt. Wenn ich die Zeile mit deiner Zeile überschreibe kommt direkt der nächste Error in Z. 48

Das ist meine Imagesearch.au3 datei:


Kann jemand hier seine funktionierende Datei hochladen? Wäre nett
Moneypulation is offline  
Old 07/16/2014, 23:27   #4
 
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,147
Code:
Func _ImageSearchArea($findImage, $resultPosition, $x1, $y1, $right, $bottom, ByRef $x, ByRef $y, $tolerance, $transparency = 0)
        ;MsgBox(0,"asd","" & $x1 & " " & $y1 & " " & $right & " " & $bottom)
        If Not ($transparency = 0) Then $findImage = "*" & $transparency & " " & $findImage
        If $tolerance > 0 Then $findImage = "*" & $tolerance & " " & $findImage
        $result = DllCall("ImageSearchDLL.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage)

        ; If error exit
        If IsArray($result) Then
            If $result[0] = 0 Then Return 0

            ; Otherwise get the x,y location of the match and the size of the image to
            ; compute the centre of search
            $array = StringSplit($result[0], "|")

            $x = Int(Number($array[2]))
            $y = Int(Number($array[3]))
            If $resultPosition = 1 Then
                    $x = $x + Int(Number($array[4]) / 2)
                    $y = $y + Int(Number($array[5]) / 2)
            EndIf
            Return 1
        Else
            Return 0
        EndIf
EndFunc   ;==>_ImageSearchArea
KDeluxe is offline  
Thanks
1 User
Old 07/17/2014, 17:44   #5


 
Moneypulation's Avatar
 
elite*gold: 138
Join Date: Apr 2012
Posts: 3,495
Received Thanks: 1,769
Quote:
Originally Posted by KDeluxe View Post
Code:
Func _ImageSearchArea($findImage, $resultPosition, $x1, $y1, $right, $bottom, ByRef $x, ByRef $y, $tolerance, $transparency = 0)
        ;MsgBox(0,"asd","" & $x1 & " " & $y1 & " " & $right & " " & $bottom)
        If Not ($transparency = 0) Then $findImage = "*" & $transparency & " " & $findImage
        If $tolerance > 0 Then $findImage = "*" & $tolerance & " " & $findImage
        $result = DllCall("ImageSearchDLL.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage)

        ; If error exit
        If IsArray($result) Then
            If $result[0] = 0 Then Return 0

            ; Otherwise get the x,y location of the match and the size of the image to
            ; compute the centre of search
            $array = StringSplit($result[0], "|")

            $x = Int(Number($array[2]))
            $y = Int(Number($array[3]))
            If $resultPosition = 1 Then
                    $x = $x + Int(Number($array[4]) / 2)
                    $y = $y + Int(Number($array[5]) / 2)
            EndIf
            Return 1
        Else
            Return 0
        EndIf
EndFunc   ;==>_ImageSearchArea

Danke, du bist hier der einzige der mir hilft :/

Der Code beinhaltet nur die Imagesearcharea funktion. Aber mit @Desktopwidh und height kann ich doch eigentlich die funktion auch desktopübergreifend benutzen oder nicht? Habs mal probiert, bekomme keine fehlermeldung aber das bild wird nicht erkannt Egal ob .bmp mit 16 oder 254 farben oder ob .png ...

Weiß jemand warum?

Moneypulation is offline  
Old 07/17/2014, 19:25   #6
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
Nimmst du Coord oder Absolut als Koordinaten Mode, liegt eventuell daran.
Außerdem sollten die Bilder die du suchst am besten mit Lossless PNG komprimiert werden.
alpines is offline  
Thanks
1 User
Old 07/18/2014, 01:17   #7


 
Moneypulation's Avatar
 
elite*gold: 138
Join Date: Apr 2012
Posts: 3,495
Received Thanks: 1,769
Ich habs mal mit beiden probiert und es passiert immer noch nichts. Hab auch die bilder komprimiert, bot erkennt die bilder wieder nicht

Hier ist mal ein Beispielbild dass erkennt werden soll:

Moneypulation is offline  
Reply


Similar Threads Similar Threads
If - ElseIf / Imagesearch Hilfe
01/10/2014 - AutoIt - 6 Replies
Hallo Community, Ich brauch mal wieder eure Hilfe, weil ich nach langen Suchen und rumprobieren nicht weiter komme. Func step2() If _WaitForImageSearch("data/munze.bmp",600 00,1,$x,$y,10) > 0 Then ;sucht die Münze und findet sie *funktioniert MouseClick("left", $x ,$y, 1, 1) Sleep(500) MouseClick("left", 686 ,374, 1, 10) ;spielt die Karte ElseIf _WaitForImageSearch("data/munze.bmp",600 00,1,$x,$y,10) > 0 Then ;findet er die Münze nicht *funktioniert
Hilfe mit ImageSearch
08/25/2013 - AutoIt - 1 Replies
Jo, wollte so 'nen simplen Cookieclicker-Bot machen und hab das Problem, dass er nicht anfängt iwas zu machen, bzw. er hovert nichtmal mit der Maus auf das Keks.bmp. Code: #include <ImageSearch.au3> Hotkeyset("{F2}","Ende") Func Ende () While 1 - Pastebin.com Keks.bmp und ImageSearch dll sind natürlich im Ordner.
ImageSearch bitte um Hilfe
01/21/2011 - AutoIt - 4 Replies
Tag allerseits ich bin noch ein zimlicher Anfänger was AuoIt betrifft meine einzige Erfahrung die ich bisher gemacht habe ist, habe mir einen Bot für Millionaire City gecoded welcher aber nur aus MouseMove und Mouse Click besteht... Deshalb wollte ich das ganze mit ImageSearch verbessern, weil soviel ich weiss kann man damit bestimmte Bilder suchen und bekommt dann diese Koordinaten des Bildes zurück. In meinem Fall wären das halt Häuser von welchen es auch mehrere der gleichen Sorte...
Hilfe bei einem AUtoIT imagesearch script
08/24/2010 - AutoIt - 2 Replies
Nun, Ich will ein Script, dass solange den Bildschirm SCHNELL nach dem Pixel 0x267042 sucht und immer wieder draufklickt, bis das Bild "gewonnen.PNG" sichtbar wird,dann da drauf klickt und wieder von vorne anfängt mit Pixelsearch. Danke
dringen hilfe zu imagesearch
07/29/2010 - AutoIt - 8 Replies
Hi ich habe mir auch die imagesearch demo angesehen werde aber nicht schlau^^. Also ich habe diesen code: #include <ImageSearch.au3> ; ; Demo on the functions of ImageSearch ; Assumes that you have a Recycle Bin icon at the top left of your screen ; Assumes that you have IE6 or 7 icon visible ; Please make the icon visible or we won't be able to find it



All times are GMT +2. The time now is 02:13.


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.