Skip to content

Instantly share code, notes, and snippets.

@deptno
Last active August 29, 2015 14:27
Show Gist options
  • Save deptno/5312a0219a523472dd8a to your computer and use it in GitHub Desktop.
Save deptno/5312a0219a523472dd8a to your computer and use it in GitHub Desktop.
!function(msec, count) {
function tcafe(msec) {
function simulateKeyPress(character, element) {
var e = $.Event('keypress');
e.which = 13;
$(element).trigger(e);
}
var text = $('#tzStr').text()
var target = $(".ment_show")[0];
var i = 0;
var timer = setInterval(function() {
target.value = text.substr(0, i++);
http.keyUp();
http.chkMiss();
http.chkTime();
if (i > text.length) {
clearInterval(timer);
setTimeout(function() {
simulateKeyPress(null, document);
setTimeout(function() {
if (count-- > 0) {
tcafe(msec);
}
}, 100);
}, 100);
}
}, msec || 75);
}
window.tcafe = tcafe;
tcafe(msec);
}(null, 10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment