Thanks very much! Its a step in the right direction but the macro still seems to run too slow. Thanks to your advice I was able to shorten the macro down to five lines...
1. Left Mouse Click
2. Repeat until %N2% = 58623
3. Get Pixel Color 227,725 into %N2%
4. End Repeat
5. Left Mouse Click
For the game, all you have to do is click the left mouse button and then left click again when the pendelum is in the center. You don't have to place the mouse anywhere specific and you can move it around all you want, just as long as you click at the right times. The problem is that the pendelum does a complete half-circle swing just about every second, and so to get it in the middle the macro needs to be checking that pixel almost every 1/25th of a second to see if it's changed from red to yellow.
Even when it works the pendelum seems to always miss the middle because I guess it takes too long for the macro to tell the mouse to click. I tried to find a way to time the loop but couldn't make it work. I'm afraid I'm not a very good programmer, and it's kind hard to type because my fingers are pretty messed up.
The written logic would be...
1. Left mouse click to get the pendelum swinging.
2. Check if pixel at 227, 725 is red or yellow.
3. If 227, 725 is red keep checking.
4. If 227, 725 is yellow then left mouse click immediately.
The key is speed. That pixel needs to be checked very often, maybe even 50 or so times per second or more, and the mouse needs to be told as fast as possible to left click.
You mentioned the pixel maybe changing color during the game, so I took about 20 screenshots during various states and it never changed color at that pixel location. It's not a very grahpics intensive game. A friend told me I might be better off with a program specifically designed to do this simple task, and which repeats very very very fast. I don't even know where to begin if I need to go down that route? Any suggestions?
Thanks for all your help! I hope I get this figured out. I love to play video games and it would be awful if I couldn't play even very simple ones like this because of my disability.