添加了js脚本 (#1670)

* Add files via upload

* 更新

* Update README.md

修改
This commit is contained in:
古又
2025-08-24 17:47:39 +08:00
committed by GitHub
parent 36d9cd0be4
commit 0e7941bc91
24 changed files with 1660 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
还在因为抽到七七bushi而感到身体乏力嘛快加入玄学玩家的步伐
主要功能有:蒙德购买圣水,璃月上香,稻妻抽签,枫丹领取福利餐,纳塔领取龙蛋;
使用前先检查你图开完没,没开的地方,就不要勾选相关选项!!!
注意:
璃月上香:铜雀庙任务解锁方法,做完群玉阁重建活动后,现实第二天,到万民堂接取任务!!!

View File

@@ -0,0 +1,58 @@
{
"config": {
"realtime_triggers": {
"AutoPick": true
}
},
"farming_info": {
"allow_farming_count": false,
"duration_seconds": 0,
"elite_details": "",
"elite_mob_count": 0,
"normal_mob_count": 0,
"primary_target": "",
"total_mora": 0
},
"info": {
"authors": [
{
"links": "",
"name": "古又"
}
],
"bgi_version": "0.45.0",
"description": "",
"enable_monster_loot_split": false,
"items": [],
"last_modified_time": 1755957333121,
"map_match_method": "",
"map_name": "Teyvat",
"name": "时间",
"order": 0,
"tags": [],
"type": "collect",
"version": "1.0"
},
"positions": [
{
"action": "set_time",
"action_params": "8:00",
"id": 1,
"move_mode": "walk",
"point_ext_params": {
"description": "",
"enable_monster_loot_split": false,
"misidentification": {
"arrival_time": 0,
"handling_mode": "previousDetectedPoint",
"type": [
"unrecognized"
]
}
},
"type": "orientation",
"x": -874.138671875,
"y": 1974.3095703125
}
]
}

View File

@@ -0,0 +1,96 @@
{
"info": {
"name": "蒙德清泉镇路线",
"bgi_version": "0.45.0",
"type": "collect",
"order": 0,
"tags": [],
"enable_monster_loot_split": false,
"map_name": "Teyvat",
"map_match_method": "",
"items": [],
"authors": [
{
"name": "古又",
"links": ""
}
],
"version": "1.0",
"description": "购买圣水",
"last_modified_time": 1755436615482
},
"config": {
"realtime_triggers": {
"AutoPick": true
}
},
"farming_info": {
"allow_farming_count": false,
"normal_mob_count": 0,
"elite_mob_count": 0,
"primary_target": "",
"duration_seconds": 0,
"elite_details": "",
"total_mora": 0
},
"positions": [
{
"id": 1,
"x": -867.2578125,
"y": 1992.54736328125,
"action": "",
"move_mode": "walk",
"type": "teleport",
"point_ext_params": {
"misidentification": {
"type": [
"unrecognized"
],
"handling_mode": "previousDetectedPoint",
"arrival_time": 0
},
"description": "",
"enable_monster_loot_split": false
}
},
{
"id": 2,
"x": -872.498046875,
"y": 1978.14111328125,
"action": "",
"move_mode": "run",
"type": "path",
"point_ext_params": {
"misidentification": {
"type": [
"unrecognized"
],
"handling_mode": "previousDetectedPoint",
"arrival_time": 0
},
"description": "",
"enable_monster_loot_split": false
}
},
{
"id": 3,
"x": -874.138671875,
"y": 1974.3095703125,
"action": "set_time",
"move_mode": "walk",
"action_params": "6:00",
"type": "path",
"point_ext_params": {
"misidentification": {
"type": [
"unrecognized"
],
"handling_mode": "previousDetectedPoint",
"arrival_time": 0
},
"description": "",
"enable_monster_loot_split": false
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -0,0 +1,114 @@
{
"info": {
"name": "挂签路线",
"bgi_version": "0.45.0",
"type": "collect",
"order": 0,
"tags": [],
"enable_monster_loot_split": false,
"map_name": "Teyvat",
"map_match_method": "",
"items": [],
"authors": [
{
"name": "古又",
"links": ""
}
],
"version": "1.0",
"description": "挂签",
"last_modified_time": 1755446724362
},
"config": {
"realtime_triggers": {
"AutoPick": true
}
},
"farming_info": {
"allow_farming_count": false,
"normal_mob_count": 0,
"elite_mob_count": 0,
"primary_target": "",
"duration_seconds": 0,
"elite_details": "",
"total_mora": 0
},
"positions": [
{
"id": 1,
"x": -4417.564453125,
"y": -2480.578125,
"action": "",
"move_mode": "walk",
"type": "path",
"point_ext_params": {
"misidentification": {
"type": [
"unrecognized"
],
"handling_mode": "previousDetectedPoint",
"arrival_time": 0
},
"description": "",
"enable_monster_loot_split": false
}
},
{
"id": 2,
"x": -4414.2421875,
"y": -2475.63671875,
"action": "",
"move_mode": "walk",
"type": "path",
"point_ext_params": {
"misidentification": {
"type": [
"unrecognized"
],
"handling_mode": "previousDetectedPoint",
"arrival_time": 0
},
"description": "",
"enable_monster_loot_split": false
}
},
{
"id": 3,
"x": -4409.728515625,
"y": -2478.0390625,
"action": "",
"move_mode": "walk",
"type": "path",
"point_ext_params": {
"misidentification": {
"type": [
"unrecognized"
],
"handling_mode": "previousDetectedPoint",
"arrival_time": 0
},
"description": "",
"enable_monster_loot_split": false
}
},
{
"id": 4,
"x": -4411.03515625,
"y": -2479.69140625,
"action": "",
"move_mode": "walk",
"type": "path",
"point_ext_params": {
"misidentification": {
"type": [
"unrecognized"
],
"handling_mode": "previousDetectedPoint",
"arrival_time": 0
},
"description": "",
"enable_monster_loot_split": false
}
}
]
}

View File

@@ -0,0 +1,67 @@
{
"info": {
"name": "枫丹梅洛彼得堡路线",
"type": "collect",
"authors": [
{
"name": "古又",
"links": ""
}
],
"version": "1.0",
"description": "领取福利餐",
"map_name": "Teyvat",
"bgi_version": "0.45.0",
"tags": [],
"last_modified_time": 1755520489362,
"enable_monster_loot_split": false,
"map_match_method": ""
},
"positions": [
{
"id": 1,
"action": "",
"move_mode": "walk",
"type": "teleport",
"x": 4618.744140625,
"y": 4390.26416015625,
"action_params": ""
},
{
"id": 2,
"x": 4621.45703125,
"y": 4401.85693359375,
"type": "path",
"move_mode": "walk",
"action": "",
"action_params": ""
},
{
"id": 3,
"x": 4613.2890625,
"y": 4404.12353515625,
"type": "path",
"move_mode": "fly",
"action": "stop_flying",
"action_params": "300"
},
{
"id": 4,
"x": 4583.609375,
"y": 4429.7861328125,
"type": "path",
"move_mode": "run",
"action": "",
"action_params": ""
},
{
"id": 5,
"x": 4601.986328125,
"y": 4492.96533203125,
"type": "path",
"move_mode": "run",
"action": "",
"action_params": ""
}
]
}

View File

@@ -0,0 +1,133 @@
{
"info": {
"name": "璃月璃沙娇路线",
"bgi_version": "0.45.0",
"type": "collect",
"order": 0,
"tags": [],
"enable_monster_loot_split": false,
"map_name": "Teyvat",
"map_match_method": "",
"items": [],
"authors": [
{
"name": "古又",
"links": ""
}
],
"version": "1.0",
"description": "璃月上香",
"last_modified_time": 1755434589510
},
"config": {
"realtime_triggers": {
"AutoPick": true
}
},
"farming_info": {
"allow_farming_count": false,
"normal_mob_count": 0,
"elite_mob_count": 0,
"primary_target": "",
"duration_seconds": 0,
"elite_details": "",
"total_mora": 0
},
"positions": [
{
"id": 1,
"x": 710.9873046875,
"y": -772.1533203125,
"action": "",
"move_mode": "walk",
"type": "teleport",
"point_ext_params": {
"misidentification": {
"type": [
"unrecognized"
],
"handling_mode": "previousDetectedPoint",
"arrival_time": 0
},
"description": "",
"enable_monster_loot_split": false
}
},
{
"id": 2,
"x": 736.2275390625,
"y": -801.23876953125,
"action": "",
"move_mode": "run",
"type": "path",
"point_ext_params": {
"misidentification": {
"type": [
"unrecognized"
],
"handling_mode": "previousDetectedPoint",
"arrival_time": 0
},
"description": "",
"enable_monster_loot_split": false
}
},
{
"id": 3,
"x": 744.0751953125,
"y": -790.17724609375,
"action": "",
"move_mode": "run",
"type": "path",
"point_ext_params": {
"misidentification": {
"type": [
"unrecognized"
],
"handling_mode": "previousDetectedPoint",
"arrival_time": 0
},
"description": "",
"enable_monster_loot_split": false
}
},
{
"id": 4,
"x": 738.716796875,
"y": -786.197265625,
"action": "",
"move_mode": "run",
"type": "path",
"point_ext_params": {
"misidentification": {
"type": [
"unrecognized"
],
"handling_mode": "previousDetectedPoint",
"arrival_time": 0
},
"description": "",
"enable_monster_loot_split": false
}
},
{
"id": 5,
"x": 735.123046875,
"y": -784.1455078125,
"action": "",
"move_mode": "walk",
"type": "path",
"point_ext_params": {
"misidentification": {
"type": [
"unrecognized"
],
"handling_mode": "previousDetectedPoint",
"arrival_time": 0
},
"description": "",
"enable_monster_loot_split": false
}
}
]
}

View File

@@ -0,0 +1,369 @@
{
"macroEvents": [
{
"type": 4,
"mouseX": 1206,
"mouseY": 920,
"mouseButton": "Left",
"time": 1125
},
{
"type": 2,
"mouseX": 1206,
"mouseY": 919,
"time": 2079
},
{
"type": 2,
"mouseX": 1206,
"mouseY": 910,
"time": 2125
},
{
"type": 2,
"mouseX": 1207,
"mouseY": 906,
"time": 2329
},
{
"type": 2,
"mouseX": 1208,
"mouseY": 899,
"time": 2360
},
{
"type": 2,
"mouseX": 1210,
"mouseY": 876,
"time": 2391
},
{
"type": 2,
"mouseX": 1211,
"mouseY": 853,
"time": 2422
},
{
"type": 2,
"mouseX": 1211,
"mouseY": 834,
"time": 2454
},
{
"type": 2,
"mouseX": 1211,
"mouseY": 824,
"time": 2485
},
{
"type": 2,
"mouseX": 1211,
"mouseY": 813,
"time": 2516
},
{
"type": 2,
"mouseX": 1211,
"mouseY": 792,
"time": 2547
},
{
"type": 2,
"mouseX": 1211,
"mouseY": 770,
"time": 2579
},
{
"type": 2,
"mouseX": 1205,
"mouseY": 672,
"time": 2672
},
{
"type": 2,
"mouseX": 1204,
"mouseY": 643,
"time": 2704
},
{
"type": 2,
"mouseX": 1202,
"mouseY": 616,
"time": 2735
},
{
"type": 2,
"mouseX": 1202,
"mouseY": 600,
"time": 2766
},
{
"type": 2,
"mouseX": 1201,
"mouseY": 576,
"time": 2797
},
{
"type": 2,
"mouseX": 1201,
"mouseY": 556,
"time": 2829
},
{
"type": 2,
"mouseX": 1201,
"mouseY": 536,
"time": 2860
},
{
"type": 2,
"mouseX": 1201,
"mouseY": 513,
"time": 2891
},
{
"type": 2,
"mouseX": 1201,
"mouseY": 499,
"time": 2922
},
{
"type": 2,
"mouseX": 1201,
"mouseY": 481,
"time": 2954
},
{
"type": 2,
"mouseX": 1201,
"mouseY": 463,
"time": 2985
},
{
"type": 2,
"mouseX": 1201,
"mouseY": 448,
"time": 3016
},
{
"type": 2,
"mouseX": 1201,
"mouseY": 425,
"time": 3047
},
{
"type": 2,
"mouseX": 1201,
"mouseY": 399,
"time": 3079
},
{
"type": 2,
"mouseX": 1201,
"mouseY": 385,
"time": 3110
},
{
"type": 2,
"mouseX": 1201,
"mouseY": 378,
"time": 3141
},
{
"type": 2,
"mouseX": 1201,
"mouseY": 314,
"time": 3235
},
{
"type": 2,
"mouseX": 1202,
"mouseY": 297,
"time": 3266
},
{
"type": 2,
"mouseX": 1203,
"mouseY": 278,
"time": 3297
},
{
"type": 2,
"mouseX": 1203,
"mouseY": 265,
"time": 3329
},
{
"type": 2,
"mouseX": 1203,
"mouseY": 248,
"time": 3360
},
{
"type": 2,
"mouseX": 1204,
"mouseY": 234,
"time": 3391
},
{
"type": 2,
"mouseX": 1204,
"mouseY": 224,
"time": 3422
},
{
"type": 2,
"mouseX": 1204,
"mouseY": 222,
"time": 3454
},
{
"type": 2,
"mouseX": 1204,
"mouseY": 221,
"time": 4750
},
{
"type": 2,
"mouseX": 1204,
"mouseY": 220,
"time": 4797
},
{
"type": 2,
"mouseX": 1204,
"mouseY": 219,
"time": 5157
},
{
"type": 2,
"mouseX": 1204,
"mouseY": 216,
"time": 5204
},
{
"type": 2,
"mouseX": 1205,
"mouseY": 216,
"time": 5235
},
{
"type": 2,
"mouseX": 1205,
"mouseY": 215,
"time": 5313
},
{
"type": 5,
"mouseX": 1205,
"mouseY": 215,
"mouseButton": "Left",
"time": 5829
},
{
"type": 2,
"mouseX": 1205,
"mouseY": 216,
"time": 5891
},
{
"type": 2,
"mouseX": 1204,
"mouseY": 219,
"time": 5969
},
{
"type": 2,
"mouseX": 1204,
"mouseY": 226,
"time": 6000
},
{
"type": 2,
"mouseX": 1205,
"mouseY": 241,
"time": 6032
},
{
"type": 2,
"mouseX": 1205,
"mouseY": 251,
"time": 6829
},
{
"type": 2,
"mouseX": 1215,
"mouseY": 312,
"time": 6860
},
{
"type": 2,
"mouseX": 1227,
"mouseY": 390,
"time": 6891
},
{
"type": 2,
"mouseX": 1233,
"mouseY": 439,
"time": 6922
},
{
"type": 2,
"mouseX": 1241,
"mouseY": 526,
"time": 6954
},
{
"type": 2,
"mouseX": 1223,
"mouseY": 799,
"time": 7063
},
{
"type": 2,
"mouseX": 1215,
"mouseY": 853,
"time": 7094
},
{
"type": 2,
"mouseX": 1211,
"mouseY": 899,
"time": 7125
},
{
"type": 2,
"mouseX": 1210,
"mouseY": 911,
"time": 7157
},
{
"type": 2,
"mouseX": 1209,
"mouseY": 914,
"time": 7219
},
{
"type": 2,
"mouseX": 1208,
"mouseY": 921,
"time": 7250
},
{
"type": 2,
"mouseX": 1208,
"mouseY": 924,
"time": 7282
}
],
"info": {
"name": "",
"description": "滑动4行",
"x": 0,
"y": 0,
"width": 1920,
"height": 1080,
"recordDpi": 1
}
}

View File

@@ -0,0 +1,92 @@
{
"info": {
"authors": [
{
"links": "",
"name": "古又"
}
],
"bgi_version": "0.45.0",
"description": "抽签",
"enable_monster_loot_split": false,
"last_modified_time": 1755867216831,
"map_match_method": "",
"map_name": "Teyvat",
"name": "稻妻鸣神大社路线-测试",
"tags": [],
"type": "collect",
"version": "1.0"
},
"positions": [
{
"action": "",
"action_params": "",
"id": 1,
"move_mode": "walk",
"type": "teleport",
"x": -4375.3359375,
"y": -2497.890625
},
{
"action": "",
"action_params": "",
"id": 2,
"move_mode": "run",
"type": "path",
"x": -4393.1015625,
"y": -2485.140625
},
{
"action": "",
"action_params": "",
"id": 3,
"move_mode": "walk",
"type": "path",
"x": -4388.609375,
"y": -2477.291015625
},
{
"action": "",
"action_params": "",
"id": 4,
"move_mode": "walk",
"type": "path",
"x": -4397.1328125,
"y": -2471.44140625
},
{
"action": "",
"action_params": "",
"id": 5,
"move_mode": "walk",
"type": "path",
"x": -4402.39453125,
"y": -2477.8330078125
},
{
"action": "",
"action_params": "",
"id": 6,
"move_mode": "run",
"type": "path",
"x": -4411.4609375,
"y": -2472.765625
},
{
"id": 7,
"move_mode": "walk",
"type": "path",
"x": -4414.5810546875,
"y": -2476.6298828125
},
{
"action": "",
"action_params": "",
"id": 8,
"move_mode": "jump",
"type": "path",
"x": -4417.701171875,
"y": -2480.494140625
}
]
}

View File

@@ -0,0 +1,152 @@
{
"info": {
"name": "纳塔悠悠集市路线",
"bgi_version": "0.45.0",
"type": "collect",
"order": 0,
"tags": [],
"enable_monster_loot_split": false,
"map_name": "Teyvat",
"map_match_method": "",
"items": [],
"authors": [
{
"name": "古又",
"links": ""
}
],
"version": "1.0",
"description": "领取龙蛋",
"last_modified_time": 1755440920507
},
"config": {
"realtime_triggers": {
"AutoPick": true
}
},
"farming_info": {
"allow_farming_count": false,
"normal_mob_count": 0,
"elite_mob_count": 0,
"primary_target": "",
"duration_seconds": 0,
"elite_details": "",
"total_mora": 0
},
"positions": [
{
"id": 1,
"x": 13979.1865234375,
"y": 470.8291015625,
"action": "",
"move_mode": "walk",
"type": "teleport",
"point_ext_params": {
"misidentification": {
"type": [
"unrecognized"
],
"handling_mode": "previousDetectedPoint",
"arrival_time": 0
},
"description": "",
"enable_monster_loot_split": false
}
},
{
"id": 2,
"x": 13964.6474609375,
"y": 457.3974609375,
"action": "",
"move_mode": "run",
"type": "path",
"point_ext_params": {
"misidentification": {
"type": [
"unrecognized"
],
"handling_mode": "previousDetectedPoint",
"arrival_time": 0
},
"description": "",
"enable_monster_loot_split": false
}
},
{
"id": 3,
"x": 13960.3623046875,
"y": 453.92626953125,
"action": "",
"move_mode": "jump",
"type": "path",
"point_ext_params": {
"misidentification": {
"type": [
"unrecognized"
],
"handling_mode": "previousDetectedPoint",
"arrival_time": 0
},
"description": "",
"enable_monster_loot_split": false
}
},
{
"id": 4,
"x": 13941.265625,
"y": 434.55224609375,
"action": "",
"move_mode": "run",
"type": "path",
"point_ext_params": {
"misidentification": {
"type": [
"unrecognized"
],
"handling_mode": "previousDetectedPoint",
"arrival_time": 0
},
"description": "",
"enable_monster_loot_split": false
}
},
{
"id": 5,
"x": 13934.8505859375,
"y": 426.47900390625,
"action": "",
"move_mode": "run",
"type": "path",
"point_ext_params": {
"misidentification": {
"type": [
"unrecognized"
],
"handling_mode": "previousDetectedPoint",
"arrival_time": 0
},
"description": "",
"enable_monster_loot_split": false
}
},
{
"id": 6,
"x": 13919.9755859375,
"y": 411.5107421875,
"action": "",
"move_mode": "run",
"type": "path",
"point_ext_params": {
"misidentification": {
"type": [
"unrecognized"
],
"handling_mode": "previousDetectedPoint",
"arrival_time": 0
},
"description": "",
"enable_monster_loot_split": false
}
}
]
}

View File

@@ -0,0 +1,49 @@
{
"info": {
"authors": [
{
"links": "",
"name": "古又"
}
],
"bgi_version": "0.45.0",
"description": "圣水",
"enable_monster_loot_split": false,
"last_modified_time": 1755961668176,
"map_match_method": "",
"map_name": "Teyvat",
"name": "蒙德清泉镇路线",
"tags": [],
"type": "collect",
"version": "1.0"
},
"positions": [
{
"action": "",
"action_params": "",
"id": 1,
"move_mode": "walk",
"type": "teleport",
"x": -867.2578125,
"y": 1992.54736328125
},
{
"action": "",
"action_params": "",
"id": 2,
"move_mode": "walk",
"type": "path",
"x": -871.37109375,
"y": 1980.560546875
},
{
"action": "",
"action_params": "",
"id": 3,
"move_mode": "walk",
"type": "path",
"x": -874.208984375,
"y": 1972.9423828125
}
]
}

View File

@@ -0,0 +1,77 @@
{
"config": {
"realtime_triggers": {
"AutoPick": true
}
},
"farming_info": {
"allow_farming_count": false,
"duration_seconds": 0,
"elite_details": "",
"elite_mob_count": 0,
"normal_mob_count": 0,
"primary_target": "",
"total_mora": 0
},
"info": {
"authors": [
{
"links": "",
"name": "古又"
}
],
"bgi_version": "0.45.0",
"description": "初始化霍普金斯",
"enable_monster_loot_split": false,
"items": [],
"last_modified_time": 1755960262200,
"map_match_method": "",
"map_name": "Teyvat",
"name": "霍普金斯",
"order": 0,
"tags": [],
"type": "collect",
"version": "1.0"
},
"positions": [
{
"action": "",
"id": 1,
"move_mode": "walk",
"point_ext_params": {
"description": "",
"enable_monster_loot_split": false,
"misidentification": {
"arrival_time": 0,
"handling_mode": "previousDetectedPoint",
"type": [
"unrecognized"
]
}
},
"type": "teleport",
"x": -1120.64453125,
"y": 2190.83203125
},
{
"action": "set_time",
"action_params": "8:00",
"id": 2,
"move_mode": "walk",
"point_ext_params": {
"description": "",
"enable_monster_loot_split": false,
"misidentification": {
"arrival_time": 0,
"handling_mode": "previousDetectedPoint",
"type": [
"unrecognized"
]
}
},
"type": "orientation",
"x": -874.138671875,
"y": 1974.3095703125
}
]
}

View File

@@ -0,0 +1,384 @@
//初始化
let gameRegion;
//对话识别区域
xZone = { min: 900, max: 1700 };
yZone = { min: 380, max: 880 };
//文字识别,并返回相关信息
async function performOcr(keyWords, xRange, yRange,judge) {
gameRegion = captureGameRegion();
try {
if (judge == "true") {
let ocrResult = gameRegion.find(RecognitionObject.ocr(
xRange.min, yRange.min,
xRange.max - xRange.min, yRange.max - yRange.min
));
if (ocrResult) {
let correctedText = ocrResult.text;
return correctedText;
} else {
// log.warn(`OCR 识别区域未找到内容`);
return "";
}
} else {
let resList = gameRegion.findMulti(RecognitionObject.ocr(
xRange.min, yRange.min,
xRange.max - xRange.min, yRange.max - yRange.min
));
gameRegion.dispose();
// 遍历识别结果,检查是否找到目标文本
let results = [];
for (let i = 0; i < resList.count; i++) {
let res = resList[i];
let correctedText = res.text;
if (correctedText.includes(keyWords)) {
results.push({ text: correctedText, x: res.x, y: res.y, width: res.width, height: res.height });
//点击中心
// await click(Math.round(res.x +res.width/2),Math.round(res.y + res.height/2));
keyDown("VK_MENU");
await sleep(500);
moveMouseTo(res.x, res.y);
leftButtonClick();
await sleep(800);
keyUp("VK_MENU");
await sleep(1000);
leftButtonClick();
break;
}
}
return results;
}
} catch (error) {
log.error(`识别图像时发生异常: ${error.message}`);
return null;
}
}
//图标识别,并返回相关信息
async function findImgIcon(imagePath, xRange, yRange) {
let template = file.ReadImageMatSync(imagePath);
let recognitionObject = RecognitionObject.TemplateMatch(template, xRange.min, yRange.min,
xRange.max - xRange.min, yRange.max - yRange.min);
let results = [];
try {
gameRegion = captureGameRegion();
let result = gameRegion.find(recognitionObject);
if (result.isExist()) {
results.push({ success: true, x: result.x, y: result.y, width: result.width, height: result.height });
keyDown("VK_MENU");
await sleep(500);
moveMouseTo(result.x, result.y);
leftButtonClick();
await sleep(800);
keyUp("VK_MENU");
} else {
// log.info("图像识别失败");
}
return results;
} catch (error) {
log.error(`识别图像时发生异常: ${error.message}`);
}
}
(async function() {
//蒙德清泉镇圣水
if (settings.water) {
await genshin.returnMainUi();
await pathingScript.runFile("assets/霍普金斯.json");
await genshin.returnMainUi();
await pathingScript.runFile("assets/蒙德清泉镇路线.json");
await sleep(1000);
//识别区域
try {
//识别对话位置,并点击
let ocrResults = await performOcr("神奇的", xZone, yZone, "false");
if (ocrResults.length != 0) {
await genshin.chooseTalkOption("如何才能获得强大的力量");
await sleep(1000);
leftButtonClick();
await sleep(1000);
let recognizedOveer = await performOcr("已",{ min: 1482, max: 1630 }, { min: 912, max: 957 }, "false")
if (recognizedOveer.length != 0) {
log.info("已售罄!!!");
await genshin.returnMainUi();
} else {
let recognizedMora = await performOcr("", { min: 1600, max: 1780 }, { min: 30, max: 60 }, "true")
if (BigInt(recognizedMora) >= 300) {
await sleep(800);
await click(1636,1019);
await sleep(1000);
await click(1168,785);
await sleep(1000);
} else {
log.info("不是哥们,你怎么比我还穷!!!");
await genshin.returnMainUi();
};
};
};
await genshin.returnMainUi();
} catch (error) {
log.error(`识别图像时发生异常: ${error.message}`);
}
};
//璃月璃沙娇上香
if (settings.sticks) {
await genshin.returnMainUi();
await pathingScript.runFile("assets/璃月璃沙娇路线.json");
await sleep(1000);
//识别区域
try {
//识别对话位置,并点击
// let ocrResults = await performOcr("王平安", { min: 1058, max: 1551 }, { min: 394, max: 680 },"false");
let ocrResults = await performOcr("王平安", xZone, yZone,"false");
if (ocrResults.length != 0) {
await genshin.chooseTalkOption("能给我几支香吗");
await sleep(700);
leftButtonClick();
await sleep(700);
leftButtonClick();
await sleep(1500);
// let ocrResults1 = await performOcr("敬香", { min: 1060, max: 1550 }, { min: 400, max: 680 },"false");
let ocrResults1 = await performOcr("敬香", xZone, yZone,"false");
if(ocrResults1.length != 0){
await sleep(1000);
await click(1168,785);
await sleep(1000);
} else {
log.error(`未识别到对话`);
await genshin.returnMainUi();
};
} else {
log.error(`识别图像时发生异常: ${error.message}`);
};
} catch (error) {
log.error(`识别图像时发生异常: ${error.message}`);
}
await genshin.returnMainUi();
};
//稻妻鸣神大社抽签
if (settings.lots) {
await genshin.returnMainUi();
await pathingScript.runFile("assets/稻妻鸣神大社路线.json");
await sleep(1000);
//识别区域
try {
//识别对话位置,并点击
let ocrResults = await performOcr("御神签箱", xZone, yZone, "false");
if (ocrResults.length != 0) {
await sleep(700);
leftButtonClick();
await sleep(2000);
let ocrResults1 = await performOcr("求签吧", xZone, yZone, "false");
if (ocrResults1.length != 0) {
await sleep(3000);
leftButtonClick();
await sleep(5000);
leftButtonClick();
await sleep(3000);
};
let ocrResults2 = await performOcr("玄冬林", xZone, yZone,"false");
if (ocrResults2.length != 0) {
await sleep(700);
leftButtonClick();
await sleep(3000);
let ocrResults3 = await performOcr("我要", xZone, yZone, "false");
if (ocrResults3.length != 0) {
await sleep(700);
leftButtonClick();
await sleep(1500);
//交互道具,直接选择位置点击
await click(111,184);
await sleep(1000);
await click(1250,817);
await sleep(1000);
await click(1603,1013);
await sleep(1500);
await genshin.returnMainUi();
//打开背包找签
await keyPress("B");
await sleep(1000);
await click(1150,50);
await sleep(700);
for(let i = 0; i <= 4; i++){
//{ min: 93, max: 1283 }, { min: 99, max: 823 }
let img = await findImgIcon("assets/RecognitionObject/YuShenQian.png", { min: 99, max: 1295 }, { min: 104, max: 967 })
if (img.length != 0) {
break;
}
await keyMouseScript.runFile(`assets/移动4行.json`);
};
await sleep(2000);
await click(1670,1025);
await sleep(2000);
let recognizedText = await performOcr("", { min: 720, max: 790 }, { min: 111, max: 155 }, "true");
if(recognizedText == "大凶" || recognizedText == "凶-"){
await genshin.returnMainUi();
await pathingScript.runFile("assets/挂签路线.json");
await performOcr("挂起来吧", { min: 900, max: 1700 }, { min: 380, max: 880 }, "false");
await sleep(700);
leftButtonClick();
log.info("事事顺利");
};
} else {
await genshin.chooseTalkOption("再见");
await sleep(700);
leftButtonClick();
await sleep(1500);
log.info("对话出现再见,默认解签完毕以及查看签操作!!!");
};
};
} else {
log.error(`识别图像时发生异常: ${error.message}`);
await genshin.returnMainUi();
}
} catch (error) {
log.error(`识别图像时发生异常: ${error.message}`);
}
await genshin.returnMainUi();
};
//枫丹梅洛彼得堡领取福利餐
if(settings.meal){
await genshin.returnMainUi();
await pathingScript.runFile("assets/枫丹梅洛彼得堡路线.json");
await sleep(1000);
try {
let ocrResults = await performOcr("布兰", xZone, yZone, "false");
if (ocrResults.length != 0) {
await sleep(1000);
let ocrResults1 = await performOcr("没什么", xZone, yZone, "false");
if(ocrResults1.length != 0){
await sleep(700);
log.info("对话出现没什么,默认领取和使用过!!!");
} else{
await genshin.chooseTalkOption("给我一份福利餐");
await sleep(1000);
leftButtonClick();
await sleep(1000);
leftButtonClick();
await sleep(1500);
//打开背包找签
log.info("打开背包");
await keyPress("B");
await sleep(1000);
await click(1250,50);
await sleep(1000);
for(let i = 0; i <= 2; i++){
let img = await findImgIcon("assets/RecognitionObject/WelffareMeal.png", { min: 99, max: 1295 }, { min: 104, max: 967 })
if (img.length != 0) {
break;
}
await keyMouseScript.runFile(`assets/移动4行.json`);
};
//这里是点击使用
await sleep(1000);
await click(1670,1025);
await sleep(2000);
//识别获得的食物名称
let recognizedText = await performOcr("", { min: 813, max: 985 }, { min: 585, max: 619 }, "true");
log.info(`获得:${recognizedText}`);
//点击幸运签,并识别内容
await sleep(1000);
await click(1000,520);
await sleep(2000);
let recognizedText1 = await performOcr("", { min: 716, max: 1200 }, { min: 631, max: 710 }, "true");
log.info(`幸运签内容:${recognizedText1}`);
};
} else {
log.error(`识别图像时发生异常: ${error.message}`);
await genshin.returnMainUi();
}
} catch (error) {
log.error(`识别图像时发生异常: ${error.message}`);
}
await genshin.returnMainUi();
};
//纳塔悠悠集市
if(settings.eggs){
await genshin.returnMainUi();
await pathingScript.runFile("assets/纳塔悠悠集市路线.json");
await sleep(1000);
try {
let ocrResults = await performOcr("察尔瓦", xZone, yZone, "false");
await sleep(700);
leftButtonClick();
await sleep(2000);
let ocrResults1 = await performOcr("让我挑一枚", xZone, yZone, "false");
if (ocrResults1 != 0) {
await sleep(5000);
let figure = 0;
//六龙蛋位置
let coordinates = [
[551, 153],
[1087, 161],
[881, 341],
[1342, 357],
[472, 572],
[572, 721]
];
switch (settings.pickupDragonEgg) {
case "闪闪礼蛋·山之血":
figure = 1;
break;
case "闪闪礼蛋·太阳的轰鸣":
figure = 2;
break;
case "闪闪礼蛋·圣龙君临":
figure = 3;
break;
case "闪闪礼蛋·菲耶蒂娜":
figure = 4;
break;
case "闪闪礼蛋·献给小酒杯":
figure = 5;
break;
case "闪闪礼蛋·飞澜鲨鲨":
figure = 6;
break;
default:
figure = Math.floor(Math.random() * 6) + 1;
log.info(`随机到第${figure}个蛋`);
break;
};
moveMouseTo(coordinates[figure - 1][0],coordinates[figure - 1][1]);
await sleep(100);
leftButtonClick();
await sleep(3000);
} else {
log.info("你今天已经领取过了");
};
} catch (error) {
log.error(`识别图像时发生异常: ${error.message}`);
}
await genshin.returnMainUi();
};
})();

View File

@@ -0,0 +1,14 @@
{
"manifest_version": 1,
"name": "提瓦特杂事(收集)",
"version": "1.0",
"description": "买圣水、抽签、上香、领福利餐、领闪闪礼蛋",
"authors": [
{
"name": "古又",
"links": "https://github.com/guyou45"
}
],
"settings_ui": "settings.json",
"main": "main.js"
}

View File

@@ -0,0 +1 @@
待加入,后续功能,暂不开放

View File

@@ -0,0 +1,48 @@
[
{
"name": "water",
"type": "checkbox",
"label": " 按自身情况选择相关内容 \n\n-----------------蒙德清泉镇圣水---------------"
},
{
"name": "sticks",
"type": "checkbox",
"label": "-----------------璃月铜雀庙上香---------------\n注意:请完成相关系列任务"
},
{
"name": "lots",
"type": "checkbox",
"label": "---------------稻妻鸣神大社抽签---------------\n注意:请完成相关系列任务"
},
{
"name": "meal",
"type": "checkbox",
"label": "-------------枫丹梅洛彼得堡福利餐-------------\n注意:开图啊,喂!!!"
},
{
"name": "eggs",
"type": "checkbox",
"label": "-------------纳塔悠悠集市闪闪龙蛋-------------\n注意:开图啊,喂!!!"
},
{
"name": "pickupDragonEgg",
"type": "select",
"label": "挑选你喜欢的龙蛋或随机",
"options": [
"闪闪礼蛋·山之血",
"闪闪礼蛋·太阳的轰鸣",
"闪闪礼蛋·圣龙君临",
"闪闪礼蛋·菲耶蒂娜",
"闪闪礼蛋·献给小酒杯",
"闪闪礼蛋·飞澜鲨鲨",
"随机龙蛋"
],
"default": "随机龙蛋"
},
{
"name": "accountName",
"type": "input-text",
"label": "账户名称\n用于多用户运行时区分不同账户\n单用户无需修改",
"default": "默认账户"
}
]