1919let url = window . location . href . split ( "/" ) [ 2 ] ;
2020let site = - 1 ;
2121if ( url == "10fastfingers.com" || url == "www.10fastfingers.com" ) {
22- console . log ( "~~~~~~~~~~~~~~~~~~~" ) ;
23- console . log ( " TypeCheat Active! " ) ;
24- console . log ( "Site: 10FastFingers" ) ;
25- console . log ( "~~~~~~~~~~~~~~~~~~~" ) ;
22+ console . log ( "~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: 10FastFingers\n~~~~~~~~~~~~~~~~~~~" ) ;
2623 site = 0 ;
2724// ---------- WIP ----------
2825// } else if(url == "www.ratatype.com"|| url == "ratatype.com") {
29- // console.log("~~~~~~~~~~~~~~~~~~~");
30- // console.log(" TypeCheat Active! ");
31- // console.log("Site: Ratatype");
32- // console.log("~~~~~~~~~~~~~~~~~~~");
26+ // console.log("~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: Ratatype\n~~~~~~~~~~~~~~~~~~~");
3327// site = 1;
3428} else if ( url == "typingtestnow.com" || url == "www.typingtestnow.com" ) {
35- console . log ( "~~~~~~~~~~~~~~~~~~~" ) ;
36- console . log ( " TypeCheat Active! " ) ;
37- console . log ( "Site: TypingTestNow" ) ;
38- console . log ( "~~~~~~~~~~~~~~~~~~~" ) ;
29+ console . log ( "~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: TypingTestNow\n~~~~~~~~~~~~~~~~~~~" ) ;
3930 site = 2 ;
4031}
4132
4233// Cheat
4334switch ( site ) {
4435 // 10FastFingers
4536 case 0 :
37+ // Generate wordlist
38+ let tText = document . getElementById ( "row1" ) ;
39+ let tWords = [ ] ;
40+ for ( let i = 0 ; i < tText . children . length ; i ++ ) {
41+ tWords . push ( tText . children [ i ] . innerText ) ;
42+ }
4643 // Interval
4744 let cWord = 0 ;
4845 // Make sure to constantly update the field
4946 setInterval ( function ( ) {
5047 if ( document . getElementById ( "inputfield" ) . value == "" ) {
51- document . getElementById ( "inputfield" ) . value = words [ cWord ] ;
48+ document . getElementById ( "inputfield" ) . value = tWords [ cWord ] ;
5249 cWord ++ ;
5350 }
5451 } , 10 ) ;
5552 break ;
5653 // ---------- WIP ----------
57- // // Ratatype
58- // case 1:
59- // // Generate wordlist
60- // let text = document.getElementsByClassName("mainTxt")[0];
61- // let field = document.getElementsByClassName("divTextarea")[0].children[0];
62- // let words = [];
63- // for(let i = 0; i < text.children.length; i++) {
64- // if(text.children[i].innerText != " ") {
65- // words.push(text.children[i].innerText);
66- // }
67- // }
68- // let i = 1;
69- // field.value = words[0];
70- // // Make sure to constantly update the field
71- // setInterval(function() {
72- // if(field.value.slice(-1) == " " || !field.value.includes(words[i])) {
73- // field.value += words[i];
74- // // Make sure that the word was actually added to the text field
75- // if(field.value.includes(words[i])) i++;
76- // console.log(field.value.includes(words[i]));
77- // }
78- // }, 10);
79- // break;
80- // // TypingTestNow
54+ // Ratatype
55+ /*
56+ * case 1:
57+ * // Generate wordlist
58+ * let text = document.getElementsByClassName("mainTxt")[0];
59+ * let field = document.getElementsByClassName("divTextarea")[0].children[0];
60+ * let words = [];
61+ * for(let i = 0; i < text.children.length; i++) {
62+ * if(text.children[i].innerText != " ") {
63+ * words.push(text.children[i].innerText);
64+ * }
65+ * }
66+ * let i = 1;
67+ * field.value = words[0];
68+ * // Make sure to constantly update the field
69+ * setInterval(function() {
70+ * if(field.value.slice(-1) == " " || !field.value.includes(words[i])) {
71+ * field.value += words[i];
72+ * // Make sure that the word was actually added to the text field
73+ * if(field.value.includes(words[i])) i++;
74+ * console.log(field.value.includes(words[i]));
75+ * }
76+ * }, 10);
77+ * break;
78+ */
79+ // TypingTestNow
8180 case 2 :
8281 // Generate wordlist
8382 let text = document . getElementsByClassName ( "sample-text" ) [ 0 ] ;
@@ -87,7 +86,6 @@ switch(site) {
8786 words . push ( text . children [ i ] . children [ j ] . innerText ) ;
8887 }
8988 }
90- console . log ( words ) ;
9189 // Interval
9290 let i = 0 ;
9391 // Make sure to constantly update the field
0 commit comments