This repository has been archived by the owner on Jul 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtypecheat.js
230 lines (228 loc) · 7.83 KB
/
typecheat.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
/*
* TypeCheat - A JS script to cheat on certain online typing tests
* Copyright (C) 2020 hackermancool
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
// Check current site
let url = window.location.href.split('/')[2].replace('www.', '');
let site = -1;
let altMode = 0;
switch(url) {
case '10fastfingers.com':
console.log('~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: 10FastFingers\n~~~~~~~~~~~~~~~~~~~');
site = 0;
if(window.location.href.split('/')[3] == 'text') altMode = 1;
break;
case 'typeracer.com':
case 'play.typeracer.com':
console.log('~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: TypeRacer\n~~~~~~~~~~~~~~~~~~~');
site = 1;
break;
case 'typingtestnow.com':
console.log('~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: TypingTestNow\n~~~~~~~~~~~~~~~~~~~');
site = 2;
break;
case 'bing.com':
console.log('~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: Bing Test\n~~~~~~~~~~~~~~~~~~~');
site = 3;
break;
case 'livechat.com':
console.log('~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: LiveChat\n~~~~~~~~~~~~~~~~~~~');
site = 4;
break;
case 'quicktypingtest.com':
console.log(' ~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: QuickTypingTest\n ~~~~~~~~~~~~~~~~~~~');
site = 5;
break;
case 'typing-speed-test.aoeu.eu':
console.log('~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: AOEU Test\n~~~~~~~~~~~~~~~~~~~');
site = 6;
break;
case 'indiatyping.com':
console.log('~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: India Typing\n~~~~~~~~~~~~~~~~~~~');
site = 7;
break;
}
// Variables
let tText, tWords, cWord, tField, workWord;
// Cheat
switch(site) {
// 10FastFingers (Normal)
case 0:
// Generate wordlist
tText = document.getElementById('row1');
tWords = [];
for(let i = 0; i < tText.children.length; i++) {
tWords.push(tText.children[i].innerText);
}
// Cheat
cWord = 0;
// Different method for different modes
tField = null;
if(altMode == 0) {
tField = document.getElementById('inputfield');
} else if(altMode == 1) {
tField = document.getElementById('text_typed');
}
tField.addEventListener('keyup', function(e) {
if(e.keyCode == 32) {
tField.value = tWords[cWord];
cWord++;
}
});
break;
// TypeRacer
case 1:
// Generate wordlist
tText = document.querySelector('.inputPanel').firstChild.firstChild.firstChild.firstChild.firstChild.firstChild;
tWords = tText.innerText.split(' ');
// Cheat
cWord = 0;
tField = document.querySelector('.txtInput');
tField.addEventListener('keydown', function(e) {
if(e.keyCode == 32) {
tField.value = tWords[cWord];
cWord++;
}
});
break;
// TypingTestNow
case 2:
// Generate wordlist
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++) {
tWords.push(tText.children[i].children[j].innerText);
}
}
// Cheat
cWord = 0;
tField = document.getElementById('practice-input');
tField.addEventListener('keydown', function(e) {
if(e.keyCode == 32) {
tField.value = tWords[cWord];
cWord++;
}
});
break;
// Bing Typing Test
case 3:
// Generate wordlist
tText = document.getElementById('edu_promptText');
tWords = [];
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;
}
}
}
// Cheat
cWord = 0;
tField = document.getElementById('edu_inputText');
tField.addEventListener('keydown', function(e) {
if(e.keyCode == 32) {
tField.value += tWords[cWord];
cWord++;
}
});
break;
// LiveChat
case 4:
// Generate wordlist
tText = document.getElementsByClassName('tst-input-wrapper')[1];
tWords = [];
for(let i = 0; i < tText.children.length; i++) {
tWords.push(tText.children[i].innerText);
}
// Cheat
cWord = 0;
tField = document.getElementById('test-input');
tField.addEventListener('keydown', function(e) {
if(e.keyCode == 32) {
tField.innerText = tWords[cWord];
cWord++;
// The wordlist constantly updates
if(tText.lastChild.innerText != tWords.slice(-1)) {
tWords.push(tText.lastChild.innerText);
}
}
});
break;
// QuickTypingTest
case 5:
// Generate wordlist
tText = document.querySelector('#text-display');
tWords = [];
workWord = '';
for(let i = 0; i < tText.children.length; i++) {
workWord = '';
for(let j = 0; j < tText.children[i].children.length; j++) {
workWord += tText.children[i].children[j].innerText;
}
tWords.push(workWord);
}
// Cheat
cWord = 0;
tField = document.getElementById('text-input');
tField.addEventListener('keydown', function(e) {
if(e.keyCode == 32) {
tField.value += tWords[cWord];
cWord++;
}
});
break;
// AOEU Typing Speed Test
case 6:
// Generate wordlist
tText = document.getElementById('words');
tWords = [];
for(let i = 0; i < tText.children.length; i++) {
tWords.push(tText.children[i].innerText);
}
// Cheat
cWord = 0;
tField = document.getElementById('input');
tField.addEventListener('keyup', function(e) {
if(e.keyCode == 32) {
tField.value = tWords[cWord];
cWord++;
}
});
break;
// India Typing
case 7:
// Generate wordlist
tText = document.getElementById('blockrandom').contentDocument.getElementById('unicodeText');
tWords = [];
for(let i = 0; i < tText.children.length; i++) {
tWords.push(tText.children[i].innerText);
}
// Cheat
cWord = 0;
tField = document.getElementById('blockrandom').contentDocument.getElementById('toType');
tField.addEventListener('keyup', function(e) {
if(e.keyCode == 32) {
tField.value += tWords[cWord];
cWord++;
}
});
break;
}