Basically, the script copies the whole page and then searches through the text for certain strings. It then completes actions depending on the string(s) found. That part is working fine. From time to time, a different page (or a popup) is clicked, which doesn't have any of the strings I am looking for. I've been working on getting the script to check for that and close it to go back to the main page again.
So far I've tested it by opening a page I know doesn't have any of the strings I am looking for. It successfully closes the page, and restarts the main loop. However, once it is on the page that has the strings I am looking for (I verified by checking the contents of the clipboard, and the info was definitely there) it closes that page as well.
I have an array that contains the strings and it is looped through. Here is the part of the code (the else statement) that is giving me problems:
Code: Select all
If(InStr(Clipboard,storeValue) > 0) ; storeValue is the current value from the array
{
SendInput {CTRL down}
sleep, miniRoll
SendInput {f}{CTRL up}
sleep, smallRoll
SendInput %storeValue%
sleep, smallRoll
SendInput {ESCAPE}
sleep, miniRoll
SendInput {ENTER}
sleep smallRoll
found := AIndex ; AIndex is a variable I made so it can be reset to 0, which A_Index can't
If(found = 1)
{
sleep, mediumRoll
searchForImage()
Click %xClick%, %yClick%
sleep, hourRoll
closeRefresh()
continue wow
}
else if(found = 2)
{
sleep, mediumRoll
searchForImage()
Click %xClick%, %yClick%
sleep, shortRoll
closeRefresh()
continue wow
}
else if (found = 3)
{
sleep, mediumRoll
searchForImage()
Click %xClick%, %yClick%
sleep, shortRoll
closeRefresh()
continue wow
}
else if (found = 4)
{
sleep, mediumRoll
searchForImage()
Click %xClick%, %yClick%
sleep, bigRoll
closeRefresh()
continue wow
}
else if (found = 5)
{
sleep, mediumRoll
searchForImage()
Click %xClick%, %yClick%
sleep, bigRoll
closeRefresh()
continue wow
}
else if (found = 6)
{
sleep, mediumRoll
searchForImage()
Click %xClick%, %yClick%
sleep, bigRoll
closeRefresh()
continue wow
}
else if (found = 7)
{
sleep, mediumRoll
searchForImage()
Click %xClick%, %yClick%
sleep, bigRoll
closeRefresh()
continue wow
}
}
else
{
closeRefresh()
continue wow
}