Skip to content

Commit 14f68c8

Browse files
committed
more info
1 parent 2016be0 commit 14f68c8

File tree

1 file changed

+13
-7
lines changed
  • scripts/backup/ext/fb-group-ext/popup/auto_duyet_bai_group

1 file changed

+13
-7
lines changed

scripts/backup/ext/fb-group-ext/popup/auto_duyet_bai_group/main.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ async function main() {
2626

2727
if (!tab.url.includes("groups") || !tab.url.includes("spam")) {
2828
return prompt(
29-
"Bạn cần mở trang duyệt bài spam của group trước. Ví dụ:",
29+
"\n\nBạn cần mở trang duyệt bài spam của group trước.\n\nLink hiện tại:" +
30+
tab.url +
31+
"\nLink đúng ví dụ:",
3032
"https://www.facebook.com/groups/gamecode/spam"
3133
);
3234
}
@@ -58,10 +60,14 @@ async function main() {
5860
// check is running
5961
(async function checkIsRunning() {
6062
const state = await getCurrentState(tab);
61-
const { running, nextExecuteTime } = state || {};
63+
const { running, nextExecuteTime, count } = state || {};
6264
if (running) {
6365
startBtn.innerHTML =
64-
"Đang xử lý... (chờ " +
66+
"Đang " +
67+
(radioAction[0].checked ? "đăng" : "xoá") +
68+
"... " +
69+
count +
70+
" bài (chờ " +
6571
renderTime(nextExecuteTime - Date.now(), 0) +
6672
")<br/>(<i>Bấm để dừng</i>)";
6773
startBtn.classList.add("running");
@@ -116,18 +122,18 @@ function start(action, maxPosts, waitMin, waitMax) {
116122
running: true,
117123
nextExecuteTime: 0,
118124
stop: false,
125+
count: 0,
119126
};
120127

121-
let counter = 0;
122-
while (counter < maxPosts && !window.fb_group_ext.stop) {
128+
while (window.fb_group_ext.count < maxPosts && !window.fb_group_ext.stop) {
123129
if (btns.length > 0) {
124130
const btn = btns.shift();
125131

126132
btn.scrollIntoView({ block: "center", behavior: "smooth" });
127133
console.log("click", btn);
128134
btn.click();
129135

130-
counter++;
136+
window.fb_group_ext.count++;
131137
const waitTime = ranInt(waitMin, waitMax);
132138
window.fb_group_ext.nextExecuteTime = Date.now() + waitTime;
133139
await sleep(waitTime, () => window.fb_group_ext.stop);
@@ -140,7 +146,7 @@ function start(action, maxPosts, waitMin, waitMax) {
140146
}
141147

142148
window.fb_group_ext.running = false;
143-
alert("Duyệt xong " + counter + " bài");
149+
alert("Duyệt xong " + window.fb_group_ext.count + " bài");
144150
}
145151

146152
main();

0 commit comments

Comments
 (0)