Need assistance with POS incrementing

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
Mudbubble
Posts: 2
Joined: Fri Jun 07, 2013 8:02 pm

Need assistance with POS incrementing

Post by Mudbubble » Fri Jun 07, 2013 8:57 pm

Hi All,

I have created a script for automating submissions for feedback loop for a few ISP's (I have do do this eveytime we add a new client).

The script prompts for the client name on run which then points to previously created CSV file and pulls information from the CSV and inputs it where needed.

I have gotten it entirely functional but with 1 issue which I have side stepped by using wildcards and ignoring errors.

I am using the current version of iMacro for Firefox free.

The basic issue is that each client can have a different number of IP's usually no more that 6 so what I have done is put 10 of the following line in:

Code: Select all

TAG POS=1 TYPE=SELECT FORM=NAME:form1 ATTR=ID:* CONTENT=$abuse@{{!COL1}}
TAG POS=2 TYPE=SELECT FORM=NAME:form1 ATTR=ID:* CONTENT=$abuse@{{!COL1}}
etc
and with ignore errors enabled, it correctly selects the value for each POS that exists and then errors and skips the extra few lines that don't exist.

This will work, but for the sake of cleanliness and time saving (it takes a little time even at TimeOut_Step = 1 to skip the unneeded entries) I would like to setup a variable prompt {{!VAR2}} at the beginning that will ask how many IP's there are for this submission and then run a script of some kind to increment up to that value as a max then continue with the rest of the script.

I was trying to get the following to work without any success (honestly I don't know javascript so my syntax is probably wrong, but beyond that I could not figure out how to call the .js from inside of my .iim macro to even get started).

Code: Select all

var macro;

macro ="CODE:";
macro +="TAG POS={{i}} TYPE=SELECT FORM=NAME:form1 ATTR=ID:* CONTENT=$abuse@{{!COL1}}";

for (var i=1;i<{{!Var2}};i++)
{

iimSet("i",i)
iimPlay(macro)
}
I understand you can not use if else directly in iMacro, but if there is a way to do the incrementing without using external scripting I'm all for it.


I will attach the full script and a copy of a datasource file that will use generic information so you can see how the page run's through (there is a captcha at the end so it wont accidentally make the submission)

The datasource has additional unused fields which can be ignored as the file is used across several scripts (other FBL's require extra info)

The Intial Prompt is for the client name, in this case enter "BN" in the prompt

Thanks everyone in advance for any help with this.

Thanks,

Tom
Attachments
FBL.zip
zip of iim and datasource
(1.04 KiB) Downloaded 143 times
Mudbubble
Posts: 2
Joined: Fri Jun 07, 2013 8:02 pm

Re: Need assistance with POS incrementing

Post by Mudbubble » Wed Jun 26, 2013 10:03 pm

Hi All,

Hadn't gotten any responses and have been so far unable to work this out on my own.

Thanks any for any help,

Tom
User avatar
FoxDot
Posts: 20
Joined: Thu Jun 13, 2013 2:31 pm
Location: Chisinau
Contact:

Re: Need assistance with POS incrementing

Post by FoxDot » Fri Jun 28, 2013 9:00 am

In such a case i would use "while" statement instead of "for" )
The Fox Will Find You!
Post Reply