js:提瓦特扫描仪初版 (#1263)
This commit is contained in:
51
repo/js/切换主角元素/assets/switchElement/岩.json
Normal file
51
repo/js/切换主角元素/assets/switchElement/岩.json
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "岩",
|
||||
"type": "collect",
|
||||
"author": "mno",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.45.0",
|
||||
"tags": [],
|
||||
"last_modified_time": 1751302360644
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"x": 978.720703125,
|
||||
"y": -353.53662109375,
|
||||
"type": "teleport",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 984.4345703125,
|
||||
"y": -351.3369140625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 985.9130859375,
|
||||
"y": -348.8408203125,
|
||||
"type": "target",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 986.513671875,
|
||||
"y": -344.76611328125,
|
||||
"type": "orientation",
|
||||
"move_mode": "walk",
|
||||
"action": "combat_script",
|
||||
"action_params": "keypress(w); 荧 attack,wait(2),keypress(f); 空 attack,wait(2),keypress(f);"
|
||||
}
|
||||
]
|
||||
}
|
||||
33
repo/js/切换主角元素/assets/switchElement/水.json
Normal file
33
repo/js/切换主角元素/assets/switchElement/水.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "水",
|
||||
"type": "collect",
|
||||
"author": "mno",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.45.0",
|
||||
"tags": [],
|
||||
"last_modified_time": 1751302729676
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": 4610.498046875,
|
||||
"y": 3600.668701171875,
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 4631.1494140625,
|
||||
"y": 3598.541259765625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "combat_script",
|
||||
"action_params": "keypress(w); 荧 attack,wait(2),keypress(f); 空 attack,wait(2),keypress(f);"
|
||||
}
|
||||
]
|
||||
}
|
||||
33
repo/js/切换主角元素/assets/switchElement/火.json
Normal file
33
repo/js/切换主角元素/assets/switchElement/火.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "火",
|
||||
"type": "collect",
|
||||
"author": "mno",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.45.0",
|
||||
"tags": [],
|
||||
"last_modified_time": 1751302846273
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": 8597.341796875,
|
||||
"y": -1928.5986328125,
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 8597.623046875,
|
||||
"y": -1932.87451171875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "combat_script",
|
||||
"action_params": "keypress(w); 荧 attack,wait(2),keypress(f); 空 attack,wait(2),keypress(f);"
|
||||
}
|
||||
]
|
||||
}
|
||||
33
repo/js/切换主角元素/assets/switchElement/草.json
Normal file
33
repo/js/切换主角元素/assets/switchElement/草.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "草",
|
||||
"type": "collect",
|
||||
"author": "mno",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.45.0",
|
||||
"tags": [],
|
||||
"last_modified_time": 1751302613795
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": 2297.580078125,
|
||||
"y": -824.5205078125,
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 2295.8798828125,
|
||||
"y": -825.7041015625,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "combat_script",
|
||||
"action_params": "keypress(w); 荧 attack,wait(2),keypress(f); 空 attack,wait(2),keypress(f);"
|
||||
}
|
||||
]
|
||||
}
|
||||
33
repo/js/切换主角元素/assets/switchElement/雷.json
Normal file
33
repo/js/切换主角元素/assets/switchElement/雷.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "雷",
|
||||
"type": "collect",
|
||||
"author": "mno",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.45.0",
|
||||
"tags": [],
|
||||
"last_modified_time": 1751302521509
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": -3233.314453125,
|
||||
"y": -3534.126953125,
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": -3237.7265625,
|
||||
"y": -3533.8779296875,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "combat_script",
|
||||
"action_params": "keypress(w); 荧 attack,wait(2),keypress(f); 空 attack,wait(2),keypress(f);"
|
||||
}
|
||||
]
|
||||
}
|
||||
42
repo/js/切换主角元素/assets/switchElement/风.json
Normal file
42
repo/js/切换主角元素/assets/switchElement/风.json
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "风主",
|
||||
"type": "collect",
|
||||
"author": "mno",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"map_name": "Teyvat",
|
||||
"bgi_version": "0.45.0",
|
||||
"tags": [],
|
||||
"last_modified_time": 1751300321221
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": -1266.748046875,
|
||||
"y": 1933.923828125,
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": -1266.5419921875,
|
||||
"y": 1929.845703125,
|
||||
"type": "target",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": -1265.130859375,
|
||||
"y": 1924.84375,
|
||||
"type": "orientation",
|
||||
"move_mode": "walk",
|
||||
"action": "combat_script",
|
||||
"action_params": "keypress(w); 荧 attack,wait(2),keypress(f); 空 attack,wait(2),keypress(f);"
|
||||
}
|
||||
]
|
||||
}
|
||||
39
repo/js/切换主角元素/main.js
Normal file
39
repo/js/切换主角元素/main.js
Normal file
@@ -0,0 +1,39 @@
|
||||
(async function () {
|
||||
//处理自定义配置
|
||||
const partyName = settings.partyName || "";
|
||||
const element = settings.element || "风";
|
||||
const fullPath = `assets/switchElement/${element}.json`;
|
||||
//切换到用户指定的含有主角的配队
|
||||
await switchPartyIfNeeded(partyName);
|
||||
//导航至对应的七天神像
|
||||
await pathingScript.runFile(fullPath);
|
||||
//点击与某元素共鸣
|
||||
log.info(`旅行者正在汲取${element}元素力`);
|
||||
for (let i = 0; i < 5; i++) {
|
||||
await click(1400, 675);
|
||||
await sleep(500);
|
||||
}
|
||||
//传送离开防止影响后续
|
||||
await genshin.returnMainUi();
|
||||
await genshin.tpToStatueOfTheSeven();
|
||||
})();
|
||||
|
||||
//切换队伍
|
||||
async function switchPartyIfNeeded(partyName) {
|
||||
if (!partyName) {
|
||||
await genshin.returnMainUi();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
log.info("正在尝试切换至" + partyName);
|
||||
if (!await genshin.switchParty(partyName)) {
|
||||
log.info("切换队伍失败,前往七天神像重试");
|
||||
await genshin.tpToStatueOfTheSeven();
|
||||
await genshin.switchParty(partyName);
|
||||
}
|
||||
} catch {
|
||||
log.error("队伍切换失败,可能处于联机模式或其他不可切换状态");
|
||||
notification.error(`队伍切换失败,可能处于联机模式或其他不可切换状态`);
|
||||
await genshin.returnMainUi();
|
||||
}
|
||||
}
|
||||
13
repo/js/切换主角元素/manifest.json
Normal file
13
repo/js/切换主角元素/manifest.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "切换主角元素",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"authors": [
|
||||
{
|
||||
"name": "mno"
|
||||
}
|
||||
],
|
||||
"settings_ui": "settings.json",
|
||||
"main": "main.js"
|
||||
}
|
||||
21
repo/js/切换主角元素/settings.json
Normal file
21
repo/js/切换主角元素/settings.json
Normal file
@@ -0,0 +1,21 @@
|
||||
[
|
||||
{
|
||||
"name": "element",
|
||||
"type": "select",
|
||||
"label": "要切换的元素",
|
||||
"options": [
|
||||
"风",
|
||||
"岩",
|
||||
"雷",
|
||||
"草",
|
||||
"水",
|
||||
"火"
|
||||
],
|
||||
"default": "不卡时间,ab交替运行"
|
||||
},
|
||||
{
|
||||
"name": "partyName",
|
||||
"type": "input-text",
|
||||
"label": "含有主角的队伍名称"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user