I want to set the high priority on the script below (only first).
Another important thing is whether you can do a Radom Sleep, 250 to 350
??
Loop
{
{
ImageSearch,,, 0, 0, A_ScreenWidth, A_ScreenHeight, mor.png
bT:= ErrorLevel ? bT : 1
If bT
{
bT:= 0
Random, x, 1130, 1300
Random, y, 580, 680
Click % x % % y %
Sleep, 500
}
}
ImageSearch,,, 0, 0, A_ScreenWidth, A_ScreenHeight, biz.png
bT:= ErrorLevel ? bT : 1
{
bT:= 0
Random, x, 540, 618
Random, y, 419, 430
Click % x % % y %
}
}
Return
f1:: ExitApp
Try it this way:
Untested.
If you want to change the priority of the thread the script is running on so that it can/cannot be interrupted by another thread, you use the
Thread
command:Where
Level
is a signed 32 bit integer. See AHK — Thread.You can generate a pseudo-random number using the
Random
command (as you already are in your code). If you want to pause the thread using random numbers, you do it like so: