Register for your free account! | Forgot your password?

Go Back   elitepvpers › Coders Den › AutoIt
You last visited: Today at 22:13

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

Advertisement



AutoIT - ImageSearch läuft nicht richtig.

Discussion on AutoIT - ImageSearch läuft nicht richtig. within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
Strix333's Avatar
 
elite*gold: 39
Join Date: Nov 2017
Posts: 22
Received Thanks: 1
AutoIT - ImageSearch läuft nicht richtig.

Hallo,

ich habe es hinbekommen, (mit x64) dass der Mauszeiger sich bewegt und klickt beim ImageSearch. Leider geht er ein ordentliches Stück unter den gewünschten Button. An was kann das liegen?

So siehts aus:
Code:
$x1=0
$y1=0
Sleep (3000)
$variable=_ImageSearch("search.bmp", 1, $x1, $y1, 0)
If $variable=1 then
  MouseMove($x1, $y1)
  Sleep (1000)
  MouseClick("left", $x1, $y1)
Endif
edit: include ist auch drinnen nur vergessen zu kopieren.
Strix333 is offline  
Old   #2
 
elite*gold: 0
Join Date: Apr 2011
Posts: 363
Received Thanks: 167
Image search was not working for me in windows 10 then i found one that works fine, i uploaded here if u want.
Code:
$param = 1; [1 - CENTER OF IMAGE],[0 - TOP LEFT CORNER OF IMAGE]
_ImageSearch("search.bmp", $param, $x1, $y1, 0)
Attached Files
File Type: rar ImageSearch2015.rar (897.4 KB, 90 views)
elmarcia is offline  
Thanks
2 Users
Old   #3
 
Strix333's Avatar
 
elite*gold: 39
Join Date: Nov 2017
Posts: 22
Received Thanks: 1
Quote:
Originally Posted by elmarcia View Post
Image search was not working for me in windows 10 then i found one that works fine, i uploaded here if u want.
Code:
$param = 1; [1 - CENTER OF IMAGE],[0 - TOP LEFT CORNER OF IMAGE]
_ImageSearch("search.bmp", $param, $x1, $y1, 0)
Thanks for the answer!

If i try to compile i got this error:

Error adding file:
ImageSearchDLLx32.dll

i put the imagesearch2015.au3 in \AutoIt3\include\
and the 2 dll (32+64) in C:\WINDWOS\system32

HTML Code:
#include <ImageSearch2015.au3>

$x1=0
$y1=0
Sleep (3000)
$param = 1; [1 - CENTER OF IMAGE],[0 - TOP LEFT CORNER OF IMAGE]
$variable = _ImageSearch("geld.png", $param, $x1, $y1, 10)
If $variable=1 then
  MouseMove($x1, $y1)
  Sleep (1000)
  MouseClick("left", $x1, $y1)
Endif
Whats wrong? :/
Strix333 is offline  
Old   #4

 
Artarex's Avatar
 
elite*gold: 1
Join Date: Aug 2009
Posts: 3,007
Received Thanks: 1,843
Quote:
Originally Posted by Strix333 View Post
Thanks for the answer!

If i try to compile i got this error:

Error adding file:
ImageSearchDLLx32.dll

i put the imagesearch2015.au3 in \AutoIt3\include\
and the 2 dll (32+64) in C:\WINDWOS\system32

HTML Code:
#include <ImageSearch2015.au3>

$x1=0
$y1=0
Sleep (3000)
$param = 1; [1 - CENTER OF IMAGE],[0 - TOP LEFT CORNER OF IMAGE]
$variable = _ImageSearch("geld.png", $param, $x1, $y1, 10)
If $variable=1 then
  MouseMove($x1, $y1)
  Sleep (1000)
  MouseClick("left", $x1, $y1)
Endif
Whats wrong? :/
try to put the dll in your project folder. So if your .au3 is on the desktop put the dll also there.
Artarex is offline  
Old   #5
 
Strix333's Avatar
 
elite*gold: 39
Join Date: Nov 2017
Posts: 22
Received Thanks: 1
Quote:
Originally Posted by Artarex View Post
try to put the dll in your project folder. So if your .au3 is on the desktop put the dll also there.
I tried. It works without error. But it dont find the pic.

Ist es evtl für autoit wichtig wie es installiert wurde? Also 64x 86x ?
Strix333 is offline  
Old   #6
 
elite*gold: 0
Join Date: Nov 2012
Posts: 9
Received Thanks: 0
Servus

Befindet sich das Bild im selben Ordner wie der Script?

Wo/In was lässt du nach "dem Geld" suchen?
Je nach Situation benötigst Du Adminrechte. Befehl: #RequireAdmin

cheers
GyRb! is offline  
Old   #7
 
Strix333's Avatar
 
elite*gold: 39
Join Date: Nov 2017
Posts: 22
Received Thanks: 1
Quote:
Originally Posted by GyRb! View Post
Servus

Befindet sich das Bild im selben Ordner wie der Script?

Wo/In was lässt du nach "dem Geld" suchen?
Je nach Situation benötigst Du Adminrechte. Befehl: #RequireAdmin

cheers
Servus

*** befindet sich im gleichen Ordner. Wie soll ich das genau machen mit den Admin-Befehlen?
Strix333 is offline  
Old   #8
 
elite*gold: 0
Join Date: Nov 2012
Posts: 9
Received Thanks: 0
"#RequireAdmin" in den Script packen. Erste Zeile oder nach den Includes.
Beim Starten verlangt er dann halt die Bestätigung d. Admins.
Ist aber auch nur in manchen Situation wirklich nötig. Wenn Bsp. die Plattform auf der gesucht werden soll ebenfalls Adminbestätigung erfragt hat.

Sollte das nicht funzen, gib' mal paar mehr Infos.
Ist zwar sehr simpel der Code, entsprechend wohl auch das Problem, aber ein "funzt nicht" reicht meist nicht aus.

Ist das "Geld" was Du suchst immer gleich, oder ist es bei der Anwendung eventuell animiert. Glitzert, blinkt, funkelt, wie auch immer?

Wie hast du das Bild erhalten? Screenshot und dann Paint o. via Snippingtool?

Bin mir nicht sicher, aber vielleicht musst' auch aus
..._ImageSearch("geld.png",.... folgends machen:
..._ImageSearch(@ScriptDir & "/geld.png",...
GyRb! is offline  
Old   #9
 
Strix333's Avatar
 
elite*gold: 39
Join Date: Nov 2017
Posts: 22
Received Thanks: 1
Quote:
Originally Posted by GyRb! View Post
"#RequireAdmin" in den Script packen. Erste Zeile oder nach den Includes.
Beim Starten verlangt er dann halt die Bestätigung d. Admins.
Ist aber auch nur in manchen Situation wirklich nötig. Wenn Bsp. die Plattform auf der gesucht werden soll ebenfalls Adminbestätigung erfragt hat.

Sollte das nicht funzen, gib' mal paar mehr Infos.
Ist zwar sehr simpel der Code, entsprechend wohl auch das Problem, aber ein "funzt nicht" reicht meist nicht aus.

Ist das "Geld" was Du suchst immer gleich, oder ist es bei der Anwendung eventuell animiert. Glitzert, blinkt, funkelt, wie auch immer?

Wie hast du das Bild erhalten? Screenshot und dann Paint o. via Snippingtool?

Bin mir nicht sicher, aber vielleicht musst' auch aus
..._ImageSearch("geld.png",.... folgends machen:
..._ImageSearch(@ScriptDir & "/geld.png",...


Okay das werde ich mal probieren und die nochmal Rückmeldung geben Trotzdem danke schonmal!
Zum "Geld": Das war Anfang für ein Spiel gedacht, allerdings hat das nicht funktioniert und ich hab das schnell aufgegeben jetzt ist es einfach das "N" von One Note

Was würde folgendes Bedeuten bei deinem Vorschlag: @ScriptDir & "/
Sollte immer noch nichts laufen werde ich mal sehr detailiert alles beschreiben

Gruß Strix333
Strix333 is offline  
Old   #10
 
elite*gold: 0
Join Date: Nov 2012
Posts: 9
Received Thanks: 0
Im ersten Parameter vom ImageSearch musst Du den Pfad zum Bild angeben. @ScriptDir übermittelt ledeglich das es im Ordner(Dir) vom Script(Script) ist. Gibt auch sowas wie @DesktopDir usw.. Verwendest doch SciTe oder? F1 gibt Dir immer die nötigsten Infos zu allen gängigen Befehlen.
GyRb! is offline  
Old   #11
 
Strix333's Avatar
 
elite*gold: 39
Join Date: Nov 2017
Posts: 22
Received Thanks: 1
Quote:
Originally Posted by GyRb! View Post
Im ersten Parameter vom ImageSearch musst Du den Pfad zum Bild angeben. @ScriptDir übermittelt ledeglich das es im Ordner(Dir) vom Script(Script) ist. Gibt auch sowas wie @DesktopDir usw.. Verwendest doch SciTe oder? F1 gibt Dir immer die nötigsten Infos zu allen gängigen Befehlen.

Ja benutze SciTe.
Habe AutoIt nochmal neu installiert (64x). Jetzt funktioniert es. Naja fast. Es findet die Bilder jetzt, verfehlt diese aber immer um ca eine Icon Größe. Habe einfach einen Teil des Chrome-Icons auf dem Desktop genommen. Mit MouseMove geht er dann aber fast auf das nächste Icon darunter... Wie kann das sein? (Habe es auch mit anderen Icons ausprobiert)
Strix333 is offline  
Old   #12
 
elite*gold: 0
Join Date: Apr 2011
Posts: 363
Received Thanks: 167
Quote:
Originally Posted by Strix333 View Post
Ja benutze SciTe.
Habe AutoIt nochmal neu installiert (64x). Jetzt funktioniert es. Naja fast. Es findet die Bilder jetzt, verfehlt diese aber immer um ca eine Icon Größe. Habe einfach einen Teil des Chrome-Icons auf dem Desktop genommen. Mit MouseMove geht er dann aber fast auf das nächste Icon darunter... Wie kann das sein? (Habe es auch mit anderen Icons ausprobiert)
That is because scan order, you need a representative image to search for and limit in the area you want it to be found
Here is an example:
Code:
#include "ImageSearch2015.au3"

_ImageSearchStartup()

Global $x= 0,$y = 0
$centerImage = 1; 0 top left corner - 1 center of image
$data = _ImageSearch("test.png",$centerImage,$x,$y,10)
MouseMove($x,$y)
;use to search for images in specific rectangle -> Faster than search entire desktop
; _ImageSearchArea($imgpath,$searchCenter,$xo,$yo,$width,$height,$x,$y,$tolerance)



_ImageSearchShutdown()
Image to search, then we split the image in one of 50x50


Lets say we have this


Then search order will be like this:

As soon as image 1 is not visible, it will find image 2, then if image 1 and 2 aren't visible will find image 3 and so on...

The best you can do to test for same images in the desktop is area search, to test if it is there or not.


[EDIT]
This code should search for all same images in a region, it takes some time for all desktop (8/10 sec)
so if u use a smaller region would be faster
elmarcia is offline  
Thanks
1 User
Old   #13
 
Strix333's Avatar
 
elite*gold: 39
Join Date: Nov 2017
Posts: 22
Received Thanks: 1
Quote:
Originally Posted by elmarcia View Post
That is because scan order, you need a representative image to search for and limit in the area you want it to be found
Here is an example:
Code:
#include "ImageSearch2015.au3"

_ImageSearchStartup()

Global $x= 0,$y = 0
$centerImage = 1; 0 top left corner - 1 center of image
$data = _ImageSearch("test.png",$centerImage,$x,$y,10)
MouseMove($x,$y)
;use to search for images in specific rectangle -> Faster than search entire desktop
; _ImageSearchArea($imgpath,$searchCenter,$xo,$yo,$width,$height,$x,$y,$tolerance)



_ImageSearchShutdown()
Image to search, then we split the image in one of 50x50


Lets say we have this


Then search order will be like this:

As soon as image 1 is not visible, it will find image 2, then if image 1 and 2 aren't visible will find image 3 and so on...

The best you can do to test for same images in the desktop is area search, to test if it is there or not.


[EDIT]
This code should search for all same images in a region, it takes some time for all desktop (8/10 sec)
so if u use a smaller region would be faster
Thanks! I will try that! Hope it works
Strix333 is offline  
Old   #14
 
Strix333's Avatar
 
elite*gold: 39
Join Date: Nov 2017
Posts: 22
Received Thanks: 1
Quote:
Originally Posted by elmarcia View Post
That is because scan order, you need a representative image to search for and limit in the area you want it to be found
Here is an example:
Code:
#include "ImageSearch2015.au3"

_ImageSearchStartup()

Global $x= 0,$y = 0
$centerImage = 1; 0 top left corner - 1 center of image
$data = _ImageSearch("test.png",$centerImage,$x,$y,10)
MouseMove($x,$y)
;use to search for images in specific rectangle -> Faster than search entire desktop
; _ImageSearchArea($imgpath,$searchCenter,$xo,$yo,$width,$height,$x,$y,$tolerance)



_ImageSearchShutdown()
Image to search, then we split the image in one of 50x50


Lets say we have this


Then search order will be like this:

As soon as image 1 is not visible, it will find image 2, then if image 1 and 2 aren't visible will find image 3 and so on...

The best you can do to test for same images in the desktop is area search, to test if it is there or not.


[EDIT]
This code should search for all same images in a region, it takes some time for all desktop (8/10 sec)
so if u use a smaller region would be faster
Hi,
i used exactly your code.
Here is a image that shows what happend:

yellow= image to search
red = mouse
so close
Strix333 is offline  
Old   #15
 
elite*gold: 0
Join Date: Apr 2011
Posts: 363
Received Thanks: 167
change

_ImageSearchArea($path,1,$x,$y,$x+$ds,$y+$ds,$fx,$fy,10)

to
_ImageSearchArea($path,0,$x,$y,$x+$ds,$y+$ds,$fx,$ fy,10)

and see if that works
elmarcia is offline  
Reply


Similar Threads Similar Threads
autoit findet mit imagesearch das bild im spiel nicht oO?
01/21/2010 - AutoIt - 7 Replies
hallo, ich habe folgendes programm geschrieben: #include <ImageSearch.au3> Global $fenster Global $active = 0 $x = 0 $y = 0
[GUIDE] AutoIt ImageSearch
10/18/2009 - Metin2 Guides & Templates - 14 Replies
Ein sehr praktischer Befehl in AutoHotkey: ImageSearch. (http://www.autohotkey.com/docs/commands/ImageSear ch.htm) Was macht der Befehl?- er sucht den ganzen Bildschrim nach einem Vorgegebenen Bild ab. Vielleicht auch Nützlich für den Angelbot, weil die Leute nicht mehr Pixel suchen müsen, sondern nuch noch Screens machen müssen! Diesen Befehl gibt es auch für AutoIt! _________________________________________________ ___________________________ . Kopiere die ImageSearchDLL.dll in...
autoit pixelsearch bzw imagesearch
02/04/2009 - General Coding - 0 Replies
hi leute, ich hab mir nen bot mit autoit programmiert. Es ist n Browsergame, das auf Flash basiert. Ich habe Imagesearch benutzt und alles funkzt prima. Das Problem: Der Pc ist immer besetzt, wenn ich botte... Also meine Frage: Gibts da ne alternative zu ImageSearch, die auch in minimierten Fenstern funktioniert?



All times are GMT +1. The time now is 22:13.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

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