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

My first IMacro, need your help please

Discussion in 'Black Hat SEO Tools' started by youmsh, Jan 23, 2011.

  1. youmsh

    youmsh Junior Member

    Joined:
    Jan 17, 2010
    Messages:
    191
    Likes Received:
    21
    It is a nonenglish website like facebook. i want to make a friend adder script using IMacros. it is the basic code after recording:

    I will make a list of user friends pages and add it to the csv file.

    Ok, now this code have 3 parts:

    1. URL GOTO=user friends url

    Here i can add this code: URL GOTO={{!COL1}}

    I want to make a csv file and add 2 columns. column1 for user friends urls.


    2. TAG POS=1 TYPE=INPUT:BUTTON ATTR=ID:hrfAddFriends
    TAG POS=1 TYPE=A ATTR=TXT:add<SP>a<SP>friend
    FRAME F=3

    It is for adding friends. we have 10 person per page. this mean this code will be repeated 10 times.

    3. TAG POS=1 TYPE=A ATTR=TXT:2

    This code is for the page number. when a person have 100 friends this mean that we will have 10 pages. i don't know if i can make a column for this and replace the code by this one:
    TAG POS=1 TYPE=A ATTR=TXT:{{!COL2}}


    Also i want to use this codes:

    SET !ERRORIGNORE YES
    SET !DATASOURCE links.csv
    SET !DATASOURCE_COLUMNS 2


    Now i think you know what i need to do. i want to complete this imacros by your helps. let me see your ideas and let me know if i am doing some thing wrong.

    I have other questions but now it is enough.

    Thanks in advance
     
  2. youmsh

    youmsh Junior Member

    Joined:
    Jan 17, 2010
    Messages:
    191
    Likes Received:
    21
    ??!!!
     
  3. JackSparrow

    JackSparrow Supreme Member

    Joined:
    Mar 24, 2007
    Messages:
    1,469
    Likes Received:
    2,054
    Occupation:
    Semi-Employed Pirate
    Location:
    search 4 blackhatsparrow
    Home Page:
    Im a bit confused by your original post, the below imacro script is an example of using some of the functions you described,the imacro script is for registering with certain forums, so it may give you an idea of how imacros and database files work.

    Always make sure you place the links.csv in the datasource folder of your imacro folder or the datasource will give an error.

    Would help if you gave the site you are trying to automate with imacros.

    Code:
    SET !TIMEOUT 20
    SET !DATASOURCE links.csv
    SET !DATASOURCE_COLUMNS 1
    SET !DATASOURCE_LINE 2
    SET !ERRORIGNORE YES
    SET !LOOP 2
    SET !DATASOURCE_LINE {{!LOOP}}
    WAIT SECONDS=3
    URL GOTO={{!COL1}}
    WAIT SECONDS=5
    TAG POS=1 TYPE=INPUT:TEXT FORM=* ATTR=NAME:username CONTENT=yourusername
    SET !ENCRYPTION NO
    TAG POS=1 TYPE=INPUT:PASSWORD FORM=* ATTR=NAME:password CONTENT=yourpassword
    SET !ENCRYPTION NO
    TAG POS=1 TYPE=INPUT:PASSWORD FORM=* ATTR=NAME:password_confirm CONTENT=yourpassword
    TAG POS=2 TYPE=INPUT:TEXT FORM=* ATTR=NAME:username CONTENT=yourusername
    SET !ENCRYPTION NO
    TAG POS=2 TYPE=INPUT:PASSWORD FORM=* ATTR=NAME:password CONTENT=yourpassword
    SET !ENCRYPTION NO
    TAG POS=2 TYPE=INPUT:PASSWORD FORM=* ATTR=NAME:password_confirm CONTENT=yourpassword
    TAG POS=1 TYPE=INPUT:TEXT FORM=* ATTR=NAME:email CONTENT=youremail
    TAG POS=1 TYPE=INPUT:TEXT FORM=* ATTR=NAME:email_confirm CONTENT=youremail
    TAG POS=1 TYPE=INPUT:TEXT FORM=* ATTR=NAME:url CONTENT=yoururl
    TAG POS=1 TYPE=TEXTAREA FORM=* ATTR=NAME:m_field_id_3 CONTENT=yourkeyword
    TAG POS=1 TYPE=INPUT:TEXT FORM=* ATTR=NAME:m_field_id_1 CONTENT=yourkeyword
    TAG POS=1 TYPE=INPUT:TEXT FORM=* ATTR=NAME:m_field_id_2 CONTENT=yourkeyword
    TAG POS=1 TYPE=INPUT:TEXT FORM=* ATTR=NAME:m_field_id_3 CONTENT=yourkeyword
    TAG POS=1 TYPE=INPUT:TEXT FORM=* ATTR=NAME:m_field_id_4 CONTENT=yourkeyword
    TAG POS=1 TYPE=INPUT:TEXT FORM=* ATTR=NAME:m_field_id_5 CONTENT=yourkeyword
    TAG POS=1 TYPE=INPUT:TEXT FORM=* ATTR=NAME:m_field_id_6 CONTENT=yourkeyword
    TAG POS=1 TYPE=INPUT:TEXT FORM=* ATTR=NAME:m_field_id_7 CONTENT=yourkeyword
    TAG POS=1 TYPE=SELECT FORM=* ATTR=NAME:m_field_id_6 CONTENT=%California
    TAG POS=1 TYPE=INPUT:TEXT FORM=* ATTR=NAME:m_field_id_20 CONTENT=90210
    TAG POS=1 TYPE=SELECT FORM=* ATTR=ID:bday_y CONTENT=%1985
    TAG POS=1 TYPE=SELECT FORM=* ATTR=ID:bday_m CONTENT=%06
    TAG POS=1 TYPE=SELECT FORM=* ATTR=ID:bday_d CONTENT=%23
    TAG POS=1 TYPE=INPUT:CHECKBOX FORM=* ATTR=NAME:accept_terms CONTENT=YES
    WAIT SECONDS=10
    TAG POS=1 TYPE=INPUT:SUBMIT FORM=* ATTR=VALUE:Submit
    WAIT SECONDS=3
     
    Last edited: Jan 24, 2011
  4. youmsh

    youmsh Junior Member

    Joined:
    Jan 17, 2010
    Messages:
    191
    Likes Received:
    21
    I made this code and tried it.

    Code:
    VERSION BUILD=7031111 RECORDER=FX
    TAB T=1
    SET !DATASOURCE links.csv
    SET !DATASOURCE_COLUMNS 2
    SET !DATASOURCE_LINE 10
    SET !ERRORIGNORE YES
    SET !LOOP 10
    SET !DATASOURCE_LINE {{!LOOP}}
    WAIT SECONDS=3
    URL GOTO={{!COL1}}
    TAG POS=1 TYPE=A ATTR=TXT:add<SP>a<SP>friend
    FRAME F=3
    TAG POS=1 TYPE=INPUT:BUTTON ATTR=ID:hrfAddFriends
    TAG POS=1 TYPE=A ATTR=TXT:add<SP>a<SP>friend
    FRAME F=3
    TAG POS=1 TYPE=INPUT:BUTTON ATTR=ID:hrfAddFriends
    TAG POS=1 TYPE=A ATTR=TXT:add<SP>a<SP>friend
    FRAME F=3
    TAG POS=1 TYPE=INPUT:BUTTON ATTR=ID:hrfAddFriends
    TAG POS=1 TYPE=A ATTR=TXT:add<SP>a<SP>friend
    FRAME F=3
    TAG POS=1 TYPE=INPUT:BUTTON ATTR=ID:hrfAddFriends
    TAG POS=1 TYPE=A ATTR=TXT:{{!COL2}} 
    i don't know if i can change the page number by this {{!COL2}}. because the code was like this: ATTR=TXT:2 and 2 is the page number. we have 10 pages for the user friends.


    i have some problems now.

    - i have 10 urls in col1 but the script starts from line 10 not from first line.

    - also in col2 i wrote numbers, 1 2 3 4-10. because we have 10 pages for the friends. the script when finished the first page it went to page 10 and then stopped.

    I want the script to go to the first url then start adding friends from pages 1 to 10 and then go to second url and do same thing.
     
  5. youmsh

    youmsh Junior Member

    Joined:
    Jan 17, 2010
    Messages:
    191
    Likes Received:
    21
    ??!!!
     
  6. Mr.Profit

    Mr.Profit Regular Member

    Joined:
    Dec 22, 2009
    Messages:
    219
    Likes Received:
    471
    Occupation:
    Marketer and SEO
    Location:
    Internet
    Home Page:
    Okay,

    Clearly you don't understand how iMacros reads a csv file.

    So let's start from your first problem:
    Change this:
    Code:
    [SIZE=3]SET !LOOP 10[/SIZE]
    Into this:
    Code:
    [SIZE=3]SET !LOOP 1[/SIZE]
    And Also remove:
    Code:
    [SIZE=3]SET !DATASOURCE_LINE 10[/SIZE]
    Now let's go to the second one:
    This is simply, because iMacros READS ROWS and not COLUMNS!

    Meaning you have the following setup:
    Code:
    url1,1
    url2,2
    url3,3
    url4,4
    url5,5
    url6,6
    url7,7
    url8,8
    url9,9
    url10,10
    
    As you have written your macro this will happen:
    Script Starts -> Goes to last URL (url10), reads the first page (as it loads the first page of friends) and the last part tells the script to go to page number 10.

    If you correct the script as I've advised you, this is what will the script do (it won't be what you want though):
    Script Starts-> Goes to url1, reads the loaded page-> goes to page 1 -> continue reading the csv
    Script Starts -> Goes to url2, reads the loaded page -> goes to page 2 -> continue reading the csv
    Script Starts -> Goes to url3, reads the loaded page -> goes to page 3 -> continue reading the csv
    .......

    So basically the script will add friends only from the page you have loaded and won't continue to the other pages, and the last command which makes it go to the next page is pointless, because after that it loads the next URL in the cue from the csv file.

    THE Solution:

    Make your script goes like this:
    Code:
    [SIZE=3][SIZE=2]VERSION BUILD=7031111 RECORDER=FX
    TAB T=1
    SET !DATASOURCE links.csv
    SET !DATASOURCE_COLUMNS 2
    SET !ERRORIGNORE YES
    [/SIZE][/SIZE][SIZE=3][SIZE=2]SET !LOOP 1[/SIZE][/SIZE]
    [SIZE=3][SIZE=2] SET !DATASOURCE_LINE {{!LOOP}}[/SIZE][/SIZE]
    [SIZE=3][SIZE=2] WAIT SECONDS=3
    URL GOTO={{!COL1}}
    TAG POS=1 TYPE=A ATTR=TXT:add<SP>a<SP>friend
    FRAME F=3
    TAG POS=1 TYPE=INPUT:BUTTON ATTR=ID:hrfAddFriends
    TAG POS=1 TYPE=A ATTR=TXT:add<SP>a<SP>friend
    FRAME F=3
    TAG POS=1 TYPE=INPUT:BUTTON ATTR=ID:hrfAddFriends
    TAG POS=1 TYPE=A ATTR=TXT:add<SP>a<SP>friend
    FRAME F=3
    TAG POS=1 TYPE=INPUT:BUTTON ATTR=ID:hrfAddFriends
    TAG POS=1 TYPE=A ATTR=TXT:add<SP>a<SP>friend
    FRAME F=3
    TAG POS=1 TYPE=INPUT:BUTTON ATTR=ID:hrfAddFriends
    TAG POS=1 TYPE=A ATTR=TXT:[SIZE=5]1[/SIZE][/SIZE]
    [/SIZE][SIZE=3][SIZE=2]TAG POS=1 TYPE=A ATTR=TXT:add<SP>a<SP>friend
     FRAME F=3
     TAG POS=1 TYPE=INPUT:BUTTON ATTR=ID:hrfAddFriends
     TAG POS=1 TYPE=A ATTR=TXT:add<SP>a<SP>friend
     FRAME F=3
     TAG POS=1 TYPE=INPUT:BUTTON ATTR=ID:hrfAddFriends
     TAG POS=1 TYPE=A ATTR=TXT:add<SP>a<SP>friend
     FRAME F=3
     TAG POS=1 TYPE=INPUT:BUTTON ATTR=ID:hrfAddFriends
     TAG POS=1 TYPE=A ATTR=TXT:add<SP>a<SP>friend
     FRAME F=3
     TAG POS=1 TYPE=INPUT:BUTTON ATTR=ID:hrfAddFriends
     TAG POS=1 TYPE=A ATTR=TXT:[SIZE=5]2[/SIZE][/SIZE][/SIZE][SIZE=3]
    AND SO ON UNTIL PAGE 10
    [/SIZE]
    I hope you get it!

    Mr.Profit
     
    • Thanks Thanks x 1
    Last edited: Jan 25, 2011
  7. Hunwarrior

    Hunwarrior Jr. VIP Jr. VIP Premium Member

    Joined:
    May 12, 2010
    Messages:
    1,027
    Likes Received:
    859
    your macro starts at 10th line, as SET !LOOP 10

    set it: SET !LOOP 1 and your macro will start at line 1
     
    • Thanks Thanks x 1
  8. youmsh

    youmsh Junior Member

    Joined:
    Jan 17, 2010
    Messages:
    191
    Likes Received:
    21
    Thank you my friends and good job Mr.Profit. i will try it today and let you now what will happen.

    Thanks a lot
     
  9. youmsh

    youmsh Junior Member

    Joined:
    Jan 17, 2010
    Messages:
    191
    Likes Received:
    21
    Ok, i tried it and it works very well but i have a problem. it is add a friend and then stop and i have to refresh the browser and then it continue. i am using this command: "SET !ERRORIGNORE YES" but i think it is not working with me. so i think i need a refresh command. any idea?
     
  10. youmsh

    youmsh Junior Member

    Joined:
    Jan 17, 2010
    Messages:
    191
    Likes Received:
    21
    Firstly i tried this command "REFRESH" and this is a good command but didn't fix my problem. then i tried ReloadEvery addon and now every thing is good. many thanks for you friends.