Selecting Random Post

Discussions and Tech Support related to automating the iMacros Browser or Internet Explorer from any scripting and programming language, such as VBS (WSH), VBA, VB, Perl, Delphi, C# or C++.
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
tomsutton
Posts: 1
Joined: Thu Dec 17, 2009 5:30 pm

Selecting Random Post

Post by tomsutton » Thu Dec 17, 2009 5:34 pm

Hey guys my current script, pretty simple.

Code: Select all

VERSION BUILD=6251204 RECORDER=FX
TAB T=1
URL GOTO=http://www.google.co.uk/
URL GOTO=http://www.tomshardware.co.uk/forum/forum-13-322.html
TAG POS=1 TYPE=A ATTR=TXT:Sign<SP>In
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:connexion ATTR=ID:myLogin_login CONTENT=*****
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:connexion ATTR=ID:myLogin_mdp CONTENT=*****
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:connexion ATTR=*
basically it signs into a forum, what i want it to next is to select a random topic from the forum. Is there anyway this is possible?

Cheers
MattBell7
Posts: 627
Joined: Thu Nov 26, 2009 11:07 am
Location: United Kingdom

Re: Selecting Random Post

Post by MattBell7 » Fri Dec 18, 2009 9:59 am

If you want a truly random post, you'll need to write a proper script, however you can try something like this

Code: Select all

TAG POS=1 TYPE=TH ATTR=TXT:Thread   
TAG POS=R6 TYPE=A ATTR=CLASS:cCatTopic&&HREF:http://www.tomshardware.co.uk/forum/*
This will select the 6th topic on the page (this isnt the case, topics with multiple pages in the top 6 shorten the selection by 1, as they have a link to the last page as well)
Post Reply