Tuvok Posted December 16, 2016 Share Posted December 16, 2016 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 More sharing options...
Moderators Melba23 Posted December 16, 2016 Moderators Share Posted December 16, 2016 Tuvok, Please give us a screenshot of these interestingly coloured pixels so that we can better grasp what it is you are attempting. M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Tuvok Posted December 16, 2016 Author Share Posted December 16, 2016 (edited) ; 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 December 16, 2016 by Tuvok Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 16, 2016 Moderators Share Posted December 16, 2016 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 More sharing options...
Tuvok Posted December 16, 2016 Author Share Posted December 16, 2016 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. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 16, 2016 Moderators Share Posted December 16, 2016 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 More sharing options...
Tuvok Posted December 16, 2016 Author Share Posted December 16, 2016 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 More sharing options...
Developers Jos Posted December 16, 2016 Developers Share Posted December 16, 2016 @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 More sharing options...
Moderators JLogan3o13 Posted December 16, 2016 Moderators Share Posted December 16, 2016 (edited) 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 December 16, 2016 by JLogan3o13 Jos 1 "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 More sharing options...
Recommended Posts