Jump to content

PixelSearch


12am
 Share

Recommended Posts

I am attempting to find a specific object within a client and so far I have been using PixelSearch, but every once in awhile there are more objects within the client with the same type of pixel coloration... so my script sometimes messes up, adding a tolerance just makes it worse.

Anyone have an idea on what would be more accurate for finding the coordinates?

-Control ID's are not available for the objects I am trying to select as it is all within the same window

-Objects are never in the same location

Any suggestions would be greatly appreciated!

Thank you for your time.

Link to comment
Share on other sites

What is the name of your application you are working with? Working with controls is much better than pixel searching.

-Not able to identify any controls from this.

Just curious with Controls out of the question and pixelsearching being "flakey" to say the least - what other suggestions would you have for finding coordinates of a specific object?

Link to comment
Share on other sites

Yeah not trolling, this person has been very careful to mention what he wants to do, while omitting any details about what he wants it to do it for.

Most interfaces that don't use controls, are games, video, etc, where multiple items are shown inside one control.

Also he says he wants to focus on an object which moves around the screen. But won't say what object.

I think you would have to be blind to not see the high possibility that this help request is for nothing other than a game bot, used to find certain objects in game and click them automatically.

Link to comment
Share on other sites

Your initial post was trolling. Then I trolled to make you see you are trolling (it's the best way), then blckpythn trolled to make me see that you weren't trolling. Then you did it again and now I'm doing it.

Do you see how wrong that is? Don't answer please. Use your head, 12am seems to be.

OP is perfectly valid and does not break any rules we have here. If I'm 12am I would be very much offended by your insinuations. Only ileandros's post is on topic, everything else is bullshit.

Edited by trancexx

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Since a dev cleared the post: You'll need to find a different color, or range of colors, and/or narrow down your search area within the client.

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

Your initial post was trolling. Then I trolled to make you see you are trolling (it's the best way), then blckpythn trolled to make me see that you weren't trolling. Then you did it again and now I'm doing it.

Do you see how wrong that is? Don't answer please. Use your head, 12am seems to be.

OP is perfectly valid and does not break any rules we have here. If I'm 12am I would be very much offended by your insinuations. Only ileandros's post is on topic, everything else is bullshit.

Well played. Sir

<links removed>

Edited by Melba23
Links removed
Link to comment
Share on other sites

  • Moderators

nullschritt,

While I agree with trancexx that the thread is entirely legal, your post linking to threads which are in contravention of the current rules is not. If the OP is not clever enough to find these threads themselves they should not be pointed to them. This is not open to discussion so do not try. :naughty:

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 appreciate the information - I will try playing around with pixelchecksum some more then, but it wasn't producing the results as accurate as I wanted.

I was not sure if there were any other options that I was completely oblivious to or not, which is why I made this thread- but this should clear things up then.

Thank you.

If the OP is not clever enough to find these threads themselves they should not be pointed to them.

M23

Your mindset is very narrow and condescending toward others.

I am sure you already know this though.

Link to comment
Share on other sites

  • Moderators

12am,

Please lose the attitude - belittling those who try to enforce the Forum Rules is not a great way begin your stay here. :naughty:

You might like to note that even with the dubious nature of the question you asked, we have allowed the thread to to run as there is no "prima facie" evidence of it breaking those rules - so we cannot be that narrow-minded. ;)

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

12am,

Please lose the attitude - belittling those who try to enforce the Forum Rules is not a great way begin your stay here. :naughty:

You might like to note that even with the dubious nature of the question you asked, we have allowed the thread to to run as there is no "prima facie" evidence of it breaking those rules - so we cannot be that narrow-minded. ;)

M23

touché - I guess I have just been taking offense reading this entire thread.

but I understand your frustration as a community in regards to this as well.

No hard feelings and thank you for the replies I have an idea on how to handle this task now - (potentially)

Edited by 12am
Link to comment
Share on other sites

  • Moderators

12am,

And none on this side either. :)

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

It is not in the help files or included. You could find enough information on how to use it in the thread.

Here is an example

#include <ImageSearch.au3>
Opt('PixelCoordMode', 2)
HotKeySet("s", "Start")
HotKeySet("x", "_Exit")
Global $size = WinGetClientSize("[CLASS:Your Client class here]"), $gX = 0, $gY = 0
$pngLoc = "@ScriptDir"
$x_ratio = $size[0] / 1440 ; This is my screen resolution you can change these in ur screen resolution
$y_ratio = $size[1] / 900
$pngLoc = @ScriptDir

Func Start()
If Search("Image", 0, Round(0 * $x_ratio), Round(0 * $y_ratio), Round(1440 * $x_ratio), Round(900 * $y_ratio), 0.5, 140) Then
MouseClick("left", $gX, $gY)
EndIf
EndFunc

Func Search($img, $type = "", $startX = 0, $startY = 0, $endX = @DesktopWidth, $endY = @DesktopHeight, $seconds = 6, $tolerance = 140)
$startX = 0 * $x_ratio
$startY = 0 * $y_ratio
$endX = 1440 * $x_ratio
$endY = 900 * $y_ratio
$seconds = 1
$c = 0
$string = $pngLoc & $img & ".bmp" ; Here you can manually change it so it reads the type of image you want it to
Do
$c += 1
Sleep(100)
If $c > ($seconds * 1) Then
If $type = "Area" Then
EndIf
Return False
EndIf
Until _ImageSearchArea($string, 1, $startX, $startY, $endX, $endY, $gX, $gY, $tolerance)
Return True
EndFunc

While 1
WEnd
 

Func _Exit()
 Exit
EndFunc; I don't care if its a game im just giving this code for people in future who will need it

Play a little bit arround with it.

Edited by ileandros

I feel nothing.It feels great.

Link to comment
Share on other sites

I will try playing around with pixelchecksum some more then, but it wasn't producing the results as accurate as I wanted.

If a screen area remains the same, then pixelchecksum should identify it. if it does not then

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

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