Jump to content

How to use PixelSearch to search the specified pixel dimension..?


 Share

Recommended Posts

I am having difficulties using ImageSearch and knowing that if i compiled my imagesearch script and use it to other pc (which autoit never installed on it) it would required the imagesearch dll files to be manually copied to those pc. So far i do not want to do copying dll files to those pc.

I think..

ImageSearch can/will search for the dimension of the image..

While PixelSearch search for the coordinate (like..1 pixel point)..

Question:

How to code PixelSearch to search for the specified "pixel in dimension" instead of coordinate-only (1-pixel-point) then MouseMove on specified coordinate inside the specified "pixel in dimension"?

It kind a pixel search authenticate by dimension not by coordinate?!

Does it even possible?

:P " Loved It ! " :wub:

Link to comment
Share on other sites

  • Moderators

Without seeing your code it is difficult to say how well it will translate to another machine. PixelSearch is, by its nature, somewhat volatile. Can you please give us a better idea of what you're trying to accomplish? 99% of the time there is a much easier way to manipulate a window or application (Control commands, etc.) which is more likely to work across different PCs.

"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

Hey JLogan3o13

I am hoping this could be done only for PixelSearch to prevent additional files (like dll and bmp/png).

Maybe a simple things but i am not a logical person (also not a programmer) specially most on complex things.

I wanted this code to search not by coordinate but by dimension. It is from sample out here just edited to prevent confusion to me.

$Targett = PixelSearch(0,0,1359,767,0X7E0000)   ;----- 0X7E0000 = THE TARGET (IPMSG ICON)
If Not @error Then
    MouseMove($Targett[0],$Targett[1],1)    ;----- ,1 = MOUSE SPEED 1=FASTEST 0=INSTANT 10=DEFAULT 100=SLOWEST
EndIf

I think the above code will only search the 0X7E0000 (a-pixel-point-only like 1pixel) from the icon of ipmsg.

According to my ipmsg icon cropping it has a dimension of 16x16 pixel. But PixelSearch only search 1pixel point inside that 16X16 pixel dimension where i point the Au3Info.exe tool.

I wanted the above script to translate it so that it would actually search the "whole 16x16 pixel".

:P " Loved It ! " :wub:

Link to comment
Share on other sites

maybe

Opt("PixelCoordMode", 0) ; relative coords to the defined window

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

MikahS

Still have no idea even pixelcoordmode recommendation.

Find this and i'm just staring at it..

AutoItSetOption("PixelCoordMode", 1)    ;----- 1 = WHOLE SCREEN AREA (NOT WINDOWS)
Sleep(5000)
$var = MouseGetPos()
MsgBox(0, " ", $var[0] & " " & $var[1])

JohnOne

I knew the pixelsearch will search the entire screen pixel by pixel. What i mean is the coordinate point.

:P " Loved It ! " :wub:

Link to comment
Share on other sites

Don't you just want to search the 16x16 area?

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

  • Moderators

gracea,

Please explain exactly what you are trying to do and in what app - if possible with a screenshot showing this coloured pixel for which you are searching. At the moment we are all very confused as to whether you are looking for a pixel, an image, or something else entirely. :wacko:

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

Don't you just want to search the 16x16 area?

 

I'm sorry if im not making sense if this is possible.

No. The 16x16 area is the target (it is the icon). The search area is the whole screen 1360x768.

In PixelSearch currently the target area is 1 pixel only.

What i want to achieve is the target area is 16x16 pixel.

The PixelSearch will look on the whole screen for 16x16 pixel.

:P " Loved It ! " :wub:

Link to comment
Share on other sites

  • Moderators

gracea,

As its name suggests, PixelSearch looks for a single pixel not a 16x16 section - so I think you not going to be able to do what you seem to be asking. :(>

But I return to the other part of my question: what are you trying to do when you find this "icon"? What is the end point of all this? As was pointed out right at the beginning of this thread, there might well be other ways to automate the app you are using. So please give more details as to the purpose of all this. :)

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

essentially you only want it to search for the whole icon, that is not a single pixel :(

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

IPMsg is only my example. IPMsg is IP Messenger.

For ImageSearch usage.

Reason for not using it (for now) is because it requires additional file (ImageSearchDll.dll) when i used my script to more than 20 pc. It is definitely easy to copy that file to 20 pc. But i do not want to do that - i just want to run the my script.

 

For PixelSearch usage..

Reason for using PixelSearch is because it does not required additional file to copy to other pc.

Reason for asking the 16x16 pixel target is that i am assuming that my target pixel "0X7E0000" from the example below would have identical/same pixel that PixelSearch would find (one is IPMsg icon and other is not).

$Targett = PixelSearch(0,0,1359,767,0X7E0000)   ;----- 0X7E0000 = THE TARGET (IPMSG ICON) 
If Not @error Then
     MouseMove($Targett[0],$Targett[1],1)    ;----- ,1 = MOUSE SPEED 1=FASTEST 0=INSTANT 10=DEFAULT 100=SLOWEST 
EndIf

@Melba23

IPMsg is only my example.

Same thing if those 16x16 pixel dimension was found then MouseMove then MouseClick. I know there is other solution like if ProcessExists and WinExists. I just thought that target pixel (not searched) is not restricted by 1 pixel only. I am also authenticating IPMsg system tray icon - it has 3 system icon image type.

 

As for what Melba23 recent statement. I think she also understood what i wanted. She think it is not possible.

And maybe i should stick to my current example.

 

"Thank You" again for all your time.

:P " Loved It ! " :wub:

Link to comment
Share on other sites

  • Moderators

gracea,

 

I think she also understood what i wanted. She think it is not possible

Just for info - I have a perfectly good Y chromosome. ;)

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

PixelChecksum?

There are all kinds of different ways to search an image, but ultimately, direct automation is way way faster and more reliable than farting around with images.

I do know the are some reasons you might need search but the ones that are not game bots are few and far between.

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