Another Loop problem for me
Posted: 15 Apr 2021, 14:07
My Script works perfectly for me so far what I want to do now is after the Pixel was found it should Repeat the Loop BUT from now on use the Command Send,{Down} all the time first so it can take the next 'Object' to find the pixel there and if from the 2nd loop the Pixel was found it should repeat the Cycle again but this time with it should use the Command Send,{Down} twice and so on and on.
Is there a Way to maybe say 1 loop was done cuz pixel was found and counter goes up by 1 and everytime the Command Send,{down} just takes the counter as info to move like Counter 23 = Send,{Down 23} times
Do i have to Create a new loop also or could Continue work also with it.
Here is also a short Video what the script should do by Moving down means
https www.youtube.com /watch?v=AxedtcOSfrU Broken Link for safety
Is there a Way to maybe say 1 loop was done cuz pixel was found and counter goes up by 1 and everytime the Command Send,{down} just takes the counter as info to move like Counter 23 = Send,{Down 23} times
Do i have to Create a new loop also or could Continue work also with it.
Here is also a short Video what the script should do by Moving down means
https www.youtube.com /watch?v=AxedtcOSfrU Broken Link for safety
Code: Select all
CODE:
settitlematchmode, 2
SetBatchLines, -1
CoordMode, Pixel, Client
#NoEnv
SetKeyDelay, 0, 50
F1::
loop{
IfWinExist, Remote
{
send,{Enter down}
sleep,150
send,{Enter up}
sleep,150
send,{Enter down}
sleep,150
send,{Enter up}
sleep,150
send,{Enter down}
sleep,150
send,{Enter up}
sleep,2000
PixelSearch, Px, Py, 988, 227, 990, 229, 0xB83031, 30, Fast, RGB
if ErrorLevel
{
}
else
{
break
}
PixelSearch, Px, Py, 988, 227, 990, 229, 0xB73435, 30, Fast, RGB
if ErrorLevel
{
}
else
{
break
}
PixelSearch, Px, Py, 988, 227, 990, 229, 0xB13434, 30, Fast, RGB
if ErrorLevel
{
}
else
{
break
}
PixelSearch, Px, Py, 988, 227, 990, 229, 0x9C3032, 30, Fast, RGB
if ErrorLevel
{
}
else
{
break
}
PixelSearch, Px, Py, 988, 227, 990, 229, 0xB24144, 30, Fast, RGB
if ErrorLevel
{
}
else
{
break
}
PixelSearch, Px, Py, 988, 227, 990, 229, 0x912B2D, 30, Fast, RGB
if ErrorLevel
{
}
else
{
break
}
PixelSearch, Px, Py, 988, 227, 990, 229, 0x611817, 30, Fast, RGB
if ErrorLevel
{
}
else
{
break
}
PixelSearch, Px, Py, 988, 227, 990, 229, 0x7D2A29, 30, Fast, RGB
if ErrorLevel
{
}
else
{
break
}
PixelSearch, Px, Py, 988, 227, 990, 229, 0x641B17, 30, Fast, RGB
if ErrorLevel
{
}
else
{
break
}
PixelSearch, Px, Py, 988, 227, 990, 229, 0xA31B1E, 30, Fast, RGB
if ErrorLevel
{
}
else
{
break
}
PixelSearch, Px, Py, 988, 227, 990, 229, 0xAA2D2C, 30, Fast, RGB
if ErrorLevel
{
}
else
{
break
}
PixelSearch, Px, Py, 988, 227, 990, 229, 0x71150E, 30, Fast, RGB
if ErrorLevel
{
msgbox, No Primal Found
}
else
{
break
}
}
}
msgbox, Primal Found in x%Px% y%Py%.
Return
F2::
reload