Jump to content

MouseClick w/ Multiple Coordinates


Tuvok
 Share

Recommended Posts

Greetings all,

I have run into a bit of a stump here.  Basically, what I am trying to do is have my script search for anything via PixelSearch of a specific color and move it to a specific coordinates.  

So what I want to accomplish here is this

I want AutoIT to search a specific coordinates for a color:

$pix1 = PixelSearch(9,28,1021,780,0x04B466,2)

If (@error) Then

I want it to start searching everything for

$pix2 = PixelSearch(9,28,1027,780,0xFFFFFF,0)

And move that color to a specified set of coordinates.  

Now I want it to start searching for a different color and if it finds it to mouseclick left and move to that specified coordinates and mouse click again.

 

My issue is I dont know how to make "mouseclick" search the entire area for a specific color (regardless of its coordinates).  I just need it to be able to select that pixel and move it to the specified coordinates.  Once it moves to that location it will turn into $pix1.  But as soon as it disappears, I want the script to research anywhere on screen to find $pix2 and mouseclick it to the specified coordinates again, and allow it to repeat it self until there are no more $pix2 colors left, in which case it would End

Link to comment
Share on other sites

  • Moderators

Tuvok,

Please give us a screenshot of these interestingly coloured pixels so that we can better grasp what it is you are attempting.

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

    ; Is pix1 active?
    $pix1 = PixelSearch(9,28,1021,780,0x8B0E45,0)
    If (@error) Then
        MouseClick("left", 918, 742, 1, 10)
        Sleep(5000)
    EndIf
    ; Is pix2 active?
    $pix2 = PixelSearch(9,28,1021,780,0x04B466,2)
        If (@error) Then
    $pix3 = PixelSearch(574,567,591,583,0x960B07,0)
        MouseClick (Here is where I run into issues, because pix3 can be located ANYWHERE within the coordinates.  I need this to be able to click on that pixel and left click it and move it to 516,402).  I just have no clue how to get MouseClick to search everywhere for that pixel rather than specific coordinates.  There will be multiple locations with that pixel, Its just when pix2 is no longer active i need it to search for pix3 and once again move it to the specified location.  
        Sleep(5000)
    EndIf

Edited by Tuvok
Link to comment
Share on other sites

  • Moderators

What part of screenshot did you not understand? Please show a screenshot of the pixels you're trying to capture.

"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

I will just use this as an example of what I want....

 

So from this image.... This only applies to pix2 and pix3....

pix2 being the green

pix3 being the gray

Pix2 is active 

Now, what if pix2 disappears or turns another color?  I want the script to look for pix3 the gray one and drag it to the coordinates of the green one.  I want it to search anywhere for the gray one. Left Click, move to location of where the green one was and left click again..  This is the general concept of what I want.

 

 

 

 

P.S. no need to be rude, i simply overlooked what was asked.

Example.png

Link to comment
Share on other sites

  • Moderators

So please explain, since you have already been pointed to the rules once, how this isn't game related.

"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

As I have not mentioned it being for a game, this was a simple example.  Not related to what im using it for.  I could have made a simple red dot yellow dot green dot example the same way.  If you prefer I could do it that way. That way you dont misunderstand my intentions.  

Link to comment
Share on other sites

  • Developers

@Tuvok,

Let's stop the cat and mouse game.
PM me when you have a true legitimate reason for this or else simply go somewhere else with your questions.

Jos 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Jos locked this topic
  • Moderators

You're being pretty evasive about what you're trying to do, even after two Mods have asked you. And now you state the screenshot you provided is not related to what you're using the code for. One more chance, what application are you trying to manipulate.

Edit: Jos beat me to it :)

@Tuvok consider yourself on thin ice, you have now come to the attention of the entire Mod team.

Edited by JLogan3o13

"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

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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