Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 20:34

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

Advertisement



i need help with image search error.

Discussion on i need help with image search error. within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2011
Posts: 278
Received Thanks: 67
i need help with image search error.

i have looked for help through the forums but non of those have helped me out.

here is the code:
Code:
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Compression=0
#AutoIt3Wrapper_UseX64=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ImageSearch.au3>

HotKeySet("{p}", "checkForImage")

global $y = 0, $x = 0

Func checkForImage()
Local $search = _ImageSearch("Killed3.bmp", 1, $x, $y,1 )
If $search = 1 Then
MouseMove($x, $y, 10)
EndIf
EndFunc

while 1
sleep(200)
WEnd

this is the error:
Code:
\ImageSearch.au3 (44) : ==> Subscript used with non-Array variable.:
if $result[0]="0" then return 0
if $result^ ERROR

here are the pics i try to make it look for.


sander2828 is offline  
Old 07/08/2013, 16:16   #2
 
butter123's Avatar
 
elite*gold: 95
Join Date: May 2011
Posts: 982
Received Thanks: 189
the error is in the imagesearch.au3
has allready been asked few times in the forum
butter123 is offline  
Old 07/08/2013, 16:28   #3
 
elite*gold: 0
Join Date: Feb 2011
Posts: 278
Received Thanks: 67
yup i know that but would be nice to figure out the fix.
because it sometimes gives error but sometimes it don't dunno why
i speak only english and estonian aswell so...

EDIT: and now agen when i changed pic to bmp 24 it works agen
sander2828 is offline  
Old 07/08/2013, 18:45   #4
 
butter123's Avatar
 
elite*gold: 95
Join Date: May 2011
Posts: 982
Received Thanks: 189
Func _ImageSearchArea($findImage,$resultPosition,$x1,$y 1,$right,$bottom,ByRef $x, ByRef $y, $tolerance)
;MsgBox(0,"asd","" & $x1 & " " & $y1 & " " & $right & " " & $bottom)
if $tolerance>0 then $findImage = "*" & $tolerance & " " & $findImage
$result = DllCall("C:\ImageSearchDLL.dll","str","ImageSearch ","int",$x1,"int",$y1,"int",$right,"int",$bottom," str",$findImage)

; If error exit
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
EndFunc
butter123 is offline  
Reply


Similar Threads Similar Threads
How do i use image search using Auotit?
06/14/2013 - AutoIt - 2 Replies
Basically what i wanna do is this video. Autoit ImageSearch - YouTube Thanks.:handsdown::handsdown::handsdown: I wanna find any image on my screen no matter where it is and click it.The link given there is now working. I use windows 7 64 bit. any help please?
Image search
05/23/2013 - AutoIt - 1 Replies
Wie binde ich bilder in meine exe ein? Ich möchte nämlich nur die exe haben und sie verschicken können, ohne, dass ich die bilder immer beilegen muss. LG Tom
Image search API
11/28/2012 - Web Development - 2 Replies
Heyho, ich wollte mal nachfragen ob wer von euch Dienste / API's kennt womit man Bilder suchen kann? Am besten gratis. Yahoo API - Gibt es nicht mehr Google API - Wird bald mal geschlossen, die neue kostet ab 100 Anfragen Geld Flickr API - Geht zwar, aber die Resultate lassen eher zu wünschen übrig Instagram API - Geht, aber man kann nur nach einen Tag ohne Leerzeichen etc. suchen Pinterest hat z.Z. keine API mehr
Problem with Image Search?
11/20/2010 - Mabinogi - 8 Replies
Ive made a script that is looking pretty perfect but it refuses to go to the images. All pictures are taken correctly and I do run it as administrator. Ive looked over the script and I didn't see any errors. Please help.
how to use image search area!! help.
12/13/2009 - Mabinogi - 8 Replies
Func _ImageSearchArea($findImage,$resultPosition,$x1,$y 1,$right,$bottom,ByRef $x, ByRef $y, $tolerance) Someone explain each variable to me please. Especially the 2 coordinate variables that determines which area it searches in specifically.



All times are GMT +1. The time now is 20:35.


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.