JS: 退出游戏多模式 (#2235)

This commit is contained in:
起个名字好难的喵
2025-10-24 19:45:09 +08:00
committed by GitHub
parent 8a234ddf7e
commit 53b81adac2
3 changed files with 86 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
(async function () {
if (settings.Modes == "Alt+F4") {
await QuitGame();
} else if (settings.Modes == "完全退出游戏") {
await ExitGame();
} else if (settings.Modes == "完全退出游戏到桌面") {
await ExitGametoDesktop();
} else {
log.info("尖尖哇嘎乃")
}
// HZYgrandma 退出游戏
async function QuitGame() {
keyDown("MENU");
keyDown("F4");
await sleep(50);
keyUp("MENU");
keyUp("F4");
await sleep(1500);
}
// Because 完全退出游戏
// 这个坐标有问题,等个有缘人来修
async function ExitGame() {
// settings 的对象内容来自于 settings.json 文件生成的动态配置页面
// 前置系统状态:大世界正常主界面
setGameMetrics(3840, 2160, 2)
keyPress("VK_ESCAPE");//打开派蒙菜单
await sleep(1000);
click(90, 2000);//点击左下角退出按钮
await sleep(1000);
click(2100, 1500);//点击确定
await sleep(10000);//渲染开门界面的时间
click(200, 1950);//点击登录界面左下角退出按钮
await sleep(1000);
click(2200, 1100);//点击确定
await sleep(1000);
}
// MeisterJ 完全退出游戏到桌面
async function ExitGametoDesktop() {
// settings 的对象内容来自于 settings.json 文件生成的动态配置页面
// 前置系统状态:大世界正常主界面
setGameMetrics(3840, 2160, 2)
keyPress("VK_ESCAPE");//打开派蒙菜单
await sleep(1000);
click(90, 2000);//点击左下角退出按钮
await sleep(1000);
click(2100, 1300);//点击确定
}
})();

View File

@@ -0,0 +1,20 @@
{
"manifest_version": 1,
"name": "退出游戏多模式",
"version": "1.0",
"description": "用于各种各样的退出游戏,主要是轮子太多了,功能还差不多",
"tags": [
"退出游戏",
"关闭游戏",
"完全退出",
"桌面"
],
"authors": [
{
"name": "起个名字好难的喵",
"links": "https://github.com/MisakaAldrich"
}
],
"main": "main.js",
"settings_ui": "settings.json"
}

View File

@@ -0,0 +1,13 @@
[
{
"name": "Modes",
"type": "select",
"label": "退出模式",
"options": [
"Alt+F4",
// "完全退出游戏",
"完全退出游戏到桌面"
],
"default": "完全退出游戏到桌面"
}
]