Wait Seconds

Discussions and Tech Support related to the iMacros Google Chrome extension.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.
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