IMacros + JavaScript

pierrecastor -  
Freedomsoul Posted messages 538 Status Membre -
Hello,

I just downloaded Imacro for Firefox in order to automate my reconnection to the internet. Let me explain: I'm connected to the internet through a Neuf hotspot. Upon startup, you land on a login page to gain access. I would like to automate this connection because I have to re-enter this password approximately every half hour.

Thanks to Imacro, when I get to the login page, I click on a bookmark, and voilà, it's magic.

But I would like to take it a step further with a JavaScript code running continuously like
If (url = login page) then "macro"
This would allow for a completely automated reconnection.

The macro looks like this:

VERSION BUILD=6030318 RECORDER=FX
TAB T=1
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:pc ATTR=NAME:username CONTENT=*****
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=NAME:pc ATTR=ID:cond CONTENT=YES
TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:pc ATTR=NAME:password CONTENT=******
TAG POS=1 TYPE=A ATTR=ID:submitpc&&TXT:Connexion<SP>!

And all I need is the if/then loop and how to make it run continuously.

I don't know anything about JavaScript, so if anyone could help me, that would be great.
Configuration: Windows XP Firefox 2.0.0.14

8 réponses

snarkpit29
 
So here's a little solution, friends.
1
Biggoude
 
With a very slight delay, here is the process to incorporate an (infinite) loop system with a macro:
You need to create a .js file (JavaScript file)
for example: ma_macro.js
then get a little understanding of JavaScript programming as well as a few commands specific to iMacro.
The JavaScript file serves as the launcher and it is the one that will run in a loop.
You then need to create another file, for example macro.iim which will contain the code to enter the login/pass and click where necessary.
Here is a small example of a .js file containing an infinite loop executing the macro made earlier in the subject:

ma_macro.js:

var retcode
while (1) {
retcode = iimPlay("macro.iim")
}

macro.iim:

VERSION BUILD=6030318 RECORDER=FX
TAB T=1
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:pc ATTR=NAME:username CONTENT=*****
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=NAME:pc ATTR=ID:cond CONTENT=YES
TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:pc ATTR=NAME:password CONTENT=******
TAG POS=1 TYPE=A ATTR=ID:submitpc&&TXT:Connexion<SP>!


All you have to do is click the iMacro button in Firefox to execute (play) this famous file ma_macro.js
Have a good day!
0
Pierrecastor Posted messages 10830 Registration date   Status Modérateur Last intervention   4 215 > Biggoude
 
Thank you very much for your clear and precise response.


Unfortunately, I no longer connect from nine, but it could be useful for quite a few other things.



--
As for these fierce soldiers, I say it, it's not to tattle, but all they do is roar in our campaigns.
0
romu19 > Biggoude
 
Je suis désolé, je ne peux pas vous aider avec ça.
0
bernie_liege
 
@ romu19

You know Romu, if you don't give more information and you don't ask specific questions, I really don't see why we should send a message.
One day, I also posted a message asking for a million or two euros, just a small amount as you can see, but there too, the mean and nasty people didn't want to know anything.

Oh cruel world!
0
Freedomsoul Posted messages 538 Status Membre 97
 
You set a WAIT SECONDS 3000 and you can click on "repeat X times"

this way every 3000 seconds, or just under an hour, it runs your script, and it will do it X times.
1
pierrecastor
 
So, no one? Please, can someone help me ;-)
0
pierrecastor
 
still no one to help a poor little guy?
0
pierrecastor
 
No? Still not?
0
al-sane
 
Hello,
I also want to do that... to automate my connection to nine... but if we realize that this is possible, then it will open a door to even greater possibilities... really very great ones, even.
0
Vieoli
 
Hi,

Try downloading Greasemonkey for Firefox instead ;) It works pretty well and since it’s directly JavaScript, it’s easier to do than to interfere with iMacro and JavaScript.

(There are links on userscript.org for automatic login).
0
Pierrecastor Posted messages 10830 Registration date   Status Modérateur Last intervention   4 215
 
Last Chance Up
--
As for those fierce soldiers, I say this not to inform, but they do nothing but roar in our fields.
-1