I would like to improve it to keep looping the first if statement until its true then move to the second and third and last statement rather then just looping the whole thing.
Spoiler
Code: Select all
F1::
Loop
{ ; loops until found:
PixelSearch, Px, Py, 1119, 656, 1156, 682, 0x414141, 1, Fast
if (Errorlevel = 0)
{
Mouseclick, left, 1230, 773
Sleep 5000
break
}
sleep 50 ; always a good idea to have sleeps in loops (lower = higher cpu usage)
}
PixelSearch, q1, q2, 919, 730, 939, 748, 0x9B7B54, 1, Fast
if (Errorlevel = 0)
{
sleep 1200
Send {right down}
sleep 1300
Send {right up}
}
PixelSearch, ax, ay, 1294, 525, 1382, 597, 0x0378FF, 1, Fast
If (ErrorLevel = 0)
{
send {shift down}
sleep 150
send {shift up}
send {shift down}
sleep 150
send {shift up}
}
PixelSearch, bx, by, 1251, 386, 1308, 462, 0x0BB0FF, 1, Fast
if (ErrorLevel = 0)
{
sleep 1000
send {n down}
sleep 150
send {n up}
sleep 150
send {enter down}
sleep 150
send {enter up}
}
return
F2::reload
Users browsing this forum: No registered users and 81 guests