Jump to content

How to search a defineable area of the screen for a already known pixelchecksum?


Recommended Posts

Hello folks.

inside a 1024x768 pixels area on the screen I'd like to search for an object that has a pixelchecksum of 430845501. After this checksum is found, the mouse pointer needs to be moved to that exact potition.

Imagine a map with zoom capabilities. I can zoom in at the general direction of the object I'm looking for, but not at it's exact location, not even by having AutoIt move the mouse to the exact position on the zoomed-out map. The particular object I'm looking for always appears in different positions on the zoomed-in area of the map.

Can you help me out on this one please?

Link to comment
Share on other sites

  • Moderators

Hello folks.

inside a 1024x768 pixels area on the screen I'd like to search for an object that has a pixelchecksum of 430845501. After this checksum is found, the mouse pointer needs to be moved to that exact potition.

Imagine a map with zoom capabilities. I can zoom in at the general direction of the object I'm looking for, but not at it's exact location, not even by having AutoIt move the mouse to the exact position on the zoomed-out map. The particular object I'm looking for always appears in different positions on the zoomed-in area of the map.

Can you help me out on this one please?

Do you have the width and height of the object? (assuming you do because you have the checksum) but you would need that to accurately show you a function... I know I've done this in the past as well as Larry has written a few to do it, on the forum. Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

It's quite small: 6x6 pixels.

I did look through the boards prior to opening this new thread about the matter and I did find the threads, however understanding why it does what it does is out of my reach for the moment. Since I am a guy who mostly learns from examples, I guessed maybe I can get a grasp on it by looking at an example that would be more closely matched to the requirements of my problem.

Edited by Sven
Link to comment
Share on other sites

  • Moderators

It's quite small: 6x6 pixels.

I did look through the boards prior to opening this new thread about the matter and I did find the threads, however understanding why it does what it does is out of my reach for the moment. Since I am a guy who mostly learns from examples, I guessed maybe I can get a grasp on it by looking at an example that would be more closely matched to the requirements of my problem.

If you found them, post the threads, and comment what you have questions on. No need to make someone go and write a function that already is out there and do what you want to it to do.

Larry's PixelFind something or other... is a good example, it searches for a unique pixel... then starts to do it's sum, this way it cuts out having to pixelchecks sum a 6x6 area 1 pixel at a time.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

OK, here we go:

Global Const $SM_VIRTUALWIDTH = 78
Global Const $SM_VIRTUALHEIGHT = 79oÝ÷ Ù8^±ëp¡×w­è^mjwpÛa¡ûayªÞk^­ëaz±zW!yÉ,ºgîËb¢x¬$x¢¶¦j×!x/j[jëh×6Global $pixel =   Int(IniRead(".\PixelSearch.ini","Main","PixelColor","-1"))
Global $chksum = Int(IniRead(".\PixelSearch.ini","Main","PixelCheckSum","-1"))oÝ÷ Øø±zP¨Ý¡ë'ßÛfjG¬z{¶!ò·w(ZuªbÅéh~éâªç¢Z+#
.Ù÷öÙÞyÚZ®Ú¶¬r·Ç­È^uú+jf­r§±zW!yÉ,ºkÚç¢Ø^~*ì¶Zq殶­sdbb33c·VÂÒÓ÷"b33c¶6·7VÒÒÓFVà ×6t&÷CbÂgV÷C´W'&÷"gV÷C²ÂgV÷C´6÷VÆBæ÷B&VBägV÷C² W@¤VæDoÝ÷ Ø)^j¶®¶­sbb33cµd%ETÄDU4µDõtEDÒDÄÄ6ÆÂgV÷C·W6W#3"æFÆÂgV÷C²ÂgV÷C¶çBgV÷C²ÂgV÷C´vWE77FVÔÖWG&72gV÷C²ÂgV÷C¶çBgV÷C²Âb33cµ4Õõd%ETÅtED¢b33cµd%ETÄDU4µDõtEDÒb33cµd%ETÄDU4µDõtED³Ð¢b33cµd%ETÄDU4µDõTtBÒDÄÄ6ÆÂgV÷C·W6W#3"æFÆÂgV÷C²ÂgV÷C¶çBgV÷C²ÂgV÷C´vWE77FVÔÖWG&72gV÷C²ÂgV÷C¶çBgV÷C²Âb33cµ4Õõd%ETÄTtB¢b33cµd%ETÄDU4µDõTtBÒb33cµd%ETÄDU4µDõTtE³ÐoÝ÷ ØÌ ¹ë,ËaȬºÇ{ayû§rبÚyø§zØ^­ë(ëb¢|!z·«)à¦,^È^rK.+%¢uú+jëh×6HotKeySet("`","find")

While 1
    ToolTip("Press ` (Tilda key) to" & @LF & "find the area in PixelSearch.ini.")
    Sleep(100)
WEndoÝ÷ Ø)^j¶®¶­sdgVæ2fæB b33c·Ò b33c·Ò b33c·VÂÒb33cµd%ETÄDU4µDõTtBÒ vÆR b33c·ÒVÅ6V&6b33c·Âb33c·Âb33cµd%ETÄDU4µDõtEDÒÂb33c·VÂÂb33c·V bW'&÷"æBb33c·VÂÒb33cµd%ETÄDU4µDõTtBÒFVà ×6t&÷CbÂgV÷C´W'&÷"gV÷C²ÂgV÷C´6÷VÆBæ÷BfæB&VâgV÷C² W@ VÇ6TbW'&÷"FVà b33c·Òb33c·V² b33c·VÂÒb33cµd%ETÄDU4µDõTtBÒ b33c·Ò VÇ6Tbb33c¶6·7VÒÒVÄ6V6µ7VÒb33c·³ÒÓRÂb33c·³ÒÓRÂb33c·³Ò³RÂb33c·³Ò³RFVà Ö÷W6TÖ÷fRb33c·³ÒÂb33c·³Ò FööÅFgV÷CµFW&RB2âgV÷C² 6ÆVW3 W@ VÇ6P b33c·Òb33c·³Ð b33c·VÂÒb33c· b33c·Òb33c·³Ò² VæD` tVæ@¤VæDgVæ0
I guess this will become clear once I know the answers to my questions above.

Thank you for your time trying to explain to a noob the higher knowledge (at least to me :D ) of AutoIt.

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