Wait Seconds

Discussions and Tech Support specific to the iMacros for Chrome extension.
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
anderson
Posts: 4
Joined: Mon Dec 14, 2009 12:54 pm

Wait Seconds

Post by anderson » Thu Feb 04, 2010 5:19 pm

Hello,

Someone know how to do a Wait Seconds with random seconds?

Thanks
Daniel, Tech Support
Posts: 1483
Joined: Tue Jan 26, 2010 11:35 am

Re: Wait Seconds

Post by Daniel, Tech Support » Fri Feb 05, 2010 10:25 am

Hello,

You would need to use a scripting language in that case. Unfortunately, due to Chrome's limitations you can't use JavaScript with iMacros in Chrome yet. We are working on connecting normal scripting interface to Chrome. We hope to finish this in the next few months.

However, you can do this with Firefox. Here is a sample script that you can adjust:

Code: Select all

var macro, iret;
var min = 5;
var max = 10;

function getRandomInt(min, max)
{
	return Math.floor(Math.random() * (max - min + 1)) + min;
}

function startMacro(delay)
{
	macro = "CODE:";
	macro += "VERSION BUILD=6311226 RECORDER=FX\n";
	macro += "URL GOTO=http://www.google.com\n";
	macro += "WAIT SECONDS=" + delay;
	iret = iimPlay(macro)
}

var stop=0;
do
{
	startMacro(getRandomInt(min, max));
	stop++;
}
while(stop<10) //set a real-life condition here!
Daniel, iOpus Support
Post Reply