Increase five per number (loop)!!!!

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++.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Increase five per number (loop)!!!!

by Co0oDe on Wed Aug 12, 2015 8:33 pm

VERSION BUILD=8920312 RECORDER=FX
firefox 39.0
WIN: 8.1
------------------------------------------------
I want to increase five for evey (loop)number then increase it again.... 1,6,11,16,21

something like that...
Code: Select all
VERSION BUILD=8920312 RECORDER=FX
SET !LOOP 1
SET !VAR1 EVAL("var x=\"{{!LOOP}}\" + 5")
PROMPT {{!VAR1}}

i want the result like that 1 then 6 then 11 then 16 etc...
Co0oDe
 
Posts: 12
Joined: Tue Jul 21, 2015 9:17 am

Re: Increase five per number (loop)!!!!

by chivracq on Thu Aug 13, 2015 6:14 am

Co0oDe wrote:VERSION BUILD=8920312 RECORDER=FX
firefox 39.0
WIN: 8.1
------------------------------------------------
I want to increase five for evey (loop)number then increase it again.... 1,6,11,16,21

something like that...
Code: Select all
VERSION BUILD=8920312 RECORDER=FX
SET !LOOP 1
SET !VAR1 EVAL("var x=\"{{!LOOP}}\" + 5")
PROMPT {{!VAR1}}

i want the result like that 1 then 6 then 11 then 16 etc...

Easy Maths Problem...!
Either using 'ADD':
Code: Select all
VERSION BUILD=8920312 RECORDER=FX
SET !LOOP 1
SET My_Loop {{!LOOP}}
ADD My_Loop {{!LOOP}}
ADD My_Loop {{!LOOP}}
ADD My_Loop {{!LOOP}}
ADD My_Loop {{!LOOP}}
ADD My_Loop -4
'SET !VAR1 EVAL("var x=\"{{!LOOP}}\" + 5")
'PROMPT {{!VAR1}}
PROMPT My_Loop:<SP>_{{My_Loop}}_

Or using 'EVAL()' like you tried. 2 ways:
Code: Select all
VERSION BUILD=8920312 RECORDER=FX
SET !LOOP 1
SET !VAR1 EVAL("var d='{{!LOOP}}'; var x=(d*5)-4; x;")
SET !VAR2 EVAL("var d='{{!LOOP}}'; var x=((d-1)*5)+1; x;")
PROMPT VAR1:<SP>_{{!VAR1}}_<BR>VAR2:<SP>_{{!VAR2}}_
(Not tested...)
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6489
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Increase five per number (loop)!!!!

by Co0oDe on Fri Aug 14, 2015 2:58 pm

thank you very much...
works!
Co0oDe
 
Posts: 12
Joined: Tue Jul 21, 2015 9:17 am

Re: Increase five per number (loop)!!!!

by chivracq on Sat Aug 15, 2015 10:29 am

Co0oDe wrote:thank you very much...
works!

Good to hear...! :D
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6489
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Increase five per number (loop)!!!!

by Alexander2112 on Mon Mar 27, 2017 1:51 am

chivracq wrote:
Co0oDe wrote:VERSION BUILD=8920312 RECORDER=FX
firefox 39.0
WIN: 8.1
------------------------------------------------
I want to increase five for evey (loop)number then increase it again.... 1,6,11,16,21

something like that...
Code: Select all
VERSION BUILD=8920312 RECORDER=FX
SET !LOOP 1
SET !VAR1 EVAL("var x=\"{{!LOOP}}\" + 5")
PROMPT {{!VAR1}}

i want the result like that 1 then 6 then 11 then 16 etc...

Easy Maths Problem...!
Either using 'ADD':
Code: Select all
VERSION BUILD=8920312 RECORDER=FX
SET !LOOP 1
SET My_Loop {{!LOOP}}
ADD My_Loop {{!LOOP}}
ADD My_Loop {{!LOOP}}
ADD My_Loop {{!LOOP}}
ADD My_Loop {{!LOOP}}
ADD My_Loop -4
'SET !VAR1 EVAL("var x=\"{{!LOOP}}\" + 5")
'PROMPT {{!VAR1}}
PROMPT My_Loop:<SP>_{{My_Loop}}_

Or using 'EVAL()' like you tried. 2 ways:
Code: Select all
VERSION BUILD=8920312 RECORDER=FX
SET !LOOP 1
SET !VAR1 EVAL("var d='{{!LOOP}}'; var x=(d*5)-4; x;")
SET !VAR2 EVAL("var d='{{!LOOP}}'; var x=((d-1)*5)+1; x;")
PROMPT VAR1:<SP>_{{!VAR1}}_<BR>VAR2:<SP>_{{!VAR2}}_
(Not tested...)

I have same problem if you can help me

Ex i have a link ex: "www.google.com/245256" and next page of this webiste is number"245256+1"
I want when i run imacros for ex: 3 loop = 245256+1 , 245256+2 , 245256+3 etc
Alexander2112
 
Posts: 1
Joined: Mon Mar 27, 2017 1:39 am

Re: Increase five per number (loop)!!!!

by chivracq on Mon Mar 27, 2017 8:43 am

Alexander2112 wrote:I have same problem if you can help me

Ex i have a link ex: "www.google.com/245256" and next page of this webiste is number"245256+1"
I want when i run imacros for ex: 3 loop = 245256+1 , 245256+2 , 245256+3 etc

Yeah but if you could mention your FCI when you open a Thread or post for the first time in some existing Thread...?, read my Sig...

But, yep, easy Answer, replace your "+1"/"+2"/etc by "+{{!LOOP}}" using 'ADD'... :idea:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6489
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to Scripting and Command Line Interface

Who is online

Users browsing this forum: No registered users and 4 guests

-->