Jump to content

Image search AutoIt v3.3.14


Recommended Posts

  • Developers

.. and you seriously think we can help you when you give no real information? I wish i was that smart as I could make a lot of money. ;)

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 post
Share on other sites
  • Developers

Come on...  Ok let 's start simple:

  1. What are you trying to automate? (Which application/Use case)
  2. Show the script you have that doesn't work.
  3. What have you tried?

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 post
Share on other sites

I'm training myself.

I want to open a chrome browser and search something doesn't matter what.

This is my script

#include <ImageSearch\ImageSearch.au3>

HotKeySet("p", "checkForImage")

Func checkForImage()
    Local $x = 0, $y = 0
    ConsoleWrite("Call image search")
    Local $search = _ImageSearch("$imgesDir" & "chrome.bmp", 100, $x, $y, 0)
    If $search = 1 Then
        ConsoleWrite("Image is at : " & $x & "-" & $y)
    EndIf
EndFunc

while 1
sleep(200)
WEnd

and i modified the top of ImageSearch like this: 

Global $iDLL = DllOpen(@ScriptDir & "\ImageSearch\ImageSearchDLL32.dll")
If $iDLL = -1 Then
    ConsoleWrite("Error opening dll" & @CRLF)
EndIf

Func _ImageSearch($findImage,$resultPosition, ByRef $x, ByRef $y,$tolerance, $HBMP=0)
   return _ImageSearchArea($findImage,$resultPosition,0,0,@DesktopWidth,@DesktopHeight,$x,$y,$tolerance,$HBMP)
EndFunc

Func _ImageSearchArea($findImage,$resultPosition,$x1,$y1,$right,$bottom, ByRef $x, ByRef $y, $tolerance,$HBMP=0)
    ;MsgBox(0,"asd","" & $x1 & " " & $y1 & " " & $right & " " & $bottom)
    if $tolerance>0 then $findImage = "*" & $tolerance & " " & $findImage
If IsString($findImage) Then
    $result = DllCall($iDLL,"string","ImageSearch","int",$x1,"int",$y1,"int",$right,"int",$bottom,"str",$findImage,"ptr",$HBMP)
Else
    $result = DllCall($iDLL,"string","ImageSearch","int",$x1,"int",$y1,"int",$right,"int",$bottom,"ptr",$findImage,"ptr",$HBMP)
EndIf

i have the console write "Call image search" and then crash

 

Thanks

Link to post
Share on other sites
  • Developers
30 minutes ago, sparky said:

search something doesn't matter what.

Seriously?  With the slim chance this is really the case you are still testing with something so again you haven't given us anything togo on to be able to assist you.
When you really want help you either provide the appropriate and sufficient information or else please done waste our space and time.

ps. the posted script portions are not runable either so post something that runs!

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 post
Share on other sites
57 minutes ago, Jos said:

search something doesn't matter what.

I am just starting using AutoIt so why is so wired cuz i just want to find an image????

You advice me like a badass developper who know all the things but i think you didn't see i just arrived here.

If you don't want to help people why you answer at my post?? To demonstrate me that you are better than me or what?

1 hour ago, Jos said:

When you really want help you either provide the appropriate and sufficient information

I am just starting how do i know what is the appropriate information???

 

1 hour ago, Jos said:

please done waste our space and time

if you respond to the post you are wasting your time the space ins on the forum is here for this

1 hour ago, Jos said:

ps. the posted script portions are not runable either so post something that runs!

why on my machine it runs???

you need this :

 

Link to post
Share on other sites
  • Developers
5 minutes ago, sparky said:

why on my machine it runs???

For starters the second piece of code is missing an EndFunc so has a syntax error.
Install the Full SciTE4AutoIt3 installer to ensure you also check your code with au3check each time.
 

As to the rest: I think I have been pretty clear about it all so am done here until things become much clearer.

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 post
Share on other sites
2 hours ago, sparky said:

and i modified the top of ImageSearch like this: 

That means is not the all script is the top of it.........of course you can't run it.......

Have you already use ImageSearch with autoit?

Check this:

you will understand of what i am talking about.

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...