Jump to content

Count stuff on screen?


Recommended Posts

  • Moderators

dainiusb,

There are a number of good image search UDFs available if you search - or you could even use PixelChecksum. :)

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

I know about ImageSearch and it's doing pretty well but I dont know how to count :) I'm going to check PixelChecksum again.

EDIT: No I don't think PixelChecksum will help here.

Edited by dainiusb
Link to comment
Share on other sites

Well in that case, do you have a sample image of the object(s) that you want to find?

"Just be fred, all we gotta do, just be fred."  -Vocaliod

"That is a Hadouken. A KAMEHAMEHA would have taken him 13 days and 54 episodes to form." - Roden Hoxha

@tabhooked

Clock made of cursors ♣ Desktop Widgets ♣ Water Simulation

Link to comment
Share on other sites

Well you could try finding the upper-left pixel on your screen and check if the adjacent pixels have the correct colour then store the co-ords of the pixels for later use.

Edited by DatMCEyeBall

"Just be fred, all we gotta do, just be fred."  -Vocaliod

"That is a Hadouken. A KAMEHAMEHA would have taken him 13 days and 54 episodes to form." - Roden Hoxha

@tabhooked

Clock made of cursors ♣ Desktop Widgets ♣ Water Simulation

Link to comment
Share on other sites

Well you could try finding the upper-left pixel on your screen and check if the adjacent pixels have the correct colour then store the co-ords of the pixels for later use.

upper-left pixel of that image? But whats the use of this? I don't think I'll be able to find more than 4 images. And it's pretty hard if images are randomly placed on screen.

Edited by dainiusb
Link to comment
Share on other sites

  • Moderators

dainiusb, you're not getting a lot of help because you're being very vague about what you want to do. "Count stuff" or "But it can be anything in the end" - probably couldn't offer less of an explanation if you tried. How about a clear, concise explanation of what you're trying to do, with a step by step example. If you're having trouble, throw in a screenshot. Help us help you ;)

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Seeing how you are new and this request of yours can easily be used for a game, would you be so kind in showing a screenshot of what you are trying to count?

Please understand if this is for a game then the moderator will close this thread. We do not allow discussion of game automation here in the forum.

forum rules

Link to comment
Share on other sites

What you mean?

I'm guessing he's referring to these threads.

'?do=embed' frameborder='0' data-embedContent>>

'?do=embed' frameborder='0' data-embedContent>>

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Firstly, by anything I meant any image. Secondly I don't know yet what my project is going to be because I'm just learning for the future at the moment but here's an example: screenie.pngSo the goal is to count all those image icons and get their coords.

Link to comment
Share on other sites

Oh I see. But these are pretty old and I've solved them myself already and completed that project the next day without problems. I'm no longer interested in game automation after I saw how crappy it was haha ;)

Edited by dainiusb
Link to comment
Share on other sites

  • Moderators

Firstly, by anything I meant any image. Secondly I don't know yet what my project is going to be because I'm just learning for the future at the moment but here's an example: So the goal is to count all those image icons and get their coords.

 A couple of questions, not because I am questioning your motives but because I truly don't understand what you're trying to accomplish.

"I don't know yet what my project is going to be because I'm just learning for the future" - If you don't know what you want to do, how is anyone supposed to help you?

"So the goal is to count all those image icons and get their coords" - These images are really just files. If you want to count them, use Melba's RecFileListToArray. You can create an array of the files, filter it as you want, then manipulate the files in any manner you wish. I can't fathom why you would want to open an Explorer file and "find the coords" of files. I'm not even sure why you would expect them not to be lined up in order, instead of splayed out all over the screen.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

 A couple of questions, not because I am questioning your motives but because I truly don't understand what you're trying to accomplish.

"I don't know yet what my project is going to be because I'm just learning for the future" - If you don't know what you want to do, how is anyone supposed to help you?

"So the goal is to count all those image icons and get their coords" - These images are really just files. If you want to count them, use Melba's RecFileListToArray. You can create an array of the files, filter it as you want, then manipulate the files in any manner you wish. I can't fathom why you would want to open an Explorer file and "find the coords" of files. I'm not even sure why you would expect them not to be lined up in order, instead of splayed out all over the screen.

I've told already that I want to learn more(this is what I want to do), not just basic stuff and I'm asking this not to automate specific program but simply to learn more because I couldn't find anything like that on the forum and even google. If I wanted to find those files the way you told me(what if was controlling some computer remotely?), I could simply use any other programming language. And this is just an example...I don't expect them to be so but that's one of the examples that I could think of ;)

Edited by dainiusb
Link to comment
Share on other sites

  • Moderators

If that is the case (and still pretending I don't believe this is still for a game), how about you expand on post #3. You state you know ImageSearch, and it is working, but you don't know how to count. Why don't you show some of your effort by posting what you've done so far.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

If that is the case (and still pretending I don't believe this is still for a game), how about you expand on post #3. You state you know ImageSearch, and it is working, but you don't know how to count. Why don't you show some of your effort by posting what you've done so far.

The thing is that I can't think of a way to do this. Well I have one idea. Like split screen or area in chunks and scan them one after another but that's quite dumb because like if just a half of that icon appears in chunk then it won't get detected...And if it was some advanced detection then same image could be detected up to 4 times...

Another crazy thought: let ImageSearch detect one of the images, then cover it somehow( :D ) and search for another bwahahaha ;D

Edited by dainiusb
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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