eltwomen Posted March 17, 2022 Share Posted March 17, 2022 i always used autoit it always worked fine the only function that never worked for me is: PixelSearch. I really need this function it would save a lot of my time but I don't know what happens and it always crashes the code or gives some problem. I use c# static void Main(string[] args) { string window_title = "Sem título - Paint";//paint while (true) { int color = 15539236; Object searchcrash = AutoItX.PixelSearch(new Rectangle(663, 209, 1799, 846), color);//663, 209 = left_up | 1799, 846 = righ_down object[] cord = searchcrash as object[]; if (AutoIt.AutoItX.ErrorCode() != 1) { AutoIt.AutoItX.MouseClick("LEFT", (int)cord[0], (int)cord[1]); Thread.Sleep(5000); } } } crash: System.AccessViolationException: 'Attempted to read or write to protected memory. This is usually an indication that other memory is corrupted.' line: Object searchcrash = AutoItX.PixelSearch(new Rectangle(663, 209, 1799, 846), color);//663, 209 = left_up | 1799, 846 = righ_down Link to comment Share on other sites More sharing options...
ad777 Posted March 31, 2022 Share Posted March 31, 2022 I really dont know c# but in Autoit: PixelSearch(663, 209, 1799, 846,15539236) it might be in C#: Object searchcrash = AutoItX.PixelSearch(663, 209, 1799, 846, color) iam ِAutoit programmer. best thing in life is to use your Brain to Achieve everything you want. 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