Jump to content

Image detection problem after editor update - (Moved)


Recommended Posts

#include <AutoItConstants.au3>
;#include <ButtonConstants.au3>
;#include <ComboConstants.au3>
;#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>
#include "ImageSearch.au3"

AutoItSetOption('MouseCoordMode', 0)

HotKeySet("p", "Image")
HotKeySet("`", "_Terminate")

Global $SleepFast = 500, $SleepNormal = 1000, $Sleepsec =1000, $Sec = 1000, $Min = 60000, $Hour = 360000
Local $Startech, $StartechX, $StartechY, $NetFlix, $NetFlixX, $NetFlixY

While 1

WEnd

Func Image()
   sleep(100)
   Do
      Local $Startech = _ImageSearch('Startech\Startech.png', 1, $StartechX, $StartechY, 100)

      If $Startech = 1 Then
         MouseMove($StartechX, $StartechY, 2)
         MouseClick("left", $StartechX, $StartechY, 1)
         sleep($SleepNormal)

      ElseIf $Startech = 0 Then
         MsgBox($MB_SYSTEMMODAL, "Title", "StarTech Not Found Going for NetFlix Scrolling to Get it", 10)
         MouseWheel($MOUSE_WHEEL_DOWN, 1)
         Send("{ESC}")
            sleep(500)
            MsgBox($MB_SYSTEMMODAL, "Title", "Exit Not Found ", 10)


      Else
         sleep($SleepNormal)
         MsgBox($MB_SYSTEMMODAL, "Title", "None Found ", 10)


      EndIf

   Until $Startech = 1

EndFunc


Func _Terminate()
   MsgBox($MB_SYSTEMMODAL, "Info :", "Script terminated by User" & @CRLF)
    Exit
 EndFunc   ;==>_Terminate

 #comments-start
 Local $NetFlix = _ImageSearch('NetFlix\NetFlix.png', 1, $NetFlixX, $NetFlixY, 100)
   MouseMove($NetFlixX, $NetFlixY, 2)
   MouseClick("left", $NetFlixX, $NetFlixY, 1)
   sleep($SleepNormal)

#comments-end

in old version this script was wokring but After Scite and autoit version update same script showing error. i am unable to finout the reason, plz help to solve the problem

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\Engr. Ashraful\Dropbox\PC\#Basic\Wait Until Image Found\Image Search with do while(Wait Until image Found).au3" /UserParams    
+>10:53:48 Starting AutoIt3Wrapper (21.316.1639.1) from:SciTE.exe (4.4.6.0)  Keyboard:00004009  OS:WIN_10/2009  CPU:X64 OS:X64  Environment(Language:0409)  CodePage:0  utf8.auto.check:4
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\Engr. Ashraful\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\Engr. Ashraful\AppData\Local\AutoIt v3\SciTE
>Running AU3Check (3.3.16.0)  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\Engr. Ashraful\Dropbox\PC\#Basic\Wait Until Image Found\Image Search with do while(Wait Until image Found).au3
"C:\Users\Engr. Ashraful\Dropbox\PC\#Basic\Wait Until Image Found\ImageSearch.au3"(30,46) : error: missing separator character before keyword.
Func _ImageSearch($findImage,$resultPosition,ByRef
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\Engr. Ashraful\Dropbox\PC\#Basic\Wait Until Image Found\ImageSearch.au3"(34,73) : error: missing separator character before keyword.
Func _ImageSearchArea($findImage,$resultPosition,$x1,$y1,$right,$bottom,ByRef
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\Engr. Ashraful\Dropbox\PC\#Basic\Wait Until Image Found\ImageSearch.au3"(74,63) : error: missing separator character before keyword.
Func _WaitForImageSearch($findImage,$waitSecs,$resultPosition,ByRef
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\Engr. Ashraful\Dropbox\PC\#Basic\Wait Until Image Found\ImageSearch.au3"(109,64) : error: missing separator character before keyword.
Func _WaitForImagesSearch($findImage,$waitSecs,$resultPosition,ByRef
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Engr. Ashraful\Dropbox\PC\#Basic\Wait Until Image Found\Image Search with do while(Wait Until image Found).au3 - 4 error(s), 0 warning(s)
!>10:53:49 AU3Check ended. Press F4 to jump to next error.rc:2
+>10:53:49 AutoIt3Wrapper Finished.
>Exit code: 2    Time: 1.013

 

image.thumb.png.d074a748632fb188cd244fd39263ccd6.png

Link to post
Share on other sites
  • Moderators

Moved to the appropriate forum.

Moderation Team

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 post
Share on other sites
5 hours ago, ashraful089 said:
#include <AutoItConstants.au3>
;#include <ButtonConstants.au3>
;#include <ComboConstants.au3>
;#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>
#include "ImageSearch.au3"

AutoItSetOption('MouseCoordMode', 0)

HotKeySet("p", "Image")
HotKeySet("`", "_Terminate")

Global $SleepFast = 500, $SleepNormal = 1000, $Sleepsec =1000, $Sec = 1000, $Min = 60000, $Hour = 360000
Local $Startech, $StartechX, $StartechY, $NetFlix, $NetFlixX, $NetFlixY

While 1

WEnd

Func Image()
   sleep(100)
   Do
      Local $Startech = _ImageSearch('Startech\Startech.png', 1, $StartechX, $StartechY, 100)

      If $Startech = 1 Then
         MouseMove($StartechX, $StartechY, 2)
         MouseClick("left", $StartechX, $StartechY, 1)
         sleep($SleepNormal)

      ElseIf $Startech = 0 Then
         MsgBox($MB_SYSTEMMODAL, "Title", "StarTech Not Found Going for NetFlix Scrolling to Get it", 10)
         MouseWheel($MOUSE_WHEEL_DOWN, 1)
         Send("{ESC}")
            sleep(500)
            MsgBox($MB_SYSTEMMODAL, "Title", "Exit Not Found ", 10)


      Else
         sleep($SleepNormal)
         MsgBox($MB_SYSTEMMODAL, "Title", "None Found ", 10)


      EndIf

   Until $Startech = 1

EndFunc


Func _Terminate()
   MsgBox($MB_SYSTEMMODAL, "Info :", "Script terminated by User" & @CRLF)
    Exit
 EndFunc   ;==>_Terminate

 #comments-start
 Local $NetFlix = _ImageSearch('NetFlix\NetFlix.png', 1, $NetFlixX, $NetFlixY, 100)
   MouseMove($NetFlixX, $NetFlixY, 2)
   MouseClick("left", $NetFlixX, $NetFlixY, 1)
   sleep($SleepNormal)

#comments-end

in old version this script was wokring but After Scite and autoit version update same script showing error. i am unable to finout the reason, plz help to solve the problem

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\Engr. Ashraful\Dropbox\PC\#Basic\Wait Until Image Found\Image Search with do while(Wait Until image Found).au3" /UserParams    
+>10:53:48 Starting AutoIt3Wrapper (21.316.1639.1) from:SciTE.exe (4.4.6.0)  Keyboard:00004009  OS:WIN_10/2009  CPU:X64 OS:X64  Environment(Language:0409)  CodePage:0  utf8.auto.check:4
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\Engr. Ashraful\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\Engr. Ashraful\AppData\Local\AutoIt v3\SciTE
>Running AU3Check (3.3.16.0)  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\Engr. Ashraful\Dropbox\PC\#Basic\Wait Until Image Found\Image Search with do while(Wait Until image Found).au3
"C:\Users\Engr. Ashraful\Dropbox\PC\#Basic\Wait Until Image Found\ImageSearch.au3"(30,46) : error: missing separator character before keyword.
Func _ImageSearch($findImage,$resultPosition,ByRef
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\Engr. Ashraful\Dropbox\PC\#Basic\Wait Until Image Found\ImageSearch.au3"(34,73) : error: missing separator character before keyword.
Func _ImageSearchArea($findImage,$resultPosition,$x1,$y1,$right,$bottom,ByRef
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\Engr. Ashraful\Dropbox\PC\#Basic\Wait Until Image Found\ImageSearch.au3"(74,63) : error: missing separator character before keyword.
Func _WaitForImageSearch($findImage,$waitSecs,$resultPosition,ByRef
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\Engr. Ashraful\Dropbox\PC\#Basic\Wait Until Image Found\ImageSearch.au3"(109,64) : error: missing separator character before keyword.
Func _WaitForImagesSearch($findImage,$waitSecs,$resultPosition,ByRef
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Engr. Ashraful\Dropbox\PC\#Basic\Wait Until Image Found\Image Search with do while(Wait Until image Found).au3 - 4 error(s), 0 warning(s)
!>10:53:49 AU3Check ended. Press F4 to jump to next error.rc:2
+>10:53:49 AutoIt3Wrapper Finished.
>Exit code: 2    Time: 1.013

 

image.thumb.png.d074a748632fb188cd244fd39263ccd6.png

CTRL+H , 

Find what: "," (no space)

Replace with: ", " (one space)

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...