IMacros + JavaScript
pierrecastor
-
Freedomsoul Posted messages 538 Status Member -
Freedomsoul Posted messages 538 Status Member -
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.
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 answers
-
-
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! -
@ 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!
-
-
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. -
-
-
-
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. -
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). -
Last Chance Up
--
As for those fierce soldiers, I say this not to inform, but they do nothing but roar in our fields.