Pregunta

I'm working on a program for a web-based game. I have few errors, I'm not familiar with AutoIt, this is like my fifth time. I found a code online which almost works with a couple of errors I've spent the whole day trying to fix this but nothing yet.

Hope you guys can help me.

Link to the post where the source is.

I have the images for the search too if you need them. Thanks.

¿Fue útil?

Solución

Ok this scipt in the pastebin is just carp XD i dont get the point of it.

Do you really nead this Script or do you need a example for ImageSearch?

Example for ImageSearch with AutoIt

#include <ImageSearch.au3>

Global $x, $y

$prison = _ImageSearch("yourPicture.PNG",1,$x,$y,50)
If $prison = 1 then
  MouseClick("left", $x, $y)
Else
   MsgBox(048,"Attention","I didnt found the picture.")
EndIf

The Explanation for the Image Search is here:

;===============================================================================
;
; Description:      Find the position of an image on the desktop
; Syntax:           _ImageSearch
; Parameter(s):     
;                   $findImage - the image to locate on the desktop
;                   $tolerance - 0 for no tolerance (0-255). Needed when colors of 
;                                image differ from desktop. e.g GIF
;                   $resultPosition - Set where the returned x,y location of the image is.
;                                     1 for centre of image, 0 for top left of image
;                   $x $y - Return the x and y location of the image
;
; Return Value(s):  On Success - Returns 1
;                   On Failure - Returns 0 
;
; Note: Use _ImageSearch to search the entire desktop, _ImageSearchArea to specify
;       a desktop region to search
;
;===============================================================================
_ImageSearch($findImage,$resultPosition,ByRef $x, ByRef $y,$tolerance)
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top