Sign in to follow this  
Followers 0
nova4

cant get image search to work

14 posts in this topic

#1 ·  Posted (edited)

Hello ppl, first the code: 

Func caras()
    print("Buscando punto")
    $found = False;
    $x = 746
    $y = 482
    While Not $found
            print("Encontrado")
        $coord =_ImageSearch("cara.png", 1, $x, $y, 0)
        If Not @error Then
            Sleep(500)                  
            MouseClick("left", $x * $y, 1, 10)
            ExitLoop
        Else
            Sleep(100)
        EndIf
    WEnd
    Return True
 EndFunc

I have imagesearch file in the same directory, and this function makes the script stop.

If i deleteit from the folder, then i get and error #include<imagesearch.au3> error opening

So i dont really know how to make this work, this is the only image search i have in the script.

Edited by nova4

Share this post


Link to post
Share on other sites



Try to add a path to your file:

$coord =_ImageSearch(@ScriptDir &"\cara.png", 1, $x, $y, 0)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

 

Try to add a path to your file:

$coord =_ImageSearch(@ScriptDir &"\cara.png", 1, $x, $y, 0)

 

tryed it and didnt work, maybe i should just reinstall autoit, i dont know why such a simple func like that dosent work

Edited by nova4

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Well, your loop only exits if it finds the image... Doubt reinstalling will fix anything.

What you need to do is add some debugging to find out what is going wrong. Is both the dll and your image file in the same folder as your script? You can use ConsoleWrite("Insert some debug text" & @CRLF) in strategic places to help you figure it out.

Edited by Geir1983
1 person likes this

Share this post


Link to post
Share on other sites

What you need to do, is do better with your description than "this function makes the script stop".

Do u want a description of what the scripts does¿ or do u want the file? i can share u both if u dont have any ideas for ur scripts. Tell me wich one and ill writte more or ill atach the file. So u can have something to play for a while.

Ive already solved the problem just had to download the dll again, all i did was read the other dudes answers, i guess he didnt needed so much stuff to figure out what could be.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

By the way i allmost forgot, thanks Geir1983.

If i ever make a question again, ill add a complete log and description of activitys and stuff ive been doing for the past 10 yeas so maybe that way John can figure out a simple a nicely answer like Geir did.

Edited by nova4

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

And maybe you can kiss my arse.

 

I need a better decription of that arse, is it cracked to much? i can tell is widely used ..

Edited by nova4

Share this post


Link to post
Share on other sites

#11 ·  Posted

Gentlemen (and I use the term loosely),

Please act like grownups. ;)

nova4,

JohnOne's request for more information was quite reasonable - the more we know about a problem the better we can advise you. :)

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

#12 ·  Posted (edited)

He can ask for more info, or the file like i said in my replys, he just needs better manners thats all.

Here John ill give u a tutorial of how to give an answer:

Hey Nova, can u provide more info? i cant really tell what the problem is whit that short description in order to help i need to know more.

Cheers, JhonnnyyyyOne ur friendly Pal

,, insted u prefer to use the clever dudes types of answer, remember John been friendly can help in life and it makes us feel better.

Edited by nova4

Share this post


Link to post
Share on other sites

#14 ·  Posted

Thanks.

No thanks u for been so polite and for trying to help me, even if u didnt find and answer to my imagesearch problem because i didnt provide enogh information about it. Next time ill add a better description, so ur help can aid me faster and if u ever need something u know u can count on me. :D and this thread comes to and end. bye bye John either way thanks for at least taking the time to answer even if ur answers wasent the ones i espected.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0