This is pseudocode at best; you will not be able to make up your own syntax with AHK. Perhaps you can explain what the script should do. The documentation is also helpful with syntax, detailed descriptions, and even examples, for every command and function. You might also consider firing the cool senior dude.
Code: Select all
x := A_ScreenWidth / 2
y := A_ScreenHeight / 2
target := 0x234AFB ; Blue-green-red
CoordMode, Mouse
CoordMode, Pixel
MouseMove, x, y
Loop {
Sleep, 100
PixelGetColor, bgr, x, y
ToolTip, %bgr%
If (bgr != target)
Continue
Click
SoundBeep, 1500
}
Esc::ExitApp
People on this forum write scripts, so when you post a subject for your thread, summarize the problem that you are having, instead of stating that you are writing a script. An example could be, "Click when target color is found". Another approach can be to search the forum, to see if someone else has already posted the script that you need. There are probably at least a hundred posted scripts like this one (maybe a thousand).
Code: Select all
x := A_ScreenWidth / 2
y := A_ScreenHeight / 2
target := 0x234AFB ; Blue-green-red
CoordMode, Mouse
CoordMode, Pixel
MouseMove, x, y
Loop {
Sleep, 100
PixelGetColor, bgr, x, y
ToolTip, %bgr%
SoundBeep, 1900
} Until (bgr = target)
Click
ToolTip
MsgBox, 64, Done, Done!
Return
Esc::ExitApp