Page 1 of 1

How to delay Keystroke transmission?

Posted: Thu Jan 16, 2014 4:20 am
by BGood
Is there a way to introduce a delay between transmitted keystrokes (not between statements as in REPLAY SPEED)? I am having a problem with a particular website which senses keystroke transmission speed. The browser is IE9 and the iMacros script was written in iMacros 7. Thanks!

Re: How to delay Keystroke transmission?

Posted: Thu Jan 16, 2014 10:33 am
by chivracq
My 2 cts:
If you were using Firefox, you could try using the EVENT Mode and split the 'TYPE=KEYPRESS' Events Keystroke by Keystroke, adding eventually some mini-Wait Statements in-between or eventually some useless "heavy" "EVAL" or "URL GOTO=javascript:" Computing Statements instead..., or select/extract some useless Element on the Page just to loose a bit of time...

Using IE, you don't have EVENT Mode, but I would then try, lets say if you need to fill in some Input Field with let's say "mylogin", I would try to split it into several Statements by filling in the same Field several times with "m", then "my", then "myl", then "mylo", then "mylog", then "mylogi" and then "mylogin" and then you can add some extra Statement between them...

Re: How to delay Keystroke transmission?

Posted: Thu Jan 16, 2014 3:12 pm
by BGood
Thanks for the suggestion, chivracq. I remember vaguely that there was some provision to execute javascript in iMacros scripting, but I can't seem to find it now. Would that be another approach? Thanks.

Re: How to delay Keystroke transmission?

Posted: Thu Jan 16, 2014 7:17 pm
by chivracq
BGood wrote: I remember vaguely that there was some provision to execute javascript in iMacros scripting, but I can't seem to find it now.
Euh..., you don't need to remember anything, I already mentioned the 2 ways to execute some Javascript in an .iim Macro in my previous msg...:
"EVAL" and "URL GOTO=javascript:"
But that's just an idea to "occupy" the iMacros Runtime Engine and delay the Keystrokes...
You could use some fake Elements Tagging/Extracting on the Page as well... Or you can open a 2nd TAB and switch to and back from it...

Re: How to delay Keystroke transmission?

Posted: Thu Jan 16, 2014 8:37 pm
by BGood
Got it, thanks. I'm awake now.

Re: How to delay Keystroke transmission?

Posted: Fri Jan 17, 2014 12:47 pm
by chivracq
Hope you'll come back and post the Solution you will have retained in the end as I begin to see more and more Sites with Keystrokes (Speed) Checking and your Solution might come in handy for other Users...

Good luck in the meantime...!

Re: How to delay Keystroke transmission?

Posted: Fri Jan 17, 2014 3:41 pm
by BGood
chivracq,

I've been thinking about it a little, but js is not my native language. I haven't tested yet, or put it into the iMacros javascript: packaging with all the <sp> conversions, but what I have come up with is as follows:

Code: Select all

//function pace introduces 250ms char by char delay in entry of USERNAME
 setTimeout(pace("USERNAME"),250);
 function pace(s)
 {
	for(var i=0;i<s.length; i++)
	{
		var evt=document.createEvent("KeyboardEvent");
		evt.initKeyEvent (“keypress”, true, true, window, false, false, false, false, 0, s.charCodeAt (i));
		event_object.dispatchEvent (evt);
	}
 }
One of the iMacros postings on the subject also suggests that the event dispatch needs to be of the form:

Code: Select all

document.getElementById("USERNAMETEXTBOX").dispatchEvent(evt);
If you are a js afficianado, do you think this is the correct approach? I'll test it out when I have some more time.

Thanks!

Re: How to delay Keystroke transmission?

Posted: Mon Jan 20, 2014 12:47 am
by chivracq
Well, I'm definitely not a Javascript Guru, though I might have earned my first 20$ tonight thanks to Javascript:
http://forum.imacros.net/viewtopic.php?f=2&t=22333#p56363

... But from your last Post, I can tell that you go for the Nobel Price...!

My idea with Javascript was just to occupy the iMacros Runtime Engine for half a second between each Keystroke with some fake Navigation/Extraction/Javascript_Calculation...

Good idea for an Add-on, I would think...

Re: How to delay Keystroke transmission?

Posted: Mon Jan 20, 2014 3:16 pm
by BGood
I had no idea that being a lurker in the iOpus forums could be so lucrative. Definitely go for the Paypal account.

Re: How to delay Keystroke transmission?

Posted: Mon Jan 20, 2014 3:31 pm
by chivracq
BGood wrote:I had no idea that being a lurker in the iOpus forums could be so lucrative. Definitely go for the Paypal account.
And I learned a new word...:
Lurker - Wikipedia, the free encyclopedia
en.wikipedia.org/wiki/Lurker‎
In Internet culture, a lurker is typically a member of an online community who observes, but does not actively participate. The exact definition depends on context.
Hum..., I do participate on the Forum though...!

Re: How to delay Keystroke transmission?

Posted: Mon Jan 20, 2014 3:41 pm
by BGood
Sorry, my comment was not intended to be disparaging in any way. I should have said "key community activist and evangelist". :D

Re: How to delay Keystroke transmission?

Posted: Mon Jan 20, 2014 4:33 pm
by chivracq
BGood wrote:Sorry, my comment was not intended to be disparaging in any way. I should have said "key community activist and evangelist". :D
No need to be sorry, I took your Comment at a "positively slightly ironic with some touch of envy fun-level", but "iMacros activist and evangelist" does suit me better indeed, I would like to think...

I quite like your sense of humor btw...