AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to stop script if certain pixels changes color?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Jensenks
Guest





PostPosted: Tue Sep 22, 2009 8:03 pm    Post subject: How to stop script if certain pixels changes color? Reply with quote

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

PostPosted: Tue Sep 22, 2009 8:42 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
fromaroundhere
Guest





PostPosted: Tue Sep 22, 2009 8:54 pm    Post subject: Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group