开源项目服务器评测 – Jaydon

开源项目服务器评测

/ 0评 / 0

bash <(wget -qO- --no-check-certificate https://gitlab.com/spiritysdx/za/-/raw/main/ecs.sh)

顺序4-3

 

https://gist.github.com/DSPerson/f983ba45f1d4067a640dd978e9546e45

 

// ==UserScript==
//
@name
New script http://node.hyper.space
//
@namespace
Violentmonkey Scripts
//
@match
https://node.hyper.space*
//
@grant
none
//
@version
1.0
//
@author
-
//
@description
自动检查并在检测到 "Disconnected" 时点击按钮
// ==/UserScript==

function getElementValueByXPath(xpath) {
const result = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
const node = result.singleNodeValue;
if (node) {
return node;
} else {
console.log("Element not found.");
return null;
}
}

function gogogo() {
// 使用提供的 XPath 查找 "Disconnected" 文本
const rs = getElementValueByXPath('//*[
@id
="root"]/div/main/div[1]/div/div/div/div[1]/div[1]/div[2]/div/div[3]/span');

if (rs !== null) {
const ll = rs.textContent;
console.log("Found text:", ll);

if (ll === "Disconnected") {
// 当检测到 "Disconnected" 时,查找并点击红色按钮
const buttond = getElementValueByXPath('//*[
@id
="root"]/div/main/div[1]/div/div/div/div[1]/div[1]/div[2]/div/div[3]/div/button');

if (buttond) {
http://buttond.click();
console.log("Red button clicked!");
} else {
console.log("Red button not found.");
}
} else {
console.log("Disconnected state not found.");
}
} else {
console.log("No Disconnected text found.");
}
}

// 延时 20 秒后执行一次,确保页面加载完成
setTimeout(() => {
gogogo();
}, 1000 * 20);

// 每隔 20 秒执行一次,确保页面更新
setInterval(() => {
gogogo();
}, 1000 * 20);

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注