AutoHotkey Community

It is currently May 27th, 2012, 11:40 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Solving a Picture Puzzle
PostPosted: May 6th, 2010, 9:16 am 
So there's this game I play, which for some reason requires me to solve a simple picture puzzle everytime I login.

I was wondering if I could automate this using AHK.

Here are some examples:

Image
Image
Image

At first I thought I could try something with PixelSearch, but as seen in the 2nd picture, sometimes there is minimal difference in the shade/hue. What functions do you guys recommend I try to work with, or better yet, any complete ideas on how to solve this?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 6th, 2010, 9:26 am 
Offline

Joined: June 8th, 2006, 2:41 am
Posts: 285
the only thing i could think of is scan it in a grid, and pick out the grid square that contains a color different from the rest.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 6th, 2010, 9:35 am 
That's sort of what I had in mind, but I don't think it would work for the 2nd picture, as it seems they've deliberately made the flags have a couple pixels with the same color as the unique object.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 6th, 2010, 6:37 pm 
I thought about this overnight, and I think one way might be to also introduce a frequency count of colors, but how efficient is thousands of pixelgetcolor function calls and storing thousands of color variables? Would the script be too slow?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 7th, 2010, 9:01 am 
Ah lame, I pretty much finished the entire script to do this, only to realize at the end that ~10000 pixelgetcolor function calls is insanely slow.

I did a 120x120 pixelgetcolor (14400) and simply had it click the lowest frequency color in a 10x10 grid of 12x12 pixel cells lol...

So back to the drawing board, anyone have an elegant solution that's faster than spamming pixelgetcolor?


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: bowen666, MSN [Bot] and 15 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group