Jump to content

Recommended Posts

Posted

Hi there!

I've got a slight problem, I'm using AutoIt for this program called EeRom-8U.

Basically what I'm doing is taking a file that got generated by a programming enviroment (CodeWright) and use EeRom to load it onto an emulator (used to test our gambling machine games before we put them onto a chip)

The problem is this: The script works but is pretty sloppy. When I start up EeRom, it has to check wether the emulators are connected. I wanted to do this by checking if the text "not connected!" would have changed to "ERU#### / 2.0", but that doesn't work since the Window tool doesn't pick up the text.

So my next idea was to see if the location of the "!" was black, that would mean it's not connected. If it was grey (the background color) it would mean it's connection.

However, how do I manage to tell PixelGetColor that the coordinates should be calculated from within the control, and not the screen?

Thanks in advance!

  • Moderators
Posted

MarauderNL,

Had to look this up myself yesterday, so it is nice and fresh in the memory! You need to adjust the PixelCoordMode through the Opt function. From the Help file for Opt:

PixelCoordMode Sets the way coords are used in the pixel functions, either absolute coords or coords relative to the window defined by hwnd (default active window):

0 = relative coords to the defined window

1 = absolute screen coordinates (default)

2 = relative coords to the client area of the defined window

Use the Au3Info tool to get the hwnd and set Mode 0 or 2. That should do it! Do not forget to reset the mode when you are done or you might get a nasty surprise when you next use a Pixel function - the current mode is returned when you set a new one, so it is easy to save it in a variable.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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:

  Reveal hidden contents

 

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...