Simplifying the code to wait random times

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
iMacrosChromeUser
Posts: 8
Joined: Sun Apr 01, 2018 1:31 pm

Simplifying the code to wait random times

Post by iMacrosChromeUser » Sat Apr 14, 2018 4:31 am

Code: Select all

Google chrome Version 65.0.3325.181 (Official Build) (64-bit)
MacOS High Sierra
iMacros version V10.0.1 free version
The code I have below I want to make changes to. is there any way to set up a code like the one below, where it will simply click the "TYPE=BUTTON ATTR=TXT:zzz but I can set it up to do it between for example 60 to 120 seconds. Not 60 OR 120 second, but a random number that falls between those numbers, then I can just have the "TYPE=BUTTON ATTR=TXT:zzz" code once or twice and under it whatever code is needed for it to pick a random number somewhere between 2 given numbers and then click the next text?

Code: Select all

SET !ERRORIGNORE YES
SET !DATASOURCE users.txt
SET !DATASOURCE_COLUMNS 1
SET !DATASOURCE_LINE {{!LOOP}}
SET !VAR1 EVAL("var n=Math.floor(Math.random()*6 + 1); n;")
SET !VAR2 EVAL("var n=Math.floor(Math.random()*10 + 1); n;")
SET !VAR3 EVAL("var n=Math.floor(Math.random()*30 + 8); n;")
URL GOTO=https://www.YYY.com/{{!COL1}}
TAG POS=1 TYPE=A ATTR=TXT:*<SP>followers
TAG POS=2 TYPE=BUTTON ATTR=TXT:ZZZ
WAIT SECONDS={{!var1}}
WAIT SECONDS=149
TAG POS=2 TYPE=BUTTON ATTR=TXT:ZZZ
WAIT SECONDS={{!var3}}
WAIT SECONDS=72
Google chrome Version 65.0.3325.181 (Official Build) (64-bit)
MacOS High Sierra
iMacros version V10.0.1 free version
Post Reply