Skip to content
This repository was archived by the owner on Jul 2, 2021. It is now read-only.

Commit 008103e

Browse files
Added support for TypingTestNow.
1 parent 9157d31 commit 008103e

File tree

3 files changed

+72
-39
lines changed

3 files changed

+72
-39
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
A JS script to cheat on certain online typing tests.
33

44
## Supported sites
5+
As of now, the sites that work are:
56
- [10FastFingers](https://10fastfingers.com/)
67
<!-- - [Ratatype](https://www.ratatype.com/) -->
78
<!-- ^^^WIP^^^ -->
9+
- [TypingTestNow](https://typingtestnow.com/)
10+
811
I am planning to add support for more.
912

1013
## Use

typecheat.js

Lines changed: 68 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -24,49 +24,79 @@ if(url == "10fastfingers.com" || url == "www.10fastfingers.com") {
2424
console.log("Site: 10FastFingers");
2525
console.log("~~~~~~~~~~~~~~~~~~~");
2626
site = 0;
27-
}
2827
// ---------- WIP ----------
29-
// else if(url == "www.ratatype.com"|| url == "ratatype.com") {
28+
// } else if(url == "www.ratatype.com"|| url == "ratatype.com") {
3029
// console.log("~~~~~~~~~~~~~~~~~~~");
3130
// console.log(" TypeCheat Active! ");
3231
// console.log("Site: Ratatype");
3332
// console.log("~~~~~~~~~~~~~~~~~~~");
3433
// site = 1;
35-
// }
34+
} 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("~~~~~~~~~~~~~~~~~~~");
39+
site = 2;
40+
}
3641

37-
// Start cheating
38-
if(site == 0) {
39-
// Interval
40-
let cWord = 0;
41-
// Make sure to constantly update the field
42-
setInterval(function() {
43-
if(document.getElementById("inputfield").value == "") {
44-
document.getElementById("inputfield").value = words[cWord];
45-
cWord++;
42+
// Cheat
43+
switch(site) {
44+
// 10FastFingers
45+
case 0:
46+
// Interval
47+
let cWord = 0;
48+
// Make sure to constantly update the field
49+
setInterval(function() {
50+
if(document.getElementById("inputfield").value == "") {
51+
document.getElementById("inputfield").value = words[cWord];
52+
cWord++;
53+
}
54+
}, 10);
55+
break;
56+
// ---------- 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
81+
case 2:
82+
// Generate wordlist
83+
let text = document.getElementsByClassName("sample-text")[0];
84+
let words = [];
85+
for(let i = 0; i < text.children.length; i++) {
86+
for(let j = 0; j < text.children[i].children.length; j++) {
87+
words.push(text.children[i].children[j].innerText);
88+
}
4689
}
47-
}, 10);
48-
}
49-
// ---------- WIP ----------
50-
// else if(site == 1) {
51-
// // Generate wordlist
52-
// let text = document.getElementsByClassName("mainTxt")[0];
53-
// let field = document.getElementsByClassName("divTextarea")[0].children[0];
54-
// let words = [];
55-
// for(let i = 0; i < text.children.length; i++) {
56-
// if(text.children[i].innerText != " ") {
57-
// words.push(text.children[i].innerText);
58-
// }
59-
// }
60-
// console.log(words);
61-
// let i = 1;
62-
// field.value = words[0];
63-
// // Make sure to constantly update the field
64-
// setInterval(function() {
65-
// if(field.value.slice(-1) == " " || !field.value.includes(words[i])) {
66-
// field.value += words[i];
67-
// // Make sure that the word was actually added to the text field
68-
// if(field.value.includes(words[i])) i++;
69-
// console.log(field.value.includes(words[i]));
70-
// }
71-
// }, 10);
72-
// }
90+
console.log(words);
91+
// Interval
92+
let i = 0;
93+
// Make sure to constantly update the field
94+
let field = document.getElementById("practice-input");
95+
setInterval(function() {
96+
if(field.value == " " || field.value == "") {
97+
field.value = words[i];
98+
i++;
99+
}
100+
}), 10;
101+
break;
102+
}

typecheat.min.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
* You should have received a copy of the GNU General Public License
1616
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1717
*/
18-
let url=window.location.href.split("/")[2],site=-1;if("10fastfingers.com"!=url&&"www.10fastfingers.com"!=url||(console.log("~~~~~~~~~~~~~~~~~~~"),console.log(" TypeCheat Active! "),console.log("Site: 10FastFingers"),console.log("~~~~~~~~~~~~~~~~~~~"),site=0),0==site){let e=0;setInterval(function(){""==document.getElementById("inputfield").value&&(document.getElementById("inputfield").value=words[e],e++)},10)}
18+
let url=window.location.href.split("/")[2],site=-1;switch("10fastfingers.com"==url||"www.10fastfingers.com"==url?(console.log("~~~~~~~~~~~~~~~~~~~"),console.log(" TypeCheat Active! "),console.log("Site: 10FastFingers"),console.log("~~~~~~~~~~~~~~~~~~~"),site=0):"typingtestnow.com"!=url&&"www.typingtestnow.com"!=url||(console.log("~~~~~~~~~~~~~~~~~~~"),console.log(" TypeCheat Active! "),console.log("Site: TypingTestNow"),console.log("~~~~~~~~~~~~~~~~~~~"),site=2),site){case 0:let e=0;setInterval(function(){""==document.getElementById("inputfield").value&&(document.getElementById("inputfield").value=l[e],e++)},10);break;case 2:let t=document.getElementsByClassName("sample-text")[0],l=[];for(let e=0;e<t.children.length;e++)for(let n=0;n<t.children[e].children.length;n++)l.push(t.children[e].children[n].innerText);console.log(l);let n=0,o=document.getElementById("practice-input");setInterval(function(){" "!=o.value&&""!=o.value||(o.value=l[n],n++)})}

0 commit comments

Comments
 (0)