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

Please Help With this my imacros script to gurus in the house

Discussion in 'Other Scripting Languages' started by safeenaat1, Oct 13, 2015.

  1. safeenaat1

    safeenaat1 Junior Member

    Joined:
    Aug 20, 2013
    Messages:
    150
    Likes Received:
    5
    hello to everyone on this great forum. i have a problem that i feel can only be solved by my wizard brothers in the house. i am new to imacros and have created a few scripts. i want to create one but am haveingdifficulty in a particular line. see the script below. what i want the script to do is to click and comment on any topic it meets at the top. but it is selecting only the one that was their when i created the script. please what will i use to command the script that it will comment on any first not just the one that was their when i created the script? if i want to comment on first 5 how will it look like? also if its possible please just re-write the script. expect my thanks

    Code:
    VERSION BUILD=8940826 RECORDER=FX
    TAB T=1
    URL GOTO=http://www.nairaland.com/topics
    TAG POS=1 TYPE=A ATTR=TXT:FG<SP>Orders<SP>IG<SP>To<SP>Hand<SP>Over<SP>Saraki<SP>Money*
    TAG POS=1 TYPE=B ATTR=TXT:Reply
    TAG POS=1 TYPE=TEXTAREA FORM=ID:postform ATTR=ID:body CONTENT=nice<SP>post
    TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:postform ATTR=NAME:follow CONTENT=NO
    TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:postform ATTR=*
    TAG POS=1 TYPE=A ATTR=TXT:New
    here is a sample of what the page looks like

    nl threads new.jpg
     
  2. safeenaat1

    safeenaat1 Junior Member

    Joined:
    Aug 20, 2013
    Messages:
    150
    Likes Received:
    5

    can you please help with my above problem?
     
  3. safeenaat1

    safeenaat1 Junior Member

    Joined:
    Aug 20, 2013
    Messages:
    150
    Likes Received:
    5
    hi bro, considering your imacros contribution on the forum, i feel you can wipe away my tears. please look into my issue. thanks in advance
     
  4. Plus44

    Plus44 Power Member

    Joined:
    Dec 14, 2014
    Messages:
    663
    Likes Received:
    252
    Gender:
    Male
    Location:
    US
    Try this

    Code:
    SET !ERRORIGNORE YES
    TAB T=1
    URL GOTO=http://www.nairaland.com/topics
    WAIT SECONDS=1
    EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV>TABLE:nth-of-type(2)>TBODY>TR>TD>B:nth-of-type(2)>A" BUTTON=0
    WAIT SECONDS=1
    TAG POS=1 TYPE=B ATTR=TXT:Reply
    WAIT SECONDS=1
    TAG POS=1 TYPE=TEXTAREA FORM=ID:postform ATTR=ID:body CONTENT=nice<SP>post
    WAIT SECONDS=1
    TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:postform ATTR=NAME:follow CONTENT=NO
    WAIT SECONDS=1
    TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:postform ATTR=*
    WAIT SECONDS=1
    TAG POS=1 TYPE=A ATTR=TXT:New
    WAIT SECONDS=1
    
     
    • Thanks Thanks x 1
  5. ThreadKiller

    ThreadKiller Power Member

    Joined:
    Jan 31, 2012
    Messages:
    628
    Likes Received:
    307
    Location:
    Never too long in one place.
    First, are you using the Firefox plugin or the standalone?

    Second, where are these posts you are quoting from. I only see 3 posts in this thread, all from you.

    Third, consider using X-Y coordinates or the Event type tag instead of full HTML

    Fourth, you could also try this and see if it works.
     
    • Thanks Thanks x 1
  6. Plus44

    Plus44 Power Member

    Joined:
    Dec 14, 2014
    Messages:
    663
    Likes Received:
    252
    Gender:
    Male
    Location:
    US
    @ThreadKiller

    The TAG POS=1 TYPE=A ATTR=TXT:* will click the name of the sub forum, not the actual post

    So in the first line of the picture he posted above, that command will make it click on the "politics" button instead of the name of the thread beside it "Senate Insists, No More Bow And Go For Ministerial Nominees"
     
  7. safeenaat1

    safeenaat1 Junior Member

    Joined:
    Aug 20, 2013
    Messages:
    150
    Likes Received:
    5
    bro you just made my day. it worked fine. thanks a zillion times. please what if i want to select the first 5 post? thanks in advance
     
  8. Plus44

    Plus44 Power Member

    Joined:
    Dec 14, 2014
    Messages:
    663
    Likes Received:
    252
    Gender:
    Male
    Location:
    US
    No problem

    For everything after the first line, all you'd have to do is change this number to the thread you want to click on
    EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV>TABLE:nth-of-type(2)>TBODY>TR:nth-of-type(5)>TD>B:nth-of-type(2)>A" BUTTON=0
    Being that it's a forum and new posts push down the old ones you should start at the bottom and work your way up so you're not overlapping anything


    Code:
    SET !ERRORIGNORE YES
    TAB T=1
    URL GOTO=http://www.nairaland.com/topics
    SET !VAR1 {{!URLCURRENT}}
    TAB T=1
    WAIT SECONDS=1
    EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV>TABLE:nth-of-type(2)>TBODY>TR:nth-of-type(5)>TD>B:nth-of-type(2)>A" BUTTON=0
    WAIT SECONDS=1
    TAG POS=1 TYPE=B ATTR=TXT:Reply
    WAIT SECONDS=1
    TAG POS=1 TYPE=TEXTAREA FORM=ID:postform ATTR=ID:body CONTENT=nice<SP>post
    WAIT SECONDS=1
    TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:postform ATTR=NAME:follow CONTENT=NO
    WAIT SECONDS=1
    TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:postform ATTR=*
    WAIT SECONDS=1
    TAG POS=1 TYPE=A ATTR=TXT:New
    WAIT SECONDS=1
    URL GOTO={{!VAR1}}
    WAIT SECONDS=1
    EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV>TABLE:nth-of-type(2)>TBODY>TR:nth-of-type(4)>TD>B:nth-of-type(2)>A" BUTTON=0
    WAIT SECONDS=1
    TAG POS=1 TYPE=B ATTR=TXT:Reply
    WAIT SECONDS=1
    TAG POS=1 TYPE=TEXTAREA FORM=ID:postform ATTR=ID:body CONTENT=nice<SP>post
    WAIT SECONDS=1
    TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:postform ATTR=NAME:follow CONTENT=NO
    WAIT SECONDS=1
    TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:postform ATTR=*
    WAIT SECONDS=1
    TAG POS=1 TYPE=A ATTR=TXT:New
    WAIT SECONDS=1
    URL GOTO={{!VAR1}}
    WAIT SECONDS=1
    EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV>TABLE:nth-of-type(2)>TBODY>TR:nth-of-type(3)>TD>B:nth-of-type(2)>A" BUTTON=0
    WAIT SECONDS=1
    TAG POS=1 TYPE=B ATTR=TXT:Reply
    WAIT SECONDS=1
    TAG POS=1 TYPE=TEXTAREA FORM=ID:postform ATTR=ID:body CONTENT=nice<SP>post
    WAIT SECONDS=1
    TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:postform ATTR=NAME:follow CONTENT=NO
    WAIT SECONDS=1
    TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:postform ATTR=*
    WAIT SECONDS=1
    TAG POS=1 TYPE=A ATTR=TXT:New
    WAIT SECONDS=1
    URL GOTO={{!VAR1}}
    WAIT SECONDS=1
    EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV>TABLE:nth-of-type(2)>TBODY>TR:nth-of-type(2)>TD>B:nth-of-type(2)>A" BUTTON=0
    WAIT SECONDS=1
    TAG POS=1 TYPE=B ATTR=TXT:Reply
    WAIT SECONDS=1
    TAG POS=1 TYPE=TEXTAREA FORM=ID:postform ATTR=ID:body CONTENT=nice<SP>post
    WAIT SECONDS=1
    TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:postform ATTR=NAME:follow CONTENT=NO
    WAIT SECONDS=1
    TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:postform ATTR=*
    WAIT SECONDS=1
    TAG POS=1 TYPE=A ATTR=TXT:New
    WAIT SECONDS=1
    URL GOTO={{!VAR1}}
    WAIT SECONDS=1
    EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV>TABLE:nth-of-type(2)>TBODY>TR>TD>B:nth-of-type(2)>A" BUTTON=0
    WAIT SECONDS=1
    TAG POS=1 TYPE=B ATTR=TXT:Reply
    WAIT SECONDS=1
    TAG POS=1 TYPE=TEXTAREA FORM=ID:postform ATTR=ID:body CONTENT=nice<SP>post
    WAIT SECONDS=1
    TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:postform ATTR=NAME:follow CONTENT=NO
    WAIT SECONDS=1
    TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:postform ATTR=*
    WAIT SECONDS=1
    TAG POS=1 TYPE=A ATTR=TXT:New
    WAIT SECONDS=1
    
    Cheers
     
    • Thanks Thanks x 1
  9. safeenaat1

    safeenaat1 Junior Member

    Joined:
    Aug 20, 2013
    Messages:
    150
    Likes Received:
    5
    hello, thanks for all the guide. i have been able to make a number of adjustments to the script but the most important one i want to make now is for it to be able to copy text from the post, manipulate it to make a comment with it. it presently goes off topic and repeat only 10 post. thanks in advance.
     
  10. HoNeYBiRD

    HoNeYBiRD Jr. VIP Jr. VIP

    Joined:
    May 1, 2009
    Messages:
    7,509
    Likes Received:
    8,437
    Gender:
    Male
    Occupation:
    Geographer, Tourism Manager
    Location:
    Ghosted
    copying text won't be an issue, you just need to use the "EXTRACT" command appropriately, but what do you mean by "manipulate to make a comment with it"?
     
    • Thanks Thanks x 1
  11. safeenaat1

    safeenaat1 Junior Member

    Joined:
    Aug 20, 2013
    Messages:
    150
    Likes Received:
    5
    what i mean is that, instead of picking up comment from excel file let it just extract a line of the topic, spine it and post it as a comment. i will be glad if you can just modify the script to how it should be. thanks in advance.
     
  12. HoNeYBiRD

    HoNeYBiRD Jr. VIP Jr. VIP

    Joined:
    May 1, 2009
    Messages:
    7,509
    Likes Received:
    8,437
    Gender:
    Male
    Occupation:
    Geographer, Tourism Manager
    Location:
    Ghosted
    imacros doesn't support content spinning natively, so you would need to use an online spinner and incorporate that into the macro

    i have no idea how to copy only a single line or part of a post though, it would need to have some kind of id what imacros can pick up, a full post has that, just a line or a random part of it doesn't

    i think i understand what you're trying to do and it makes sense, however i'm pretty sure that the spun responses wouldn't make too much sense for human readers, you can't really reproduce a convo by just spinning
     
    • Thanks Thanks x 1
  13. safeenaat1

    safeenaat1 Junior Member

    Joined:
    Aug 20, 2013
    Messages:
    150
    Likes Received:
    5
    yes i am really thinking that it will makes less sense to human readers. commenting from an excel is also not helping matters as it often goes off topic. do you have a solution of where the comment should come from that is better than the excel n spine txt? its a general forum with all sorts of post and its difficult to get few comments that can suit all kinds of post. thanks in advance.
     
  14. HoNeYBiRD

    HoNeYBiRD Jr. VIP Jr. VIP

    Joined:
    May 1, 2009
    Messages:
    7,509
    Likes Received:
    8,437
    Gender:
    Male
    Occupation:
    Geographer, Tourism Manager
    Location:
    Ghosted
    i think what you would need is general spun comments, like thanking the OP for his useful post and similar, these get shared on the forum from time to time, just like in this trhead: http://www.blackhatworld.com/blackh...megathread-perfectly-spun-comments-share.html

    input these into spinnerchief one by one, get all the permutations and populate the datasource .csv with them one comment per each line, if you want to randomize the order, you can do it with this online tool: http://textmechanic.com/Sort-Text-Lines.html

    it won't be perfect, but i think that's the closest what you can get
     
    • Thanks Thanks x 2
  15. safeenaat1

    safeenaat1 Junior Member

    Joined:
    Aug 20, 2013
    Messages:
    150
    Likes Received:
    5
    thanks very much bro i have seen. the problem is that it is a forum not a blog. a lady or a guy may come and post "my father or mother just passed away, i need your prayers". imagine posting "excellent post and what have u". that is why i think the best way is to find a way to use part of the post so that it can always be inline. thanks for all the support.
     
  16. safeenaat1

    safeenaat1 Junior Member

    Joined:
    Aug 20, 2013
    Messages:
    150
    Likes Received:
    5
    i posted it initially without quote it seems you did not saw it.

     
  17. Plus44

    Plus44 Power Member

    Joined:
    Dec 14, 2014
    Messages:
    663
    Likes Received:
    252
    Gender:
    Male
    Location:
    US
    I understand exactly what you're trying to do. You want to scrape a response to the thread, then spin it so it will still be on topic with the original post... That would be extremely difficult to do and probably wouldn't look human the majority of the time... I even see spun posts come around here on BHW occasionally and they always get called out... Very hard to seem legit with them

    I just create my own responses and post them from an excel file saying stuff like this

    "I love topics like these. I am looking forward to seeing more opinions on this"
    "Has this forum been lagging for everyone today, or is it just me? I clicked on this thread and it took like 5 mins to load!!"
    "We need more topics like this. I have been having a really bad day and it's good to take my mind off things talking about the stuff that interests me"

    If you're just looking to get your post count up, the quickest & easiest way would be to just run a script in the introduce yourself section with generic comments welcoming everyone to the forum. I do it all the time.

    Other than that though, sorry I can't help further.

    Disclaimer for the mods: This is just for educational purposes :) I do not do this type of stuff on BHW. I don't shit where I eat.


    Holy crap thanks for linking to that thread I've never seen that one before! I will put it to good use soon
     
    • Thanks Thanks x 1
  18. safeenaat1

    safeenaat1 Junior Member

    Joined:
    Aug 20, 2013
    Messages:
    150
    Likes Received:
    5
    hi great minds in the house, please i need help on the above script. what if i need the script to select usernames from a file and the file has 10 usernames all with same password. the content should also be randomly selected from same file or different file. please look into it.
     
  19. safeenaat1

    safeenaat1 Junior Member

    Joined:
    Aug 20, 2013
    Messages:
    150
    Likes Received:
    5

    my boss i am back with your script for the last time. please i need help on the above script. what if i need the script to select usernames from a file and the file has 10 usernames all with same password. the content should also be randomly selected from same file or different file. please look into it. thanks in advance dearie.
     
  20. HoNeYBiRD

    HoNeYBiRD Jr. VIP Jr. VIP

    Joined:
    May 1, 2009
    Messages:
    7,509
    Likes Received:
    8,437
    Gender:
    Male
    Occupation:
    Geographer, Tourism Manager
    Location:
    Ghosted
    So practically what you want to do is select random lines from a source file? This can be done with the scripting interface of iMacros: http://forum.imacros.net/viewtopic.php?f=2&t=5802. I have never used that one though, so i can't really help with that, but maybe that one is the easiest or shortest way to do it.

    But there's always a workaround. :)

    I see i replied a few times back then and one of the replies contains vital info to this solution too.
    I figured out a backwards solution, we don't pick random lines from the data source, but we randomize the data source with each loop, so we will have a random username and content (whatever that means in this case, let's say the content is comments) to use with each loop.

    I put this macro together quick:
    HTML:
    VERSION BUILD=8970419 RECORDER=FX
    TAB T=1
    TAB CLOSEALLOTHERS
    SET !ERRORIGNORE YES
    SET !EXTRACT_TEST_POPUP NO
    URL GOTO=http://freespinner.net/
    TAG POS=1 TYPE=TEXTAREA FORM=ID:demoForm ATTR=ID:spin Content={username01|username02|username03|username04|username05|username06|username07|username08|username09|username10}
    TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:demoForm ATTR=ID:submit
    TAG POS=1 TYPE=DIV ATTR=ID:clip_text0 EXTRACT=TXT
    REFRESH
    TAG POS=1 TYPE=TEXTAREA FORM=ID:demoForm ATTR=ID:spin Content={comment01|comment02|comment03|comment04|comment05|comment06|comment07|comment08|comment09|comment10}
    TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:demoForm ATTR=ID:submit
    TAG POS=1 TYPE=DIV ATTR=ID:clip_text0 EXTRACT=TXT
    SAVEAS TYPE=EXTRACT FOLDER=* FILE=random_username+random_comment.csv
    TAG POS=1 TYPE=DIV ATTR=ID:clip_text1 EXTRACT=TXT
    SET !DATASOURCE c:\Users\YourWindowsUsername\Documents\iMacros\Downloads\random_username+random_comment.csv
    SET !LOOP 1
    SET !DATASOURCE_LINE {{!LOOP}}
    You need to put the usernames (line 7) and the comments (line 11) into spintax format. Play the macro in loop.
    Note: if the comments contain empty spaces, you need to replace every empty space with <SP>

    What this macro does: spins the usernames, comments and extracts them into a .csv file into your iMacros\Downloads folder. One username and one comment per line. New data is appended to the existing data with each loop.

    E.g. the .csv file with the extracted data will look like this after 2 loops:
    username03;comment07
    username09;comment04

    LOOP 1 spins the 10 usernames and 10 comments, extracts a random username and a random comment into the 1st line of the .csv. LOOP 1 will use the 1st line of the .csv as data source.
    LOOP 2 spins the 10 usernames and 10 comments, extracts a random username and a random comment into the 2nd line of the .csv. LOOP 2 will use the 2nd line of the .csv as data source.
    And so on.

    Usernames are under COL1, comments are under COL2, the password you said is the same for all accounts, so that can be entered manually into the appropriate part of the login process.
     
    Last edited: Jul 30, 2017