Skip to content

Instantly share code, notes, and snippets.

@Domiii
Last active June 11, 2024 21:56
Show Gist options
  • Save Domiii/52cf49d780ec8c9f01771973c36197af to your computer and use it in GitHub Desktop.
Save Domiii/52cf49d780ec8c9f01771973c36197af to your computer and use it in GitHub Desktop.
This script types for you automatically on www.typingclub.com: 1. Open the website 2. Blaze past the tutorials 3. Go into a level 4. Open Console 5. Paste the script and press ENTER
/**
* This script types for you automatically on www.typingclub.com:
* 1. Open the website
* 2. Blaze past the tutorials
* 3. Go into a level
* 4. Open Console
* 5. Paste the script and press ENTER
*/
// NOTE: When delay (in ms between two strokes) is too low, the site might bug out and the result page will not be shown
const minDelay = 60;
const maxDelay = 60;
const keyOverrides = {
[String.fromCharCode(160)]: ' ' // convert hardspace to normal space
};
function getTargetCharacters() {
const els = Array.from(document.querySelectorAll('.token span.token_unit'));
const chrs = els
.map(el => {
// get letter to type from each letter DOM element
if (el.firstChild?.classList?.contains('_enter')) {
// special case: ENTER
return '\n';
}
let text = el.textContent[0];
return text;
})
.map(c => keyOverrides.hasOwnProperty(c) ? keyOverrides[c] : c); // convert special characters
return chrs;
}
function recordKey(chr) {
// send it straight to the internal API
window.core.record_keydown_time(chr);
}
function sleep(ms) {
return new Promise(r => setTimeout(r, ms));
}
async function autoPlay(finish) {
const chrs = getTargetCharacters();
for (let i = 0; i < chrs.length - (!finish); ++i) {
const c = chrs[i];
recordKey(c);
//console.log(c, c.charCodeAt());
await sleep(Math.random() * (maxDelay - minDelay) + minDelay);
}
}
// ############################################################################################################
// old utilities
// ############################################################################################################
// /**
// * @see https://stackoverflow.com/questions/8942678/keyboardevent-in-chrome-keycode-is-0/12522752#12522752
// */
// function simulateKey(chr, el) {
// _simulateKey(chr, 'keydown', el);
// _simulateKey(chr, 'keypress', el);
// }
// function _simulateKey(chr, type, el) {
// var eventObj = document.createEventObject ?
// document.createEventObject() : document.createEvent("Events");
// if (eventObj.initEvent) {
// eventObj.initEvent(type || "keydown", true, true);
// }
// let keyCode = chr.charCodeAt(0);
// eventObj.key = chr[0];
// eventObj.keyCode = keyCode;
// eventObj.which = keyCode;
// eventObj.isTrusted = true;
// el = el || document.body;
// // console.log(keyCode, eventObj);
// el.dispatchEvent ? el.dispatchEvent(eventObj) : el.fireEvent("onkeydown", eventObj);
// }
// document.addEventListener("keydown", function (e) {
// console.log('down', e);
// });
// document.addEventListener("keypress", function (e) {
// console.log('press', e);
// });
//$($('.menu-btn')[0].parentNode).prepend('<button onclick=\'simulateKeyPress("c")\'>sim</button>');
// simulateKey('a', $('input')[0]);
// ############################################################################################################
// go!
// ############################################################################################################
autoPlay(true);
@GlizxyBoi
Copy link

It doesn't work on minigames

k well it doesn't work on anything

Works for me except for minigames

how??

It just types the stuff for you. Idk why it doesn’t work for you.

send a screen recording of u doing it

@NohioOso
Copy link

is there anyway to change the accuracy

@GlizxyBoi
Copy link

can yall make smash karts cheats?? pls

@ygom3001
Copy link

ygom3001 commented Mar 6, 2023

t6.fmyizshvhdvn

@ygom3001
Copy link

ygom3001 commented Mar 6, 2023

this is good game bro

@GlizxyBoi
Copy link

this is good game bro

what game and is there cheats for smash karts

@Emerald-Wither
Copy link

Emerald-Wither commented Mar 7, 2023

any way to change to WPM?

yes, all you have to do it change the max and min internal, i have mine from 95-250, works like a charm

Where in the code does it say that?

// NOTE: When delay (in ms between two strokes) is too low, the site might bug out and the result page will not be shown
const minDelay = 60;
const maxDelay = 60;

The lower the numbers, the faster the wpm.

@g3b0800
Copy link

g3b0800 commented Mar 23, 2023

could somebody make this but for the website klav.hu?

@zoypk
Copy link

zoypk commented May 4, 2023

can u include Auto enter after each level?

@J3J3boy
Copy link

J3J3boy commented Sep 29, 2023

I worked your code so that it always goes to the next level automatically.
send the code please it would really be helpful

@peoplehello
Copy link

Where do i paste the script?

go into element and change it to consotle and there is where is where you pase it

@D3ADK1LLSH0T
Copy link

@Guy0orSomeone You can change the wpm on the top in const minDelay and const maxDelay.

@izaohhi
Copy link

izaohhi commented Nov 20, 2023

I worked your code so that it always goes to the next level automatically.

Can you send the code please

@krissidh
Copy link

Thanks it helped

@krissidh
Copy link

// NOTE: When delay (in ms between two strokes) is too low, the site might bug out and the result page will not be shown
const minDelay = 60;
const maxDelay = 60;

const keyOverrides = {
[String.fromCharCode(160)]: ' ' // convert hardspace to normal space
};

function getTargetCharacters() {
const els = Array.from(document.querySelectorAll('.token span.token_unit'));
const chrs = els
.map(el => {
// get letter to type from each letter DOM element
if (el.firstChild?.classList?.contains('_enter')) {
// special case: ENTER
return '\n';
}
let text = el.textContent[0];
return text;
})
.map(c => keyOverrides.hasOwnProperty(c) ? keyOverrides[c] : c); // convert special characters
return chrs;
}

function recordKey(chr) {
// send it straight to the internal API
window.core.record_keydown_time(chr);
}

function sleep(ms) {
return new Promise(r => setTimeout(r, ms));
}

async function autoPlay(finish) {
const chrs = getTargetCharacters();
for (let i = 0; i < chrs.length - (!finish); ++i) {
const c = chrs[i];
recordKey(c);
//console.log(c, c.charCodeAt());
await sleep(Math.random() * (maxDelay - minDelay) + minDelay);
}
}

// ############################################################################################################
// old utilities
// ############################################################################################################

// /**
// * @see https://stackoverflow.com/questions/8942678/keyboardevent-in-chrome-keycode-is-0/12522752#12522752
// */
// function simulateKey(chr, el) {
// _simulateKey(chr, 'keydown', el);
// _simulateKey(chr, 'keypress', el);
// }
// function _simulateKey(chr, type, el) {
// var eventObj = document.createEventObject ?
// document.createEventObject() : document.createEvent("Events");

// if (eventObj.initEvent) {
// eventObj.initEvent(type || "keydown", true, true);
// }

// let keyCode = chr.charCodeAt(0);

// eventObj.key = chr[0];
// eventObj.keyCode = keyCode;
// eventObj.which = keyCode;
// eventObj.isTrusted = true;

// el = el || document.body;

// // console.log(keyCode, eventObj);

// el.dispatchEvent ? el.dispatchEvent(eventObj) : el.fireEvent("onkeydown", eventObj);
// }

// document.addEventListener("keydown", function (e) {
// console.log('down', e);
// });
// document.addEventListener("keypress", function (e) {
// console.log('press', e);
// });
//$($('.menu-btn')[0].parentNode).prepend('<button onclick='simulateKeyPress("c")'>sim');
// simulateKey('a', $('input')[0]);

// ############################################################################################################
// go!
// ############################################################################################################

autoPlay(true);

@ut0zz
Copy link

ut0zz commented Dec 4, 2023

I worked your code so that it always goes to the next level automatically.

can you send it??

@Powermna
Copy link

Powermna commented Jan 6, 2024

Sorry but how do i start the thing like what i copy and where i paste it please tell me what to come or put what i copy in chat thank you

@joeyo12344
Copy link

can you make an auto enter?

@aitorbaraibar
Copy link

thanks for the script! i use it every lesson and is very nice!!!

@aitorbaraibar
Copy link

lehengo mensajea nik ez dut idatzi, ez sinetsi faborez

@Mikelosle
Copy link

thanks for the script! i use it every lesson and is very nice!!!

@Mikelosle
Copy link

lehengo mensajea nik ez dut idatzi, ez sinetsi faborez

@KaneJKM
Copy link

KaneJKM commented Feb 29, 2024

For me this worked just not on the games. Now I'm #1 on the school leaderboard lmao

@yoboyscoob
Copy link

is there any way to make wpm faster?

@Mr-Beaf
Copy link

Mr-Beaf commented Apr 9, 2024

very useful and cool, works perfectly for me, but is there anyway to make it so you dont have to paste it in every time? im new to this stuff

@CAMTheGOAT10
Copy link

Everything is fine with the code except it doesn't work on mini games so you have to type those other than that it works.

@JkuwariX
Copy link

JkuwariX commented May 8, 2024

How can we make it work for Arabic writing? it just spams any writing and it keeps repeating because the accuracy isn't right

@ThePikminCaptain
Copy link

make it press enter automatically

@ThePikminCaptain
Copy link

// NOTE: When delay (in ms between two strokes) is too low, the site might bug out and the result page will not be shown const minDelay = 60; const maxDelay = 60;

const keyOverrides = { [String.fromCharCode(160)]: ' ' // convert hardspace to normal space };

function getTargetCharacters() { const els = Array.from(document.querySelectorAll('.token span.token_unit')); const chrs = els .map(el => { // get letter to type from each letter DOM element if (el.firstChild?.classList?.contains('_enter')) { // special case: ENTER return '\n'; } let text = el.textContent[0]; return text; }) .map(c => keyOverrides.hasOwnProperty(c) ? keyOverrides[c] : c); // convert special characters return chrs; }

function recordKey(chr) { // send it straight to the internal API window.core.record_keydown_time(chr); }

function sleep(ms) { return new Promise(r => setTimeout(r, ms)); }

async function autoPlay(finish) { const chrs = getTargetCharacters(); for (let i = 0; i < chrs.length - (!finish); ++i) { const c = chrs[i]; recordKey(c); //console.log(c, c.charCodeAt()); await sleep(Math.random() * (maxDelay - minDelay) + minDelay); } }

// ############################################################################################################ // old utilities // ############################################################################################################

// /** // * @see https://stackoverflow.com/questions/8942678/keyboardevent-in-chrome-keycode-is-0/12522752#12522752 // */ // function simulateKey(chr, el) { // _simulateKey(chr, 'keydown', el); // _simulateKey(chr, 'keypress', el); // } // function _simulateKey(chr, type, el) { // var eventObj = document.createEventObject ? // document.createEventObject() : document.createEvent("Events");

// if (eventObj.initEvent) { // eventObj.initEvent(type || "keydown", true, true); // }

// let keyCode = chr.charCodeAt(0);

// eventObj.key = chr[0]; // eventObj.keyCode = keyCode; // eventObj.which = keyCode; // eventObj.isTrusted = true;

// el = el || document.body;

// // console.log(keyCode, eventObj);

// el.dispatchEvent ? el.dispatchEvent(eventObj) : el.fireEvent("onkeydown", eventObj); // }

// document.addEventListener("keydown", function (e) { // console.log('down', e); // }); // document.addEventListener("keypress", function (e) { // console.log('press', e); // }); //$($('.menu-btn')[0].parentNode).prepend('sim'); // simulateKey('a', $('input')[0]);

// ############################################################################################################ // go! // ############################################################################################################

autoPlay(true);

doesnt work

@ThePikminCaptain
Copy link

I worked your code so that it always goes to the next level automatically.
where

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment