Jump to content

Issues with Image Search - (Moved)


Recommended Posts

Hello, I am new to autoit and i was still learning but i am stuck on Image Recognition.

i have tried to google and search the forums but no solution (maybe i saw the solution but did not understand).

i made a very simple image recognition script that is just checking if image is found or not if yes it just moves the mouse to that location.

this is the code:

#include <ImageSearch.au3>

$x1 = 0
$y1 = 0
$filename = @ScriptDir & '\Capture.PNG'

ConsoleWrite(@CRLF & $filename & @CRLF)

While 1
    Sleep(5000)
    $result = _ImageSearch('Capture.PNG', 1, $x1, $y1, 0)
    If $result = 1 Then
        MouseMove($x1, $y1)
    EndIf
WEnd

and this is the console after i try to run the program:

>"D:\AutoIt3\SciTE\..\AutoIt3.exe" "D:\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "D:\projects\Autoit\ImageSearch Test\ImgSearch.au3" /UserParams    
+>15:40:40 Starting AutoIt3Wrapper v.17.224.935.0 SciTE v.3.7.3.0   Keyboard:00004009  OS:WIN_10/  CPU:X64 OS:X64  Environment(Language:0809)  CodePage:0  utf8.auto.check:4
+>         SciTEDir => D:\AutoIt3\SciTE   UserDir => C:\Users\aksha\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\aksha\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.14.3)  from:D:\AutoIt3  input:D:\projects\Autoit\ImageSearch Test\ImgSearch.au3
+>15:40:41 AU3Check ended.rc:0a
>Running:(3.3.14.3):D:\AutoIt3\autoit3.exe "D:\projects\Autoit\ImageSearch Test\ImgSearch.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop

D:\projects\Autoit\ImageSearch Test\Capture.PNG
"D:\projects\Autoit\ImageSearch Test\ImageSearch.au3" (44) : ==> Subscript used on non-accessible variable.:
If $result[0] = "0" Then Return 0
If $result^ ERROR
->15:40:42 AutoIt3.exe ended.rc:1
+>15:40:42 AutoIt3Wrapper Finished.
>Exit code: 1    Time: 1.884

I have no idea what is going wrong here please help.

Link to comment
Share on other sites

19 minutes ago, akshatgupta said:

D:\projects\Autoit\ImageSearch Test\Capture.PNG "D:\projects\Autoit\ImageSearch Test\ImageSearch.au3" (44) : ==> Subscript used on non-accessible variable.: If $result[0] = "0" Then Return 0 If $result^ ERROR

says a not expected error happened, so i suggest to contact autor of this unnecessary tool.

Only needed if you wan't to win a memory chalenge.

Link to comment
Share on other sites

4 minutes ago, AutoBert said:

says a not expected error happened, so i suggest to contact autor of this unnecessary tool.

Only needed if you wan't to win a memory chalenge.

other than this what will be the suggested image recognition tool to be used

Link to comment
Share on other sites

2 minutes ago, akshatgupta said:

other than this what will be the suggested image recognition tool to be used

I don't suggest a other image recognition tool, i suggest a stable method to automate a app. But none is as each other, so i/we must know, which app  you wan't to automate.

Link to comment
Share on other sites

Just now, AutoBert said:

I don't suggest a other image recognition tool, i suggest a stable method to automate a app. But none is as each other, so i/we must know, which app  you wan't to automate.

i am still learning so i am not working on any app as of now but in future if i need to find an image i will be needing it

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

  • Recently Browsing   0 members

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