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++.
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
Co0oDe
Posts: 12
Joined: Tue Jul 21, 2015 4:17 pm

Increase five per number (loop)!!!!

Post by Co0oDe » Thu Aug 13, 2015 3:33 am

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...
chivracq
Posts: 8720
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

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

Post by chivracq » Thu Aug 13, 2015 1:14 pm

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)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Co0oDe
Posts: 12
Joined: Tue Jul 21, 2015 4:17 pm

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

Post by Co0oDe » Fri Aug 14, 2015 9:58 pm

thank you very much...
works!
chivracq
Posts: 8720
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

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

Post by chivracq » Sat Aug 15, 2015 5:29 pm

Co0oDe wrote:thank you very much...
works!
Good to hear...! :D
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Alexander2112
Posts: 1
Joined: Mon Mar 27, 2017 8:39 am

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

Post by Alexander2112 » Mon Mar 27, 2017 8: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
chivracq
Posts: 8720
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

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

Post by chivracq » Mon Mar 27, 2017 3:43 pm

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)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Post Reply