My code functions like this: Image search for 16 different pictures in a specific area in the 1st line( in a table) > if any image is found > do a function > go to 2nd line and do image search for same 16 pics and etc. It also would go to 2nd line even if images weren't found.
I have 7 lines, 16 image, and 1 image search function that would repeat with every image found or image not found in each line.
Code: Select all
Line1:
CoordMode, Pixel
ImageSearch, FoundX, FoundY, 2506, 428, 2554, 464, *100 img1.png
if (ErrorLevel = 0){
Click %FoundX%, %FoundY%.
RandomSleep(88,111)
Click 2533, 1230
RandomSleep(88,111)
Send {Enter}
}
CoordMode, Pixel
ImageSearch, FoundX, FoundY, 1881, 875, 2011, 916, *100 Buynow.png
if (ErrorLevel = 0){
Click %FoundX%, %FoundY%.
RandomSleep(200,300)
Send, {Enter}
Sleep 9000
}
ImageSearch, FoundX, FoundY, 2506, 428, 2554, 464, *100 img2.png
if (ErrorLevel = 0){
Click %FoundX%, %FoundY%.
RandomSleep(88,111)
Click 2533, 1230
RandomSleep(88,111)
Send {Enter}
}
CoordMode, Pixel
ImageSearch, FoundX, FoundY, 1881, 875, 2011, 916, *100 Buynow.png
if (ErrorLevel = 0){
Click %FoundX%, %FoundY%.
RandomSleep(200,300)
Send, {Enter}
Sleep 9000
}
ImageSearch, FoundX, FoundY, 2506, 428, 2554, 464, *100 img3.png
if (ErrorLevel = 0){
Click %FoundX%, %FoundY%.
RandomSleep(88,111)
Click 2533, 1230
RandomSleep(88,111)
Send {Enter}
}
CoordMode, Pixel
ImageSearch, FoundX, FoundY, 1881, 875, 2011, 916, *100 Buynow.png
if (ErrorLevel = 0){
Click %FoundX%, %FoundY%.
RandomSleep(200,300)
Send, {Enter}
Sleep 9000
}
What I am looking for is something that would make it search a whole folder for 16 image instead of adding a a script for each image. and since the lines are parallel and search area in each line is parallel also, a code like add this number to Line1 to make line 2, 3, 4, 5 cords and make it shorter.
I would appreciate the help if possible, and hope I explained what I wish to have clearly
thanx