Jump to content

Having a small problem with Imagesearch


MahM
 Share

Recommended Posts

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?

 

Link to comment
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

Link to comment
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

Link to comment
Share on other sites

  • Moderators

MahM,

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

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Jos locked this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...