I'll offer my advice.
1. Decide if you would like to write a v1 or v2 script.
2. Post in the forum that matches the version you want: v1 or v2; gaming forum or not.
3. Refer to the AHK documentation that matches your version (v1 or v2).
4. Check the documentation carefully, so that you are following the provided syntax. AHK documentation includes examples for just about everything. As boiler noted, adding your own command parameters that are not part of the syntax will not lead to success.
5. Remove the loop commands during your testing, so that you can test a single iteration and get it working.
6. Read the documentation about blocks. A block has an opening brace and a closing brace. If you omit one of them, you create a bug in your script.
7. I suggest thinking about answering questions from the forum responders, because they are trying to help you achieve your goal. That is generally why they are responding to what you post. They are not responding simply to waste everyone's time.
8. When you post a broken script, describe what it actually does, and what it should do instead. Include an example.
9. Some people who come to the forum have brought ChatGPT output with them. This should be avoided.
As for me, I sign off when I encounter unresponsiveness-- as we are both getting nowhere-- but I wish you the best of luck, and others may provide more help for you here. You are on the right track, but I would follow your script line by line, because it doesn't match your description closely. Your description is not bad, so if you break it down into specific phrases, and then translate each phrase into a line of AHK code, you can probably fix this rather quickly.
Code: Select all
Sleep 50
Look for the colour 0x0000FD ; By default, colours in v1 are in Blue-Green-Red format
; By default, coordinates are relative to the active window
If ErrorLevel { ; If the colour is *not* found,
Look for 0xA0FFFF ; then search again; and do what with the result?
If __________ ; Under what condition?
Click ; click the left mouse button
} Else { ; Otherwise (if colour *is* found),
____________ ; generate a random number,
Sleep for 17-23 seconds ; and sleep;
}
; Do what next?