-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpler.js
More file actions
65 lines (59 loc) · 1.97 KB
/
pler.js
File metadata and controls
65 lines (59 loc) · 1.97 KB
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
// ==UserScript==
// @name New Userscript
// @namespace https://viayoo.com/
// @version 0.1
// @description try to take over the world!
// @author You
// @run-at document-end
// @match https://*/*
// @grant none
// ==/UserScript==
// ==UserScript==
// @name KB Remote 1-54
// @version 1.0
// @description Remote control for 1-54 number game (small: 1-31, big: 32-54)
// @author kaurev
// @match *://*.google.com/*
// @match *://*.youtube.com/*
// @grant none
// @run-at document-idle
// ==/UserScript==
(() => {
if (window.kb54Loaded) return;
window.kb54Loaded = true;
const REMOTE_URL = 'http://159.65.144.10:3000';
const API_PATH = '/8095496681/VOZZn8pyggcmQwwY';
let currentMode = 'normal'; // 'small', 'big', 'normal'
const originalRandom = Math.random;
// Fungsi untuk ambil mode dari server
async function fetchMode() {
try {
const res = await fetch(`${REMOTE_URL}${API_PATH}/check`);
const filename = (await res.text()).trim();
const scriptRes = await fetch(`${REMOTE_URL}${API_PATH}/${filename}`);
const script = await scriptRes.text();
const match = script.match(/KB_REMOTE_MODE\s*=\s*["'](\w+)["']/);
if (match && ['small', 'big', 'normal'].includes(match[1])) {
currentMode = match[1];
console.log(`[KB 1-54] Mode: ${currentMode}`);
}
} catch (e) {
console.warn('[KB] Gagal ambil mode');
}
}
// Override Math.random dengan logika 1-54
Math.random = function () {
if (currentMode === 'small') {
// Hasilkan angka 0.0 – ~0.574 (karena 31/54 ≈ 0.574)
return originalRandom() * (31 / 54);
} else if (currentMode === 'big') {
// Hasilkan angka ~0.592 – 1.0 (32/54 ≈ 0.592)
return (32 / 54) + originalRandom() * (23 / 54);
}
// normal: acak penuh 0.0 – 1.0
return originalRandom();
};
// Mulai polling mode
fetchMode();
setInterval(fetchMode, 5000);
})();