Sign in to follow this  
Followers 0
neosporin

Color Detection and Key Press

2 posts in this topic

I registered to make this thread, but I've been a longtime autoit user and cannot thank you guys enough for the various publicly posted scripts I've used over the years. This community has been amazing, and you guys deserve thanks; especially those who put up with those of us who were able to use but not able to contribute.

I'm looking into making my own script to use color detection and a subsequent key press for an online scientific journal I've been reading from. As the pages don't skip automatically, or an easy method to do so, you must click the two icons on the bottom (I usually read with only my keyboard handy); but thankfully, the skip/back color is consistent, so I figure I would be able to use a simple color detection method to press a subsequent key based on whether to go to the next page, or back a page. 

The way the reader works, you read through the articles and then, after pressing the down arrow once, the skip/prev buttons become available. I was thinking of just making a script whose skip/prev variables are activated by Mouse4 and Mouse5, and whose values are defined as a color to be detected on the page; and after the down arrow is pressed (also works with mouse scroll), will scan for the color and either click or press a subsequent key.

I don't need a script written out, just some guidance is fine. I would like to hear some recommended methods and orders of operations to mess around with. My experience is only of basic c++ and vb in a couple university programs, but I'm always up for a challenge.

Thanks for the help, it's appreciated.

 

Share this post


Link to post
Share on other sites



To monitor the screen, you'll likely want to use PixelGetColor / PixelSearch.  You can read about those in the help file.

It's not too hard to capture Left/Middle/Right mouse clicks.  Going beyond that, into Mouse 4 & Mouse 5, may require you to capture the mouse.  I'm guessing that's going to involve a DllCall function using SetCapture.  You would have to monitor mouse input, and process only Mouse 4/5 (although I'm still not sure how you'd check for mouse 4/5 clicks).  Hopefully someone more awesome can give you insight there.

It may be simpler to use AdBlock Plus or some type of page plug-in that lets you reformat the page you're viewing.  AutoIt could be used to navigate the page, but that may not be the best solution if I'm understanding the problem. 

Share this post


Link to post
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
Sign in to follow this  
Followers 0