1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Imacros, how to repeat an action!??

Discussion in 'Black Hat SEO Tools' started by javi1812, Jun 26, 2016.

  1. javi1812

    javi1812 Newbie

    Joined:
    Jun 15, 2016
    Messages:
    7
    Likes Received:
    0
    Gender:
    Male
    Hi,

    I want to repeat this action


    CLICK X=1064 Y=159
    WAIT SECONDS=1
    CLICK X=1069 Y=159
    WAIT SECONDS=1
    CLICK X=1069 Y=159
    WAIT SECONDS=1
    CLICK X=1069 Y=159
    WAIT SECONDS=1
    CLICK X=1069 Y=159
    WAIT SECONDS=1
    CLICK X=1069 Y=159
    WAIT SECONDS=1



    how can I put this in just one line???
    because I tried to create a variable
    and the set !Loop 19
    but it doesn't work...
    I don't know how to set a variable for the action


    any help on that?
     
  2. cloaking

    cloaking Registered Member

    Joined:
    Aug 21, 2015
    Messages:
    94
    Likes Received:
    31
    You just need the code once:
    Code:
    CLICK X=1069 Y=159
    WAIT SECONDS=1
    
    Then, you can set the loop from inside the "Play" tab. For example, if you want it to loop 6 times:

    [​IMG]

    Let me know if I misunderstood the question.
     
  3. javi1812

    javi1812 Newbie

    Joined:
    Jun 15, 2016
    Messages:
    7
    Likes Received:
    0
    Gender:
    Male
    Thanks for your answer but is more complex...
    I just pasted a small part before, but imagine it is like this:

    URL GO TO= URL1
    CLICK X=1064 Y=159
    WAIT SECONDS=1
    CLICK X=1069 Y=159
    WAIT SECONDS=1
    CLICK X=1069 Y=159
    WAIT SECONDS=1
    CLICK X=1069 Y=159
    WAIT SECONDS=1
    CLICK X=1069 Y=159
    WAIT SECONDS=1
    CLICK X=1069 Y=159
    WAIT SECONDS=1

    URL GO TO=URL2
    CLICK X=1064 Y=159
    WAIT SECONDS=1
    CLICK X=1069 Y=159
    WAIT SECONDS=1
    CLICK X=1069 Y=159
    WAIT SECONDS=1
    CLICK X=1069 Y=159
    WAIT SECONDS=1
    CLICK X=1069 Y=159
    WAIT SECONDS=1
    CLICK X=1069 Y=159
    WAIT SECONDS=1

    ETC ETC


    my question is how can I simplify this in one line? so its look like

    URL GO TO=URL 1
    "REPEAT 19 TIMES" : CLICK X=1064 Y=159 + WAIT SECONDS=1

    URL GO TO=URL 2
    "REPEAT 19 TIMES" : CLICK X=1064 Y=159 + WAIT SECONDS=1

    ETC





    I hope to be clear this time hehe
     
  4. cloaking

    cloaking Registered Member

    Joined:
    Aug 21, 2015
    Messages:
    94
    Likes Received:
    31
    Save this as a JS file in your iMacros' folder (ie. "clicker.js"):
    Code:
    var macro;
    
    // Enter below the URLs to visit (in the same format):
    var urls = [
       "http://google.com/",
       "http://yahoo.com/",
    ];
    
    // Enter below how many times to repeat the action:
    var count = 19;
    
    macro = "CODE:";
    urls.forEach(function (url) {
       macro += "URL GOTO="+url+ "\n ";
       for (i=0; i<count; i++) {
         macro += 'CLICK X=1064 Y=159' + "\n ";
         macro += 'WAIT SECONDS=1' + "\n ";
       }
    });
    iret = iimPlay(macro);
    
    Then just press "Play" once. ;)
     
  5. javi1812

    javi1812 Newbie

    Joined:
    Jun 15, 2016
    Messages:
    7
    Likes Received:
    0
    Gender:
    Male

    shit I don't know javascript =(
    I don't know how to read and modify this...

    thank you anyway
     
  6. THUNDERELVI

    THUNDERELVI Elite Member

    Joined:
    Sep 12, 2009
    Messages:
    2,547
    Likes Received:
    2,200
    Gender:
    Male
    Location:
    W3
    The guy above even put comments in the code, so you know exactly what to modify. You need to change the URL-s (google and yahoo) to the URL-s you want your macro to visit and in case you need more than 2 URL-s, then add them all after the first 2 separated by a comma. After that, change the value of the count variable from 19 to whatever number you want. And that's it, play the macro only once and enjoy!
     
  7. HoNeYBiRD

    HoNeYBiRD Jr. VIP Jr. VIP

    Joined:
    May 1, 2009
    Messages:
    7,502
    Likes Received:
    8,427
    Gender:
    Male
    Occupation:
    Geographer, Tourism Manager
    Location:
    Ghosted
    You don't necessarily need to know JS to edit it using the guidelines of the guy who posted it or the other guy above me.

    But what's the issue with copy-pasting the code x amount times? It won't look too good and might be a bit long, but it solves the same purpose.
     
  8. cloaking

    cloaking Registered Member

    Joined:
    Aug 21, 2015
    Messages:
    94
    Likes Received:
    31
    As the above posters noted, you can just refer to the comments in my code. These are the lines that start with "//" in the code.

    For example, enter the URLs you want to visit in the above code like this:
    Code:
    var urls = [
       "http://website1.com/",
       "http://website2.com/",
       "http://website3.com/",
    ];
    
    For each website that it visits, specify how many times you want to "click" on the X/Y coordinates here:
    Code:
    var count = 19;
    
    In the above case, I have set it to 19 clicks as per your example.

    If you still can't get it to work, I can whip together a non-JavaScript version. However, it would be messier (similar to your current macro), and rely on a text file to pull the URLs.
     
  9. javi1812

    javi1812 Newbie

    Joined:
    Jun 15, 2016
    Messages:
    7
    Likes Received:
    0
    Gender:
    Male
    Can I put in the same file imacros commands and the JS script you put me?

    Because I want to do this for example:


    URL GOTO="facebook login page"
    WAIT SECONDS= 3
    TAG POS=1 TYPE=INPUT:TEXT FORM=ID:login-form ATTR=ID:id_username CONTENT="XXXXXX"
    SET !ENCRYPTION NO
    WAIT SECONDS= 3
    TAG POS=1 TYPE=INPUT:pASSWORD FORM=ID:login-form ATTR=ID:id_password CONTENT="XXXX"
    WAIT SECONDS= 3
    TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:login-form ATTR=*
    WAIT SECONDS= 3
    var macro;

    var urls = [
    "XXXXXX",
    ];
    var count = 19;

    macro = "CODE:";
    urls.forEach(function (url) {
    macro += "URL GOTO="+url+ "\n ";
    for (i=0; i<count; i++) {
    macro += 'CLICK X=1064 Y=159' + "\n ";
    macro += 'WAIT SECONDS=2' + "\n ";
    }
    });
    iret = iimPlay(macro);

    Then log out, and repeat it with other account...



    Hope it is clear!

    thanks in advance!