Jump to content

Help! PixelSearch start from Middle screen?


Recommended Posts

I'm really new to autoit and writing scripts in general
What I'm trying to do
Create a simple script that would click the closet pixel from the middle outwards;

Instead of pixel search top left to bottom right
I need to find a way to
click a pixel closest to the middle of the search box area, starting from the middle of the box and searching pixels outwards imagine an outwards spiral circle search pattern if you will.

;here is my script
$color = (colorhere)
while(1)
   $pix = PixelSearch(11, 36, 1399, 954, $Color,5)
   if not (@error) then  
      MouseClick("left", $pix[0], $pix[1],1,1)
      sleep(Random(1000,2000))
EndIf
WEnd

If you can help thanks in advanced I've hit a wall and am stuck.

Below I've drawn a simple diagram and would like the pixelsearch to click the boxes prioritizing numbers 1-10 in that order where 1 would always come first because it's closer to the center.

image.thumb.png.88ccf90da079508cdefed1d6c1e359cf.png

Link to comment
Share on other sites

make the start coordinate half of the total width.

You can make a somewhat complex function that searches in a spiral, but you have to figure out the maths to make it search like that

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

Thanks for the quick reply @careca
This is how I  interoperate what you said half the search area,
while this would be a good idea and a step in the right direction the other points outside of the half'd search area would be missing and pixel search would still prioritize top left over closer points towards the middle,
I'm trying to comprehend a way to make this possible.
Even leaning towards paying some body for help if this is allowed on this forum.

 

image.png.c1604b27f63d499d0f7a40470f809777.png

 

image.png

Link to comment
Share on other sites

The approach I would use would be to take a screenshot of the screen and move the pixels to a 2D array.  After that you could use the proper algorithm to search into specific area of the screen.  Out of curiosity, what is the application you are trying to automate ?

Link to comment
Share on other sites

  • 4 months later...

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