mirror of
https://github.com/babalae/bettergi-scripts-list.git
synced 2026-03-15 03:23:22 +08:00
2
repo/js/Ciallo/README.md
Normal file
2
repo/js/Ciallo/README.md
Normal file
@@ -0,0 +1,2 @@
|
||||
啥功能也不实现,纯骚扰好友玩
|
||||
|
||||
BIN
repo/js/Ciallo/assets/RecognitionObject/chat.png
Normal file
BIN
repo/js/Ciallo/assets/RecognitionObject/chat.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
BIN
repo/js/Ciallo/assets/RecognitionObject/friend.png
Normal file
BIN
repo/js/Ciallo/assets/RecognitionObject/friend.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
54
repo/js/Ciallo/main.js
Normal file
54
repo/js/Ciallo/main.js
Normal file
@@ -0,0 +1,54 @@
|
||||
/*******************************************************
|
||||
* 完整文件:进入/退出世界循环脚本
|
||||
* 所有函数均在此文件内,直接覆盖原文件即可运行
|
||||
*******************************************************/
|
||||
|
||||
/* ---------- 匹配模板 ---------- */
|
||||
const friendRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/RecognitionObject/friend.png"));
|
||||
const chatTemplate = file.ReadImageMatSync("assets/RecognitionObject/chat.png");
|
||||
/* ---------- 主流程 ---------- */
|
||||
(async function () {
|
||||
const ciallo = settings.ciallo || "Ciallo~(∠・ω< )⌒☆";
|
||||
await genshin.returnMainUi();
|
||||
await sleep(1000);
|
||||
keyPress("VK_ESCAPE");
|
||||
await sleep(1000);
|
||||
await findAndClick(friendRo);
|
||||
//依次点击七个好友并进行对话
|
||||
for (let i = 0; i < 7; i++) {
|
||||
const yStart = 119 + i * 124;
|
||||
const yEnd = 243 + i * 124;
|
||||
|
||||
const recognitionObj = RecognitionObject.TemplateMatch(
|
||||
chatTemplate,
|
||||
0, // x 起始
|
||||
yStart, // y 起始
|
||||
1920, // x 范围(宽度)
|
||||
yEnd - yStart // y 范围(高度)
|
||||
);
|
||||
await sleep(1000);
|
||||
await findAndClick(recognitionObj);
|
||||
keyPress("VK_RETURN");
|
||||
await sleep(1000);
|
||||
inputText(ciallo);
|
||||
await sleep(500);
|
||||
keyPress("VK_RETURN");
|
||||
await sleep(500);
|
||||
keyPress("VK_ESCAPE");
|
||||
}
|
||||
await genshin.returnMainUi();
|
||||
|
||||
})();
|
||||
|
||||
/** 通用点击,默认最多5次 */
|
||||
async function findAndClick(target, maxAttempts = 5) {
|
||||
for (let i = 0; i < maxAttempts; i++) {
|
||||
const rg = captureGameRegion();
|
||||
try {
|
||||
const res = rg.find(target);
|
||||
if (res.isExist()) { res.click(); return true; }
|
||||
} finally { rg.dispose(); }
|
||||
if (i < maxAttempts - 1) await sleep(250);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
15
repo/js/Ciallo/manifest.json
Normal file
15
repo/js/Ciallo/manifest.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "自动恰咯",
|
||||
"version": "0.0.1",
|
||||
"tags": [],
|
||||
"description": "挑战向好友列表前七位发送ciallo让他们感到莫名其妙",
|
||||
"authors": [
|
||||
{
|
||||
"name": "mno",
|
||||
"links": "https://github.com/Bedrockx"
|
||||
}
|
||||
],
|
||||
"settings_ui": "settings.json",
|
||||
"main": "main.js"
|
||||
}
|
||||
8
repo/js/Ciallo/settings.json
Normal file
8
repo/js/Ciallo/settings.json
Normal file
@@ -0,0 +1,8 @@
|
||||
[
|
||||
{
|
||||
"name": "ciallo",
|
||||
"type": "input-text",
|
||||
"label": "发送的文本内容",
|
||||
"default": "Ciallo~(∠・ω< )⌒☆"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user