I'm new in this forum and i'm speaking in foreign language, so sorry for my English.
I'm trying to write a script which will automatic hits the targets. I have a small bullet shield, which show at screen always in the same place and has a random color, but there is a pixel in this bullet shield that change color very rarely.
I wrote a script that use onEvent Pixel_Color, then it move mouse to this pixel coordinate and LCLICK. It works, but it's too slow and sometimes can't see that Pixel_Color.
Example code:
Code: Select all
SRT>t1
MouseMove>499,290
LCLick
end>t1
SRT>t2
MouseMove>701,290
LCLick
end>t2
SRT>t3
MouseMove>1000,290
LCLick
end>t3
Label>start
OnEvent>PIXEL_COLOR,462:279,1255,t1
OnEvent>PIXEL_COLOR,666:279,3221677,t2
OnEvent>PIXEL_COLOR,871:279,525543,t3
Goto>start
Maybe i should use waitpixelchange function or waitrectchange function, but how should i do this? WPC or WRC only show WPC_RESULT=TRUE or FALSE, and it works when there is 1 target. There is any way to store WPC_RESULT to variable and when that variable is TRUE do something? for example: WPC_RESULT_a1=TRUE -> so hit the target.
Thanks in advance
EDIT:
The background is black. So maybe the best way will be wait for pixel to change color from black to any other and then if it change hit it. But how can i do this to handle about 8 pixels at the same time?