feat: update with 1.0
This commit is contained in:
+11
-6
@@ -381,8 +381,8 @@ handlers[1] = (tabNode, containerNode) => {
|
|||||||
const list = containerNode.querySelectorAll(`button.btn`);
|
const list = containerNode.querySelectorAll(`button.btn`);
|
||||||
for (const node of list) {
|
for (const node of list) {
|
||||||
if (node.id === id) continue;
|
if (node.id === id) continue;
|
||||||
|
if (node.querySelector("button.theresmore-helper")) continue;
|
||||||
const name = node.firstChild.textContent;
|
const name = node.firstChild.textContent;
|
||||||
if (!node.querySelector("button.btn")) {
|
|
||||||
const button = document.createElement("button");
|
const button = document.createElement("button");
|
||||||
button.classList.add(
|
button.classList.add(
|
||||||
"-bottom-0",
|
"-bottom-0",
|
||||||
@@ -393,6 +393,7 @@ handlers[1] = (tabNode, containerNode) => {
|
|||||||
"rounded-full",
|
"rounded-full",
|
||||||
"font-bold",
|
"font-bold",
|
||||||
"text-xs",
|
"text-xs",
|
||||||
|
"theresmore-helper",
|
||||||
);
|
);
|
||||||
button.textContent = "A";
|
button.textContent = "A";
|
||||||
if (blackList.has(name)) {
|
if (blackList.has(name)) {
|
||||||
@@ -415,7 +416,6 @@ handlers[1] = (tabNode, containerNode) => {
|
|||||||
};
|
};
|
||||||
node.appendChild(button);
|
node.appendChild(button);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (containerNode.firstChild.textContent === "ALL") return;
|
if (containerNode.firstChild.textContent === "ALL") return;
|
||||||
const btn = document.createElement("button");
|
const btn = document.createElement("button");
|
||||||
@@ -569,7 +569,7 @@ handlers[4] = async (tabNode, containerNode) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (currentSubTab.firstChild.textContent === "攻击") {
|
} else if (currentSubTab.firstChild.textContent === "攻击") {
|
||||||
const chooseBtn = containerNode.querySelector(`button.btn.btn-dark`);
|
const chooseBtn = containerNode.querySelector(`button.btn:nth-child(2)`);
|
||||||
if (chooseBtn && chooseBtn.firstChild.textContent !== "没有敌人可供攻击") {
|
if (chooseBtn && chooseBtn.firstChild.textContent !== "没有敌人可供攻击") {
|
||||||
if (chooseBtn.lastChild.id !== "auto-attack") {
|
if (chooseBtn.lastChild.id !== "auto-attack") {
|
||||||
const btn = document.createElement("button");
|
const btn = document.createElement("button");
|
||||||
@@ -729,8 +729,13 @@ function customFunction(MainStore) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function sleep(time) {
|
async function sleep(time) {
|
||||||
return new Promise((resolve) => {
|
let timer;
|
||||||
setTimeout(resolve, time);
|
try {
|
||||||
|
return await new Promise((resolve) => {
|
||||||
|
timer = setTimeout(resolve, time);
|
||||||
});
|
});
|
||||||
|
} finally {
|
||||||
|
return clearTimeout(timer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user