Jump to content

ImageSearch Script Closing w/ Error


Recommended Posts

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

  • Moderators

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

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 comment
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!

Link to comment
Share on other sites

  • Developers
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

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

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

  • Developers
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

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

Link to comment
Share on other sites

  • Developers
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

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 comment
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?

Link to comment
Share on other sites

  • Developers
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

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

Link to comment
Share on other sites

  • Developers

 

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*

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

  • Jos locked this topic
  • Moderators

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

 

 

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

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...