 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Jensenks Guest
|
Posted: Tue Sep 22, 2009 8:03 pm Post subject: How to stop script if certain pixels changes color? |
|
|
Hello
Im very new at AutoHotKey, and at programming at all.
Im working on a very simpel "Clicking" script like:
| Quote: |
MouseClick, left, 238, 529
Sleep, 100
MouseClick, left, 222, 540
Sleep, 100
MouseClick, left, 868, 540
Sleep, 100
|
And so on.
And I want it so stop if something goes wrong. Like a window popping up. So it dosen't just click all over the place.
How can i do that? (mabye something like stopping the script if certain pixels changes color)
I hope you understand what im talking about, and that you are willing to help me. |
|
| Back to top |
|
 |
Carcophan
Joined: 24 Dec 2008 Posts: 768 Location: :noitacoL
|
Posted: Tue Sep 22, 2009 8:42 pm Post subject: |
|
|
There are dozens of ways to meet your request needs.
There is a specific way to tell if a pixle changes, yes. .. but it may not be your best option. (If the box that comes up, is the same color as the pixle for example, no error condition is met)
You can tell it to 'activate' a certain window, and only send the commands to THAT window.
You can tell the script to stop, if another window appears, outside of a preset list.
You can
| Quote: |
And I want it so stop if something goes wrong. Like a window popping up. So it dosen't just click all over the place
|
We need a little bit more information to better assist you. |
|
| Back to top |
|
 |
fromaroundhere Guest
|
Posted: Tue Sep 22, 2009 8:54 pm Post subject: |
|
|
If you're autoclicking around in a specific window, you could check for changes in the windows size, position, title, text, controls, check if it's still the active window, check if it still exists, check if any other windows were opened since the start of the script, check for changes in the other windows' sizes, positions, etc., check for new processes, etc. etc.
It's hard to suggest anything without knowing any specifics. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|