Skip to content

Commit 00a244e

Browse files
committed
fix
1 parent 6140d49 commit 00a244e

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

scripts/fb_autoLike.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,15 @@ export default {
9595

9696
const btns = [];
9797
UfsGlobal.DOM.onElementsAdded(
98-
[type.en, type.vi]
99-
.map((_) => `[aria-label*='${_}']:not(li *)`)
98+
["en", "vi"]
99+
.map((l) =>
100+
type === Types.removeReact
101+
? Object.values(Reactions).map(
102+
(r) => `[aria-label='${type[l]}${r[l]}']:not(li *)`
103+
)
104+
: `[aria-label='${type[l]}']:not(li *)`
105+
)
106+
.flat()
100107
.join(", "),
101108
(nodes) => {
102109
btns.push(...nodes);
@@ -124,6 +131,7 @@ export default {
124131
block: "center",
125132
behavior: "smooth",
126133
});
134+
await sleep(500);
127135
btn.click();
128136

129137
if (type === Types.addReact) {
@@ -134,16 +142,15 @@ export default {
134142
.map((_) => `[aria-label='${_}']`)
135143
.join(", ")
136144
);
137-
console.log(reactBtn);
138145
if (reactBtn) {
139146
focusTo(reactBtn);
140-
await sleep(50);
147+
await sleep(100);
141148
reactBtn.click();
142-
await sleep(50);
149+
await sleep(100);
143150
}
144151
}
145152

146-
let waitFor = rand(2000, 5000);
153+
let waitFor = rand(1000, 4000);
147154
count++;
148155
if (count >= maxPosts) break;
149156
notify.setText(

0 commit comments

Comments
 (0)