How To Use Array Loop in Imacros

Discussions and Tech Support related to the iMacros Google Chrome extension.
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.
Post Reply
salmanno1
Posts: 1
Joined: Fri Oct 05, 2018 6:33 pm

How To Use Array Loop in Imacros

Post by salmanno1 » Sat Oct 06, 2018 8:59 am

Code: Select all

-1
down vote
favorite
VERSION BUILD=1005 RECORDER=CR SET !ERRORIGNORE YES

URL GOTO=https://api.whatsapp.com/send?phone=923002021392&text=Great%20Offer%20For%20Karachites!%20Get%20a%20Free%20Squishy%20StressBall%20By%20Just%20Paying%20Rs%20200%20Delivery.%20Get%20your%20free%20Ball%20at:%20http://netlify.com/%20Have%20fun.

TAG POS=1 TYPE=A ATTR=TXT:Send WAIT SECONDS=10

TAG POS=1 TYPE=SPAN ATTR=DATA-ICON:send&&CLASS:

URL GOTO=https://api.whatsapp.com/send?phone=923002021397&text=Great%20Offer%20For%20Karachites!%20Get%20a%20Free%20Squishy%20StressBall%20By%20Just%20Paying%20Rs%20200%20Delivery.%20Get%20your%20free%20Ball%20at:%20http://netlify.com/%20Have%20fun. TAG POS=1 TYPE=A ATTR=TXT:Send

WAIT SECONDS=10

TAG POS=1 TYPE=SPAN ATTR=DATA-ICON:send&&CLASS:

URL GOTO=https://api.whatsapp.com/send?phone=923002025509&text=Great%20Offer%20For%20Karachites!%20Get%20a%20Free%20Squishy%20StressBall%20By%20Just%20Paying%20Rs%20200%20Delivery.%20Get%20your%20free%20Ball%20at:%20http://netlify.com/%20Have%20fun. TAG POS=1 TYPE=A ATTR=TXT:Send

WAIT SECONDS=10
I have a list of 1000 Numbers, and i cant add more than 50 lines, how can i use a array or loop As you see that link has different phone numbers, i want those number to be taken from array or txt files
chivracq
Posts: 7895
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How To Use Array Loop in Imacros

Post by chivracq » Sat Oct 06, 2018 11:56 pm

salmanno1 wrote: -1
down vote
favorite

Code: Select all

VERSION BUILD=1005 
RECORDER=CR 
SET !ERRORIGNORE YES

URL GOTO=https://api.whatsapp.com/send?phone=923002021392&text=Great%20Offer%20For%20Karachites!%20Get%20a%20Free%20Squishy%20StressBall%20By%20Just%20Paying%20Rs%20200%20Delivery.%20Get%20your%20free%20Ball%20at:%20http://netlify.com/%20Have%20fun.

TAG POS=1 TYPE=A ATTR=TXT:Send WAIT SECONDS=10

TAG POS=1 TYPE=SPAN ATTR=DATA-ICON:send&&CLASS:

URL GOTO=https://api.whatsapp.com/send?phone=923002021397&text=Great%20Offer%20For%20Karachites!%20Get%20a%20Free%20Squishy%20StressBall%20By%20Just%20Paying%20Rs%20200%20Delivery.%20Get%20your%20free%20Ball%20at:%20http://netlify.com/%20Have%20fun. TAG POS=1 TYPE=A ATTR=TXT:Send

WAIT SECONDS=10

TAG POS=1 TYPE=SPAN ATTR=DATA-ICON:send&&CLASS:

URL GOTO=https://api.whatsapp.com/send?phone=923002025509&text=Great%20Offer%20For%20Karachites!%20Get%20a%20Free%20Squishy%20StressBall%20By%20Just%20Paying%20Rs%20200%20Delivery.%20Get%20your%20free%20Ball%20at:%20http://netlify.com/%20Have%20fun. TAG POS=1 TYPE=A ATTR=TXT:Send

WAIT SECONDS=10
I have a list of 1000 Numbers, and i cant add more than 50 lines, how can i use a array or loop As you see that link has different phone numbers, i want those number to be taken from array or txt files
Yeah, no need to open Duplicates, I guess you understood... :wink:

The Copy&Paste from your Thread on SOF is a bit "messy" btw, you may want to edit a bit your Post to "clean" it a bit, like I did already in my Quote... :idea:

FCIM...! :mrgreen: (Read my Sig...)
=> iMacros for CR v10.0.5, 'Free', CR68/69...?, OS...?

Hum, and you could add a Question Mark to your Thread Title, you are not sharing a 'How-To'...
(And correct Spelling is "iMacros" btw...)

Hum, I see you got a bit "lucky" on SOF, and Advanced User @Shugar already gave you a very neat Solution...:
Shugar on SOF wrote:You can try the following code:

Code: Select all

SET !VAR1 EVAL("array = [923002021392, 923002021397, 923002025509];")
SET !VAR1 EVAL("array[{{!LOOP}} - 1];")
URL GOTO=https://api.whatsapp.com/send?phone={{!VAR1}}&text=Great%20Offer%20For%20Karachites!%20Get%20a%20Free%20Squishy%20StressBall%20By%20Just%20Paying%20Rs%20200%20Delivery.%20Get%20your%20free%20Ball%20at:%20http://netlify.com/%20Have%20fun.
TAG POS=1 TYPE=A ATTR=TXT:Send
WAIT SECONDS=10
TAG POS=1 TYPE=SPAN ATTR=DATA-ICON:send&&CLASS:
Play this macro repeatedly (in loop mode).
Hope it helps.
I say "lucky" because I wouldn't help you "personally" with this Script as I consider the Intent of your Script to be "spamming" those poor Users, and I don't help for Spam..., ah-ah...! :shock:

But @Shugar's Solution is very neat..., even if he made a "Mistake", but I guess he will notice it himself and will probably correct it...
I use that Functionality as well myself in a few of my own Scripts, (even if I still use some "previous" Version of iMacros (for FF) (=> v8.8.2) which doesn't have all the Limitations like in v10.x for CR/FF), but I have implemented it in a slightly different way, but the main "Principle" is the same, and I might even combine a bit my own "Implementation" with @Shugar's, that could lead to some "Simplifications" in a few Cases, ah-ah...! 8)

From using the 'Free' iMacros for FF Version, you will still be limited to the Max Loops = 100, and you'll therefore have to run your Script in Bunches of 100 Loops but I guess, you'll already be "happy" with that, but if you are a bit "creative", you could combine @Shugar's Solution with maybe repeating the Block of Code say, maybe 5 times, to remain below the 50 Line Limitation and add some 'Modulo[5]' Functionality to the Array, which would already take you to 500 Loops instead of 100... :idea:

And otherwise, you can always "upgrade" to the 'PE' Version, for which you then don't have the 50-Line + 100-Loop 'Freeware' Limitations, and you could even use a '.CSV' directly as Input DataSource...

>>>

But hum, I had a "closer" look at @Shugar's Solution, and tried to adapt his Script to "correct" his Mistake, but hum..., it's not as "straightforward" as I first thought, and I hit some same "not exactly expected Result/Behaviour" like I had noticed when I had done my own Implementation of that Functionality and which was the Reason why I chose for "my" "slightly different" way, ah-ah...!

I'll keep following your Thread on SOF, I'll be "curious" to see how he will "solve" it, and I then wouldn't be surprised if he "follows" the same way like I did, hum, this is getting "interesting" though, ah-ah...! :D

EDIT:
Hum, no, it's OK, I managed with some very "minimal" Editing to get his Solution to work... OK, good News for you I guess then..., and I'm glad I don't have a 'Jazz Pakistan' Mobile Nb, ah-ah...! :wink:
- (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: 7895
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How To Use Array Loop in Imacros

Post by chivracq » Tue Oct 09, 2018 1:19 am

Mini-Update... (from SOF)..., @Shugar has indeed edited his Sol to correct the "mini-Mistake", in the same way like I did in my "mini-Edit" I mentioned in the 'EDIT' part at the end of my previous Post...:
Shugar on SOF wrote:

Code: Select all

SET !VAR1 EVAL("[923002021392, 923002021397, 923002025509][{{!LOOP}} - 1];")
No follow-up from @OP though, on both Forums... :shock:
- (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...
Post Reply