Wait for the contents of the window to change or appear in Imacros
1 VERSION BUILD=844 RECORDER=CR
2 SET !ERRORIGNORE YES
3 SET !TIMEOUT_PAGE 35
4 TAB T=1
6 TAG POS=1 TYPE=A ATTR=TXT:Click<SP>here<SP>to<SP>earn
7 Wait Seconds=35
this is my code for some website i made a fixed time but it is actually a random time as i can do imacros to check this "you can go back" text and then continue the script without WAIT time
thanks in advance
source to share
You can simply do the next step you want (for example, search for the "next" button), but add before it SET !TIMEOUT_STEP 1000
(any large number of seconds), and instead try for 6 seconds (the default) and not after finding it, iMacro will repeat the action until the condition (STEP) is met, or if time runs out, it will act as if emelent was not found.
VERSION BUILD=844 RECORDER=CR
SET !ERRORIGNORE YES
SET !TIMEOUT_PAGE 35
TAB T=1
TAG POS=1 TYPE=A ATTR=TXT:Click<SP>here<SP>to<SP>earn
SET !TIMEOUT_STEP 600 ' or any other # of sec you think is ok
TAG POS=1 TYPE=A ATTR=TXT:You<SP>Can<SP>Go<SP>Back 'or other commands like search source
SET !TIMEOUT_STEP 6 ' remember to set back to 6 to not get stuck on other commands
source to share
"Waiting for XYZ to appear":
Another method is using the iMacros IMAGESEARCH feature, or using automation tools based on image search first, such as Kantu Web Automation (free).
iMacros:
Replace
TAG POS = 1 TYPE = A ATTR = TXT: YouCanGoBack
from
IMAGESEARCH POS = 1 IMAGE = c: \ youcangoback.png
source to share
you can use
var macro,retcode;
macro = "CODE:";
macro += "SET !ERRORIGNORE NO" + "\n";
macro += "TAG POS=1 TYPE=A ATTR=TXT:You<SP>can<SP>go<SP>back" + "\n";
retcode = iimPlay(macro);
while (retcode < 1) {
macro = "CODE:";
macro += "SET !ERRORIGNORE NO" + "\n";
macro += "TAG POS=1 TYPE=A ATTR=TXT:You<SP>can<SP>go<SP>back" + "\n";
retcode = iimPlay(macro);
}
source to share