Jump to content

Recommended Posts

Posted

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

  • 2 weeks later...
Posted

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)

 

none

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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