NutImNot Posted January 23, 2018 Share Posted January 23, 2018 Hi all, I'm trying to create a program where it searches an area for a specific color, and then if it does so, it performs another action where it searches another area for another color and clicks it if found. Here is the code: Func findColor() While 1 $point = PixelSearch(2516, 135, 2532, 150, 0xF00B09) if IsArray($point) Then MouseClick("right", $point[0], $point[1]) Sleep(500) $point2 = PixelSearch(2278, 300, 2514, 633, 0xA0315B) if IsArray($point2) Then MouseClick("left", $point2[0], $point2[1]) EndIf EndIf Sleep(50) WEnd EndFunc Any help would be lovely Link to comment Share on other sites More sharing options...
Earthshine Posted January 23, 2018 Share Posted January 23, 2018 and what would this be for? My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
NutImNot Posted January 23, 2018 Author Share Posted January 23, 2018 how come Link to comment Share on other sites More sharing options...
rcmaehl Posted January 23, 2018 Share Posted January 23, 2018 Code seems fine. Although you have to realize PixelSearch is a bit slow and can't detect pixels drawn using certain methods. DirectX being an example I believe. My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.My Projects WhyNotWin11Cisco Finesse, Github, IRC UDF, WindowEx UDF Link to comment Share on other sites More sharing options...
NutImNot Posted January 23, 2018 Author Share Posted January 23, 2018 Just now, rcmaehl said: Code seems fine. Although you have to realize PixelSearch is a bit slow and can't detect pixels drawn using certain methods. DirectX being an example I believe. I've used pixel search on the same application before without any problems. This one it doesn't do anything, just runs until i quit the program. Link to comment Share on other sites More sharing options...
rcmaehl Posted January 23, 2018 Share Posted January 23, 2018 (edited) Honestly the code is fine which means one or more of the following: PixelSearch is searching for the wrong color code PixelSearch is searching the wrong window PixelSearch is searching the wrong area PixelSearch is being called too often and throttling Edited January 23, 2018 by rcmaehl My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.My Projects WhyNotWin11Cisco Finesse, Github, IRC UDF, WindowEx UDF Link to comment Share on other sites More sharing options...
NutImNot Posted January 23, 2018 Author Share Posted January 23, 2018 I agree with you rcmaehl, I've used the exact code in the past to do something similar just with different color values. I double checked the colors and the areas that they're searching but still nothing. Link to comment Share on other sites More sharing options...
Earthshine Posted January 23, 2018 Share Posted January 23, 2018 What app are you trying to automate? You want assistance or not? Not going to guess My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
careca Posted January 23, 2018 Share Posted January 23, 2018 Try adding some tolerance and see what happens. 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 More sharing options...
junkew Posted January 23, 2018 Share Posted January 23, 2018 Which os version? Take screenshot and analyze it at pixel level with paint or other tools to see if there are shading variations which have not been there before. Maybe you have transparancy turned on. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
NutImNot Posted January 24, 2018 Author Share Posted January 24, 2018 @careca i upped the tolerance and it works great now, you're the best <3 careca 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now