-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathSCRIPT.js
497 lines (455 loc) · 16.8 KB
/
SCRIPT.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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
const APP = {
ver: "1.2.0",
user: {
id: 0
},
cfg: {
mod: true,
auto: false,
questionSpoof: true,
darkMode: true,
autoSpeed: 750,
speedOptions: [750, 1000, 1250, 1500]
}
};
// Load external libraries
async function loadScript(url) {
const response = await fetch(url);
const script = await response.text();
eval(script);
}
async function loadCss(url) {
return new Promise(resolve => {
const link = document.createElement("link");
link.rel = "stylesheet";
link.type = "text/css";
link.href = url;
link.onload = resolve;
document.head.appendChild(link);
});
}
// Toast notification function
function sendToast(message, duration = 5000, position = "bottom") {
if (typeof Toastify !== 'undefined') {
Toastify({
text: message,
duration,
gravity: position,
position: "center",
stopOnFocus: true,
style: { background: "#000000" }
}).showToast();
} else {
console.log("Toast:", message);
}
}
// Audio player function
const playAudio = src => {
new Audio(src).play();
};
class UI {
static init() {
const _0x3d849d = document.createElement("div");
_0x3d849d.id = "khanDestroyer-panel";
Object.assign(_0x3d849d.style, {
position: "fixed",
top: "10px",
right: "15px",
width: "200px",
background: "linear-gradient(145deg, #1a1a1a, #111)",
borderRadius: "12px",
display: "flex",
flexDirection: "column",
padding: "12px",
zIndex: "9999",
boxShadow: "0 4px 15px rgba(0,0,0,0.3)",
border: "1px solid #333",
maxWidth: "90%"
});
_0x3d849d.innerHTML = `
<style>
.khandestroyer-header {
color: #fff;
font-size: 18px;
font-weight: bold;
text-align: center;
margin-bottom: 10px;
padding-bottom: 10px;
border-bottom: 1px solid #333;
cursor: pointer;
user-select: none;
display: flex;
justify-content: center;
align-items: center;
}
.khandestroyer-header:after {
content: "▼";
font-size: 12px;
margin-left: 5px;
transition: transform 0.3s ease;
}
.khandestroyer-header.collapsed:after {
transform: rotate(-90deg);
}
.khandestroyer-content {
transition: max-height 0.3s ease, opacity 0.3s ease;
max-height: 500px;
opacity: 1;
overflow: hidden;
}
.khandestroyer-content.collapsed {
max-height: 0;
opacity: 0;
}
.khandestroyer-version {
color: #666;
font-size: 12px;
font-weight: normal;
}
.khandestroyer-opt {
display: flex;
align-items: center;
justify-content: space-between;
color: #fff;
padding: 8px;
margin: 3px 0;
}
.switch {
position: relative;
display: inline-block;
width: 44px;
height: 22px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #333;
transition: .4s;
border-radius: 22px;
}
.slider:before {
position: absolute;
content: "";
height: 18px;
width: 18px;
left: 2px;
bottom: 2px;
background-color: white;
transition: .4s;
border-radius: 50%;
}
input:checked + .slider {
background: linear-gradient(145deg, #6200ea, #7c4dff);
}
input:checked + .slider:before {
transform: translateX(22px);
}
.khandestroyer-credit {
color: #666;
font-size: 11px;
text-align: center;
margin-top: 10px;
padding-top: 10px;
border-top: 1px solid #333;
}
.speed-slider-container {
width: 100%;
margin-top: 5px;
padding: 0 2px;
box-sizing: border-box;
overflow: visible;
}
.speed-slider {
-webkit-appearance: none;
width: 100%;
height: 8px;
border-radius: 5px;
background: #333;
outline: none;
margin: 10px 0;
}
.speed-slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 18px;
height: 18px;
border-radius: 50%;
background: linear-gradient(145deg, #6200ea, #7c4dff);
cursor: pointer;
}
.speed-slider::-moz-range-thumb {
width: 18px;
height: 18px;
border-radius: 50%;
background: linear-gradient(145deg, #6200ea, #7c4dff);
cursor: pointer;
border: none;
}
.speed-value {
display: none;
}
/* Removendo as classes relacionadas às marcações de velocidade */
.speed-ticks {
display: none;
}
.speed-tick {
display: none;
}
.speed-ticks {
padding: 0;
}
.speed-tick {
font-size: 7px;
}
}
</style>
<div class="khandestroyer-header">
KhanDestroyer <span class="khandestroyer-version">${APP.ver}</span>
</div>
<div class="khandestroyer-content">
<div class="khandestroyer-opt">
<span>Auto Complete</span>
<label class="switch">
<input type="checkbox" id="autoCheck">
<span class="slider"></span>
</label>
</div>
<div class="khandestroyer-opt">
<span>Question Spoof</span>
<label class="switch">
<input type="checkbox" id="spoofCheck" checked>
<span class="slider"></span>
</label>
</div>
<div class="khandestroyer-opt">
<span>Dark Mode</span>
<label class="switch">
<input type="checkbox" id="darkModeCheck" checked>
<span class="slider"></span>
</label>
</div>
<div class="khandestroyer-opt" id="speedControlContainer" style="display: none;">
<span>Velocidade</span>
<div style="width: 100%; display: flex; align-items: center; padding-left: 10px; box-sizing: border-box;">
<div class="speed-slider-container">
<input type="range" min="0" max="3" value="0" class="speed-slider" id="speedSlider">
<div class="speed-value" id="speedValue" style="display: none;">750ms</div>
</div>
</div>
</div>
<div class="khandestroyer-credit">by ! Snow?</div>
</div>
`;
document.body.appendChild(_0x3d849d);
// Adicionar evento de clique ao cabeçalho para encolher/expandir o menu
const header = document.querySelector('.khandestroyer-header');
const content = document.querySelector('.khandestroyer-content');
header.addEventListener('click', () => {
header.classList.toggle('collapsed');
content.classList.toggle('collapsed');
// Salvar o estado do menu no localStorage
const isCollapsed = header.classList.contains('collapsed');
localStorage.setItem('khanDestroyer-collapsed', isCollapsed);
// Mostrar toast informativo
sendToast(isCollapsed ? "🔼 Menu recolhido" : "🔽 Menu expandido", 1000);
});
// Verificar se o menu estava recolhido anteriormente
const wasCollapsed = localStorage.getItem('khanDestroyer-collapsed') === 'true';
if (wasCollapsed) {
header.classList.add('collapsed');
content.classList.add('collapsed');
}
// Setup event listeners
document.getElementById("autoCheck").onchange = event => {
APP.cfg.auto = event.target.checked;
document.getElementById("speedControlContainer").style.display = APP.cfg.auto ? "flex" : "none";
sendToast(APP.cfg.auto ? "✅ Auto Complete Enabled" : "❌ Auto Complete Disabled", 2000);
};
// Configurar o slider de velocidade
const speedSlider = document.getElementById("speedSlider");
const speedValue = document.getElementById("speedValue");
// Definir o valor inicial do slider
const initialIndex = APP.cfg.speedOptions.indexOf(APP.cfg.autoSpeed);
speedSlider.value = initialIndex >= 0 ? initialIndex : 0;
// Adicionar evento de mudança ao slider
speedSlider.oninput = () => {
const index = parseInt(speedSlider.value);
const speed = APP.cfg.speedOptions[index];
APP.cfg.autoSpeed = speed;
speedValue.textContent = speed + "ms";
};
// Adicionar evento de mudança completa para mostrar toast
speedSlider.onchange = () => {
const index = parseInt(speedSlider.value);
const speed = APP.cfg.speedOptions[index];
sendToast(`⏱️ Velocidade alterada para ${speed}ms`, 2000);
};
document.getElementById("spoofCheck").onchange = event => {
APP.cfg.questionSpoof = event.target.checked;
sendToast(APP.cfg.questionSpoof ? "✅ Question Spoof Enabled" : "❌ Question Spoof Disabled", 2000);
};
document.getElementById("darkModeCheck").onchange = event => {
APP.cfg.darkMode = event.target.checked;
if (typeof DarkReader !== 'undefined') {
if (APP.cfg.darkMode) {
DarkReader.enable();
sendToast("🌑 Dark Mode Enabled", 2000);
} else {
DarkReader.disable();
sendToast("☀️ Dark Mode Disabled", 2000);
}
} else {
console.error("DarkReader não está disponível");
sendToast("⚠️ Dark Mode não disponível. Recarregue a página.", 3000);
}
};
// Ativar Dark Mode por padrão
if (APP.cfg.darkMode && typeof DarkReader !== 'undefined') {
DarkReader.enable();
}
}
}
class Core {
static init() {
// Inicialização sequencial das funcionalidades
this.setupMod();
this.setupAuto();
}
static async loadExternalLibraries() {
try {
await loadCss("https://cdn.jsdelivr.net/npm/toastify-js/src/toastify.min.css");
await loadScript("https://cdn.jsdelivr.net/npm/toastify-js");
// Configurar o DarkReader após carregá-lo
if (typeof DarkReader !== 'undefined') {
DarkReader.setFetchMethod(window.fetch);
if (APP.cfg.darkMode) {
DarkReader.enable();
}
} else {
console.error("DarkReader não foi carregado corretamente");
}
// Verificar se Toastify foi carregado antes de usar
if (typeof Toastify !== 'undefined') {
sendToast("🌿 Script loaded successfully!");
} else {
console.error("Toastify não foi carregado corretamente");
}
console.clear();
} catch (error) {
console.error("Erro ao carregar bibliotecas externas:", error);
}
}
static setupMod() {
const messages = [
"🔥 Games Destroyer On Top[Discord](https://discord.gg/gamesdest)!",
"🤍 Made by [@iUnknownBr](https://guns.lol/iunknownbr)."
];
const originalFetch = window.fetch;
window.fetch = async function (_0xb0b6f5, _0x45b6eb) {
const _0x238f50 = await originalFetch.apply(this, arguments);
const _0xc057f3 = _0x238f50.clone();
try {
const _0x46e77b = await _0xc057f3.text();
let _0x3cbec8 = JSON.parse(_0x46e77b);
if (_0x3cbec8?.data?.assessmentItem?.item?.itemData) {
let _0x3ca1c5 = JSON.parse(_0x3cbec8.data.assessmentItem.item.itemData);
if (_0x3ca1c5.question.content[0] === _0x3ca1c5.question.content[0].toUpperCase() && APP.cfg.questionSpoof) {
_0x3ca1c5.answerArea = {
calculator: false
};
_0x3ca1c5.question.content = messages[Math.floor(Math.random() * messages.length)] + "[[☃ radio 1]]";
_0x3ca1c5.question.widgets = {
"radio 1": {
type: "radio",
alignment: "default",
static: false,
graded: true,
options: {
choices: [{
content: "✅",
correct: true
}],
randomize: false,
multipleSelect: false,
displayCount: null,
hasNoneOfTheAbove: false,
onePerLine: true,
deselectEnabled: false
}
}
};
_0x3cbec8.data.assessmentItem.item.itemData = JSON.stringify(_0x3ca1c5);
sendToast("🔓 Question Bypassed", 1000);
const _0x1aa163 = {
status: _0x238f50.status,
statusText: _0x238f50.statusText,
headers: _0x238f50.headers
};
return new Response(JSON.stringify(_0x3cbec8), _0x1aa163);
}
}
} catch (_0x2e758e) {}
return _0x238f50;
};
}
static async setupAuto() {
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
const classNames = ["_1tuo6xk", "_ssxvf9l", "_1f0fvyce", "_rz7ls7u", "_1yok8f4", "_1e5cuk2a", "_s6zfc1u", "_4i5p5ae", "_1r8cd7xe"];
const checkAnswerSelector = "[data-testid=\"exercise-check-answer\"]";
function findAndClickByClass(className) {
const element = document.getElementsByClassName(className)[0];
if (element) {
element.click();
if (element.textContent === "Mostrar resumo") {
sendToast("🎉 Exercise completed!", 3000);
playAudio("https://r2.e-z.host/4d0a0bea-60f8-44d6-9e74-3032a64a9f32/4x5g14gj.wav");
}
}
return !!element;
}
// Função otimizada para processar elementos
async function processElements() {
if (!APP.cfg.auto) return;
// Processar todos os botões de classe conhecida
for (const className of classNames) {
findAndClickByClass(className);
await delay(APP.cfg.autoSpeed / 5);
}
// Verificar e clicar no botão de verificar resposta
const checkAnswerButton = document.querySelector(checkAnswerSelector);
if (checkAnswerButton) {
checkAnswerButton.click();
await delay(APP.cfg.autoSpeed / 5);
}
}
// Loop principal otimizado
while (true) {
await processElements();
await delay(APP.cfg.autoSpeed / 3);
}
}
}
// Inicialização otimizada - primeiro carregamos as bibliotecas, depois inicializamos a UI e o Core
async function initApp() {
try {
await Core.loadExternalLibraries();
UI.init();
Core.init();
console.log(`KhanDestroyer v${APP.ver} iniciado com sucesso!`);
sendToast(`🚀 KhanDestroyer v${APP.ver} iniciado!`, 3000);
} catch (error) {
console.error("Erro ao inicializar KhanDestroyer:", error);
sendToast("⚠️ Erro ao inicializar KhanDestroyer", 5000);
}
}
initApp();