mttgbsn Posted April 13, 2016 Share Posted April 13, 2016 (edited) Hello, New Autoit user who has been crawling the forum. I have been working on a script for a few days and have hit a brick wall. WinActivate("example window") $pixel = PixelSearch(762, 458, 771, 466, 0x772B1E, 20) If IsArray($pixel) = True Then WinActivate("other example window") MouseClick($MOUSE_CLICK_LEFT, 477, 539, 2) EndIf If IsArray($pixel) = False Then Sleep(500) EndIf The intent of my script: 1. to run a pixel search for a color of pixel on a window (very small area, could be 20x20 pixels). (For reference this window would be the "example window" in the script I wrote). 2. If the pixel is found in the designated area to mouse click on a button on another window ("other example window") (or if easier for scripting to send a keystroke to "example window") 3. If the pixel is not found in the designated area then to run the script over. Any help is appreciated. Additionally any information regarding how quickly the typical pixelsearch with such a small area occurs would be helpful. I am assuming from what I read on this forum that this is largely processor and CPU dependent. Problem Script.au3 Edited April 13, 2016 by mttgbsn to add the script Link to comment Share on other sites More sharing options...
AutoBert Posted April 13, 2016 Share Posted April 13, 2016 Pixelsearch is one of the unsafest methods to auotmate somerthing. Tell the applications name and we will find a better solution. Use the "< >" -Button for Codetags Your link is like the script, he makes problems. Link to comment Share on other sites More sharing options...
mttgbsn Posted April 13, 2016 Author Share Posted April 13, 2016 (edited) Thanks for the feedback @AutoBert. I was not aware that there was a better way to do this than a pixelsearch. This is the current script with application names included: WinActivate("PS4 Remote Play") $pixel = PixelSearch(762, 458, 771, 466, 0x772B1E, 20) If IsArray($pixel) = True Then WinActivate("MaxAim DI Plugin v4.25") MouseClick($MOUSE_CLICK_LEFT, 477, 539, 2) EndIf If IsArray($pixel) = False Then Sleep(500) EndIf Edited April 13, 2016 by mttgbsn Link to comment Share on other sites More sharing options...
Developers Jos Posted April 13, 2016 Developers Share Posted April 13, 2016 @mttgbsn, Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. (there is also a link link in my signature) Please read them now particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. 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...
Recommended Posts