Jump to content

NEWBIE Question: Is this possible using Autoit?


Recommended Posts

Hello everyone,

 

I'm completely new to autoit and I have a small project I would like to test which could help in my business.

But before I get started learning autoit, I would truly love to know if what I'm attempting to do is within the feasible capabilities of autoit.

 

First of all the computer on which I would like to run autoit, use 3 monitor. 2 of which have a program (One on Monitor 2 and One on Monitor 3) open that I would need autoit to interact with.

 

The task I would like autoit to perform is actually quite mundane for a human to do and therefore I would like to automate this process.

 

Example:

 

Program A run an interface with 50x50 square and program B run the same program (albeit with a slightly different interface, color wise) and at the start of the day both program show identical figures.

 

For instance Program A would show something along the following in an image on the interface. (0 = the square is empty, meaning it's in a default state and the value is currently neutral), ( 1 = White = the square value as changed positively) (2 = Black = The value as changed negatively)

 

NOTE: The program A & B always know if the value is Positive(White) or Negative(Black) so I'm only interested in the left-click part.

 

000

000

000

 

After 5 minutes the following happens on Program A:

000

010

000

 

Then I manually left-click on program B at the same position as the change on Program A. (Program B is homemade by my company and allow me to manipulate the data which is very useful for us.

 

After 5 Minutes Program B:

 

020

010

000

 

Then I manually left click on Program A at the center top point and wait until a change occur in Program A.

 

020

010

000

 

Now both program are identical. I wait another 5 or so minutes and then a change occur on Program A:

 

120

010

000

 

I then left click on program B so both program look identical and then wait for a change to occur in Program B.

 

To reiterate, at the start of the day Program A & B are identical. (aside from slight color difference and being on different monitor)

 

When a change occur in Program A or B I left click on the other one at the position of the change so that both program look identical than wait for the other program to make a change. And this go on ALL day until market close.

 

Here is some rules that are ALWAYS true.

 

IF Program A make the first change in the day, Program B will ALWAYS make the second change and Program A will make the next.

 

A > B > A > B > A > B

 

If the first value is positive in program A or B the next value will ALWAYS be negative in program A or B.

 

Example:

 

A1 > B2 > A1 > B2 > A1 > B2

 

or

 

A2 > B1 > A2 > B1 > A2 > B1

 

Those rules never change everyday but I will never know in advance if the value is going to appear on Program A or B at the start of the day.

 

But once a value change in one program the next value will ALWAYS change in the other after.

 

I'm actually hoping to automatize everything but first I would like the left-click part to be automated.

 

Since this is the one that is the most crucial.

 

Thank you in advance for letting me know if this is possible or now using autoit!

 

 

 

 

Link to comment
Share on other sites

You can check the color of pixels at specific coordinates ( PixelGetColor() ) and perform a mouse click on specific coordinates ( MouseClick() ). Check the help file, they have example scripts. So you could write a script in a loop waiting for color changes to occur at specific coordinates, then react to those changes. It sounds like that would probably get you to a very basic version of what you're looking for.

Then again, it's hard to tell exactly because you're being vague about your applications. Could you maybe post a couple of screenshots (block out any specific company information if you need to) so we have an idea what you're dealing with?

Also, maybe it's an option to go back to the people who wrote that proprietary software for you and ask them for an improved interface or maybe discuss with them some automatic actions you may want to configure, so you don't have to script it yourself?

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

3 hours ago, SadBunny said:

You can check the color of pixels at specific coordinates ( PixelGetColor() ) and perform a mouse click on specific coordinates ( MouseClick() ). Check the help file, they have example scripts. So you could write a script in a loop waiting for color changes to occur at specific coordinates, then react to those changes. It sounds like that would probably get you to a very basic version of what you're looking for.

Then again, it's hard to tell exactly because you're being vague about your applications. Could you maybe post a couple of screenshots (block out any specific company information if you need to) so we have an idea what you're dealing with?

Also, maybe it's an option to go back to the people who wrote that proprietary software for you and ask them for an improved interface or maybe discuss with them some automatic actions you may want to configure, so you don't have to script it yourself?

NO NO NO! Do NOT use Pixel searching. It is the WORST way to automate for it is horribly unstable for a host of reasons. It is to be used if and ONLY if you have no other option in automating.
If your apps are homegrown, then most likely you can hook into the controls of the app and read the data. This is not hard.

Lets do this first - make sure you have downloaded the full AutoIt suite and have it installed. There is a app in the suite called "AutoIt Window Info" that you can use to check a control. I do not know if you have a 32 or 64 bit windows so you have to pick the correct one.

Run the tool and check a field you want to read. Post the data it reports back in the thread and we can then tell you what you need to do next.

Edited by Bert
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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