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

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


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.

bro thanks very much for this great response. more respects bro. example in the above script if i want each account to make only 2 comments, then logout for the other account to continue, does it mean that i will have to repeat the script and make it very long with loggin n logout after every 2 comments?
 
bro thanks very much for this great response. more respects bro. example in the above script if i want each account to make only 2 comments, then logout for the other account to continue, does it mean that i will have to repeat the script and make it very long with loggin n logout after every 2 comments?
If you want to make 2 comments with every account, you can extract two results (there are 4 results on the site), the comments will be under COL 2 and COL 3 in the .csv, so you can make two comments without the need to logout and login again:
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
TAG POS=1 TYPE=DIV ATTR=ID:clip_text1 EXTRACT=TXT
SAVEAS TYPE=EXTRACT FOLDER=* FILE=random_username+random_comment.csv
SET !DATASOURCE c:\Users\YourWindowsUsername\Documents\iMacros\Downloads\random_username+random_comment.csv
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}
 
If you want to make 2 comments with every account, you can extract two results (there are 4 results on the site), the comments will be under COL 2 and COL 3 in the .csv, so you can make two comments without the need to logout and login again:
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
TAG POS=1 TYPE=DIV ATTR=ID:clip_text1 EXTRACT=TXT
SAVEAS TYPE=EXTRACT FOLDER=* FILE=random_username+random_comment.csv
SET !DATASOURCE c:\Users\YourWindowsUsername\Documents\iMacros\Downloads\random_username+random_comment.csv
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}


thanks very much bro for the time. you are the best here. i am finding it complex via your root and i think i have gotten s simple solution without spinning. the only challenge i am currently having is that instead of the content of a column in an entry it enters {{!COL2}}. see the sample code below. all that i need now is that let it enter the content of the colum n not the code. thanks in advance

Code:
VERSION BUILD=9030808 RECORDER=FX
SET !ERRORIGNORE YES
SET !DATASOURCE Book11.csv
SET !DATASOURCE_COLUMNS 2
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}
TAB T=1
URL GOTO=http://www.nairaland.com/
TAG POS=1 TYPE=A ATTR=TXT:LOGIN!
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/do_login ATTR=NAME:name CONTENT ={{!COL2}
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:/do_login ATTR=NAME:password CONTENT=7a345tr5434
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:/do_login ATTR=*
WAIT SECONDS=10
REFRESH
URL GOTO=http://www.nairaland.com/topics
SET !VAR1 {{!URLCURRENT}}
TAB T=1
WAIT SECONDS=10
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=5
TAG POS=1 TYPE=B ATTR=TXT:Reply
WAIT SECONDS=5
TAG POS=1 TYPE=TEXTAREA FORM=ID:postform ATTR=ID:body CONTENT={{!COL1}}
WAIT SECONDS=5
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:postform ATTR=NAME:follow CONTENT=NO
WAIT SECONDS=5
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:postform ATTR=*
WAIT SECONDS=10
TAG POS=1 TYPE=A ATTR=TXT:Logout
 
thanks very much bro for the time. you are the best here. i am finding it complex via your root and i think i have gotten s simple solution without spinning. the only challenge i am currently having is that instead of the content of a column in an entry it enters {{!COL2}}. see the sample code below. all that i need now is that let it enter the content of the colum n not the code. thanks in advance

Code:
VERSION BUILD=9030808 RECORDER=FX
SET !ERRORIGNORE YES
SET !DATASOURCE Book11.csv
SET !DATASOURCE_COLUMNS 2
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}
TAB T=1
URL GOTO=http://www.nairaland.com/
TAG POS=1 TYPE=A ATTR=TXT:LOGIN!
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/do_login ATTR=NAME:name CONTENT ={{!COL2}
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:/do_login ATTR=NAME:password CONTENT=7a345tr5434
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:/do_login ATTR=*
WAIT SECONDS=10
REFRESH
URL GOTO=http://www.nairaland.com/topics
SET !VAR1 {{!URLCURRENT}}
TAB T=1
WAIT SECONDS=10
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=5
TAG POS=1 TYPE=B ATTR=TXT:Reply
WAIT SECONDS=5
TAG POS=1 TYPE=TEXTAREA FORM=ID:postform ATTR=ID:body CONTENT={{!COL1}}
WAIT SECONDS=5
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:postform ATTR=NAME:follow CONTENT=NO
WAIT SECONDS=5
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:postform ATTR=*
WAIT SECONDS=10
TAG POS=1 TYPE=A ATTR=TXT:Logout
Because there's a syntax error in the 10th line, it should be:
HTML:
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/do_login ATTR=NAME:name CONTENT={{!COL2}}
 
Because there's a syntax error in the 10th line, it should be:
HTML:
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/do_login ATTR=NAME:name CONTENT={{!COL2}}

bro words are not enough to appreciate you. the script is now working fine. the challenge now is that after the 10th row for the user name it starts entering blank spaces for the username. what should i do? should i just repeat the user names in the file or i can set the limit for column 2?
 
Back
Top