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

Commit cfb45db

Browse files
Fixed problems on 10FastFingers that stopped the script from working.
1 parent 008103e commit cfb45db

File tree

2 files changed

+37
-39
lines changed

2 files changed

+37
-39
lines changed

typecheat.js

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -19,65 +19,64 @@
1919
let url = window.location.href.split("/")[2];
2020
let site = -1;
2121
if(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
4334
switch(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

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;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++)})}
18+
var url=window.location.href.split("/")[2],site=-1;switch("10fastfingers.com"==url||"www.10fastfingers.com"==url?(console.log("~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: 10FastFingers\n~~~~~~~~~~~~~~~~~~~"),site=0):"typingtestnow.com"!=url&&"www.typingtestnow.com"!=url||(console.log("~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: TypingTestNow\n~~~~~~~~~~~~~~~~~~~"),site=2),site){case 0:for(var tText=document.getElementById("row1"),tWords=[],i=0;i<tText.children.length;i++)tWords.push(tText.children[i].innerText);var cWord=0;setInterval(function(){""==document.getElementById("inputfield").value&&(document.getElementById("inputfield").value=tWords[cWord],cWord++)},10);break;case 2:var text=document.getElementsByClassName("sample-text")[0],words=[];for(i=0;i<text.children.length;i++)for(var j=0;j<text.children[i].children.length;j++)words.push(text.children[i].children[j].innerText);i=0;var field=document.getElementById("practice-input");setInterval(function(){" "!=field.value&&""!=field.value||(field.value=words[i],i++)})}

0 commit comments

Comments
 (0)