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

Commit

Permalink
Added support for Bing Typing Test and normalized variable names.
Browse files Browse the repository at this point in the history
  • Loading branch information
MysteryBlokHed committed Feb 12, 2020
1 parent 6bc3e07 commit c4178dc
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 47 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ As of now, the sites that work are:
- [10FastFingers](https://10fastfingers.com/) (Normal tests and [custom text](https://10fastfingers.com/text-practice/new))
- [TypeRacer](https://play.typeracer.com/)
- [TypingTestNow](https://typingtestnow.com/)
- [Bing Typing Test](https://www.bing.com/search?q=typing+test)

I am planning to add support for more.

Expand All @@ -30,6 +31,7 @@ If you go too fast, an alert box will appear saying that they believe you have c
### If you're using `typecheat-button.min.js`
On **10FastFingers**, the button appears just **below** the text field.
On **TypeRacer**, the button appears **in the navbar** above the "Blog, Forum, Pit Stop, About" buttons.
On **TypingTestNow**, the button appears at the **top of the page** just under the navbar.
On **TypingTestNow**, the button appears at the **top of the page** just under the navbar.
On **Bing Typing Test**, the button appears in the typing test item **to the right of** the "Typing test" heading.

**Note: On 10FastFingers, if you end up going through the entire text, the words will continue to autofill. If you continue to press space it can cause you to get incorrect words marked, despite the text being over.**
**Note: On 10FastFingers, if you end up going through the entire text, the words will continue to autofill. If you continue to press space it can cause you to get incorrect words marked, despite the text being over.**
82 changes: 61 additions & 21 deletions typecheat-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,26 @@ if(url == "10fastfingers.com" || url == "www.10fastfingers.com") {
} else if(url == "typingtestnow.com" || url == "www.typingtestnow.com") {
console.log("~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: TypingTestNow\n~~~~~~~~~~~~~~~~~~~");
site = 2;
} else if(url == "www.bing.com" || url == "bing.com") {
console.log("~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: Bing Test\n~~~~~~~~~~~~~~~~~~~");
site = 3;
}

// Variables
let tText, tWords, cWord, tField;

// 10FastFingers Cheat Code
function tenFastCheat() {
// Generate wordlist
let tText = document.getElementById("row1");
let tWords = [];
tText = document.getElementById("row1");
tWords = [];
for(let i = 0; i < tText.children.length; i++) {
tWords.push(tText.children[i].innerText);
}
// Interval
let cWord = 0;
cWord = 0;
// Different method for different modes
let tField = null;
tField = null;
if(altMode == 0) {
tField = document.getElementById("inputfield");
} else if(altMode == 1) {
Expand All @@ -78,15 +84,15 @@ function tenFastCheat() {
// TypeRacer Cheat Code
function typeRacerCheat() {
// Generate wordlist
let textElement = document.querySelector("#gwt-uid-15 > table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(1) > td > table > tbody > tr:nth-child(1) > td");
let wordlist = textElement.innerText.split(" ");
tText = document.querySelector("#gwt-uid-15 > table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(1) > td > table > tbody > tr:nth-child(1) > td");
tWords = tText.innerText.split(" ");
// Interval
let crWord = 0;
let textField = document.querySelector("#gwt-uid-15 > table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(2) > td > input");
textField.addEventListener("keydown", function(e) {
cWord = 0;
tField = document.querySelector("#gwt-uid-15 > table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(2) > td > input");
tField.addEventListener("keydown", function(e) {
if(e.keyCode == 32) {
textField.value = wordlist[crWord];
crWord++;
tField.value = tWords[cWord];
cWord++;
}
});
// Change button colour to show that it has activated
Expand All @@ -96,26 +102,55 @@ function typeRacerCheat() {
// TypingTestNow Cheat Code
function typingTestNowCheat() {
// Generate wordlist
let text = document.getElementsByClassName("sample-text")[0];
let words = [];
for(let i = 0; i < text.children.length; i++) {
for(let j = 0; j < text.children[i].children.length; j++) {
words.push(text.children[i].children[j].innerText);
tText = document.getElementsByClassName("sample-text")[0];
tWords = [];
for(let i = 0; i < tText.children.length; i++) {
for(let j = 0; j < tText.children[i].children.length; j++) {
words.push(tText.children[i].children[j].innerText);
}
}
// Interval
var i = 0;
let field = document.getElementById("practice-input");
field.addEventListener("keydown", function(e) {
cWord = 0;
tField = document.getElementById("practice-input");
tField.addEventListener("keydown", function(e) {
if(e.keyCode == 32) {
field.value = words[i];
i++;
tField.value = tWords[cWord];
cWord++;
}
});
// Change button colour to show that it has activated
document.getElementsByClassName("row")[0].children[0].style = "width: 100%; color: #0F0;";
}

// Bing Typing Test Cheat Code
function bingCheat() {
// Generate wordlist
tText = document.getElementById("edu_promptText");
tWords = [];
let workWord = "";
for(let i = 0; i < tText.children.length; i++) {
for(let j = 0; j < tText.children[i].children.length; j++) {
if(tText.children[i].children[j].className == "space") {
tWords.push(workWord);
workWord = "";
} else {
workWord += tText.children[i].children[j].innerText;
}
}
}
// Interval
cWord = 0;
tField = document.getElementById("edu_inputText");
tField.addEventListener("keydown", function(e) {
if(e.keyCode == 32) {
tField.value += tWords[cWord];
cWord++;
}
});
// Change button colour to show that it has activated
document.getElementById("edu_answer").children[0].children[0].getElementsByTagName("button")[0].style = "color: #0F0;";
}

// Cheat
switch(site) {
// 10FastFingers (Normal)
Expand All @@ -133,4 +168,9 @@ switch(site) {
// Create cheat button
document.getElementsByClassName("row")[0].innerHTML = "<button style=\"width: 100%;\" onclick=\"javascript:typingTestNowCheat();\">Start TypeCheat</button>"
break;
// Bing Typing Test
case 3:
// Create cheat button
document.getElementById("edu_answer").children[0].children[0].innerHTML += "<button onclick=\"javascript:bingCheat();\">Start TypeCheat</button>";
break;
}
2 changes: 1 addition & 1 deletion typecheat-button.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 52 additions & 22 deletions typecheat.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,28 @@ if(url == "10fastfingers.com" || url == "www.10fastfingers.com") {
} else if(url == "typingtestnow.com" || url == "www.typingtestnow.com") {
console.log("~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: TypingTestNow\n~~~~~~~~~~~~~~~~~~~");
site = 2;
} else if(url == "www.bing.com" || url == "bing.com") {
console.log("~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: Bing Test\n~~~~~~~~~~~~~~~~~~~");
site = 3;
}

// Variables
let tText, tWords, cWord, tField;

// Cheat
switch(site) {
// 10FastFingers (Normal)
case 0:
console.log("BROKEN");
// Generate wordlist
let tText = document.getElementById("row1");
let tWords = [];
tText = document.getElementById("row1");
tWords = [];
for(let i = 0; i < tText.children.length; i++) {
tWords.push(tText.children[i].innerText);
}
// Interval
let cWord = 0;
cWord = 0;
// Different method for different modes
let tField = null;
tField = null;
if(altMode == 0) {
tField = document.getElementById("inputfield");
} else if(altMode == 1) {
Expand All @@ -61,36 +66,61 @@ switch(site) {
// TypeRacer
case 1:
// Generate wordlist
let textElement = document.querySelector("#gwt-uid-15 > table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(1) > td > table > tbody > tr:nth-child(1) > td");
let wordlist = textElement.innerText.split(" ");
tText = document.querySelector("#gwt-uid-15 > table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(1) > td > table > tbody > tr:nth-child(1) > td");
tWords = tText.innerText.split(" ");
// Interval
let crWord = 0;
let textField = document.querySelector("#gwt-uid-15 > table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(2) > td > input");
textField.addEventListener("keydown", function(e) {
cWord = 0;
tField = document.querySelector("#gwt-uid-15 > table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(2) > td > input");
tField.addEventListener("keydown", function(e) {
if(e.keyCode == 32) {
textField.value = wordlist[crWord];
crWord++;
tField.value = tWords[cWord];
cWord++;
}
});
break;
// TypingTestNow
case 2:
// Generate wordlist
let text = document.getElementsByClassName("sample-text")[0];
let words = [];
for(let i = 0; i < text.children.length; i++) {
for(let j = 0; j < text.children[i].children.length; j++) {
words.push(text.children[i].children[j].innerText);
tText = document.getElementsByClassName("sample-text")[0];
tWords = [];
for(let i = 0; i < tText.children.length; i++) {
for(let j = 0; j < tText.children[i].children.length; j++) {
words.push(tText.children[i].children[j].innerText);
}
}
// Interval
let i = 0;
let field = document.getElementById("practice-input");
field.addEventListener("keydown", function(e) {
cWord = 0;
tField = document.getElementById("practice-input");
tField.addEventListener("keydown", function(e) {
if(e.keyCode == 32) {
field.value = words[i];
i++;
tField.value = tWords[cWord];
cWord++;
}
});
break;
// Bing Typing Test
case 3:
// Generate wordlist
tText = document.getElementById("edu_promptText");
tWords = [];
let workWord = "";
for(let i = 0; i < tText.children.length; i++) {
for(let j = 0; j < tText.children[i].children.length; j++) {
if(tText.children[i].children[j].className == "space") {
tWords.push(workWord);
workWord = "";
} else {
workWord += tText.children[i].children[j].innerText;
}
}
}
// Interval
cWord = 0;
tField = document.getElementById("edu_inputText");
tField.addEventListener("keydown", function(e) {
if(e.keyCode == 32) {
tField.value += tWords[cWord];
cWord++;
}
});
}
Loading

0 comments on commit c4178dc

Please sign in to comment.