iMacro how to call function from a central place?

Scorpion Ghost

Elite Member
Executive VIP
Jr. VIP
Joined
Mar 22, 2013
Messages
8,706
Reaction score
10,271
Guys I need help with something that should be very simple. I'm using iMacros 8.9.7 with Firefox.

I have a script, say:

do action 1
do action 1
do action 1
do action 1
do action 1

Now, say it does this 30 times (30 lines) for the month. But next month I want to change it to "do action 2"

Instead of having to edit 30 lines of code, I wanna make it something like:

SET !VAR1 EVAL("1")

do action {{!VAR1}}
do action {{!VAR1}}
do action {{!VAR1}}
do action {{!VAR1}}
do action {{!VAR1}}

And then I can just edit the first line and change the number when I need.

I could probably explain this better, but you know what I'm talking about.

How can I do this?
 
I tried this:

Code:
SET !VAR3 EVAL("%3")

TAG POS=1 TYPE=SELECT ATTR=ID:nxs_mm CONTENT={{!VAR3}}

Doesn't work.
 
Hamm, figured it out.

I think a pretty shitty solution, completely not elegant, but, as long as it gets the job done.

Code:
SET !VAR1 EVAL("var min = 3; var max = 3; var randomNumber = Math.floor(Math.random() * (max - min + 1)) + min; randomNumber;")

TAG POS=1 TYPE=SELECT ATTR=ID:nxs_mm CONTENT=%{{!VAR1}}

Gross I know :D
 
Back
Top