Merge remote-tracking branch 'upstream/main'

This commit is contained in:
秋云
2025-11-08 15:54:14 +08:00
1217 changed files with 58171 additions and 34931 deletions

View File

@@ -1,17 +1,17 @@
(async function () {
keyDown("LWIN");
keyDown("X");
await sleep(50);
keyUp("LWIN");
keyUp("X");
await sleep(3000);
keyPress("LSHIFT");
await sleep(50);
keyPress("LCONTROL");
await sleep(50);
keyPress("U");
await sleep(1000);
keyPress("U");
await sleep(50);
keyPress("RETURN");
})();
(async function () {
keyDown("LWIN");
keyDown("X");
await sleep(50);
keyUp("LWIN");
keyUp("X");
await sleep(3000);
keyPress("LSHIFT");
await sleep(50);
keyPress("LCONTROL");
await sleep(50);
keyPress("U");
await sleep(1000);
keyPress("U");
await sleep(50);
keyPress("RETURN");
})();

View File

@@ -1,13 +1,13 @@
{
"manifest_version": 1,
"name": "关闭计算机",
"version": "1.0",
"description": "用于关闭计算机",
"authors": [
{
"name": "HZYgrandma",
"links": "https://github.com/HZYgrandma"
}
],
"main": "main.js"
{
"manifest_version": 1,
"name": "关闭计算机",
"version": "1.0",
"description": "用于关闭计算机",
"authors": [
{
"name": "HZYgrandma",
"links": "https://github.com/HZYgrandma"
}
],
"main": "main.js"
}

View File

@@ -1,42 +1,42 @@
# 自动切换账号脚本
**重要免责声明:**
1. **数据安全:**
1. 本脚本使用的用户名、密码等敏感信息仅存储在本地设备,开发者无法获取。
2. 使用者需自行承担账户信息泄露风险,请勿在公共设备或不可信环境中使用。
2. **使用风险:**
1. 本脚本为开源学习项目,禁止用于商业用途或违反游戏条款的行为。
2. 滥用可能导致游戏账号封禁,开发者不承担任何直接或间接责任。
3. **责任限制:**
1. 本脚本按“现状”提供,不承诺兼容性、安全性或功能完整性。
2. 因使用本脚本导致的账号、数据、设备损失,开发者概不负责。
4. **禁止条款:**
1. 严禁逆向工程、恶意篡改或用于外挂等非法用途。
2. 若游戏运营商提出要求,开发者保留随时停止维护的权利。
使用脚本即表示您已阅读并同意上述条款。
如果使用BGI一条龙启动且第一个脚本就是账号切换则需要开启BGI启动配置-同时启动原神-自动进入游戏
根据使用者设备配置和网络环境,脚本中的延时可以适当调整。(如果不熟悉脚本操作则不建议修改延时)
作者留言:
毕竟都使用BGI了时间还算个事吗
需要国际服适配脚本私信我。
**Last Updated:** 2025-06-26
---
# 脚本信息
@name 原神自动化登录脚本
@version 1.2
@description 原神自动登录工具(仅供学习交流,请勿商业用途)
@author 彩虹QQ人
@match 原神版本≥5.5BGI版本≥0.44.6
# 更新记录
2025年6月26日 version 1.1 整合代码
2025年6月27日 version 1.2 解决循环无法跳出的问题
# 自动切换账号脚本
**重要免责声明:**
1. **数据安全:**
1. 本脚本使用的用户名、密码等敏感信息仅存储在本地设备,开发者无法获取。
2. 使用者需自行承担账户信息泄露风险,请勿在公共设备或不可信环境中使用。
2. **使用风险:**
1. 本脚本为开源学习项目,禁止用于商业用途或违反游戏条款的行为。
2. 滥用可能导致游戏账号封禁,开发者不承担任何直接或间接责任。
3. **责任限制:**
1. 本脚本按“现状”提供,不承诺兼容性、安全性或功能完整性。
2. 因使用本脚本导致的账号、数据、设备损失,开发者概不负责。
4. **禁止条款:**
1. 严禁逆向工程、恶意篡改或用于外挂等非法用途。
2. 若游戏运营商提出要求,开发者保留随时停止维护的权利。
使用脚本即表示您已阅读并同意上述条款。
如果使用BGI一条龙启动且第一个脚本就是账号切换则需要开启BGI启动配置-同时启动原神-自动进入游戏
根据使用者设备配置和网络环境,脚本中的延时可以适当调整。(如果不熟悉脚本操作则不建议修改延时)
作者留言:
毕竟都使用BGI了时间还算个事吗
需要国际服适配脚本私信我。
**Last Updated:** 2025-06-26
---
# 脚本信息
@name 原神自动化登录脚本
@version 1.2
@description 原神自动登录工具(仅供学习交流,请勿商业用途)
@author 彩虹QQ人
@match 原神版本≥5.5BGI版本≥0.44.6
# 更新记录
2025年6月26日 version 1.1 整合代码
2025年6月27日 version 1.2 解决循环无法跳出的问题

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

Before

Width:  |  Height:  |  Size: 852 B

After

Width:  |  Height:  |  Size: 852 B

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -1,195 +1,201 @@
const author = "彩虹QQ人";
const script_name = "切换账号(OCR)版本";
const pm_out = {
template: RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/pm_out.png")),
name: "pm_out.png"
};
const out_to_login = {
template: RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/out_to_login.png")),
name: "out_to_login.png"
};
const login_out_account = {
template:RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/login_out_account.png")),
name: "login_out_account.png"
};
const out_account = {
template:RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/out_account.png")),
name: "out_account.png"
};
const login_other_account = {
template:RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/login_other_account_1.png")),
name: "login_other_account.png"
};
const input_phone_or_email = {
template:RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/input_phone_or_email.png")),
name: "input_phone_or_email.png"
};
const input_password = {
template:RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/input_password.png")),
name: "input_password.png"
};
const agree = {
template:RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/agree.png")),
name: "agree.png"
};
//人机验证识别图片
const login_verification = {
template:RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/verification.png")),
name: "verification.png"
};
async function clickCenter(x, y, width, height) {
let centerX = Math.round(x + width / 2);
let centerY = Math.round(y + height / 2);
await click(centerX, centerY);
await sleep(500); // 确保点击后有足够的时间等待
return { success: true, x: centerX, y: centerY };
}
async function matchImgAndClick(obj, desc, timeout = 8000) {
const start = Date.now();
let retryCount = 0; // 识别次数计数
let status = false; // 用于记录是否匹配成功
try {
while (Date.now() - start < timeout && !status) {
await sleep(300);
let result = captureGameRegion().Find(obj.template);
await sleep(500); // 短暂延迟,避免过快循环
if (result.isExist()) {
let clickResult = await clickCenter(result.x, result.y, result.width, result.height);
log.info(`【IMG】成功识别并点击 ${desc}| 耗时: ${Date.now() - start}ms`);
status = true; // 设置匹配成功状态
return {success: true, x: clickResult.x, y: clickResult.y};
}
// await sleep(200); // 短暂延迟,避免过快循环
log.info(`【IMG】第${retryCount++}次识别并点击 ${desc} 失败 | 耗时: ${Date.now() - start}ms`);
}
} catch (error) {
log.error(`【IMG】${script_name}等待超时,请人工介入。===待切换账号:${settings.username}===超时原因:未找到目标 [${desc}] | 文件:${obj.name}`);
//如果有配置通知……
notification.error(`【IMG】${script_name}等待超时,请人工介入。===待切换账号:${settings.username}===超时原因:未找到目标 [${desc}] | 文件:${obj.name}`);
throw new Error(`【IMG】识别图像时发生异常: ${error.message}`);
}
return {success: false};
}
async function recognizeTextAndClick(targetText, ocrRegion, timeout = 8000) {
let start = Date.now();
let retryCount = 0; // 重试计数
let status = false; // 用于记录是否匹配成功
try {
while (Date.now() - start < timeout && !status) {
let resultList = captureGameRegion().findMulti(ocrRegion);
await sleep(500); // 短暂延迟,避免过快循环
for (let result of resultList) {
if (result.text.includes(targetText)) {
let clickResult = await clickCenter(result.x, result.y, result.width, result.height);
log.info(`【OCR】成功识别并点击 ${targetText}| 耗时: ${Date.now() - start}ms`);
status = true; // 设置匹配成功状态
return {success: true, x: clickResult.x, y: clickResult.y};
}
}
// await sleep(200); // 短暂延迟,避免过快循环
log.info(`【OCR】${targetText}失败,正在进行第 ${retryCount++} 次重试...`);
}
}catch (error) {
log.warn(`【OCR】经过多次尝试仍然无法识别文字: ”${targetText}“,尝试点击默认中心位置`);
await clickCenter(result.x, result.y, result.width, result.height);
//如果有配置通知……
notification.error(`【OCR】识别文字: “${targetText}”,发生异常`);
throw new Error(`【OCR】识别文字时发生异常: ${error.message}`);
}
return {success: false };
}
/**
* main流程开始
*/
(async function () {
setGameMetrics(1920, 1080, 1);
// 如果切换账号是第一个脚本,则有可能出现月卡选项
//防止genshin.blessingOfTheWelkinMoon();方法失效,先使用物理点击。
try {
keyDown("VK_MENU");
await sleep(500);
for(let i = 0; i<=4; i++){
await click(genshin.width / 2.0, genshin.height * 0.8);
await sleep(1000);
}
}finally {
keyUp("VK_MENU");
}
//await genshin.blessingOfTheWelkinMoon();
//await sleep(1000);
//await genshin.blessingOfTheWelkinMoon();
//await sleep(1000);
await genshin.returnMainUi();
await keyPress("VK_ESCAPE");
await sleep(500);
try {
await matchImgAndClick(pm_out,"左下角退出门");
await matchImgAndClick(out_to_login,"退出至登陆页面");
//这一步根据 电脑配置和当前网络情况不同休眠时间不同,建议实际运行之后,如果有日志 第x次 识别失败,就适当增加休眠时间
await sleep(9000);
await matchImgAndClick(login_out_account,"登录页的右下角退出按钮");
await matchImgAndClick(out_account,"退出当前账号");
await matchImgAndClick(login_other_account,"登录其他账号");
await sleep(1000);
await matchImgAndClick(input_phone_or_email,"填写邮箱/手机号");
await inputText(settings.username);
await sleep(1000);
await matchImgAndClick(input_password,"填写密码");
await inputText(settings.password);
await sleep(1000);
//按下回车登录账号,弹出用户协议对话框
await keyPress("VK_RETURN");
//点击回车后,等待特瓦特大门加载
await matchImgAndClick(agree,"同意用户协议");
//如果当天上下线次数过于频繁
for(let i = 1;i<=2;i++){
let verify = captureGameRegion().Find(login_verification.template);
//等待1s避免循环速度过快
await sleep(1000);
if (verify.isExist()) {
//这里可配置通知方法
notification.error(`${script_name}触发人机验证,请手动登录。===待切换UID${settings.UID}`);
log.error(`${script_name}触发人机验证,请手动登录。===待切换UID${settings.UID}`);
}
}
/**
* 根据不同网络环境和电脑配置此操作可能会将领取月卡操作取代但是不影响使用
* 如果发现卡在这一步请适当延长sleep时间
*/
await sleep(8000);
await recognizeTextAndClick("点击进入", RecognitionObject.Ocr(862, 966, 206, 104), 960, 540, 5000);
await sleep(15000);
//可能登录账号的时候出现月卡提醒,则先点击一次月卡。
//await genshin.blessingOfTheWelkinMoon();
//await sleep(1000);
//await genshin.blessingOfTheWelkinMoon();
//await sleep(1000);
//防止genshin.blessingOfTheWelkinMoon();方法失效,先使用物理点击。
await sleep(2000);
keyDown("VK_MENU");
await sleep(500);
for(let i = 0; i<=4; i++){
await click(genshin.width / 2.0, genshin.height * 0.8);
await sleep(1000);
}
//keyUp("VK_MENU");
await genshin.returnMainUi();
await sleep(1000);
// 如果配置了通知
notification.send("账号【" + settings.UID + "】切换成功");
}catch (error) {
log.error(`${script_name}脚本执行过程中发生错误:${error.message}`);
//如果发生错误,则发送通知
notification.error(`${script_name}脚本执行过程中发生错误:${error.message}`);
throw new Error(`${script_name}脚本执行过程中发生错误:${error.message}`);
}finally {
keyUp("VK_MENU");
}
const author = "彩虹QQ人";
const script_name = "切换账号(OCR)版本";
const pm_out = {
template: RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/pm_out.png")),
name: "pm_out.png"
};
const out_to_login = {
template: RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/out_to_login.png")),
name: "out_to_login.png"
};
const login_out_account = {
template:RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/login_out_account.png")),
name: "login_out_account.png"
};
const out_account = {
template:RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/out_account.png")),
name: "out_account.png"
};
const login_other_account = {
template:RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/login_other_account_1.png")),
name: "login_other_account.png"
};
const input_phone_or_email = {
template:RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/input_phone_or_email.png")),
name: "input_phone_or_email.png"
};
const input_password = {
template:RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/input_password.png")),
name: "input_password.png"
};
const agree = {
template:RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/agree.png")),
name: "agree.png"
};
//人机验证识别图片
const login_verification = {
template:RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/verification.png")),
name: "verification.png"
};
async function clickCenter(x, y, width, height) {
let centerX = Math.round(x + width / 2);
let centerY = Math.round(y + height / 2);
await click(centerX, centerY);
await sleep(500); // 确保点击后有足够的时间等待
return { success: true, x: centerX, y: centerY };
}
async function matchImgAndClick(obj, desc, timeout = 8000) {
const start = Date.now();
let retryCount = 0; // 识别次数计数
let status = false; // 用于记录是否匹配成功
try {
while (Date.now() - start < timeout && !status) {
await sleep(300);
const ro = captureGameRegion();
let result = ro.Find(obj.template);
ro.dispose();
await sleep(500); // 短暂延迟,避免过快循环
if (result.isExist()) {
let clickResult = await clickCenter(result.x, result.y, result.width, result.height);
log.info(`【IMG】成功识别并点击 ${desc}| 耗时: ${Date.now() - start}ms`);
status = true; // 设置匹配成功状态
return {success: true, x: clickResult.x, y: clickResult.y};
}
// await sleep(200); // 短暂延迟,避免过快循环
log.info(`【IMG】第${retryCount++}次识别并点击 ${desc} 失败 | 耗时: ${Date.now() - start}ms`);
}
} catch (error) {
log.error(`【IMG】${script_name}等待超时,请人工介入。===待切换账号:${settings.username}===超时原因:未找到目标 [${desc}] | 文件:${obj.name}`);
//如果有配置通知……
notification.error(`【IMG】${script_name}等待超时,请人工介入。===待切换账号:${settings.username}===超时原因:未找到目标 [${desc}] | 文件:${obj.name}`);
throw new Error(`【IMG】识别图像时发生异常: ${error.message}`);
}
return {success: false};
}
async function recognizeTextAndClick(targetText, ocrRegion, timeout = 8000) {
let start = Date.now();
let retryCount = 0; // 重试计数
let status = false; // 用于记录是否匹配成功
try {
while (Date.now() - start < timeout && !status) {
const ro = captureGameRegion();
let resultList = ro.findMulti(ocrRegion);
ro.dispose();
await sleep(500); // 短暂延迟,避免过快循环
for (let result of resultList) {
if (result.text.includes(targetText)) {
let clickResult = await clickCenter(result.x, result.y, result.width, result.height);
log.info(`【OCR】成功识别并点击 ${targetText}| 耗时: ${Date.now() - start}ms`);
status = true; // 设置匹配成功状态
return {success: true, x: clickResult.x, y: clickResult.y};
}
}
// await sleep(200); // 短暂延迟,避免过快循环
log.info(`【OCR】${targetText}失败,正在进行第 ${retryCount++} 次重试...`);
}
}catch (error) {
log.warn(`【OCR】经过多次尝试仍然无法识别文字: ${targetText}“,尝试点击默认中心位置`);
await clickCenter(result.x, result.y, result.width, result.height);
//如果有配置通知……
notification.error(`【OCR】识别文字: “${targetText}”,发生异常`);
throw new Error(`【OCR】识别文字时发生异常: ${error.message}`);
}
return {success: false };
}
/**
* main流程开始
*/
(async function () {
setGameMetrics(1920, 1080, 1);
// 如果切换账号是第一个脚本,则有可能出现月卡选项
//防止genshin.blessingOfTheWelkinMoon();方法失效,先使用物理点击。
try {
keyDown("VK_MENU");
await sleep(500);
for(let i = 0; i<=4; i++){
await click(genshin.width / 2.0, genshin.height * 0.8);
await sleep(1000);
}
}finally {
keyUp("VK_MENU");
}
//await genshin.blessingOfTheWelkinMoon();
//await sleep(1000);
//await genshin.blessingOfTheWelkinMoon();
//await sleep(1000);
await genshin.returnMainUi();
await keyPress("VK_ESCAPE");
await sleep(500);
try {
await matchImgAndClick(pm_out,"左下角退出");
await matchImgAndClick(out_to_login,"退出至登陆页面");
//这一步根据 电脑配置和当前网络情况不同休眠时间不同,建议实际运行之后,如果有日志 第x次 识别失败,就适当增加休眠时间
await sleep(9000);
await matchImgAndClick(login_out_account,"登录页的右下角退出按钮");
await matchImgAndClick(out_account,"退出当前账号");
await matchImgAndClick(login_other_account,"登录其他账号");
await sleep(1000);
await matchImgAndClick(input_phone_or_email,"填写邮箱/手机号");
await inputText(settings.username);
await sleep(1000);
await matchImgAndClick(input_password,"填写密码");
await inputText(settings.password);
await sleep(1000);
//按下回车登录账号,弹出用户协议对话框
await keyPress("VK_RETURN");
//点击回车后,等待特瓦特大门加载
await matchImgAndClick(agree,"同意用户协议");
//如果当天上下线次数过于频繁
for(let i = 1;i<=2;i++){
const ro = captureGameRegion();
let verify = ro.Find(login_verification.template);
ro.dispose();
//等待1s避免循环速度过快
await sleep(1000);
if (verify.isExist()) {
//这里可配置通知方法
notification.error(`${script_name}触发人机验证,请手动登录。===待切换UID${settings.UID}`);
log.error(`${script_name}触发人机验证,请手动登录。===待切换UID${settings.UID}`);
}
}
/**
* 根据不同网络环境和电脑配置此操作可能会将领取月卡操作取代但是不影响使用
* 如果发现卡在这一步请适当延长sleep时间
*/
await sleep(8000);
await recognizeTextAndClick("点击进入", RecognitionObject.Ocr(862, 966, 206, 104), 960, 540, 5000);
await sleep(15000);
//可能登录账号的时候出现月卡提醒,则先点击一次月卡。
//await genshin.blessingOfTheWelkinMoon();
//await sleep(1000);
//await genshin.blessingOfTheWelkinMoon();
//await sleep(1000);
//防止genshin.blessingOfTheWelkinMoon();方法失效,先使用物理点击。
await sleep(2000);
keyDown("VK_MENU");
await sleep(500);
for(let i = 0; i<=4; i++){
await click(genshin.width / 2.0, genshin.height * 0.8);
await sleep(1000);
}
//keyUp("VK_MENU");
await genshin.returnMainUi();
await sleep(1000);
// 如果配置了通知
notification.send("账号【" + settings.UID + "】切换成功");
}catch (error) {
log.error(`${script_name}脚本执行过程中发生错误:${error.message}`);
//如果发生错误,则发送通知
notification.error(`${script_name}脚本执行过程中发生错误:${error.message}`);
throw new Error(`${script_name}脚本执行过程中发生错误:${error.message}`);
}finally {
keyUp("VK_MENU");
}
})();

View File

@@ -1,19 +1,19 @@
{
"manifest_version": 1,
"name": "切换账号(OCR)版本",
"version": "1.2",
"description": "使用OCR实现从主页面退出登录实现切换选定账号。脚本维护/脚本问题请联系作者。\n免责申明所有的账号密码均保存在本地请使用者妥善保管账号密码请勿外泄账号密码。若因使用此脚本导致的账号泄露、封禁问题与脚本作者无关。",
"tags": [
"切换账号",
"OCR"
],
"authors": [
{
"name": "彩虹QQ人",
"email": "846224811@qq.com",
"links": "https://github.com/KRdingsan"
}
],
"settings_ui": "settings.json",
"main": "main.js"
{
"manifest_version": 1,
"name": "切换账号(OCR)版本",
"version": "1.3",
"description": "使用OCR实现从主页面退出登录实现切换选定账号。脚本维护/脚本问题请联系作者。\n免责申明所有的账号密码均保存在本地请使用者妥善保管账号密码请勿外泄账号密码。若因使用此脚本导致的账号泄露、封禁问题与脚本作者无关。",
"tags": [
"切换账号",
"OCR"
],
"authors": [
{
"name": "彩虹QQ人",
"email": "846224811@qq.com",
"links": "https://github.com/KRdingsan"
}
],
"settings_ui": "settings.json",
"main": "main.js"
}

View File

@@ -1,13 +1,13 @@
[
{
"name": "username",
"type": "input-text",
"label": "账号(账号只保存在本地,请妥善保管)"
},
{
"name": "password",
"type": "input-text",
"label": "密码(账号只保存在本地,请妥善保管)"
}
]
[
{
"name": "username",
"type": "input-text",
"label": "账号(账号只保存在本地,请妥善保管)"
},
{
"name": "password",
"type": "input-text",
"label": "密码(账号只保存在本地,请妥善保管)"
}
]

View File

@@ -1,64 +1,64 @@
(async function () {
/**
* 不使用屏幕识别的登出至其他账号的脚本
* 版本
* 原神5.5
* BIG0.44.6
*/
//实测缩放倍数1.0、1.5可行实测凡169大于1920*1080均能正常使用。
setGameMetrics(1920, 1080, 2.0);
//到达主页面
await genshin.returnMainUi();
await sleep(1000);
//打开派蒙页面
keyPress("VK_ESCAPE");
await sleep(1000);
click(50, 1030);
//退出门图标
await sleep(1000);
//退出至登录页面
click(978, 540);
await sleep(10000);
//登录页面退出当前账号的小门图标
click(1828, 985);
await sleep(1000);
//勾选:退出并保留登录记录
click(701, 573);
await sleep(1000);
//点击退出大按钮
click(1107, 684);
await sleep(1000);
//登录其他账号
click(946, 703);
await sleep(1000);
//点击用户名输入框
click(815, 400);
//如果有文本,清除
await keyPress("VK_DELETE");
// 输入文本
await inputText(settings.username);
await sleep(500);
//点击密码输入框
click(815, 480);
//如果有文本,清除
await keyPress("VK_DELETE");
// 输入文本
await inputText(settings.password);
await sleep(500);
//登录
keyPress("VK_RETURN");
await sleep(500);
//用户协议弹窗点击同意等待8.5s,增加容错
click(1093, 593);
await sleep(8500);
//进入世界循环点击,增加容错
for(let i = 3;i>0;i--){
click(960, 540);
await sleep(1500);
}
//确保进入主页面
await sleep(12000);
//点击领月卡
await genshin.blessingOfTheWelkinMoon();
(async function () {
/**
* 不使用屏幕识别的登出至其他账号的脚本
* 版本
* 原神5.5
* BIG0.44.6
*/
//实测缩放倍数1.0、1.5可行实测凡169大于1920*1080均能正常使用。
setGameMetrics(1920, 1080, 2.0);
//到达主页面
await genshin.returnMainUi();
await sleep(1000);
//打开派蒙页面
keyPress("VK_ESCAPE");
await sleep(1000);
click(50, 1030);
//退出门图标
await sleep(1000);
//退出至登录页面
click(978, 540);
await sleep(10000);
//登录页面退出当前账号的小门图标
click(1828, 985);
await sleep(1000);
//勾选:退出并保留登录记录
click(701, 573);
await sleep(1000);
//点击退出大按钮
click(1107, 684);
await sleep(1000);
//登录其他账号
click(946, 703);
await sleep(1000);
//点击用户名输入框
click(815, 400);
//如果有文本,清除
await keyPress("VK_DELETE");
// 输入文本
await inputText(settings.username);
await sleep(500);
//点击密码输入框
click(815, 480);
//如果有文本,清除
await keyPress("VK_DELETE");
// 输入文本
await inputText(settings.password);
await sleep(500);
//登录
keyPress("VK_RETURN");
await sleep(500);
//用户协议弹窗点击同意等待8.5s,增加容错
click(1093, 593);
await sleep(8500);
//进入世界循环点击,增加容错
for(let i = 3;i>0;i--){
click(960, 540);
await sleep(1500);
}
//确保进入主页面
await sleep(12000);
//点击领月卡
await genshin.blessingOfTheWelkinMoon();
})();

View File

@@ -1,19 +1,19 @@
{
"manifest_version": 1,
"name": "切换账号非OCR方案",
"version": "1.0",
"description": "从主页面退出登录实现切换选定账号。\n脚本问题请联系作者。\n免责申明所有的账号密码均保存在本地请使用者妥善保管账号密码请勿外泄账号密码。\n",
"tags": [
"切换账号",
"坐标点击"
],
"authors": [
{
"name": "彩虹QQ人",
"email": "846224811@qq.com",
"links": "https://github.com/KRdingsan"
}
],
"settings_ui": "settings.json",
"main": "main.js"
{
"manifest_version": 1,
"name": "切换账号非OCR方案",
"version": "1.0",
"description": "从主页面退出登录实现切换选定账号。\n脚本问题请联系作者。\n免责申明所有的账号密码均保存在本地请使用者妥善保管账号密码请勿外泄账号密码。\n",
"tags": [
"切换账号",
"坐标点击"
],
"authors": [
{
"name": "彩虹QQ人",
"email": "846224811@qq.com",
"links": "https://github.com/KRdingsan"
}
],
"settings_ui": "settings.json",
"main": "main.js"
}

View File

@@ -1,13 +1,13 @@
[
{
"name": "username",
"type": "input-text",
"label": "账号(账号只保存在本地)"
},
{
"name": "password",
"type": "input-text",
"label": "密码(账号只保存在本地)"
}
]
[
{
"name": "username",
"type": "input-text",
"label": "账号(账号只保存在本地)"
},
{
"name": "password",
"type": "input-text",
"label": "密码(账号只保存在本地)"
}
]

View File

Before

Width:  |  Height:  |  Size: 367 B

After

Width:  |  Height:  |  Size: 367 B

View File

Before

Width:  |  Height:  |  Size: 646 B

After

Width:  |  Height:  |  Size: 646 B

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -59,6 +59,7 @@
while (Date.now() < endTime) {
let captureRegion = captureGameRegion();
let res = captureRegion.Find(asset);
captureRegion.dispose();
if (!res.isEmpty()) {
return res;
}
@@ -77,6 +78,7 @@
while (true) {
let captureRegion = captureGameRegion();
let resList = captureRegion.findMulti(RecognitionObject.ocr(x, y, w, h));
captureRegion.dispose();
if (typeof text === "string") {
let textFound = u.findText(resList, text);
if (textFound) {
@@ -124,6 +126,7 @@
let captureRegion = captureGameRegion();
let resList = captureRegion.findMulti(RecognitionObject.ocrThis);
captureRegion.dispose();
for (let i = 0; i < resList.count; i++) {
let res = resList[i];
@@ -138,6 +141,7 @@
let captureRegionGetReward = captureGameRegion();
let resGetReward = captureRegionGetReward.findMulti(RecognitionObject.ocrThis);
captureRegionGetReward.dispose();
for (let i = 0; i < resGetReward.count; i++) {
let res = resGetReward[i];
if (res.text.includes("点击") || res.text.includes("空白") || res.text.includes("获得")) {
@@ -158,6 +162,7 @@
if (logoutIconFound) {
let resList = captureRegion.findMulti(RecognitionObject.ocr(u.x(850), u.y(970), u.x(220), u.y(100)));
captureRegion.dispose();
if (u.findText(resList, "点击进入")) {
u.logi("检测到目前处于登录界面");
return false;
@@ -169,6 +174,7 @@
// Not in the login screen, check if is in the game main menu.
let paimonIcon = captureRegion.Find(assetPaimonMenuIcon);
captureRegion.dispose();
if (!paimonIcon.isEmpty()) {
u.logi("检测到目前处于游戏主界面");
return true;
@@ -236,6 +242,7 @@
const assetSelectUserDropDownIcon = u.loadTemplate("assets/caret.png", 680, 380, 1220, 720);
let captureRegion = captureGameRegion();
let res = captureRegion.Find(assetSelectUserDropDownIcon);
captureRegion.dispose();
if (res.isEmpty()) {
u.logi("未找到下拉菜单图标,点击硬编码的坐标(960, 500)展开菜单");
click(u.x(960), u.y(500));
@@ -255,6 +262,7 @@
let captureRegion = captureGameRegion();
let resList = captureRegion.findMulti(RecognitionObject.ocr(u.x(680), u.y(540), u.x(540), u.y(500)));
captureRegion.dispose();
for (let i = 0; i < resList.count; i++) {
let res = resList[i];
let user = lastLog > start ? u.matchUserRelaxed(res.text, targetUser) : u.matchUser(res.text, targetUser);
@@ -285,6 +293,8 @@
let captureRegion = captureGameRegion();
let btnEnterGame = captureRegion.DeriveCrop(u.x(684), u.y(598), u.x(552), u.y(66));
btnEnterGame.Click();
captureRegion.dispose();
btnEnterGame.dispose();
// btnEnterGame.DrawSelf("EnterGameBtn");
// u.logi("已点击\"进入游戏\"按钮,完成账号选择。");
}

View File

@@ -1,7 +1,7 @@
{
"manifest_version": 1,
"name": "切换账号(从下拉列表中选择)",
"version": "1.1",
"version": "1.2",
"bgi_version": "0.49.0",
"description": "退出当前登录用户并从列表中选定指定用户,纯鼠标操作。",
"tags": [

View File

Before

Width:  |  Height:  |  Size: 594 B

After

Width:  |  Height:  |  Size: 594 B

View File

Before

Width:  |  Height:  |  Size: 239 B

After

Width:  |  Height:  |  Size: 239 B

View File

Before

Width:  |  Height:  |  Size: 652 B

After

Width:  |  Height:  |  Size: 652 B

View File

@@ -1,163 +1,160 @@
(async function () {
//模板匹配得到烹制时间
async function getPerfectCookingWaitTime() {
let extraTime = settings.extraTime || 0; //
let threshold0 = Number(settings.threshold0) || 0.9;
extraTime = extraTime+300;
const checkPoints = [
{x: 741, y: 772}, // 原始点1
{x: 758, y: 766}, // 中间点1-2
{x: 776, y: 760}, // 原始点2
{x: 793, y: 755}, // 中间点2-3
{x: 810, y: 751}, // 原始点3
{x: 827, y: 747}, // 中间点3-4
{x: 845, y: 744}, // 原始点4
{x: 861, y: 742}, // 中间点4-5
{x: 878, y: 740}, // 原始点5
{x: 897, y: 737}, // 中间点5-6
{x: 916, y: 735}, // 原始点6
{x: 933, y: 735}, // 中间点6-7
{x: 950, y: 736}, // 原始点7
{x: 968, y: 736}, // 中间点7-8
{x: 986, y: 737}, // 原始点8
{x: 1002, y: 738}, // 中间点8-9
{x: 1019, y: 740}, // 原始点9
{x: 1038, y: 742}, // 中间点9-10
{x: 1057, y: 744}, // 原始点10
{x: 1074, y: 748}, // 中间点10-11
{x: 1092, y: 752}, // 原始点11
{x: 1107, y: 757}, // 中间点11-12
{x: 1122, y: 762}, // 原始点12
{x: 1138, y: 766}, // 中间点12-13
{x: 1154, y: 770}, // 原始点13
{x: 1170, y: 774}, // 中间点13-14
{x: 1193, y: 779} // 原始点14
];
// 区域大小
const regionSize = 60;
// 加载模板图片
const templateMat0 = file.readImageMatSync("assets/best0.png");
const templateMat1 = file.readImageMatSync("assets/best1.png");
const templateMat2 = file.readImageMatSync("assets/best2.png");
// 创建模板匹配识别对象
const templateRo0 = RecognitionObject.templateMatch(templateMat0);
const templateRo1 = RecognitionObject.templateMatch(templateMat1);
const templateRo2 = RecognitionObject.templateMatch(templateMat2);
templateRo0.threshold = threshold0;
templateRo0.Use3Channels = true;
templateRo1.threshold = threshold0;
templateRo1.Use3Channels = true;
templateRo2.threshold = threshold0;
templateRo2.Use3Channels = true;
// 捕获游戏区域
const gameRegion = captureGameRegion();
// 检查每个点
for (let i = 0; i < checkPoints.length; i++) {
const point = checkPoints[i];
// 裁剪出当前检测区域
const region = gameRegion.deriveCrop(
point.x - regionSize/2,
point.y - regionSize/2,
regionSize,
regionSize
);
let result;
if (i < 9) {
result = region.find(templateRo0);
} else if (i >= 18) {
result = region.find(templateRo2);
} else {
result = region.find(templateRo1);
}
if (!result.isEmpty()) {
const segmentTime = 66;
const waitTime = Math.round(i * segmentTime+extraTime);
log.info(`找到点位${i}号区域`);
await sleep(waitTime);
keyPress("VK_SPACE");
return 0;
}
}
log.info(`未找到点位区域,烹饪结束`);
keyPress("ESCAPE");
await sleep(1000);
keyPress("ESCAPE");
throw new Error("人家才不是错误呢>_<");
}
//主要流程
await sleep(1000);
await pathingScript.runFile("assets/前往蒙德灶台.json");
keyPress("F");
await sleep(1000);
click(910, 51);//选择料理
await sleep(1000);
click(170, 1020);//筛选
await sleep(500);
click(195, 1020);//重置
await sleep(500);
click(195, 675);//熟练度未满
await sleep(1000);
click(490, 1020);//确认筛选
await sleep(1000);
let sum= 0;
while (1) {
await sleep(500);
click(175, 200);//选择第一个菜
await sleep(500);
click(1700, 1020);//制作
await sleep(1000);
click(1080, 1015);//手动烹饪
await sleep(1000);//等待画面稳定
//自动烹饪
await getPerfectCookingWaitTime();
log.info(`${sum+1}次烹饪`);
await sleep(1000);
click(975, 900);//确认
await sleep(500);
click(215, 1015);//重新排序
await sleep(500);
click(1700, 1020);//制作
await sleep(500);
click(1700, 1020);//制作
await sleep(1000);
keyPress("ESCAPE");
await sleep(1000);
click(215, 1015);//重新排序
await sleep(1000);
sum++;
}
})();
(async function () {
//模板匹配得到烹制时间
async function getPerfectCookingWaitTime() {
let extraTime = settings.extraTime || 0; //
let threshold0 = Number(settings.threshold0) || 0.9;
extraTime = extraTime+300;
const checkPoints = [
{x: 741, y: 772}, // 原始点1
{x: 758, y: 766}, // 中间点1-2
{x: 776, y: 760}, // 原始点2
{x: 793, y: 755}, // 中间点2-3
{x: 810, y: 751}, // 原始点3
{x: 827, y: 747}, // 中间点3-4
{x: 845, y: 744}, // 原始点4
{x: 861, y: 742}, // 中间点4-5
{x: 878, y: 740}, // 原始点5
{x: 897, y: 737}, // 中间点5-6
{x: 916, y: 735}, // 原始点6
{x: 933, y: 735}, // 中间点6-7
{x: 950, y: 736}, // 原始点7
{x: 968, y: 736}, // 中间点7-8
{x: 986, y: 737}, // 原始点8
{x: 1002, y: 738}, // 中间点8-9
{x: 1019, y: 740}, // 原始点9
{x: 1038, y: 742}, // 中间点9-10
{x: 1057, y: 744}, // 原始点10
{x: 1074, y: 748}, // 中间点10-11
{x: 1092, y: 752}, // 原始点11
{x: 1107, y: 757}, // 中间点11-12
{x: 1122, y: 762}, // 原始点12
{x: 1138, y: 766}, // 中间点12-13
{x: 1154, y: 770}, // 原始点13
{x: 1170, y: 774}, // 中间点13-14
{x: 1193, y: 779} // 原始点14
];
// 区域大小
const regionSize = 60;
// 加载模板图片
const templateMat0 = file.readImageMatSync("assets/best0.png");
const templateMat1 = file.readImageMatSync("assets/best1.png");
const templateMat2 = file.readImageMatSync("assets/best2.png");
// 创建模板匹配识别对象
const templateRo0 = RecognitionObject.templateMatch(templateMat0);
const templateRo1 = RecognitionObject.templateMatch(templateMat1);
const templateRo2 = RecognitionObject.templateMatch(templateMat2);
templateRo0.threshold = threshold0;
templateRo0.Use3Channels = true;
templateRo1.threshold = threshold0;
templateRo1.Use3Channels = true;
templateRo2.threshold = threshold0;
templateRo2.Use3Channels = true;
// 捕获游戏区域
const gameRegion = captureGameRegion();
// 检查每个点
for (let i = 0; i < checkPoints.length; i++) {
const point = checkPoints[i];
// 裁剪出当前检测区域
const region = gameRegion.deriveCrop(
point.x - regionSize/2,
point.y - regionSize/2,
regionSize,
regionSize
);
let result;
if (i < 9) {
result = region.find(templateRo0);
} else if (i >= 18) {
result = region.find(templateRo2);
} else {
result = region.find(templateRo1);
}
if (!result.isEmpty()) {
const segmentTime = 66;
const waitTime = Math.round(i * segmentTime+extraTime);
log.info(`找到点位${i}号区域`);
await sleep(waitTime);
keyPress("VK_SPACE");
return 0;
}
}
log.info(`未找到点位区域,烹饪结束`);
keyPress("ESCAPE");
await sleep(1000);
keyPress("ESCAPE");
throw new Error("人家才不是错误呢>_<");
}
//主要流程
await sleep(1000);
await pathingScript.runFile("assets/前往蒙德灶台.json");
keyPress("F");
await sleep(1000);
click(910, 51);//选择料理
await sleep(1000);
click(170, 1020);//筛选
await sleep(500);
click(195, 1020);//重置
await sleep(500);
click(195, 675);//熟练度未满
await sleep(1000);
click(490, 1020);//确认筛选
await sleep(1000);
let sum= 0;
while (1) {
await sleep(500);
click(175, 200);//选择第一个菜
await sleep(500);
click(1700, 1020);//制作
await sleep(1000);
click(1080, 1015);//手动烹饪
await sleep(1000);//等待画面稳定
//自动烹饪
await getPerfectCookingWaitTime();
log.info(`${sum+1}次烹饪`);
await sleep(1000);
click(975, 900);//确认
await sleep(500);
click(215, 1015);//重新排序
await sleep(500);
click(1700, 1020);//制作
await sleep(500);
click(1700, 1020);//制作
await sleep(1000);
keyPress("ESCAPE");
await sleep(1000);
click(215, 1015);//重新排序
await sleep(1000);
sum++;
}
})();

View File

@@ -1,58 +1,58 @@
/**
* === 重要免责声明 ===
* 1. 使用风险
* - 本脚本为开源学习项目,禁止用于商业用途或违反游戏条款的行为。
* - 滥用可能导致游戏账号封禁,开发者不承担任何直接或间接责任。
*
* 2. 责任限制
* - 本脚本按“现状”提供,不承诺兼容性、安全性或功能完整性。
* - 因使用本脚本导致的账号、数据、设备损失,开发者概不负责。
*
* 3. 禁止条款
* - 严禁恶意篡改或用于外挂等非法用途。
* - 如游戏运营商提出要求,开发者保留随时停止维护的权利。
*
* 使用即表示您已阅读并同意上述条款。
*
* Last Updated: 2025-05-14
*/
# 鸟蛋自动采集脚本
## 介绍
本脚本旨在为用户提供自动采集鸟蛋的辅助工具。鸣谢:@不瘦五十斤不改名@灰林鸮
## 脚本功能
- 自动整合仓库内的鸟蛋采集脚本;
- 按照国家、地区及拖图顺序进行采集任务整理。
## 更新日志
### 1.02025.05.14
- 整合并梳理仓库内鸟蛋采集脚本;
- 新增以下采集脚本:
- "05-鸟蛋-璃月-石门上-2个"
- "18-鸟蛋-璃月-孤云阁左上-2个"
- "23-鸟蛋-璃月-药蝶谷左-2个"
- "24-鸟蛋-璃月-赤璋城垣左上神像-2个"
- "25-鸟蛋-璃月-赤望台左-2个"
- "26-鸟蛋-璃月-灵濛山左上-2个"
- "27-鸟蛋-枫丹-梅洛彼得堡下神像-2个"
- "32-鸟蛋-枫丹-幽林雾道右上-6个"
- "34-鸟蛋-须弥-谒颂幽境左上-2个"
- "36-鸟蛋-须弥-三运河之地左-2个"
- "38-鸟蛋-稻妻-越石村左-2个"
- "39-鸟蛋-稻妻-黄金王兽下-2个"
- 移除重复脚本:"鸟蛋-纳塔-回声之子下-2蛋"
- 移除高风险脚本:
- "鸟蛋-纳塔-坚岩隘谷-5蛋"
- "鸟蛋-稻妻-绯木村-2蛋【高危】"
- "鸟蛋-稻妻-踏鞴砂-3蛋"(因可能导致采集失败)
- 移除易触发好感事件的脚本:"鸟蛋-璃月-绝云间右-2蛋"。
## 后言
/**
* === 重要免责声明 ===
* 1. 使用风险
* - 本脚本为开源学习项目,禁止用于商业用途或违反游戏条款的行为。
* - 滥用可能导致游戏账号封禁,开发者不承担任何直接或间接责任。
*
* 2. 责任限制
* - 本脚本按“现状”提供,不承诺兼容性、安全性或功能完整性。
* - 因使用本脚本导致的账号、数据、设备损失,开发者概不负责。
*
* 3. 禁止条款
* - 严禁恶意篡改或用于外挂等非法用途。
* - 如游戏运营商提出要求,开发者保留随时停止维护的权利。
*
* 使用即表示您已阅读并同意上述条款。
*
* Last Updated: 2025-05-14
*/
# 鸟蛋自动采集脚本
## 介绍
本脚本旨在为用户提供自动采集鸟蛋的辅助工具。鸣谢:@不瘦五十斤不改名@灰林鸮
## 脚本功能
- 自动整合仓库内的鸟蛋采集脚本;
- 按照国家、地区及拖图顺序进行采集任务整理。
## 更新日志
### 1.02025.05.14
- 整合并梳理仓库内鸟蛋采集脚本;
- 新增以下采集脚本:
- "05-鸟蛋-璃月-石门上-2个"
- "18-鸟蛋-璃月-孤云阁左上-2个"
- "23-鸟蛋-璃月-药蝶谷左-2个"
- "24-鸟蛋-璃月-赤璋城垣左上神像-2个"
- "25-鸟蛋-璃月-赤望台左-2个"
- "26-鸟蛋-璃月-灵濛山左上-2个"
- "27-鸟蛋-枫丹-梅洛彼得堡下神像-2个"
- "32-鸟蛋-枫丹-幽林雾道右上-6个"
- "34-鸟蛋-须弥-谒颂幽境左上-2个"
- "36-鸟蛋-须弥-三运河之地左-2个"
- "38-鸟蛋-稻妻-越石村左-2个"
- "39-鸟蛋-稻妻-黄金王兽下-2个"
- 移除重复脚本:"鸟蛋-纳塔-回声之子下-2蛋"
- 移除高风险脚本:
- "鸟蛋-纳塔-坚岩隘谷-5蛋"
- "鸟蛋-稻妻-绯木村-2蛋【高危】"
- "鸟蛋-稻妻-踏鞴砂-3蛋"(因可能导致采集失败)
- 移除易触发好感事件的脚本:"鸟蛋-璃月-绝云间右-2蛋"。
## 后言
本脚本目前处于测试阶段,可能仍存在未发现的问题。欢迎通过 QQ1765137214 提交反馈。

View File

@@ -58,6 +58,7 @@
"芝士贝果": "https://github.com/cheese-bagel",
"MissDan": "https://github.com/MisDandan23",
"白白喵": "https://github.com/taotao568685",
"躁动的氨气": "https://github.com/zaodonganqi"
"躁动的氨气": "https://github.com/zaodonganqi",
"海豹穹穹队": "https: //github.com/OhmyPaoPao"
}
}
}

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

1216
repo.json

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More