need help, break the looping

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
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
qb_marukochan
Posts: 1
Joined: Sat Jan 16, 2010 4:14 am

need help, break the looping

Post by qb_marukochan » Sat Jan 16, 2010 4:21 am

First of all, im newbie here, :)

i have a code somthing like this (forever looping):

Code: Select all

function a(){
iimPlay("a",2);
b();
}
function b(){
iimPlay("b",2);
a();
}

a();
when it started, it cant stop. Yes i know, because it is looping all times.

but cant some1 help me, how to modify it if i wanna stop it.

Thanks
ABooth
Posts: 223
Joined: Mon Aug 10, 2009 4:25 pm

Re: need help, break the looping

Post by ABooth » Mon Jan 18, 2010 2:44 am

Not only can you not break the loop, your loop will use up stack space, 'til it gets a stack overflow, because no call to a method will ever complete.

If all your functions are doing is executing macro 'a' then 'b', why not do something like this: -

Code: Select all

const iterations = 10; // Only run them 10 times

for (var i=0; i<iterations; i++)
{
    iimPlay("a");
    iimPlay("b");
}
You can determine when it should stop by changing the value of iterations.
iMacros for Firefox supports JavaScript Macros (Scripting)
JavaScript supports Java via LiveConnect

Therefore: You can write powerful macros with iMacros for Firefox. Have a look at this one

Post feature requests here. Maybe one day, they'll pin it?
Post Reply