Compare commits
5 Commits
42520b3146
...
4850932db2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4850932db2 | ||
|
|
eac3b770ea | ||
|
|
9cc7c3ff7a | ||
|
|
57104f4c87 | ||
|
|
64e50be6e4 |
26
repo.json
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"time": "20250806010023",
|
||||
"time": "20250807084551",
|
||||
"url": "https://github.com/babalae/bettergi-scripts-list/archive/refs/heads/main.zip",
|
||||
"file": "repo.json",
|
||||
"indexes": [
|
||||
@@ -74015,8 +74015,8 @@
|
||||
{
|
||||
"name": "AutoFontaineLeyLine",
|
||||
"type": "directory",
|
||||
"hash": "343c42b201fe5653a1f7e16b7220039ac70fab0b",
|
||||
"version": "3.3",
|
||||
"hash": "90fba627f9900c94b3051947d36e0857729ab1f8",
|
||||
"version": "3.4",
|
||||
"author": "LCB-茶包",
|
||||
"authors": [
|
||||
{
|
||||
@@ -74041,7 +74041,7 @@
|
||||
"bgi≥0.44.8",
|
||||
"地脉花"
|
||||
],
|
||||
"lastUpdated": "2025-07-16 23:13:30"
|
||||
"lastUpdated": "2025-08-07 08:45:14"
|
||||
},
|
||||
{
|
||||
"name": "AutoFriendshipEvilBaresItsFangsGetRawMeat",
|
||||
@@ -74243,6 +74243,24 @@
|
||||
],
|
||||
"lastUpdated": "2025-07-28 12:15:15"
|
||||
},
|
||||
{
|
||||
"name": "AutoStygianOnslaught",
|
||||
"type": "directory",
|
||||
"hash": "d0cfdd78a03a253e842691412267a12531f1cf05",
|
||||
"version": "1.7",
|
||||
"author": "LCB-茶包",
|
||||
"authors": [
|
||||
{
|
||||
"name": "LCB-茶包"
|
||||
}
|
||||
],
|
||||
"description": "自动幽境危战~|~请先配置好秘境内的队伍,幽境危战战斗失败或执行错误会重试一次,请保证队伍实力",
|
||||
"tags": [
|
||||
"bgi≥0.44.8",
|
||||
"幽境危战"
|
||||
],
|
||||
"lastUpdated": "2025-08-07 08:44:31"
|
||||
},
|
||||
{
|
||||
"name": "AutoSwitchRoles",
|
||||
"type": "directory",
|
||||
|
||||
@@ -45,7 +45,7 @@ const npcData = {
|
||||
"page": 2,
|
||||
"time": "any",
|
||||
"path": "assets/path/葵.json",
|
||||
"goods": ["洋葱", "牛奶", "卷心菜", "土豆", "稻米", "虾仁", "豆腐", "盐", "胡椒", "番茄"]
|
||||
"goods": ["洋葱", "牛奶", "卷心菜", "土豆", "小麦", "稻米", "虾仁", "豆腐", "盐", "胡椒", "番茄"]
|
||||
},
|
||||
"ShimuraKanbei": {
|
||||
"name": "志村勘兵卫",
|
||||
@@ -86,12 +86,13 @@ const npcData = {
|
||||
"time": "any",
|
||||
"path": "assets/path/恩忒卡.json",
|
||||
"goods": ["咖啡豆"]
|
||||
},
|
||||
}
|
||||
,
|
||||
"Azalai": {
|
||||
"name": "阿扎莱",
|
||||
"enable": true,
|
||||
"page": 2,
|
||||
"time": "any",
|
||||
"time": "night",
|
||||
"path": "assets/path/阿扎莱.json",
|
||||
"goods": ["鱼肉", "兽肉", "秃秃豆"]
|
||||
},
|
||||
|
||||
@@ -23,51 +23,51 @@
|
||||
'全天': ['花鳉', '维护机关·澄金领队型', '海涛斧枪鱼', '维护机关·初始能力型', '甜甜花鳉', '炮鲀', '锖假龙', '金赤假龙', '玉玉心羽鲈', '苦炮鲀', '琉璃花鳉', '伪装鲨鲨独角鱼', '拟似燃素独角鱼', '炽岩斗士急流鱼', '蓝染花鳉', '青金斧枪鱼', '翡玉斧枪鱼', '佛玛洛鳐', '迪芙妲鳐', '秘源机关·巡戒使']
|
||||
}
|
||||
const fish_msg = { // 可能有误,需要检查
|
||||
'花鳉': {'bait': '果酿饵', 'time': '全天'},
|
||||
'波波心羽鲈': {'bait': '酸桔饵', 'time': '夜晚'},
|
||||
'烘烘心羽鲈': {'bait': '酸桔饵', 'time': '白天'},
|
||||
'维护机关·水域清理者': {'bait': '维护机关频闪诱饵', 'time': '白天'},
|
||||
'维护机关·态势控制者': {'bait': '维护机关频闪诱饵', 'time': '夜晚'},
|
||||
'维护机关·澄金领队型': {'bait': '维护机关频闪诱饵', 'time': '全天'},
|
||||
'海涛斧枪鱼': {'bait': '甘露饵', 'time': '全天'},
|
||||
'维护机关·初始能力型': {'bait': '维护机关频闪诱饵', 'time': '全天'},
|
||||
'维护机关·白金典藏型': {'bait': '维护机关频闪诱饵', 'time': '夜晚'},
|
||||
'吹沙角鲀': {'bait': '甘露饵', 'time': '白天'},
|
||||
'甜甜花鳉': {'bait': '果酿饵', 'time': '全天'},
|
||||
'擒霞客': {'bait': '果酿饵', 'time': '夜晚'},
|
||||
'水晶宴': {'bait': '果酿饵', 'time': '白天'},
|
||||
'斗棘鱼': {'bait': '赤糜饵', 'time': '夜晚'},
|
||||
'炮鲀': {'bait': '飞蝇假饵', 'time': '全天'},
|
||||
'流纹褐蝶鱼': {'bait': '蠕虫假饵', 'time': '白天'},
|
||||
'锖假龙': {'bait': '飞蝇假饵', 'time': '全天'},
|
||||
'金赤假龙': {'bait': '飞蝇假饵', 'time': '全天'},
|
||||
'玉玉心羽鲈': {'bait': '酸桔饵', 'time': '全天'},
|
||||
'赤魔王': {'bait': '赤糜饵', 'time': '白天'},
|
||||
'长生仙': {'bait': '蠕虫假饵', 'time': '白天'},
|
||||
'苦炮鲀': {'bait': '飞蝇假饵', 'time': '全天'},
|
||||
'肺棘鱼': {'bait': '赤糜饵', 'time': '夜晚'},
|
||||
'流纹京紫蝶鱼': {'bait': '蠕虫假饵', 'time': '白天'},
|
||||
'琉璃花鳉': {'bait': '果酿饵', 'time': '全天'},
|
||||
'伪装鲨鲨独角鱼': {'bait': '澄晶果粒饵', 'time': '全天'},
|
||||
'繁花斗士急流鱼': {'bait': '澄晶果粒饵', 'time': '夜晚'},
|
||||
'深潜斗士急流鱼': {'bait': '澄晶果粒饵', 'time': '白天'},
|
||||
'晚霞翻车鲀': {'bait': '澄晶果粒饵', 'time': '夜晚'},
|
||||
'青浪翻车鲀': {'bait': '澄晶果粒饵', 'time': '白天'},
|
||||
'拟似燃素独角鱼': {'bait': '温火饵', 'time': '全天'},
|
||||
'炽岩斗士急流鱼': {'bait': '温火饵', 'time': '全天'},
|
||||
'蓝染花鳉': {'bait': '果酿饵', 'time': '全天'},
|
||||
'鸩棘鱼': {'bait': '赤糜饵', 'time': '夜晚'},
|
||||
'流纹茶蝶鱼': {'bait': '蠕虫假饵', 'time': '白天'},
|
||||
'雪中君': {'bait': '赤糜饵', 'time': '夜晚'},
|
||||
'真果角鲀': {'bait': '甘露饵', 'time': '白天'},
|
||||
'青金斧枪鱼': {'bait': '甘露饵', 'time': '全天'},
|
||||
'暮云角鲀': {'bait': '甘露饵', 'time': '夜晚'},
|
||||
'翡玉斧枪鱼': {'bait': '甘露饵', 'time': '全天'},
|
||||
'沉波蜜桃': {'bait': '甘露饵', 'time': '白天'},
|
||||
'雷鸣仙': {'bait': '蠕虫假饵', 'time': '夜晚'},
|
||||
'佛玛洛鳐': {'bait': '飞蝇假饵', 'time': '全天'},
|
||||
'迪芙妲鳐': {'bait': '飞蝇假饵', 'time': '全天'},
|
||||
'秘源机关·巡戒使': {'bait': '温火饵', 'time': '全天'}
|
||||
'花鳉': { 'bait': '果酿饵', 'time': '全天' },
|
||||
'波波心羽鲈': { 'bait': '酸桔饵', 'time': '夜晚' },
|
||||
'烘烘心羽鲈': { 'bait': '酸桔饵', 'time': '白天' },
|
||||
'维护机关·水域清理者': { 'bait': '维护机关频闪诱饵', 'time': '白天' },
|
||||
'维护机关·态势控制者': { 'bait': '维护机关频闪诱饵', 'time': '夜晚' },
|
||||
'维护机关·澄金领队型': { 'bait': '维护机关频闪诱饵', 'time': '全天' },
|
||||
'海涛斧枪鱼': { 'bait': '甘露饵', 'time': '全天' },
|
||||
'维护机关·初始能力型': { 'bait': '维护机关频闪诱饵', 'time': '全天' },
|
||||
'维护机关·白金典藏型': { 'bait': '维护机关频闪诱饵', 'time': '夜晚' },
|
||||
'吹沙角鲀': { 'bait': '甘露饵', 'time': '白天' },
|
||||
'甜甜花鳉': { 'bait': '果酿饵', 'time': '全天' },
|
||||
'擒霞客': { 'bait': '果酿饵', 'time': '夜晚' },
|
||||
'水晶宴': { 'bait': '果酿饵', 'time': '白天' },
|
||||
'斗棘鱼': { 'bait': '赤糜饵', 'time': '夜晚' },
|
||||
'炮鲀': { 'bait': '飞蝇假饵', 'time': '全天' },
|
||||
'流纹褐蝶鱼': { 'bait': '蠕虫假饵', 'time': '白天' },
|
||||
'锖假龙': { 'bait': '飞蝇假饵', 'time': '全天' },
|
||||
'金赤假龙': { 'bait': '飞蝇假饵', 'time': '全天' },
|
||||
'玉玉心羽鲈': { 'bait': '酸桔饵', 'time': '全天' },
|
||||
'赤魔王': { 'bait': '赤糜饵', 'time': '白天' },
|
||||
'长生仙': { 'bait': '蠕虫假饵', 'time': '白天' },
|
||||
'苦炮鲀': { 'bait': '飞蝇假饵', 'time': '全天' },
|
||||
'肺棘鱼': { 'bait': '赤糜饵', 'time': '夜晚' },
|
||||
'流纹京紫蝶鱼': { 'bait': '蠕虫假饵', 'time': '白天' },
|
||||
'琉璃花鳉': { 'bait': '果酿饵', 'time': '全天' },
|
||||
'伪装鲨鲨独角鱼': { 'bait': '澄晶果粒饵', 'time': '全天' },
|
||||
'繁花斗士急流鱼': { 'bait': '澄晶果粒饵', 'time': '夜晚' },
|
||||
'深潜斗士急流鱼': { 'bait': '澄晶果粒饵', 'time': '白天' },
|
||||
'晚霞翻车鲀': { 'bait': '澄晶果粒饵', 'time': '夜晚' },
|
||||
'青浪翻车鲀': { 'bait': '澄晶果粒饵', 'time': '白天' },
|
||||
'拟似燃素独角鱼': { 'bait': '温火饵', 'time': '全天' },
|
||||
'炽岩斗士急流鱼': { 'bait': '温火饵', 'time': '全天' },
|
||||
'蓝染花鳉': { 'bait': '果酿饵', 'time': '全天' },
|
||||
'鸩棘鱼': { 'bait': '赤糜饵', 'time': '夜晚' },
|
||||
'流纹茶蝶鱼': { 'bait': '蠕虫假饵', 'time': '白天' },
|
||||
'雪中君': { 'bait': '赤糜饵', 'time': '夜晚' },
|
||||
'真果角鲀': { 'bait': '甘露饵', 'time': '白天' },
|
||||
'青金斧枪鱼': { 'bait': '甘露饵', 'time': '全天' },
|
||||
'暮云角鲀': { 'bait': '甘露饵', 'time': '夜晚' },
|
||||
'翡玉斧枪鱼': { 'bait': '甘露饵', 'time': '全天' },
|
||||
'沉波蜜桃': { 'bait': '甘露饵', 'time': '白天' },
|
||||
'雷鸣仙': { 'bait': '蠕虫假饵', 'time': '夜晚' },
|
||||
'佛玛洛鳐': { 'bait': '飞蝇假饵', 'time': '全天' },
|
||||
'迪芙妲鳐': { 'bait': '飞蝇假饵', 'time': '全天' },
|
||||
'秘源机关·巡戒使': { 'bait': '温火饵', 'time': '全天' }
|
||||
}
|
||||
const path_pathing = [
|
||||
'枫丹-垂钓点-伊黎耶林区幽林雾道西南-花鳉_波波心羽鲈_烘烘心羽鲈_维护机关·水域清理者_维护机关·态势控制者_维护机关·澄金领队型-果酿饵_酸橘饵_维护机关频闪诱饵-普通',
|
||||
@@ -140,19 +140,19 @@
|
||||
'须弥-垂钓点-下风蚀地阿如村-花鳉_水晶宴_吹沙角鲀_暮云角鲀_翡玉斧枪鱼-果酿饵_甘露饵-普通',
|
||||
'须弥-垂钓点-千壑沙地「五绿洲」的孑遗-真果角鲀_吹沙角鲀_暮云角鲀_青金斧枪鱼_翡玉斧枪鱼-甘露饵-战斗',
|
||||
'须弥-垂钓点-护世森无郁稠林-沉波蜜桃_暮云角鲀_青金斧枪鱼_翡玉斧枪鱼-甘露饵-普通',
|
||||
'须弥-垂钓点-桓那兰那觉王之殿北-花鳉_青果角鲀_吹沙角鲀_暮云角鲀_青金斧枪鱼_翡玉斧枪鱼-果酿饵_甘露饵-普通',
|
||||
'须弥-垂钓点-桓那兰那觉王之殿北-花鳉_真果角鲀_吹沙角鲀_暮云角鲀_青金斧枪鱼_翡玉斧枪鱼-果酿饵_甘露饵-普通',
|
||||
'须弥-垂钓点-荒石苍漠铁穆山南-擒霞客_真果角鲀_吹沙角鲀_暮云角鲀_青金斧枪鱼_翡玉斧枪鱼-果酿饵_甘露饵-普通',
|
||||
'须弥-垂钓点-道成林天臂池-赤魔王_青果角鲀_吹沙角鲀_暮云角鲀_青金斧枪鱼_翡玉斧枪鱼-赤糜饵_甘露饵-普通',
|
||||
'须弥-垂钓点-道成林维摩庄北-花鳉_青果角鲀_吹沙角鲀_暮云角鲀_青金斧枪鱼_翡玉斧枪鱼-果酿饵_甘露饵-普通',
|
||||
'须弥-垂钓点-道成林天臂池-赤魔王_真果角鲀_吹沙角鲀_暮云角鲀_青金斧枪鱼_翡玉斧枪鱼-赤糜饵_甘露饵-普通',
|
||||
'须弥-垂钓点-道成林维摩庄北-花鳉_真果角鲀_吹沙角鲀_暮云角鲀_青金斧枪鱼_翡玉斧枪鱼-果酿饵_甘露饵-普通',
|
||||
'须弥-垂钓点-道成林须弥城南-擒霞客_吹沙角鲀_暮云角鲀_青金斧枪鱼-果酿饵_甘露饵-普通',
|
||||
'须弥-垂钓点-阿陀河谷奥摩斯港北-水晶宴_青果角鲀_吹沙角鲀_暮云角鲀_青金斧枪鱼_翡玉斧枪鱼-果酿饵_甘露饵-普通',
|
||||
'须弥-垂钓点-阿陀河谷降诸魔山-擒霞客_青果角鲀_暮云角鲀_翡玉斧枪鱼-果酿饵_甘露饵-普通',
|
||||
'须弥-垂钓点-阿陀河谷奥摩斯港北-水晶宴_真果角鲀_吹沙角鲀_暮云角鲀_青金斧枪鱼_翡玉斧枪鱼-果酿饵_甘露饵-普通',
|
||||
'须弥-垂钓点-阿陀河谷降诸魔山-擒霞客_真果角鲀_暮云角鲀_翡玉斧枪鱼-果酿饵_甘露饵-普通',
|
||||
]
|
||||
const fishing_time_dic = {
|
||||
"全天": {"name": "All", "param": 0},
|
||||
"白天": {"name": "Daytime", "param": 1},
|
||||
"夜晚": {"name": "Nighttime", "param": 2},
|
||||
"禁用": {"name": "Block", "param": ""},
|
||||
"全天": { "name": "All", "param": 0 },
|
||||
"白天": { "name": "Daytime", "param": 1 },
|
||||
"夜晚": { "name": "Nighttime", "param": 2 },
|
||||
"禁用": { "name": "Block", "param": "" },
|
||||
}
|
||||
const statue_name = "蒙德-七天神像-苍风高地";
|
||||
// 存储本次任务中的所有鱼类,作为调节时间的关键参考
|
||||
@@ -207,9 +207,9 @@
|
||||
content[user_id][pathing_name]["Nighttime"] = timestamp;
|
||||
} else if (time_status === "白天") {
|
||||
content[user_id][pathing_name]["Daytime"] = timestamp;
|
||||
content[user_id][pathing_name]["Nighttime"] = Object.keys(content[user_id][pathing_name]).includes("Nighttime") ? content[user_id][pathing_name]["Nighttime"]: null;
|
||||
content[user_id][pathing_name]["Nighttime"] = Object.keys(content[user_id][pathing_name]).includes("Nighttime") ? content[user_id][pathing_name]["Nighttime"] : null;
|
||||
} else if (time_status === "夜晚") {
|
||||
content[user_id][pathing_name]["Daytime"] = Object.keys(content[user_id][pathing_name]).includes("Daytime") ? content[user_id][pathing_name]["Daytime"]: null;
|
||||
content[user_id][pathing_name]["Daytime"] = Object.keys(content[user_id][pathing_name]).includes("Daytime") ? content[user_id][pathing_name]["Daytime"] : null;
|
||||
content[user_id][pathing_name]["Nighttime"] = timestamp;
|
||||
}
|
||||
|
||||
@@ -290,15 +290,15 @@
|
||||
let regex_area, regex_fish, regex_bait;
|
||||
|
||||
// 读取地区
|
||||
let path_sort_area = typeof(settings.path_sort_area) === 'undefined' || settings.path_sort_area === "" ? [] : settings.path_sort_area.split(' ');
|
||||
let path_sort_area = typeof (settings.path_sort_area) === 'undefined' || settings.path_sort_area === "" ? [] : settings.path_sort_area.split(' ');
|
||||
// 读取鱼类
|
||||
let path_sort_fish = typeof(settings.path_sort_fish) === 'undefined' || settings.path_sort_fish === "" ? [] : settings.path_sort_fish.split(' ');
|
||||
let path_sort_fish = typeof (settings.path_sort_fish) === 'undefined' || settings.path_sort_fish === "" ? [] : settings.path_sort_fish.split(' ');
|
||||
// 读取鱼饵
|
||||
let path_sort_bait = typeof(settings.path_sort_bait) === 'undefined' || settings.path_sort_bait === "" ? [] : settings.path_sort_bait.split(' ');
|
||||
let path_sort_bait = typeof (settings.path_sort_bait) === 'undefined' || settings.path_sort_bait === "" ? [] : settings.path_sort_bait.split(' ');
|
||||
// 读取兑换材料
|
||||
let path_sort_material = typeof(settings.path_sort_material) === 'undefined' ? "无(默认)" : settings.path_sort_material;
|
||||
let path_sort_material = typeof (settings.path_sort_material) === 'undefined' ? "无(默认)" : settings.path_sort_material;
|
||||
// 读取调试信息
|
||||
let path_select = typeof(settings.path_select) === 'undefined' ? "无(默认)" : settings.path_select;
|
||||
let path_select = typeof (settings.path_select) === 'undefined' ? "无(默认)" : settings.path_select;
|
||||
|
||||
// 调式模式
|
||||
if (path_select !== "无(默认)") {
|
||||
@@ -362,7 +362,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
for (const path of path_pathing) {
|
||||
for (const path of path_pathing) {
|
||||
if (regex_area.test(path) && regex_fish.test(path) && regex_bait_include.test(path)) { // 逻辑薄弱点,可能导致bug
|
||||
path_list.push(path);
|
||||
}
|
||||
@@ -376,7 +376,7 @@
|
||||
// 作为时间调节参照数组
|
||||
list_fish = msg;
|
||||
log.info(`目标材料: ${material_name}\n鱼类: ${msg}`);
|
||||
for (const path of path_pathing) {
|
||||
for (const path of path_pathing) {
|
||||
const fish_sort_regex = new RegExp(msg.join("|"));
|
||||
if (fish_sort_regex.test(path)) {
|
||||
path_list.push(path);
|
||||
@@ -418,9 +418,9 @@
|
||||
// 时间调节
|
||||
let fishing_time = "全天";
|
||||
// 读取游戏模式(多人模式则禁用时间调节)[暂时不可用]
|
||||
let check_multiplayer = typeof(settings.check_multiplayer) === 'undefined' ? false : settings.check_multiplayer;
|
||||
let check_multiplayer = typeof (settings.check_multiplayer) === 'undefined' ? false : settings.check_multiplayer;
|
||||
// 读取调试模式的时间
|
||||
let path_time = typeof(settings.path_time) === 'undefined' ? "全天" : settings.path_time;
|
||||
let path_time = typeof (settings.path_time) === 'undefined' ? "全天" : settings.path_time;
|
||||
// 需要的鱼类
|
||||
let fish_need = list_fish.filter(item => path_msg["fish_type"].includes(item));
|
||||
// 正则-全天出现的鱼
|
||||
@@ -445,12 +445,12 @@
|
||||
const is_nighttime = fish_need.some(item => regex_nighttime.test(item));
|
||||
|
||||
// 调式模式不弹出未匹配钓鱼时间的报错
|
||||
if (!is_daytime && !is_nighttime && (typeof(settings.path_select) === 'undefined' || settings.path_select === "无(默认)")) {
|
||||
if (!is_daytime && !is_nighttime && (typeof (settings.path_select) === 'undefined' || settings.path_select === "无(默认)")) {
|
||||
log.error("出错:未找到匹配的钓鱼时间")
|
||||
return null;
|
||||
} else if (is_daytime && !is_nighttime){ // 只有白天的鱼
|
||||
} else if (is_daytime && !is_nighttime) { // 只有白天的鱼
|
||||
fishing_time = "白天";
|
||||
} else if (!is_daytime && is_nighttime){ // 只有夜晚的鱼
|
||||
} else if (!is_daytime && is_nighttime) { // 只有夜晚的鱼
|
||||
fishing_time = "夜晚";
|
||||
}
|
||||
// 昼夜都有则还是 全天
|
||||
@@ -595,8 +595,8 @@
|
||||
let time_out_throw, time_out_whole;
|
||||
try {
|
||||
// 读取超时时间
|
||||
time_out_throw = typeof(settings.time_out_throw) === 'undefined' ? 10 : parseInt(settings.time_out_throw, 10);
|
||||
time_out_whole = typeof(settings.time_out_whole) === 'undefined' ? 300 : parseInt(settings.time_out_whole, 10);
|
||||
time_out_throw = typeof (settings.time_out_throw) === 'undefined' ? 10 : parseInt(settings.time_out_throw, 10);
|
||||
time_out_whole = typeof (settings.time_out_whole) === 'undefined' ? 300 : parseInt(settings.time_out_whole, 10);
|
||||
} catch (error) {
|
||||
log.error(`超时时间读取错误,请检查JS脚本配置: ${error}`);
|
||||
return null;
|
||||
@@ -604,25 +604,25 @@
|
||||
// 筛选路径
|
||||
let path_filter = pathing_filter();
|
||||
// 读取要继续的路径
|
||||
let path_continue = typeof(settings.path_continue) === 'undefined' ? "无(默认)" : settings.path_continue;
|
||||
let path_continue = typeof (settings.path_continue) === 'undefined' ? "无(默认)" : settings.path_continue;
|
||||
let is_continue = true;
|
||||
// 判断是否是调式模式
|
||||
const is_con = !(typeof(settings.path_select) === 'undefined' || settings.path_select === "无(默认)");
|
||||
const is_con = !(typeof (settings.path_select) === 'undefined' || settings.path_select === "无(默认)");
|
||||
// 键鼠设置读取
|
||||
const block_gcm = typeof(settings.block_gcm) === 'undefined' ? false : settings.block_gcm;
|
||||
const block_gcm = typeof (settings.block_gcm) === 'undefined' ? false : settings.block_gcm;
|
||||
// 战斗设置读取
|
||||
const block_fight = typeof(settings.block_fight) === 'undefined' ? false : settings.block_fight;
|
||||
const block_fight = typeof (settings.block_fight) === 'undefined' ? false : settings.block_fight;
|
||||
// 鹤观设置读取
|
||||
const block_tsurumi = typeof(settings.block_tsurumi) === 'undefined' ? false : settings.block_tsurumi;
|
||||
const block_tsurumi = typeof (settings.block_tsurumi) === 'undefined' ? false : settings.block_tsurumi;
|
||||
// 读取自动拾取设置
|
||||
const auto_pick = typeof(settings.auto_pick) === 'undefined' ? false : settings.auto_pick;
|
||||
const auto_pick = typeof (settings.auto_pick) === 'undefined' ? false : settings.auto_pick;
|
||||
// 读取4点自动领取月卡的设置
|
||||
const auto_skip = typeof(settings.auto_skip) === 'undefined' ? false : settings.auto_skip;
|
||||
const auto_skip = typeof (settings.auto_skip) === 'undefined' ? false : settings.auto_skip;
|
||||
// 读取垂钓点CD统计
|
||||
let fishing_cd = typeof(settings.fishing_cd) === 'undefined' ? false: settings.fishing_cd;
|
||||
let fishing_cd = typeof (settings.fishing_cd) === 'undefined' ? false : settings.fishing_cd;
|
||||
// 读取终止时间
|
||||
const kill_hour = typeof(settings.time_kill_hour) === 'undefined' ? "无" : settings.time_kill_hour;
|
||||
const kill_minute = typeof(settings.time_kill_minute) === 'undefined' ? "无" : settings.time_kill_minute;
|
||||
const kill_hour = typeof (settings.time_kill_hour) === 'undefined' ? "无" : settings.time_kill_hour;
|
||||
const kill_minute = typeof (settings.time_kill_minute) === 'undefined' ? "无" : settings.time_kill_minute;
|
||||
const is_time_kill = kill_hour !== "无" && kill_minute !== "无"; // 判断是否启用
|
||||
let time_target = new Date();
|
||||
|
||||
@@ -695,19 +695,19 @@
|
||||
// 路径详细信息
|
||||
const path_msg = get_pathing_msg(path_filter[i]);
|
||||
// try {
|
||||
let current_msg = `${path_msg["area"]}-${path_msg["detail"]}`
|
||||
log.info(`当前钓鱼点: ${current_msg}(进度: ${i + 1}/${path_filter.length})`);
|
||||
if (path_continue === current_msg) {
|
||||
is_continue = false;
|
||||
}
|
||||
let current_msg = `${path_msg["area"]}-${path_msg["detail"]}`
|
||||
log.info(`当前钓鱼点: ${current_msg}(进度: ${i + 1}/${path_filter.length})`);
|
||||
if (path_continue === current_msg) {
|
||||
is_continue = false;
|
||||
}
|
||||
|
||||
// 从选择的点位继续
|
||||
if (path_continue !== "无(默认)" && !is_con && is_continue && path_filter.length === path_pathing.length) {
|
||||
log.info("跳过...");
|
||||
continue;
|
||||
}
|
||||
// 从选择的点位继续
|
||||
if (path_continue !== "无(默认)" && !is_con && is_continue && path_filter.length === path_pathing.length) {
|
||||
log.info("跳过...");
|
||||
continue;
|
||||
}
|
||||
|
||||
await run_file(path_msg, time_out_throw, time_out_whole, is_con, block_gcm, block_fight, block_tsurumi, auto_skip, fishing_cd, uid);
|
||||
await run_file(path_msg, time_out_throw, time_out_whole, is_con, block_gcm, block_fight, block_tsurumi, auto_skip, fishing_cd, uid);
|
||||
// } catch (error) {
|
||||
// const file_name = `${path_msg["area"]}-${path_msg["type"]}-${path_msg["detail"]}`;
|
||||
// log.info(`路径: ${file_name} 执行时出错,已跳过...\n错误信息: ${error}`)
|
||||
|
||||
@@ -26,6 +26,17 @@
|
||||
|
||||
## 三、更新说明
|
||||
|
||||
### v.3.4版本:20250807
|
||||
|
||||
- **新功能**:
|
||||
|
||||
- **优化**:
|
||||
1. 优化打开冒险之证的时序,减少冒险之证打开失败的几率。
|
||||
2. 切换队伍失败后添加返回函数,防止卡在切换界面。
|
||||
3. 领奖时切换队伍失败或找不到时,通过地图追踪重新寻找一次。
|
||||
4. 优化JS设置的默认显示和顺序。
|
||||
5. 优化第六线路第二朵花战斗地点,避免游泳。
|
||||
|
||||
### v.3.3版本:20250716
|
||||
|
||||
- **新功能**:
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "枫丹地脉花-路线6 芒索斯山东麓-2:锚点右1_特殊处理",
|
||||
"type": "collect",
|
||||
"author": "平面镜&LCB茶包",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgi_version": "0.44.3"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 4971.0547,
|
||||
"y": 4465.7285,
|
||||
"move_mode": "walk",
|
||||
"type": "path"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -72,7 +72,7 @@
|
||||
}
|
||||
else{
|
||||
ii=8;
|
||||
if(x !== 840 && x !== 1188){
|
||||
if(x !== 840 && x !== 1188 && x !== 113 ){
|
||||
keyPress("w")
|
||||
};
|
||||
}
|
||||
@@ -81,7 +81,7 @@
|
||||
}
|
||||
|
||||
//初始化
|
||||
var SMODEL = settings.SMODEL ? settings.SMODEL : false; // false 公版BETTERGI,true 自编译版本LCB
|
||||
var SMODEL = settings.SMODEL ? settings.SMODEL : true;
|
||||
var SHUOVER=0 //0初始状态,1队伍配置标志,2结束线路,3线路出错
|
||||
var haoganq=0 //0初始状态,1好感队伍配置标志
|
||||
var Rewards = settings.Rewards ? settings.Rewards : false; // ture 领取冒险点奖励,false 不领取冒险点奖励
|
||||
@@ -146,7 +146,7 @@
|
||||
}
|
||||
var timesConfig = { value: timesValue };
|
||||
|
||||
log.warn(`全自动枫丹地脉花: v3.3 - ${SHUV}.${color}.${rawTimes}`);//调试LOG
|
||||
log.warn(`全自动枫丹地脉花: v3.4 - ${SHUV}.${color}.${rawTimes}`);//调试LOG
|
||||
log.warn(`使用树脂类型数量:${rewards.length}`);
|
||||
log.warn(`使用树脂顺序:${golbalRewardText.join(" ->")}`);
|
||||
|
||||
@@ -329,7 +329,7 @@
|
||||
await genshin.returnMainUi();
|
||||
|
||||
for(let i = 0;i<5;i++){
|
||||
await sleep(700);
|
||||
await sleep(1100);
|
||||
await keyPress("VK_ESCAPE");
|
||||
await sleep(300);
|
||||
|
||||
@@ -686,7 +686,7 @@
|
||||
}
|
||||
|
||||
//定义领取动作,好感队伍是否添加?
|
||||
async function claimRewards() {
|
||||
async function claimRewards( Rewardspath = null ) {
|
||||
await genshin.returnMainUi();
|
||||
log.info(`尝试领取奖励,优先${onerewards}'`);
|
||||
let SHUN01 = await Textocr("接触地脉之花",1.5,2,0,1187,358,200,400);
|
||||
@@ -708,7 +708,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
await Textocr("地脉之花", 1, 1, 0, 840,225, 230, 125);
|
||||
let dimai = await Textocr("地脉之花", 1, 1, 0, 840,225, 230, 125);
|
||||
if (!dimai.found) {
|
||||
let pathDic = JSON.parse(file.readTextSync(Rewardspath));
|
||||
pathDic["positions"][0]["type"] = "path";
|
||||
await pathingScript.run(JSON.stringify(pathDic));
|
||||
await keyPress("F");await keyPress("F")
|
||||
}
|
||||
|
||||
await sleep(500);
|
||||
|
||||
for (let j = 0;j < 2;j++) {
|
||||
@@ -1126,6 +1133,8 @@
|
||||
if(position.line==2 && (i+position.flower*2-2)==8){
|
||||
|
||||
await pathingScript.runFile("assets/枫丹地脉花-路线2 秋分山西侧锚点左下/线路修复/枫丹地脉花-路线2 秋分山西侧锚点左下-5:秋分山左左下下_特殊处理.json");
|
||||
}else if (position.line==6 && (i+position.flower*2-2)==2){
|
||||
await pathingScript.runFile("assets/枫丹地脉花-路线6 芒索斯山东麓/线路修复/枫丹地脉花-路线6 芒索斯山东麓-2:锚点右1_特殊处理.json");
|
||||
}
|
||||
|
||||
await sleep(1000);
|
||||
@@ -1186,14 +1195,21 @@
|
||||
}
|
||||
shouldContinueChecking = false;
|
||||
await sleep(500);
|
||||
if (!(await claimRewards())) {
|
||||
if (!(await claimRewards( `${selectedFolder}${jsonFile2}` ))) {
|
||||
log.warn("树脂消耗完毕,结束任务");
|
||||
dispatcher.addTimer(new RealtimeTimer("AutoPick", { forceInteraction: false }));
|
||||
await genshin.returnMainUi();
|
||||
return true; // 条件2触发:树脂耗尽================
|
||||
}
|
||||
Lastexecution=true;
|
||||
if (haoganq==1){log.info(`切换战斗队伍:'${settings.n}'`);await genshin.returnMainUi(); await sleep(1000);await genshin.SwitchParty(settings.n);}
|
||||
if (haoganq==1){
|
||||
log.info(`切换战斗队伍:'${settings.n}'`);
|
||||
await genshin.returnMainUi();
|
||||
await sleep(1000);
|
||||
if (!await genshin.SwitchParty(settings.n)){
|
||||
await genshin.returnMainUi();
|
||||
}
|
||||
}
|
||||
dispatcher.addTimer(new RealtimeTimer("AutoPick", { forceInteraction: false }));
|
||||
// 冷却等待(可选)
|
||||
await sleep(1000);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "全自动枫丹地脉花",
|
||||
"version": "3.3",
|
||||
"version": "3.4",
|
||||
"bgi_version": "0.44.8",
|
||||
"description": "枫丹地脉花,蓝花金花通用。生存压力大,请带盾奶;避免纯水输出,请注意说明文件。如有BUG请联系作者QQ:119996800",
|
||||
"tags": [
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
"options": [
|
||||
"冒险之证",
|
||||
"拖动地图"
|
||||
]
|
||||
],
|
||||
"default": "冒险之证"
|
||||
},
|
||||
{
|
||||
"name": "n",
|
||||
@@ -21,7 +22,8 @@
|
||||
{
|
||||
"name": "times",
|
||||
"type": "input-text",
|
||||
"label": "选填:按刷取次数,默认6次,最多99次,树脂耗尽模式下无效"
|
||||
"label": "选填:按刷取次数,默认6次,最多99次,树脂耗尽模式下无效",
|
||||
"default": "6"
|
||||
},
|
||||
{
|
||||
"name": "shuv",
|
||||
@@ -30,7 +32,8 @@
|
||||
"options": [
|
||||
"1-次数刷取",
|
||||
"2-树脂耗尽"
|
||||
]
|
||||
],
|
||||
"default": "1-次数刷取"
|
||||
},
|
||||
{
|
||||
"name": "color",
|
||||
@@ -39,17 +42,33 @@
|
||||
"options": [
|
||||
"1-蓝花(经验花)",
|
||||
"2-黄花(摩拉花)"
|
||||
]
|
||||
],
|
||||
"default": "1-蓝花(经验花)"
|
||||
},
|
||||
{
|
||||
"name": "Rewardsuse",
|
||||
"type": "input-text",
|
||||
"label": "树脂设定:1=浓缩/2=原粹/3=脆弱/4=须臾\n用`/`隔开:填写对应的树脂<数字>即可\n默认:1/2 (表示先用浓缩后原粹,直至用完,不填的不使用)"
|
||||
"label": "树脂设定:1=浓缩/2=原粹/3=脆弱/4=须臾\n用`/`隔开:填写对应的树脂<数字>即可\n默认:1/2 (表示先用浓缩后原粹,直至用完,不填的不使用)",
|
||||
"default": "1/2"
|
||||
},
|
||||
{
|
||||
"name": "nowuid",
|
||||
"name": "Fightquick",
|
||||
"type": "checkbox",
|
||||
"label": "默认开启:异步检测战斗结束,即地脉花长出后马上停止战斗\n开启后,建议关闭配置组中的<自动检测战斗结束>选项\n不启用:使用传统<打开队伍界面>进行判断战斗结束",
|
||||
"default": "true"
|
||||
|
||||
},
|
||||
{
|
||||
"name": "timeout",
|
||||
"type": "input-text",
|
||||
"label": "禁止特定UID刷地脉花,用 / 隔开,如12345/99999"
|
||||
"label": "战斗超时,启用<异步检测战斗结束>开启后,下方填写的超时时间才有效\n默认180秒,建议和配置组的战斗超时一致",
|
||||
"default": "180"
|
||||
},
|
||||
{
|
||||
"name": "SMODEL",
|
||||
"type": "checkbox",
|
||||
"label": "直跑模式:如下个花近,直跑过去,不传送,要求44.8版本以上",
|
||||
"default": "true"
|
||||
},
|
||||
{
|
||||
"name": "Rewards",
|
||||
@@ -57,18 +76,8 @@
|
||||
"label": "勾选后,打完地脉花后,领取历练点并提交每日任务"
|
||||
},
|
||||
{
|
||||
"name": "SMODEL",
|
||||
"type": "checkbox",
|
||||
"label": "直跑模式:如下个花近,直跑过去,不传送,要求44.8版本!"
|
||||
},
|
||||
{
|
||||
"name": "Fightquick",
|
||||
"type": "checkbox",
|
||||
"label": "默认开启:异步检测战斗结束,即地脉花长出后马上停止战斗\n开启后,建议关闭配置组中的<自动检测战斗结束>选项\n不启用:使用传统<打开队伍界面>进行判断战斗结束"
|
||||
},
|
||||
{
|
||||
"name": "timeout",
|
||||
"name": "nowuid",
|
||||
"type": "input-text",
|
||||
"label": "启用<异步检测战斗结束>开启后,下方填写的超时时间才有效\n默认180秒,建议和配置组的战斗超时一致"
|
||||
"label": "禁止特定UID刷地脉花,用 / 隔开,如12345/99999"
|
||||
}
|
||||
]
|
||||
108
repo/js/AutoStygianOnslaught/README.md
Normal file
@@ -0,0 +1,108 @@
|
||||
# 自动幽境危战注意事项
|
||||
|
||||
## 零、前言
|
||||
|
||||
- 本代码仅供娱乐学习,下载请24小时内删除,禁止用于商业行为,如有BUG,非常欢迎请到测试群反馈或Q119996800。
|
||||
- 本脚本基于地脉花和首领一条龙脚本进行改造。
|
||||
|
||||
## 一、省流注意事项
|
||||
|
||||
1. **使用前准备**:
|
||||
- 请在`<<幽境危战>>`中配置好战斗队伍。
|
||||
2. **黑名单建议**:
|
||||
- 根目录下有文件内含建议加入`自动拾取黑名单`的名称,请检查并添加。
|
||||
3. **战斗实力**:
|
||||
- 请确保队伍具备足够的战斗实力,当前版本在战斗失败或执行错误,只会重试`一次`。
|
||||
4. **自动拾取功能**:
|
||||
- 为避免不必要的干扰,建议关闭自动拾取功能。
|
||||
|
||||
## 二、配置简介
|
||||
|
||||
1. **圣遗物奖励**:
|
||||
- 默认设置下,脚本不会修改圣遗物奖励。
|
||||
|
||||
2. **Boss挑战关卡选择**:
|
||||
- 必填项:请从上往下选择第几个Boss挑战关卡`(1至3)`,否则脚本将无法执行。
|
||||
|
||||
3. **挑战次数**:
|
||||
- 默认设置为`15`次,期间若树脂耗尽,脚本将自动结束。
|
||||
|
||||
4. **树脂顺序设定**:
|
||||
- 使用`/`隔开数字来设定树脂使用顺序,如`1/2`表示先使用浓缩树脂,再使用原粹树脂。
|
||||
- 树脂类型对应关系:
|
||||
- 1 = 浓缩树脂
|
||||
- 2 = 原粹树脂
|
||||
- 3 = 脆弱树脂
|
||||
- 4 = 须臾树脂
|
||||
- 默认设置:`1/2`,表示先使用浓缩树脂,再使用原粹树脂,不填的不使用"。
|
||||
|
||||
5. **最长战斗超时时间**:
|
||||
- 默认设置为`180`秒,一般情况下无需修改,建议和配置组中的战斗超时一致。
|
||||
|
||||
6. **开始战斗后的移动时间**:
|
||||
- 默认设置为`1`秒(注意单位为`秒`),由于战斗开始位置离Boss较远,请根据实际情况设定,一般情况下默认设置即可。
|
||||
|
||||
## 三、更新说明
|
||||
|
||||
### v.1.7版本:20250807
|
||||
|
||||
- **新功能**:
|
||||
|
||||
- **优化**:
|
||||
1. 进入选择页面时,判断是否在爆发期。
|
||||
2. 更改进入秘境的判断,避免因为聊天按键被改导致判断错误。
|
||||
|
||||
### v.1.6版本:20250702
|
||||
|
||||
- **优化**:
|
||||
1. 优化没找到地脉花领奖的超时退出处理。
|
||||
2. 优化树脂识别OCR区域。
|
||||
3. 优化LOG和代码写法和整理。
|
||||
|
||||
### v.1.5版本(20250630)
|
||||
|
||||
- **新增功能**:
|
||||
1. 自动战斗失败原地`重试2次`,失败后再退出秘境重试。
|
||||
- **优化**:
|
||||
1. 优化`LOG`显示。
|
||||
2. 优化`完全没有树脂`情况弹窗提示处理。
|
||||
3. 优化删除拾取`黑名单`文件(0.47.0后不会乱触发了)。
|
||||
4. 优化各种`异常状态`的退出处理方法。
|
||||
5. 优化当有须臾树脂时,脆弱树脂不显示时的处理。
|
||||
|
||||
### v.1.4版本(20250629)
|
||||
|
||||
- **新增功能**:
|
||||
1. 添加领奖后的树脂识别,不足时退出秘境,防止多打一次。
|
||||
- **优化**:
|
||||
1. 优化`再次挑战`挑战的点击逻辑,添加重试。
|
||||
2. 优化相关自动拾取代码。
|
||||
3. 优化`难度选择`和`圣遗物选择`的识别范围。
|
||||
|
||||
### v.1.3版本(20250628)
|
||||
|
||||
- **新增功能**:
|
||||
1. 添加`自动重试`,战斗失败或执行错误会`重试一次`。
|
||||
- **优化**:
|
||||
2. 优化退出点击时序和逻辑。
|
||||
3. 优化进入秘境后向前走的逻辑。
|
||||
4. 优化LOG输出显示内容。
|
||||
- **修复**
|
||||
1. 修复默认状态下,选择长夜套的BUG。
|
||||
|
||||
### v.1.2版本(20250627)
|
||||
|
||||
- **新增功能**:
|
||||
1. 添加圣遗物`奖励选择`功能。
|
||||
2. 添加自动选择`难度`功能。
|
||||
- **优化**:
|
||||
1. 优化逻辑处理。
|
||||
2. 加大战斗完成识别区域。
|
||||
|
||||
### v.1.1版本
|
||||
|
||||
- **备注**:此版本信息被省略。
|
||||
|
||||
### v.1.0版本(20250627)
|
||||
|
||||
- **功能**:脚本发布。
|
||||
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_1.bmp
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_10.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_10in.bmp
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_11.bmp
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_11in.bmp
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_12.bmp
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_12in.bmp
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_13.bmp
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_13in.bmp
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_14.bmp
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_14in.bmp
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_15.bmp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_15in.bmp
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_16.bmp
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_16in.bmp
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_17.bmp
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_17in.bmp
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_18.bmp
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_18in.bmp
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_1in.bmp
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_2.bmp
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_2in.bmp
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_3.bmp
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_3in.bmp
Normal file
|
After Width: | Height: | Size: 9.9 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_4.bmp
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_4in.bmp
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_5.bmp
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_5in.bmp
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_6.bmp
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_6in.bmp
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_7.bmp
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_7in.bmp
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_8.bmp
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_8in.bmp
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_9.bmp
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/Artifacts/artifact_9in.bmp
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/box.png
Normal file
|
After Width: | Height: | Size: 1018 B |
BIN
repo/js/AutoStygianOnslaught/assets/box2.png
Normal file
|
After Width: | Height: | Size: 1018 B |
BIN
repo/js/AutoStygianOnslaught/assets/condensed_resin_count.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/enter.png
Normal file
|
After Width: | Height: | Size: 908 B |
BIN
repo/js/AutoStygianOnslaught/assets/fragile_resin_count.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/moment_resin_count.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/one.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/original_resin_count.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
repo/js/AutoStygianOnslaught/assets/rewards.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
26
repo/js/AutoStygianOnslaught/assets/全自动幽境危战.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "全自动幽境危战",
|
||||
"type": "collect",
|
||||
"author": "LCB-茶包",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgi_version": "0.44.8"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": -194.198,
|
||||
"y": 984.095,
|
||||
"move_mode": "walk",
|
||||
"type": "teleport"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": -194.25293,
|
||||
"y": 980.6616,
|
||||
"move_mode": "walk",
|
||||
"type": "target"
|
||||
}
|
||||
]
|
||||
}
|
||||
811
repo/js/AutoStygianOnslaught/main.js
Normal file
@@ -0,0 +1,811 @@
|
||||
(async function () {
|
||||
|
||||
let challengeNum = settings.challengeNum;//挑战次数
|
||||
if (challengeNum === undefined || challengeNum === ""){challengeNum = 15; }//挑战次数
|
||||
let challengeName = settings.challengeName;//挑战BOSS
|
||||
if (challengeName === undefined || challengeName === ""){throw new Error("挑战Boss未配置,请在JS配置中选择...")}//初始化处理
|
||||
let Startforward = settings.Startforward*1000 ? settings.Startforward*1000 : 1000;//开始战斗的前进时间
|
||||
var Fighttimeout = settings.timeout * 1000 ? settings.timeout * 1000 : 240000;//战斗超时时间,默认为240秒
|
||||
const ocrRegion1 = { x: 643, y: 58, width: 800, height: 800 }; // 上方挑战成功区域
|
||||
const ocrRegion2 = { x: 780, y: 406, width: 370, height: 135 }; // 中间挑战失败区域
|
||||
const ocrRo1 = RecognitionObject.ocr(ocrRegion1.x, ocrRegion1.y, ocrRegion1.width, ocrRegion1.height);//上方挑战成功区域OCR对象
|
||||
const ocrRo2 = RecognitionObject.ocr(ocrRegion2.x, ocrRegion2.y, ocrRegion2.width, ocrRegion2.height);//中间挑战失败区域OCR对象
|
||||
var Rewardsuse = settings.Rewardsuse ? settings.Rewardsuse : "1/2";//树脂使用类型,默认为1/2,即浓缩树脂和原粹树脂
|
||||
var resinTypes = Rewardsuse.split("/");
|
||||
var rewards = [];
|
||||
var onerewards, secendrewards, threendrewards, fourdrewards;
|
||||
for (var i = 0; i < resinTypes.length; i++) {
|
||||
var resinType = parseInt(resinTypes[i]);
|
||||
if (isNaN(resinType) || resinType < 1 || resinType > 4) {
|
||||
throw new Error("设定的树脂类型无效或缺失,请重新配置");
|
||||
}
|
||||
rewards.push(resinType);
|
||||
}
|
||||
const resinTypeMap = ["","使用1个浓缩树脂,获取2倍产出", "使用20个原粹树脂", "使用1个脆弱树脂,获取3倍产出", "使用1个须臾树脂,获取3倍产出"];//识别树脂领奖文字
|
||||
const golbalRewards = ["","浓缩树脂","原粹树脂","脆弱树脂","须臾树脂"]; // 对应四种树脂
|
||||
// 根据 rewards 数组长度,依次赋值给对应的变量
|
||||
if (rewards.length > 0) onerewards = golbalRewards[rewards[0]];
|
||||
if (rewards.length > 1) secendrewards = golbalRewards[rewards[1]];
|
||||
if (rewards.length > 2) threendrewards = golbalRewards[rewards[2]];
|
||||
if (rewards.length > 3) fourdrewards = golbalRewards[rewards[3]];
|
||||
const golbalRewardText = [onerewards, secendrewards, threendrewards, fourdrewards].filter(Boolean);//过滤树脂使用类型
|
||||
|
||||
var advanceNum = 0;//前进寻找地脉之花次数
|
||||
var verticalNum = 0;//重试寻找地脉之花次数
|
||||
var resinAgain = false;//是否重试标志
|
||||
|
||||
var Artifacts = settings.Artifacts ? settings.Artifacts : "保持圣遗物奖励不变";
|
||||
|
||||
//映射所有圣遗物对应需要识别的图片
|
||||
var artifactImageMap = {
|
||||
"长夜之誓 / 深廊终曲": "assets/Artifacts/artifact_1.bmp",
|
||||
"黑曜秘典 / 烬城勇者绘卷": "assets/Artifacts/artifact_2.bmp",
|
||||
"谐律异想断章 / 未竟的遐思": "assets/Artifacts/artifact_3.bmp",
|
||||
"回声之林夜话 / 昔时之歌": "assets/Artifacts/artifact_4.bmp",
|
||||
"逐影猎人 / 黄金剧团": "assets/Artifacts/artifact_5.bmp",
|
||||
"水仙之梦 / 花海甘露之光": "assets/Artifacts/artifact_6.bmp",
|
||||
"乐园遗落之花 / 沙上楼阁史话": "assets/Artifacts/artifact_7.bmp",
|
||||
"深林的记忆 / 饰金之梦": "assets/Artifacts/artifact_8.bmp",
|
||||
"来歆余响 / 辰砂往生录": "assets/Artifacts/artifact_9.bmp",
|
||||
"华馆梦醒形骸记 / 海染砗磲": "assets/Artifacts/artifact_10.bmp",
|
||||
"绝缘之旗印 / 追忆之注连": "assets/Artifacts/artifact_11.bmp",
|
||||
"昔日宗室之仪 / 染血的骑士道": "assets/Artifacts/artifact_12.bmp",
|
||||
"渡过烈火的贤人 / 炽烈的炎之魔女": "assets/Artifacts/artifact_13.bmp",
|
||||
"悠古的磐岩 / 逆飞的流星": "assets/Artifacts/artifact_14.bmp",
|
||||
"千岩牢固 / 苍白之火": "assets/Artifacts/artifact_15.bmp",
|
||||
"冰风迷途的勇士 / 沉沦之心": "assets/Artifacts/artifact_16.bmp",
|
||||
"翠绿之影 / 被怜爱的少女": "assets/Artifacts/artifact_17.bmp",
|
||||
"如雷的盛怒 / 平息鸣雷的尊者": "assets/Artifacts/artifact_18.bmp"
|
||||
};
|
||||
|
||||
//树脂识别图片
|
||||
var condensedResin = "assets/condensed_resin_count.png";
|
||||
var originalResin = "assets/original_resin_count.png";
|
||||
var fragileResin = "assets/fragile_resin_count.png";
|
||||
var momentResin = "assets/moment_resin_count.png";
|
||||
var oneResin = "assets/one.png";
|
||||
var enterButton = "assets/enter.png";
|
||||
var rewardsButton = "assets/rewards.png";
|
||||
|
||||
//文字识别封装函数
|
||||
async function Textocr(wenzi="空参数",chaotime=10,clickocr=0,debugcode=0,x=0,y=0,w=1920,h=1080) {
|
||||
const startTime = new Date();
|
||||
for (let ii = 0; ii < 10; ii++)
|
||||
{
|
||||
// 获取一张截图
|
||||
let captureRegion = captureGameRegion();
|
||||
let res1
|
||||
// 对整个区域进行 OCR
|
||||
let resList = captureRegion.findMulti(RecognitionObject.ocr(x,y,w,h));
|
||||
//log.info("OCR 全区域识别结果数量 {len}", resList.count);
|
||||
for (let i = 0; i < resList.count; i++)
|
||||
{ // 遍历的是 C# 的 List 对象,所以要用 count,而不是 length
|
||||
let res = resList[i];
|
||||
res1=res.text
|
||||
if (res.text===wenzi) {
|
||||
log.info(`识别到 ·${res1}·`);
|
||||
if (debugcode===1){if (x===0 & y===0){log.info("全图代码位置:({x},{y},{h},{w})", res.x-10, res.y-10, res.width+10, res.Height+10);return result = { text: res.text, x: res.x, y: res.y, found: true }}}else{if (x===0 & y===0){log.info("文本OCR完成'{text}'", res.text);}}
|
||||
if (clickocr===1){await sleep(1000);await click(res.x, res.y);}else{}
|
||||
if (clickocr===2){await sleep(100);await keyPress("F");}else{}
|
||||
return result = { text: res.text, x: res.x, y: res.y, found: true }
|
||||
}
|
||||
if (debugcode===2 && !res.isEmpty()){
|
||||
// log.info("({x},{y},{h},{w})", res.x-10, res.y-10, res.width+10, res.Height+10);
|
||||
return result = { text: res.text, x: res.x, y: res.y, found: true }
|
||||
}
|
||||
}
|
||||
const NowTime = new Date();
|
||||
if (Math.abs(NowTime - startTime)>chaotime*1000){if (x===0 & y===0){log.info(`${chaotime}秒超时退出,"${wenzi}"未找到`);}return result = {found: false };}else{ii=8;if (x !== 861){if(debugcode!==3){await keyPress("VK_W");}};}
|
||||
await sleep(100);
|
||||
}
|
||||
}
|
||||
|
||||
// 图片识别封装函数
|
||||
async function imageRecognition(imagefilePath="空参数",timeout=10,afterBehavior=0,debugmodel=0,xa=0,ya=0,wa=1920,ha=1080) {
|
||||
const startTime = new Date();
|
||||
const Imagidentify = RecognitionObject.TemplateMatch(file.ReadImageMatSync(imagefilePath));
|
||||
for (let ii = 0; ii < 10; ii++) {
|
||||
captureRegion = captureGameRegion(); // 获取一张截图
|
||||
res = captureRegion.DeriveCrop(xa, ya, wa, ha).Find(Imagidentify);
|
||||
if (res.isEmpty()) {
|
||||
if (debugmodel===1 & xa===0 & ya===0){log.info("未识别页面元素")};
|
||||
} else {
|
||||
if (afterBehavior===1){if (xa===0 & ya===0){log.info("点击模式:开");}await sleep(1000);click(res.x+xa, res.y+ya);}else{if (debugmodel===1 & xa===0 & ya===0){log.info("点击模式:关")}}
|
||||
if (afterBehavior===2){if (xa===0 & ya===0){log.info("F模式:开");}await sleep(1000);keyPress("F");}else{if (debugmodel===1 & xa===0 & ya===0){log.info("F模式:关")}}
|
||||
if (debugmodel===1 & xa===0 & ya===0){log.info("全图代码位置:({x},{y},{h},{w})", res.x+xa, res.y+ya, res.width, res.Height);}else{ log.info("识别到页面元素");}
|
||||
|
||||
return result = { x: res.x+xa, y: res.y+ya, w:res.width,h:res.Height,found: true }
|
||||
}
|
||||
const NowTime = new Date();
|
||||
if ((NowTime - startTime)>timeout*1000){if (debugmodel===1 & xa===0 & ya===0){log.info(`${timeout}秒超时退出,未找到图片`);}return result = {found: false };}else{ii=8}
|
||||
await sleep(200);
|
||||
}
|
||||
await sleep(1200);
|
||||
}
|
||||
|
||||
//树脂数量获取函数
|
||||
async function getRemainResinStatus() {
|
||||
var condensedResinCount = 0; // 浓缩树脂
|
||||
var originalResinCount = 0; // 原粹树脂
|
||||
var fragileResinCount = 0; // 脆弱树脂
|
||||
var momentResinCount = 0; // 须臾树脂
|
||||
|
||||
var originalResinCountRa = await imageRecognition(originalResin,0.3, 0, 0,1500,0,200,90);
|
||||
if (originalResinCountRa.found) {
|
||||
// await moveMouseTo(originalResinCountRa.x,originalResinCountRa.y);
|
||||
let countArea = await Textocr("",1, 0, 2,originalResinCountRa.x+originalResinCountRa.w,originalResinCountRa.y,originalResinCountRa.w*3,originalResinCountRa.h);//
|
||||
if (countArea.found){
|
||||
log.info("原粹树脂识别数量结果:"+ countArea.text);
|
||||
let match = countArea.text.match(/(\d+)\s*[/17]\s*(2|20|200)/);
|
||||
if (match) {
|
||||
originalResinCount = match[1];
|
||||
// log.info("脆弱树脂识别数量提取:"+ originalResinCount);
|
||||
}
|
||||
else{
|
||||
log.info("原粹树脂识别数量提取失败");
|
||||
}
|
||||
}
|
||||
else{
|
||||
log.info("原粹树脂识别数量结果::无");
|
||||
}
|
||||
|
||||
} else {
|
||||
log.info("未检测到原粹树脂图标");
|
||||
}
|
||||
|
||||
// 浓缩树脂
|
||||
var condensedResinCountRa = await imageRecognition(condensedResin,0.1, 0, 0,960,0,800,100);
|
||||
if (condensedResinCountRa.found) {
|
||||
// await moveMouseTo(condensedResinCountRa.x,condensedResinCountRa.y);
|
||||
let countArea = await Textocr("",0.5, 0, 2,condensedResinCountRa.x+condensedResinCountRa.w,condensedResinCountRa.y,condensedResinCountRa.w,condensedResinCountRa.h);//
|
||||
if (countArea.found){
|
||||
// log.info("浓缩树脂识别数量结果: "+ countArea.text);
|
||||
condensedResinCount = countArea.text
|
||||
}
|
||||
else{
|
||||
condensedResinCount = "1";
|
||||
log.info("浓缩树脂识别数量结果:1");//不知道为什么,1无法识别,0是不显示图标的,所以就当时1了,反正也没啥影响
|
||||
}
|
||||
|
||||
} else {
|
||||
log.info("未检测到浓缩树脂图标");
|
||||
}
|
||||
|
||||
var momentResinCountRa = await imageRecognition(momentResin,0.1, 0, 1,1170,0,300,100);
|
||||
if (momentResinCountRa.found) {
|
||||
// await moveMouseTo(momentResinCountRa.x,momentResinCountRa.y);
|
||||
let countArea = await Textocr("",0.5, 0, 2,momentResinCountRa.x+momentResinCountRa.w+20,momentResinCountRa.y-15,60,40);//
|
||||
if (countArea.found){
|
||||
//log.info("须臾树脂识别数量结果:"+ countArea.text);
|
||||
momentResinCount = countArea.text
|
||||
}
|
||||
else{
|
||||
var oneRa = await imageRecognition(oneResin,0.1, 0, 1,momentResinCountRa.x+momentResinCountRa.w+20,momentResinCountRa.y-15,60,40);
|
||||
if (oneRa.found){
|
||||
momentResinCount = "1";
|
||||
}else{
|
||||
log.info("须臾树脂强制为 1 ");
|
||||
momentResinCount = "1";
|
||||
}
|
||||
}
|
||||
log.info("脆弱树脂强制为 1 ");//须臾树脂出现,脆弱树脂不显示,强制设置为1,情况非常少,大不了打多一次
|
||||
fragileResinCount = "1";
|
||||
}else
|
||||
{
|
||||
var fragileResinCountRa = await imageRecognition(fragileResin,0.1, 0, 1,1170,0,300,100);
|
||||
if (fragileResinCountRa.found) {
|
||||
// await moveMouseTo(fragileResinCountRa.x+fragileResinCountRa.w+20,fragileResinCountRa.y-15);
|
||||
let countArea = await Textocr("",0.5, 0, 2,fragileResinCountRa.x+fragileResinCountRa.w+20,fragileResinCountRa.y-15,60,40);//
|
||||
if (countArea.found){
|
||||
// log.info("脆弱树脂识别数量结果:"+ countArea.text);
|
||||
fragileResinCount = countArea.text
|
||||
}
|
||||
else{
|
||||
var oneRa = await imageRecognition(oneResin,0.1, 0, 1,fragileResinCountRa.x+fragileResinCountRa.w+20,fragileResinCountRa.y-15,60,40);
|
||||
if (oneRa.found){
|
||||
fragileResinCount = "1";
|
||||
}else{
|
||||
fragileResinCount = "1";
|
||||
log.info("脆弱树脂识别强制为 1 ");//有图标说明至少为1
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
log.info("未检测到脆弱树脂图标");
|
||||
}
|
||||
}
|
||||
|
||||
log.info("树脂状态:浓缩{0} 原粹{1} 脆弱{2} 须臾{3}", condensedResinCount, originalResinCount, fragileResinCount,momentResinCount)
|
||||
return {condensedResinCount,originalResinCount,fragileResinCount,momentResinCount}
|
||||
}
|
||||
|
||||
|
||||
//征讨之花领奖寻找函数
|
||||
const autoNavigateToReward = async () => {
|
||||
// 定义识别对象
|
||||
const boxIconRo = RecognitionObject.TemplateMatch(file.ReadImageMatSync("assets/box.png"));
|
||||
|
||||
advanceNum = 0;//前进次数
|
||||
//调整为俯视视野
|
||||
middleButtonClick();
|
||||
await sleep(800);
|
||||
moveMouseBy(0, 1030);
|
||||
await sleep(400);
|
||||
moveMouseBy(0, 920);
|
||||
await sleep(400);
|
||||
moveMouseBy(0, 710);
|
||||
log.info("开始领奖");
|
||||
|
||||
while (true) {
|
||||
// 1. 优先检查是否已到达领奖点
|
||||
let captureRegion = captureGameRegion();
|
||||
let rewardTextArea = captureRegion.DeriveCrop(1210, 515, 200, 50);
|
||||
let rewardResult = rewardTextArea.find(RecognitionObject.ocrThis);
|
||||
// 检测到特点文字则结束!!!
|
||||
if (rewardResult.text.includes("之花") || rewardResult.text.includes("激活")) {
|
||||
log.info("已到达领奖点,检测到文字: " + rewardResult.text);
|
||||
return true;
|
||||
}
|
||||
else if(advanceNum > 40){
|
||||
await getOut();
|
||||
await await genshin.returnMainUi();
|
||||
throw new Error('前进时间超时');
|
||||
}
|
||||
// 2. 未到达领奖点,则调整视野
|
||||
for(let i = 0; i < 100; i++){
|
||||
captureRegion = captureGameRegion();
|
||||
let iconRes = captureRegion.Find(boxIconRo);
|
||||
|
||||
if (iconRes.x >= 920 && iconRes.x <= 980 && iconRes.y <= 540) {
|
||||
advanceNum++;
|
||||
log.info(`视野已调正,前进第${advanceNum}次`);
|
||||
break;
|
||||
} else {
|
||||
// 小幅度调整
|
||||
if(iconRes.y >= 520) moveMouseBy(0, 920);
|
||||
let adjustAmount = iconRes.x < 920 ? -20 : 20;
|
||||
let distanceToCenter = Math.abs(iconRes.x - 920); // 计算与920的距离
|
||||
let scaleFactor = Math.max(1, Math.floor(distanceToCenter / 50)); // 根据距离缩放,最小为1
|
||||
let adjustAmount2 = iconRes.y < 540 ? scaleFactor : 10;
|
||||
moveMouseBy(adjustAmount * adjustAmount2, 0);
|
||||
await sleep(100);
|
||||
}
|
||||
|
||||
if(i > 97) {
|
||||
if (verticalNum >= 2) {
|
||||
verticalNum = 0;
|
||||
await getOut();
|
||||
await await genshin.returnMainUi();
|
||||
throw new Error('领取超时');
|
||||
}
|
||||
log.info("领取超时,重新尝试1次");
|
||||
await sleep(1000);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// 3. 前进一小步
|
||||
keyDown("w");
|
||||
await sleep(600);
|
||||
keyUp("w");
|
||||
await sleep(100); // 等待角色移动稳定
|
||||
let earthlyVeins = await Textocr("地脉之花", 0.1, 0, 0, 840,225, 230, 125)
|
||||
if (earthlyVeins.found) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//向前寻找钥匙函数
|
||||
async function readyFightIn(){
|
||||
var startTime = new Date();
|
||||
await sleep(500);
|
||||
var NowTime = new Date();
|
||||
keyDown("w");
|
||||
while ((NowTime - startTime)<15*1000){
|
||||
const result = await Textocr("战斗准备",0,0,3,1198,492,150,80);
|
||||
const result2 = await Textocr("开始挑战",0,0,3,1554,970,360, 105);
|
||||
if (result.found || result2.found) {
|
||||
keyPress("F");keyPress("F");keyPress("F");keyPress("F");
|
||||
keyUp("w");
|
||||
return true;
|
||||
}
|
||||
keyDown("w");
|
||||
keyPress("F");
|
||||
NowTime = new Date();
|
||||
}
|
||||
await keyUp("w");
|
||||
return false
|
||||
}
|
||||
|
||||
//异步检测战斗执行函数,来自D捣蛋&秋云佬的全自动地脉花的代码
|
||||
async function autoFight(timeout) {
|
||||
const cts = new CancellationTokenSource();
|
||||
log.info("开始战斗");
|
||||
dispatcher.RunTask(new SoloTask("AutoFight"), cts);
|
||||
let fightResult = await recognizeTextInRegion(timeout);
|
||||
logFightResult = fightResult ? "成功" : "失败";
|
||||
log.info(`战斗结束,战斗结果:${logFightResult}`);
|
||||
cts.cancel();
|
||||
return fightResult;
|
||||
}
|
||||
|
||||
//异步检测战斗结果函数
|
||||
async function recognizeTextInRegion(timeout) {
|
||||
return new Promise((resolve, reject) => {
|
||||
(async () => {
|
||||
try {
|
||||
let startTime = Date.now();
|
||||
const successKeywords = ["挑战完成","战斗完成"];
|
||||
const failureKeywords = ["战斗失败","挑战失败"];
|
||||
|
||||
// 循环检测直到超时
|
||||
while (Date.now() - startTime < timeout) {
|
||||
try {
|
||||
let captureRegion = captureGameRegion();
|
||||
let result = captureRegion.find(ocrRo1);
|
||||
let result2 = captureRegion.find(ocrRo2);
|
||||
let text = result.text;
|
||||
let text2 = result2.text;
|
||||
|
||||
// 检查成功关键词
|
||||
for (let keyword of successKeywords) {
|
||||
if (text.includes(keyword)) {
|
||||
log.info("检测到战斗成功关键词: {0}", keyword);
|
||||
resolve(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 检查失败关键词--
|
||||
for (let keyword of failureKeywords) {
|
||||
if (text2.includes(keyword)) {
|
||||
log.warn("检测到战斗失败关键词: {0}", keyword);
|
||||
resolve(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
log.error("OCR过程中出错: {0}", error);
|
||||
}
|
||||
|
||||
await sleep(1000); // 检查间隔
|
||||
}
|
||||
|
||||
log.warn("在超时时间内未检测到战斗结果");
|
||||
resolve(false);
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
})();
|
||||
});
|
||||
}
|
||||
|
||||
//圣遗物奖励更换函数
|
||||
async function selectionHolyRelics() {
|
||||
|
||||
let artifactImagePath = artifactImageMap[Artifacts];
|
||||
// 检查artifactImagePath是否存在
|
||||
if (!artifactImagePath) {
|
||||
throw new Error(`未找到与Artifacts值'${Artifacts}'对应的图片路径`);
|
||||
}
|
||||
let modifiedPath = artifactImagePath.slice(0, -4);
|
||||
let newImagePath = modifiedPath + "in.bmp";
|
||||
|
||||
await sleep(500);
|
||||
await click(116,980) // 领取奖励切换按钮
|
||||
await sleep(100);
|
||||
await click(116,980) // 领取奖励切换按钮
|
||||
await sleep(100);
|
||||
|
||||
let rewardSettings = await Textocr("奖励设置",15,0,0,882,34,161,52);//这个时候有人申请进入世界会遮住,真是尴尬啊,不过不影响大局。
|
||||
if (!rewardSettings.found) {await genshin.returnMainUi();return false;}
|
||||
await click(1642,159);
|
||||
await sleep(100);
|
||||
await click(1642,159);
|
||||
await sleep(100);
|
||||
|
||||
let YOffset = 0; // Y轴偏移量,根据需要调整
|
||||
|
||||
//滚轮预操作
|
||||
await moveMouseTo(1642,159);
|
||||
await sleep(100);
|
||||
await leftButtonDown();
|
||||
await sleep(100);
|
||||
await moveMouseTo(1642,155);
|
||||
|
||||
const maxRetries = 9; // 最大重试次数
|
||||
let retries = 0; // 当前重试次数
|
||||
while (retries < maxRetries) {
|
||||
let result1 = await imageRecognition(newImagePath,1, 0, 0,1166,141,210,857);//
|
||||
if (result1.found) {
|
||||
await leftButtonUp();
|
||||
await sleep(500);
|
||||
await click(result.x-500,result.y);
|
||||
await sleep(1000);
|
||||
await keyPress("VK_ESCAPE");
|
||||
return true
|
||||
}
|
||||
retries++; // 重试次数加1
|
||||
//滚轮操作
|
||||
YOffset += 100;
|
||||
if (retries === maxRetries || retries+YOffset > 1080) {
|
||||
await leftButtonUp();
|
||||
await sleep(100);
|
||||
await keyPress("VK_ESCAPE");
|
||||
await genshin.returnMainUi();
|
||||
return false;
|
||||
}
|
||||
await moveMouseTo(1642,155+YOffset);
|
||||
await sleep(500);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// 领取奖励函数
|
||||
async function claimRewards() {
|
||||
// log.info(`尝试领取奖励,优先${onerewards}'`);
|
||||
let SHUN01 = await Textocr("激活地脉之花",0.6,2,0,1188,358,200,400);
|
||||
let SHUN02 = await Textocr("地脉之花", 0.2, 1, 0, 840,225, 230, 125);
|
||||
if (SHUN01.found || SHUN02.found) {
|
||||
log.info("找到地脉之花,开始领取奖励...");
|
||||
}
|
||||
else
|
||||
{
|
||||
await keyPress("F");
|
||||
log.warn("未找到地脉之花,尝试向前寻找...")
|
||||
await keyDown("W");await sleep(300);await keyUp("W");
|
||||
await keyPress("F");
|
||||
await sleep(1000);
|
||||
}
|
||||
|
||||
await sleep(300);
|
||||
|
||||
for (let j = 0;j < 2;j++) {
|
||||
|
||||
for (let i = 0;i < rewards.length;i++) {
|
||||
let SHU = await Textocr(resinTypeMap[rewards[i]],0.3,0,0,510,380,640,600);
|
||||
if (SHU.found){
|
||||
if (resinTypeMap[rewards[i]] == "使用20个原粹树脂")
|
||||
{
|
||||
let BUC = await Textocr("补充",0.2,0,0,1150,440,210,130);
|
||||
if (BUC.found) {continue;}
|
||||
}
|
||||
await sleep(100);
|
||||
await click(SHU.x+550,SHU.y)
|
||||
await sleep(100);
|
||||
await click(SHU.x+550,SHU.y)
|
||||
await sleep(300);
|
||||
log.info(`${resinTypeMap[rewards[i]]} 获取奖励...`);
|
||||
|
||||
await Textocr("锁定辅助",10,0,0,1768,0,115,90);
|
||||
let { condensedResinCount, originalResinCount, fragileResinCount , momentResinCount} = await getRemainResinStatus();
|
||||
let shouldExit = true;
|
||||
|
||||
if (resinTypes.includes("1"))
|
||||
{
|
||||
shouldExit &= (parseInt(condensedResinCount, 10) == 0);
|
||||
}
|
||||
if (resinTypes.includes("2"))
|
||||
{
|
||||
shouldExit &= (parseInt(originalResinCount, 10) < 20);
|
||||
}
|
||||
if (resinTypes.includes("3"))
|
||||
{
|
||||
shouldExit &= (parseInt(fragileResinCount, 10) == 0);
|
||||
}
|
||||
if (resinTypes.includes("4"))
|
||||
{
|
||||
shouldExit &= (parseInt(momentResinCount, 10) == 0);
|
||||
}
|
||||
|
||||
if (shouldExit)
|
||||
{
|
||||
await sleep(1000);
|
||||
await keyPress("VK_ESCAPE");
|
||||
await sleep(1000);
|
||||
return false;
|
||||
}
|
||||
log.warn("还有树脂...");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
await sleep(500);
|
||||
}
|
||||
log.warn("未找到树脂,结束领取奖励...");
|
||||
await sleep(1000);
|
||||
await keyPress("VK_ESCAPE");
|
||||
await sleep(1000);
|
||||
return false;
|
||||
}
|
||||
|
||||
// 进入秘境入口函数
|
||||
async function VeinEntrance() {
|
||||
for (let i = 0;i < 2;i++) {
|
||||
let JIECHU = await Textocr("F",2,2,0,1098,519,35,32);
|
||||
if (JIECHU.found)
|
||||
{
|
||||
await keyPress("F");
|
||||
await keyPress("F");
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(i == 1){
|
||||
log.warn("没找入口,尝试强制转圈寻找...");
|
||||
await keyDown("W");keyPress("F");await sleep(500);keyPress("F");await keyUp("W");
|
||||
await keyDown("D");keyPress("F");await sleep(500);keyPress("F");await keyUp("D");
|
||||
await keyDown("S");keyPress("F");await sleep(500);keyPress("F");await keyUp("S");
|
||||
await keyDown("A");keyPress("F");await sleep(500);keyPress("F");await keyUp("A");
|
||||
await keyDown("W");keyPress("F");await sleep(500);keyPress("F");await keyUp("W");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//秘境内退出函数
|
||||
async function getOut() {
|
||||
|
||||
for (let i = 0;i < 2;i++){
|
||||
log.info("尝试退出挑战...");
|
||||
await keyPress("VK_ESCAPE");
|
||||
await sleep(1000);
|
||||
let exitChallenge0 = await Textocr("退出挑战",0.5,1,0,866,719,274,86);
|
||||
await sleep(1000);
|
||||
await keyPress("VK_ESCAPE");
|
||||
await sleep(1000);
|
||||
let exitChallenge1 = await Textocr("退出挑战",0.5,1,0,866,719,274,86);
|
||||
await sleep(1000);
|
||||
await keyPress("VK_ESCAPE");
|
||||
await sleep(1000);
|
||||
let exitChallenge2 = await Textocr("退出挑战",0.5,1,0,866,719,274,86);
|
||||
if (!exitChallenge2.found){break}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
log.warn("自动幽境危战版本:v1.7");
|
||||
log.warn("请保证队伍战斗实力,战斗失败或执行错误,会重试两次...");
|
||||
log.warn("使用前请在 <<幽境危战>> 中配置好战斗队伍...");
|
||||
log.info("使用树脂类型数量:{0} ", rewards.length)
|
||||
log.info(`使用树脂顺序:${golbalRewardText.join(" ->")}`);
|
||||
log.info("圣遗物奖励选择:{0} ", Artifacts)
|
||||
|
||||
//重试两次
|
||||
for (let j = 0;j < 2;j++) {
|
||||
|
||||
resinAgain = false; //重试标志
|
||||
|
||||
try{
|
||||
//1.导航进入页面
|
||||
await genshin.returnMainUi();
|
||||
await pathingScript.runFile(`assets/全自动幽境危战.json`);
|
||||
await VeinEntrance();
|
||||
|
||||
//2.难度确认和选择
|
||||
let intoAction = await Textocr("单人挑战",10,0,0,1554,970,360, 105);
|
||||
if (!intoAction.found){
|
||||
await genshin.returnMainUi();
|
||||
throw new Error("未进入挑战页面,停止执行...")
|
||||
}
|
||||
|
||||
//2.5 判断爆发期
|
||||
let rewardsBu = await imageRecognition(rewardsButton,0.1, 0, 0,63,949,87,80);
|
||||
if (!rewardsBu.found){
|
||||
await genshin.returnMainUi();
|
||||
throw new Error("未在爆发期内,停止执行...")
|
||||
}
|
||||
|
||||
let adjustmentType = await Textocr("至危挑战", 1, 0, 0,797,144,223,84);
|
||||
if (adjustmentType.found) {
|
||||
log.warn("找到至危挑战,尝试切换...")
|
||||
await sleep(500);
|
||||
await click(adjustmentType.x,adjustmentType.y)
|
||||
await sleep(500);
|
||||
}
|
||||
let hardMode = await Textocr("困难", 0.3, 0, 0,1049,157,72,47);
|
||||
let hardMode2 = await Textocr("困难", 0.2, 0, 0,805,156,83,47);
|
||||
if (hardMode.found || hardMode2.found) {
|
||||
log.warn("确认困难模式...")
|
||||
}
|
||||
else{
|
||||
log.warn("未找到困难模式,尝试切换...")
|
||||
await sleep(500);
|
||||
await click(1096,186);
|
||||
await sleep(500);
|
||||
await click(1093,399);
|
||||
}
|
||||
|
||||
//3.圣遗物奖励选择
|
||||
if (Artifacts != "保持圣遗物奖励不变"){
|
||||
let artifact = await imageRecognition(artifactImageMap[Artifacts],0.2,0,0,186,972,71,71);
|
||||
if (!artifact.found) {
|
||||
log.warn("圣遗物奖励和设定不一致,尝试切换...")
|
||||
if (!await selectionHolyRelics()){await genshin.returnMainUi();throw new Error("圣遗物奖励设置错误,停止执行...")}
|
||||
}
|
||||
else{
|
||||
log.warn("圣遗物奖励一致,无需切换 {0} ", Artifacts)
|
||||
}
|
||||
}
|
||||
|
||||
//4.进入秘境
|
||||
await sleep(500);
|
||||
await click(intoAction.x,intoAction.y)
|
||||
await sleep(1000);
|
||||
await click(intoAction.x,intoAction.y)
|
||||
let enter = await imageRecognition(enterButton,5, 0, 0,15,96 ,40,43);
|
||||
if (!enter.found){
|
||||
await genshin.returnMainUi();
|
||||
throw new Error("未进入秘境,停止执行...")
|
||||
}
|
||||
|
||||
//5.向前走进入挑战
|
||||
if (!(await readyFightIn())){
|
||||
await getOut();
|
||||
await genshin.returnMainUi();
|
||||
throw new Error("未进入准备战斗,停止执行...")
|
||||
}
|
||||
await sleep(1000);
|
||||
|
||||
//6.选择挑战boss
|
||||
log.info("选择挑战Boss:'{0}' 挑战次数:'{1}'", challengeName,challengeNum)
|
||||
log.info(`期间树脂耗尽会自动退出秘境...`);
|
||||
const clickCoordinates = [ { x: 207, y: 349 }, { x: 239, y: 531 }, { x: 227, y: 713 } ]; // Boss坐标1~3
|
||||
await click(clickCoordinates[challengeName - 1].x, clickCoordinates[challengeName - 1].y);
|
||||
|
||||
//6.5选择队员-苏婷老师-待写
|
||||
//log.warn("队伍选择功能等伟大的苏苏老师考完试做...")
|
||||
|
||||
//7.开始挑战
|
||||
await Textocr("开始挑战",1,1,0,1554,970,360, 105);
|
||||
var resinexhaustion = false; // 条件1:树脂耗尽
|
||||
|
||||
//8.战斗循环
|
||||
for (let i = 0;i < challengeNum; i++) {
|
||||
|
||||
log.info("进入战斗环境,开始第 {0} 次战斗", i+1)
|
||||
|
||||
//8.1自动战斗
|
||||
for (let fightCount = 0; fightCount < 3; fightCount++) {
|
||||
|
||||
let battleBegins = await Textocr("战斗开始",20,0,0,877,235,164,50);
|
||||
if (!battleBegins.found){
|
||||
await getOut();
|
||||
throw new Error("未进入战斗环境,停止执行...")
|
||||
}
|
||||
|
||||
try {
|
||||
await keyDown("w");
|
||||
await sleep(Startforward);
|
||||
await keyUp("w");
|
||||
|
||||
if(!await autoFight(Fighttimeout)){
|
||||
|
||||
resinAgain = true;
|
||||
|
||||
if (fightCount >= 2){
|
||||
await sleep(1000);
|
||||
await keyPress("VK_ESCAPE");
|
||||
await sleep(1000);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
let Again = await Textocr("再次挑战",10,1,0,1059,920,177,65);
|
||||
if (!Again.found)break;
|
||||
await sleep(1000);
|
||||
log.warn("战斗失败,第 {0} 次重试...", fightCount+1)
|
||||
throw new Error(`战斗失败,第 ${fightCount+1} 次重试...`)
|
||||
}
|
||||
|
||||
}else
|
||||
{
|
||||
resinAgain= false;
|
||||
break;
|
||||
}
|
||||
} catch (error) {
|
||||
if (fightCount < 2)continue;
|
||||
else break;
|
||||
}
|
||||
}
|
||||
|
||||
//8.2领取奖励
|
||||
if (resinAgain != true) {
|
||||
|
||||
await sleep(1000);
|
||||
await keyPress("VK_ESCAPE");
|
||||
await sleep(1000);
|
||||
|
||||
while(await imageRecognition(enterButton,5, 0, 0,15,96 ,40,43).found == false)
|
||||
{
|
||||
await keyPress("VK_ESCAPE");
|
||||
await sleep(1000);
|
||||
}
|
||||
|
||||
log.info("幽境危战:第 {0} 次领奖...", i+1)
|
||||
|
||||
if(!(await autoNavigateToReward())){verticalNum++;continue;}
|
||||
|
||||
await sleep(1000);
|
||||
|
||||
if (!(await claimRewards())) {
|
||||
resinexhaustion = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (challengeNum != i+1)
|
||||
{
|
||||
let challengeAgian = await Textocr("再次挑战",10,0,0,1094,958,200,70);
|
||||
if (!challengeAgian.found){
|
||||
await getOut();
|
||||
throw new Error("未找到·再次挑战·按键,停止执行...")
|
||||
}
|
||||
for (let retry = 0; retry < 5 && challengeAgian.found; retry++) {
|
||||
challengeAgian = await Textocr("再次挑战",0.2,0,0,1094,958,200,70);
|
||||
if (challengeAgian.found){
|
||||
await sleep(500);
|
||||
await click(challengeAgian.x, challengeAgian.y);
|
||||
await sleep(1000);
|
||||
}
|
||||
await sleep(200);
|
||||
}
|
||||
let resinTips = await Textocr("提示",2,0,0,840,225, 230, 125);
|
||||
if (resinTips.found){
|
||||
await sleep(1000);
|
||||
await keyPress("VK_ESCAPE");
|
||||
await sleep(200);
|
||||
log.info(`树脂提示已耗尽,...`);
|
||||
resinexhaustion = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//8.3判断继续或退出
|
||||
if (challengeNum == i+1 || resinexhaustion == true || resinAgain == true ){
|
||||
log.info(resinAgain ? "累计战斗失败 3 次,退出秘境..."
|
||||
: (challengeNum == i+1) ? `完成 ${i+1}/${challengeNum} 次战斗,退出挑战...`: `树脂耗尽,退出挑战...`);
|
||||
await sleep(1000);
|
||||
await keyPress("VK_ESCAPE");
|
||||
await sleep(1000);
|
||||
|
||||
var exitTimeout = 0;
|
||||
while(exitTimeout < 20) {
|
||||
let exitChallenge = await Textocr("退出挑战",0.3,0,0,866,719,274,86);
|
||||
if (exitChallenge.found) {
|
||||
await sleep(1000);
|
||||
await click(exitChallenge.x, exitChallenge.y);
|
||||
await sleep(1000);
|
||||
break;
|
||||
}
|
||||
let exitChallenge2 = await Textocr("退出挑战",0.3,1,0,866,719,274,86);
|
||||
log.info("尝试退出挑战...");
|
||||
await sleep(1000);
|
||||
await keyPress("VK_ESCAPE");
|
||||
await sleep(1000);
|
||||
exitTimeout++;
|
||||
}
|
||||
await genshin.returnMainUi();
|
||||
if (resinAgain == true){throw new Error("执行重试错误...")}
|
||||
return true;
|
||||
}
|
||||
|
||||
await sleep(500);
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
//9.执行错误,重试处理
|
||||
log.error(`执行过程中发生错误:${error.message}`);
|
||||
resinAgain = true;
|
||||
await genshin.returnMainUi();
|
||||
continue;
|
||||
}finally{
|
||||
//10.结束脚本
|
||||
await genshin.returnMainUi();
|
||||
if (resinAgain == false) log.info(`Auto自动幽境危战结束...`);
|
||||
}
|
||||
}
|
||||
|
||||
})();
|
||||
15
repo/js/AutoStygianOnslaught/manifest.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "自动幽境危战",
|
||||
"version": "1.7",
|
||||
"tags": ["幽境危战"],
|
||||
"bgi_version": "0.44.8",
|
||||
"description": "请先配置好秘境内的队伍,幽境危战战斗失败或执行错误会重试一次,请保证队伍实力",
|
||||
"authors": [
|
||||
{
|
||||
"name": "LCB-茶包"
|
||||
}
|
||||
],
|
||||
"settings_ui": "settings.json",
|
||||
"main": "main.js"
|
||||
}
|
||||
58
repo/js/AutoStygianOnslaught/settings.json
Normal file
@@ -0,0 +1,58 @@
|
||||
[
|
||||
{
|
||||
"name": "Artifacts",
|
||||
"type": "select",
|
||||
"label": "圣遗物奖励,默认不修改圣遗物奖励",
|
||||
"options": [
|
||||
"保持圣遗物奖励不变",
|
||||
"长夜之誓 / 深廊终曲",
|
||||
"黑曜秘典 / 烬城勇者绘卷",
|
||||
"谐律异想断章 / 未竟的遐思" ,
|
||||
"回声之林夜话 / 昔时之歌" ,
|
||||
"逐影猎人 / 黄金剧团" ,
|
||||
"水仙之梦 / 花海甘露之光" ,
|
||||
"乐园遗落之花 / 沙上楼阁史话" ,
|
||||
"深林的记忆 / 饰金之梦" ,
|
||||
"来歆余响 / 辰砂往生录" ,
|
||||
"华馆梦醒形骸记 / 海染砗磲" ,
|
||||
"绝缘之旗印 / 追忆之注连" ,
|
||||
"昔日宗室之仪 / 染血的骑士道" ,
|
||||
"渡过烈火的贤人 / 炽烈的炎之魔女" ,
|
||||
"悠古的磐岩 / 逆飞的流星",
|
||||
"千岩牢固 / 苍白之火" ,
|
||||
"冰风迷途的勇士 / 沉沦之心" ,
|
||||
"翠绿之影 / 被怜爱的少女" ,
|
||||
"如雷的盛怒 / 平息鸣雷的尊者"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "challengeName",
|
||||
"type": "select",
|
||||
"label": "必填:从上往下(1~3),选择第几个Boss挑战关卡",
|
||||
"options": [
|
||||
"1",
|
||||
"2",
|
||||
"3"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "challengeNum",
|
||||
"type": "input-text",
|
||||
"label": "挑战次数,默认15次,期间树脂耗尽会自动结束"
|
||||
},
|
||||
{
|
||||
"name": "Rewardsuse",
|
||||
"type": "input-text",
|
||||
"label": "树脂顺序,1=浓缩树脂/2=原粹树脂/3=脆弱树脂/4=须臾树脂\n用`/`隔开,填写对应的树脂数字即可,默认:1/2\n表示先使用浓缩树脂,再使用原粹树脂,不填的不使用"
|
||||
},
|
||||
{
|
||||
"name": "Fighttimeout",
|
||||
"type": "input-text",
|
||||
"label": "最长战斗超时时间,单位秒,默认240秒"
|
||||
},
|
||||
{
|
||||
"name": "Startforward",
|
||||
"type": "input-text",
|
||||
"label": "开始战斗后,向前移动的时间,默认1秒(注意单位:秒)"
|
||||
}
|
||||
]
|
||||