-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.js
More file actions
50 lines (37 loc) · 1.57 KB
/
code.js
File metadata and controls
50 lines (37 loc) · 1.57 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
// auto-collect.js
// Version: 3.2
// Last updated: 2026-01-20
(function() {
'use strict';
console.log('🚀 Auto Collect Script đã load!');
let hasClicked = false; // Cờ đánh dấu đã click
let lastValue = 0; // Giá trị trước đó
function autoCollect() {
const tikElement = document.getElementById('tik');
const collectButton = document.querySelector('button[name="games_sbor"]');
if (!tikElement || !collectButton) {
return;
}
const valueText = tikElement.textContent.trim().replace(/,/g, '');
const currentValue = parseFloat(valueText);
console.log('💰 Giá trị:', currentValue);
// Chỉ click nếu:
// 1. Chưa click lần nào (hasClicked = false)
// 2. Giá trị >= 1.6
// 3. Giá trị đang tăng (để tránh click ngay sau reload)
if (!hasClicked && currentValue >= 1.5 && currentValue > lastValue) {
console.log('✅ Đạt ngưỡng - Click COLLECT!');
collectButton.click();
hasClicked = true; // Đánh dấu đã click
}
// Reset cờ nếu giá trị giảm xuống dưới 1.0 (sau khi reload)
if (currentValue < 1.0) {
hasClicked = false;
}
lastValue = currentValue;
}
// Đợi page load xong
setTimeout(() => {
setInterval(autoCollect, 100); // Có thể để interval nhỏ hơn an toàn
}, 2000);
})();