Reizvoller

ImageSearch Script Closing w/ Error

14 posts in this topic

#1 ·  Posted (edited)

Hello,

I am back once again to ask for assistance. I am just trying to fool around with the "ImageSearch" function in order to detect when certain elements appear on my active window to then respond to. To begin testing this I simply cut out a small segment of my background, saved it as a BMP, and used that as the bmp for the search function. I had hoped for it to just run through quickly and say it found it and spit out the X Y coords of where it was found. Instead I am getting this : http://screencast.com/t/MD9aOzPhETE

Here's my script thus far :

#Include <msgBoxConstants.au3>
#Include <ImageSearch.au3>

global $x = 0
global $y = 0
CheckForImage ()
Func checkForImage ()
   Local $Search = _ImageSearchArea ('ninjaCheck.bmp', 1, 0, 0, 1366, 768, $x, $y, 100)
   If $Search = 1 Then
      MsgBox ($IDOK,"Found",$resultPosition)
   EndIf
EndFunc
While 1
   Sleep (10)
WEnd

What I would like assistance with is how do I "Debug" this in order to see where/why it is failing.

I've reviewed https://www.autoitscript.com/wiki/FAQ#How_can_I_debug_my_script.3F but I am not entirely sure how to apply the information. If I could get a return on "Hey, this Func or This Line is where I died" , that would be awesome.

Any suggestions on how I can tackle this issue?

Thank you for your time!

-Reiz

 

checkNinja.bmp is " " around it now and it has the same result 

Edited by Reizvoller
I changed and tested my scripting

Share this post


Link to post
Share on other sites



Maybe the Ninja is against checking and killed your script?

Share this post


Link to post
Share on other sites

Reizvoller,

Given the name of the image for which you are checking, you might like to read the Forum rules before you post again.

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
16 hours ago, Melba23 said:

Reizvoller,

Given the name of the image for which you are checking, you might like to read the Forum rules before you post again.

M23

Howdy!

"Given the name of the image for which you are checking" , I am guessing that is referencing "ninjaCheck.bmp".

I've reviewed the forum rules, as you suggested, but... I don't see what you are trying to say to me. This isn't an attempt at being facetious or evading but honestly asking for guidance with what you are saying to me. Thank you!

Share this post


Link to post
Share on other sites
8 minutes ago, Reizvoller said:

what you are saying to me

Thought that would be pretty obvious...right.. as your guess is correct?
In case it isn't clear then read the part about Game automation.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

4 minutes ago, Jos said:

Thought that would be pretty obvious...right.. as your guess is correct?
In case it isn't clear then read the part about Game automation.

Jos

Okay, I have done so. How does this apply to me? 
When did I reference a game in my posts? 

"To begin testing this I simply cut out a small segment of my background, saved it as a BMP, and used that as the bmp for the search function." 

So...Am I being told to review rules rather than getting actual replies regarding my question due to an assumption that I am trying to automate game processes?

I've attached a copy of my desktop background and the segment I cut out to hopefully further emphasise the fact that I am not breaking any rules... 

d092ecd9fae122c90aedd6734647ef23.jpg

ninjaCheck.bmp

Edited by Reizvoller
More evidence

Share this post


Link to post
Share on other sites
3 minutes ago, Reizvoller said:

Okay, I have done so. How does this apply to me? 

You have just been pointed to the rules since you used a term used in games.
In case we were convinced it was against our rules, you wouldn't have been able to post in it anymore, as we would have closed it already.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
1 minute ago, Jos said:

You have just been pointed to the rules since you used a term used in games.
In case we were convinced it was against our rules, you wouldn't have been able to post in it anymore, as we would have closed it already.

Jos

Hello,

So assumptions were made rather than asking questions for clarification. I understand.

I'd like to bring this thread back on topic since we now validated it as an actual question that doesn't break the rules.

#Include <msgBoxConstants.au3>
#Include <ImageSearch.au3>

global $x = 0
global $y = 0
CheckForImage ()
Func checkForImage ()
   Local $Search = _ImageSearch ("ninjaCheck.bmp", 1, $x, $y, 50)
   If $Search = 1 Then
      MsgBox ($IDOK,"Found",$resultPosition)
   EndIf
EndFunc
While 1
   Sleep (10)
WEnd

I've re-modified my script to try the _ImageSearch function rather than _ImageSearchArea . This tosses the same error pop-up that I linked to in my original post. 

Share this post


Link to post
Share on other sites
Just now, Reizvoller said:

So assumptions were made rather than asking questions for clarification. I understand.

What about you step of your high horse before continuing?
This is our standard approach and when you don't like then that is your problem... sorry. ;) 

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
1 minute ago, Jos said:

What about you step of your high horse before continuing?
This is our standard approach and when you don't like then that is your problem... sorry. ;) 

Jos

To iterate again... I'd like to bring this thread back on topic since we now validated it as an actual question that doesn't break the rules.

#Include <msgBoxConstants.au3>
#Include <ImageSearch.au3>

global $x = 0
global $y = 0
CheckForImage ()
Func checkForImage ()
   Local $Search = _ImageSearch ("ninjaCheck.bmp", 1, $x, $y, 50)
   If $Search = 1 Then
      MsgBox ($IDOK,"Found",$resultPosition)
   EndIf
EndFunc
While 1
   Sleep (10)
WEnd

I've re-modified my script to try the _ImageSearch function rather than _ImageSearchArea . This tosses the same error pop-up that I linked to in my original post. 

Jos : You are a skilled developer , do you have any insight you can provide regarding this?

Share this post


Link to post
Share on other sites
1 minute ago, Reizvoller said:

To iterate again.

 

1 minute ago, Reizvoller said:

Jos : You are a skilled developer , do you have any insight you can provide regarding this?

Seriously...   after first trying to tell me to shut up?  
simple answer: No

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
8 minutes ago, Jos said:

 

Seriously...   after first trying to tell me to shut up?  
simple answer: No

Jos

Howdy,

I am sorry you somehow feel that my posts were saying "Shut up" to you. Could you cite the exact line that suggests that notion? I'd rather not make that impression again in the future.

Regarding your reply I accept it and thank you for taking the time to respond.

Now, to iterate once again to get this thread back on topic...

After manipulating my script multiple times and running it in two different environments with clean installs of AutoIt I have come to the conclusion that the library of ImageSearch.au3 is erroneous and I've reached out to the developer of said script. If I get any useful information in return I will post it here so everyone may have said information.

-Reiz 

Share this post


Link to post
Share on other sites

 

Just now, Reizvoller said:

Now, to iterate once again to get this thread back on topic...

... ahh that is why you reported me. It never dawned on you that I wouldn't appreciate you keep on going on and on about it.

Let me help you to stop this BS

*click*


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Reizvoller,

I would strongly suggest a serious change of attitude if you want to stick around here.

You posted a question using a filename which in our experience indicated that the question was against the forum rules. Rather then simply assuming that the question was game-related and closing the thread, I gently pointed you to the Forum rules so as to prevent any future unpleasantness. I fail to see why you have suddenly become all excited and started acting as if we had come over all heavy-handed. What you saw was our normal response when we have doubts about a question - all you needed to do was to assure us that your question was legal and we could have avoided a great deal of annoyance all round. As it is you have managed to alienate 2 of the Mods here in fairly short order - pretty good going after only 9 posts.

So I suggest you wind your neck very firmly back in and try in future not to take unwarranted offence when absolutely none has been offered.

M23

 

 

2 people like this

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
Guest
This topic is now closed to further replies.

  • Similar Content

    • argumentum
      By argumentum
      UDF to intercept the error window of AutoIt, showing more details about the error, including ability to save and send by email!
    • nacerbaaziz
      By nacerbaaziz
      Hello
      How are you
      I have a question, please.
      I've created a window and i need
      when i run the script if it detect an other copy from the same script was runing
       the script close the first copy Automatically and run a new copy
      I want an example to understand it
    • Nareshm
      By Nareshm
      Please Somebody Help me i am trying to create new script but, i don't know how to create it.

      I am Creating script like this :
      ; My script here [First Script]
      Check the internet connection, if internet connected then
      ; My Script here [Second Script]
      If internet not connected, wait for connect, after connected run my second script
      If Control id/windows/title matched do nothing and end/exit autoit script
      If Control id/windows/title not matched repeat my first and second script again until control id/windows/tittle not matched

      match with :
      >>>> Window <<<<
      Title:    PS :: Version - 2.8.0.0  - [PS Bill]
      Class:    WindowsForm734a
      Position:    -8, -8
      Size:    1382, 744
      Style:    0x17CD0000
      ExStyle:    0x00050100
      Handle:    0x0000000000130572
      >>>> Control <<<<
      Class:    WindowsForm734a
      Instance:    15
      ClassnameNN:    WindowsForm34a15
      Name:    BillPrint
      Advanced (Class):    [NAME:BillPrint]
      ID:    7875
      Text:    
      Position:    39, 310
      Size:    1221, 306
      ControlClick Coords:    745, 20
      Style:    0x56010000
      ExStyle:    0x00000000
      Handle:    0x00000000000C0468
       
    • SkysLastChance
      By SkysLastChance
      I get this error, Whenever I try to find a date. Does anyone have any idea why? I saw some post from 2015, However I would imagine this is fixed by now. @water
      >"J:\Temporary Files\XXXXXXXXX\AutoIt\AutoIt\AutoIt\SciTe\..\autoit3.exe" /ErrorStdOut "C:\Users\XXXXXX\Desktop\Call Report Automation.au3"     "J:\Temporary Files\XXXXXXXX\AutoIt\AutoIt\AutoIt\Include\Excel.au3" (656) : ==> The requested action with this object has failed.: $aResult[$iIndex][1] = $oMatch.Name.Name $aResult[$iIndex][1] = $oMatch^ ERROR >Exit code: 1    Time: 5.791 #include <Excel.au3> Global $sExcelFile1 = FileOpenDialog("Choose/Create Excel File", @ScriptDir, "(*.xlsm)") Global $sExcelFile2 = FileOpenDialog("Choose/Create Excel File", @ScriptDir, "Excel Sheet (*.xlsx;*.xls)|All (*.*)") If FileExists($sExcelFile2) Then Global $oExcel2 = _Excel_Open () $oExcel2 = _Excel_BookOpen($oExcel2,$sExcelFile2) EndIF If FileExists($sExcelFile1) Then Global $oExcel1 = _Excel_Open () $oExcel1 = _Excel_BookOpen($oExcel1,$sExcelFile1,Default,Default,"2007") EndIF $oRead = _Excel_RangeRead ($oExcel2,Default,"A2",3) _Excel_RangeWrite ($oExcel1,"Calls Handled",$oRead,"BY7") Sleep (1000) _Excel_RangeFind ($oExcel1,$oRead,"E4:FD92") MsgBox (0,"Test",$oRead) UPDATE:
      If I take out this line it works. By works I mean I don't get the error. :/  However, I need it. I am just confused.
      _Excel_RangeWrite ($oExcel1,"Calls Handled",$oRead,"BY7")  
      UPDATE 2: I also get this error when trying to use the helpfile examples. I have version 3.3.14.2
      \AutoIt\AutoIt\AutoIt\Include\Excel.au3" (670) : ==> The requested action with this object has failed.: $oSheet = $oWorkbook.Sheets($iIndexSheets) $oSheet = $oWorkbook^ ERROR >Exit code: 1 Time: 0.8931  
    • kawliga751
      By kawliga751
      I am attempting to run an Autoit.exe with schtasks every weekday @ 9:05 am.
      I have the below
      C:\>SchTasks /Create /TN "P10Run" /TR "O:\AUTOIT\P40 Run.au3" /SC WEEKLY /D MON, TUE,WED,THU,FRI /ST 09:05:00 SUCCESS: The scheduled task "P10Run" has successfully been created. I also did a "test" run :
      C:\>Schtasks /Run /TN "P10Run SUCCESS: Attempted to run the scheduled task "P10Run". But when I run my query to verify success my "Last Result" seems to indicate that the script did not run:
      C:\>SCHTASKS /QUERY /FO LIST /V /TN "P10RUN" Folder: \ HostName: xxxxxxxxxxxxxxxx TaskName: \P10RUN Next Run Time: N/A Status: Could not start Logon Mode: Interactive only Last Run Time: 6/14/2017 9:08:56 AM Last Result: -2147024894 Author: xxxxxxx Task To Run: O:\AUTOIT\P40 Run.au3 Start In: N/A Comment: N/A Scheduled Task State: Enabled Idle Time: Disabled Power Management: Stop On Battery Mode, No Start On Batterie s Run As User: xxxxxxxxx\xxxxxxxx Delete Task If Not Rescheduled: Enabled Stop Task If Runs X Hours and X Mins: 72:00:00 Schedule: Scheduling data is not available in this f ormat. Schedule Type: Weekly Start Time: 9:05:00 AM Start Date: 6/14/2017 End Date: N/A Days: MON, TUE, WED, THU, FRI Months: Every 1 week(s) Repeat: Every: Disabled Repeat: Until: Time: Disabled Repeat: Until: Duration: Disabled Repeat: Stop If Still Running: Disabled C:\> Is there something missing in my command? Also is there a better way to make sure that the script does in fact sun successfully?
      Thanks In Advance!