MahM

Having a small problem with Imagesearch

13 posts in this topic

Hello everyone

This is my first post in Autoit and i recently started to use Autoit so i hope you will ignore my noobiness :/

I have a very simple use for imagesearch function. All i want is my script to recognize a specific image and stop the function automatically. below is my script but in there i am only testing the mousemove function when the image is recognized which however doesnt work yet so i came here to ask the professionals. I would really appreciate any help.

My Script and the errors i get with it when i run it

#include <ImageSearch.au3>
(error: cant open file <ImageSearch.au3>.)

HotKeySet('S', '_Start')

$X = 0
$Y = 0

Func _Start()
Do
 $Search = _ImageSearch('img2.bmp', 0, $X, $Y, 0)

(error: _imageSearch(): undefined function.)


Until $Search = 1
MouseMove($X, $Y,10)
EndFunc


While 1
    Sleep(100)
WEnd

 

I have included all of dll, imagesearch.au3, myscript.au3 and the img2.bmp into one folder inside desktop  (Desktop > Imagesearch)

I am running windows 7 64bit so i downloaded 64 bit Autoit version. I just dont know what can be wrong with such a simple script as i have proofread it million times now. Do i need to place the folders somewhere else for them to work?

 

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

imagesearch.au3 must be placed in C:\Program Files (x86)\AutoIt3\Include

Edited by langthang084

Share this post


Link to post
Share on other sites

Thanks guys, it did sort out the error but now i have a different issue. first of all i want to tell you where i have placed the folders.

Imagesearch,au3 is placed in C:\Program Files (x86)\AutoIt3\Include

while the script,image.bmp and dll are included in C:\Program Files (x86)\AutoIt3\Include\Imagesearch

What happens is when i run the script, it runs but then does nothing eventhough i make sure the image the script is looking for is on the desktop visible. I have attached the image and the imagesearch.au3 so if anyone can see a mistake in them then please let me know. I took the snorlax2 image from browser and printscreening and cropping in paint so i am not too sure if imagesearch would still search for such images. Please can anyone give advice on what kind of images to use or if pixelsearch is better for me to use and etc?

Really appreicate all the help.

snorlax2.bmp.bmp

imagesearch4.au3

ImageSearchDLL.dll

ImageSearch.au3

Share this post


Link to post
Share on other sites

btw the script has snorlax2.bmp as the image to look for. Also i wanted my script to click on the image when it spots it but at the moment when i run it, it does nothing so maybe it doesnt recognize the image. Thank you

Share this post


Link to post
Share on other sites

MahM,

That image looks very much like part of a game - is that indeed the case?

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Hey if you figure this out can you please message me, i've been trying to get this to work for months. I'm a noob too. Love Auto it just cant get this to work 

Share this post


Link to post
Share on other sites

feistcomputers,

If a Moderator has asked a question in a thread to ascertain its legality, it is not acceptable for someone else to post before an answer is forthcoming and acknowledged

I understand your impatience, but please do not do it again.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Or quotes used instead of angle brackets, like in the link mikell posted.

Not really, the only think changing with <> or "" is the sequence it searches the different directories, but it should still find in in case it is located in the scriptdir.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Yes it is part of a game, is there something wrong?

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.