0
0
mirror of https://github.com/ok-oldking/ok-wuthering-waves.git synced 2025-04-24 08:25:16 +00:00

添加自动强化声骸功能

优化触发任务调度
This commit is contained in:
firedcto@gmail.com 2025-03-22 01:23:39 +08:00
parent 1f53d9d5fb
commit d44e3769bd
19 changed files with 405 additions and 143 deletions

BIN
assets/images/68.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
assets/images/69.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
assets/images/70.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
assets/images/71.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
assets/images/72.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -407,6 +407,36 @@
"height": 2160,
"id": 67,
"file_name": "images/67.png"
},
{
"width": 3840,
"height": 2160,
"id": 68,
"file_name": "images/68.png"
},
{
"width": 3840,
"height": 2160,
"id": 69,
"file_name": "images/69.png"
},
{
"width": 3840,
"height": 2160,
"id": 70,
"file_name": "images/70.png"
},
{
"width": 3840,
"height": 2160,
"id": 71,
"file_name": "images/71.png"
},
{
"width": 3840,
"height": 2160,
"id": 72,
"file_name": "images/72.png"
}
],
"categories": [
@ -752,274 +782,298 @@
},
{
"id": 85,
"name": "echo_locked"
"name": "echo_enhance_btn"
},
{
"id": 86,
"name": "echo_rarity_blue"
"name": "echo_enhance_confirm"
},
{
"id": 87,
"name": "echo_rarity_gold"
"name": "echo_enhance_success"
},
{
"id": 88,
"name": "echo_rarity_green"
"name": "echo_enhance_to"
},
{
"id": 89,
"name": "echo_rarity_purple"
"name": "echo_locked"
},
{
"id": 90,
"name": "echo_sort_asc"
"name": "echo_merge"
},
{
"id": 91,
"name": "echo_sort_desc"
"name": "echo_rarity_blue"
},
{
"id": 92,
"name": "echo_stats_aero_dmg"
"name": "echo_rarity_gold"
},
{
"id": 93,
"name": "echo_stats_atk"
"name": "echo_rarity_green"
},
{
"id": 94,
"name": "echo_stats_crit"
"name": "echo_rarity_purple"
},
{
"id": 95,
"name": "echo_stats_crit_dmg"
"name": "echo_sort_asc"
},
{
"id": 96,
"name": "echo_stats_def"
"name": "echo_sort_desc"
},
{
"id": 97,
"name": "echo_stats_electro_dmg"
"name": "echo_stats_aero_dmg"
},
{
"id": 98,
"name": "echo_stats_energy_regen"
"name": "echo_stats_atk"
},
{
"id": 99,
"name": "echo_stats_fusion_dmg"
"name": "echo_stats_crit"
},
{
"id": 100,
"name": "echo_stats_glacio_dmg"
"name": "echo_stats_crit_dmg"
},
{
"id": 101,
"name": "echo_stats_havoc_dmg"
"name": "echo_stats_def"
},
{
"id": 102,
"name": "echo_stats_healing"
"name": "echo_stats_electro_dmg"
},
{
"id": 103,
"name": "echo_stats_hp"
"name": "echo_stats_energy_regen"
},
{
"id": 104,
"name": "echo_stats_spectro_dmg"
"name": "echo_stats_fusion_dmg"
},
{
"id": 105,
"name": "echo_unlocked"
"name": "echo_stats_glacio_dmg"
},
{
"id": 106,
"name": "edge_levitator"
"name": "echo_stats_havoc_dmg"
},
{
"id": 107,
"name": "fast_travel_confirm"
"name": "echo_stats_healing"
},
{
"id": 108,
"name": "fast_travel_custom"
"name": "echo_stats_hp"
},
{
"id": 109,
"name": "gray_book_all_monsters"
"name": "echo_stats_spectro_dmg"
},
{
"id": 110,
"name": "gray_book_boss"
"name": "echo_unlocked"
},
{
"id": 111,
"name": "gray_book_boss_highlight"
"name": "edge_levitator"
},
{
"id": 112,
"name": "gray_button_challenge"
"name": "fast_travel_confirm"
},
{
"id": 113,
"name": "gray_combat_count_down"
"name": "fast_travel_custom"
},
{
"id": 114,
"name": "gray_confirm_exit_button"
"name": "gray_book_all_monsters"
},
{
"id": 115,
"name": "gray_crownless_battle"
"name": "gray_book_boss"
},
{
"id": 116,
"name": "gray_custom_way_point"
"name": "gray_book_boss_highlight"
},
{
"id": 117,
"name": "gray_start_battle"
"name": "gray_button_challenge"
},
{
"id": 118,
"name": "gray_teleport"
"name": "gray_combat_count_down"
},
{
"id": 119,
"name": "illusive_realm_exit"
"name": "gray_confirm_exit_button"
},
{
"id": 120,
"name": "illusive_realm_menu"
"name": "gray_crownless_battle"
},
{
"id": 121,
"name": "login_account"
"name": "gray_custom_way_point"
},
{
"id": 122,
"name": "monthly_card"
"name": "gray_start_battle"
},
{
"id": 123,
"name": "multiplayer_world_mark"
"name": "gray_teleport"
},
{
"id": 124,
"name": "pick_up_f_hcenter_vcenter"
"name": "illusive_realm_exit"
},
{
"id": 125,
"name": "purple_target_distance_icon"
"name": "illusive_realm_menu"
},
{
"id": 126,
"name": "remove_custom"
"name": "login_account"
},
{
"id": 127,
"name": "revive_confirm_hcenter_vcenter"
"name": "monthly_card"
},
{
"id": 128,
"name": "set_name_0"
"name": "multiplayer_world_mark"
},
{
"id": 129,
"name": "set_name_1"
"name": "pick_up_f_hcenter_vcenter"
},
{
"id": 130,
"name": "set_name_10"
"name": "purple_target_distance_icon"
},
{
"id": 131,
"name": "set_name_11"
"name": "red_dot"
},
{
"id": 132,
"name": "set_name_12"
"name": "remove_custom"
},
{
"id": 133,
"name": "set_name_13"
"name": "revive_confirm_hcenter_vcenter"
},
{
"id": 134,
"name": "set_name_14"
"name": "set_name_0"
},
{
"id": 135,
"name": "set_name_15"
"name": "set_name_1"
},
{
"id": 136,
"name": "set_name_16"
"name": "set_name_10"
},
{
"id": 137,
"name": "set_name_17"
"name": "set_name_11"
},
{
"id": 138,
"name": "set_name_18"
"name": "set_name_12"
},
{
"id": 139,
"name": "set_name_19"
"name": "set_name_13"
},
{
"id": 140,
"name": "set_name_2"
"name": "set_name_14"
},
{
"id": 141,
"name": "set_name_20"
"name": "set_name_15"
},
{
"id": 142,
"name": "set_name_3"
"name": "set_name_16"
},
{
"id": 143,
"name": "set_name_4"
"name": "set_name_17"
},
{
"id": 144,
"name": "set_name_5"
"name": "set_name_18"
},
{
"id": 145,
"name": "set_name_6"
"name": "set_name_19"
},
{
"id": 146,
"name": "set_name_7"
"name": "set_name_2"
},
{
"id": 147,
"name": "set_name_8"
"name": "set_name_20"
},
{
"id": 148,
"name": "set_name_9"
"name": "set_name_3"
},
{
"id": 149,
"name": "skip_quest_confirm"
"name": "set_name_4"
},
{
"id": 150,
"name": "target_enemy_white"
"name": "set_name_5"
},
{
"id": 151,
"name": "treasure_icon"
"name": "set_name_6"
},
{
"id": 152,
"name": "set_name_7"
},
{
"id": 153,
"name": "set_name_8"
},
{
"id": 154,
"name": "set_name_9"
},
{
"id": 155,
"name": "skip_quest_confirm"
},
{
"id": 156,
"name": "target_enemy_white"
},
{
"id": 157,
"name": "treasure_icon"
},
{
"id": 158,
"name": "ww"
}
],
@ -1027,7 +1081,7 @@
{
"id": 0,
"image_id": 0,
"category_id": 115,
"category_id": 120,
"segmentation": [],
"bbox": [
272.0,
@ -1222,7 +1276,7 @@
{
"id": 13,
"image_id": 5,
"category_id": 106,
"category_id": 111,
"segmentation": [],
"bbox": [
2937.0,
@ -1237,7 +1291,7 @@
{
"id": 14,
"image_id": 6,
"category_id": 117,
"category_id": 122,
"segmentation": [],
"bbox": [
3579.0,
@ -1402,7 +1456,7 @@
{
"id": 25,
"image_id": 8,
"category_id": 127,
"category_id": 133,
"segmentation": [],
"bbox": [
2887.0,
@ -1417,7 +1471,7 @@
{
"id": 26,
"image_id": 9,
"category_id": 112,
"category_id": 117,
"segmentation": [],
"bbox": [
2413.0000000000005,
@ -1432,7 +1486,7 @@
{
"id": 27,
"image_id": 10,
"category_id": 114,
"category_id": 119,
"segmentation": [],
"bbox": [
2805.0,
@ -1462,7 +1516,7 @@
{
"id": 29,
"image_id": 11,
"category_id": 118,
"category_id": 123,
"segmentation": [],
"bbox": [
2589.0,
@ -1657,7 +1711,7 @@
{
"id": 42,
"image_id": 16,
"category_id": 110,
"category_id": 115,
"segmentation": [],
"bbox": [
77.00000000000001,
@ -1672,7 +1726,7 @@
{
"id": 43,
"image_id": 16,
"category_id": 109,
"category_id": 114,
"segmentation": [],
"bbox": [
79.64601769911505,
@ -1762,7 +1816,7 @@
{
"id": 49,
"image_id": 21,
"category_id": 108,
"category_id": 113,
"segmentation": [],
"bbox": [
3219.9999999999973,
@ -1777,7 +1831,7 @@
{
"id": 50,
"image_id": 21,
"category_id": 126,
"category_id": 132,
"segmentation": [],
"bbox": [
3083.8938053097336,
@ -1852,7 +1906,7 @@
{
"id": 55,
"image_id": 24,
"category_id": 125,
"category_id": 130,
"segmentation": [],
"bbox": [
2090.0,
@ -1867,7 +1921,7 @@
{
"id": 56,
"image_id": 24,
"category_id": 119,
"category_id": 124,
"segmentation": [],
"bbox": [
29.0,
@ -1882,7 +1936,7 @@
{
"id": 57,
"image_id": 24,
"category_id": 120,
"category_id": 125,
"segmentation": [],
"bbox": [
217.0,
@ -1912,7 +1966,7 @@
{
"id": 59,
"image_id": 25,
"category_id": 111,
"category_id": 116,
"segmentation": [],
"bbox": [
36.0,
@ -1987,7 +2041,7 @@
{
"id": 64,
"image_id": 28,
"category_id": 122,
"category_id": 127,
"segmentation": [],
"bbox": [
1555.0000000000002,
@ -2002,7 +2056,7 @@
{
"id": 65,
"image_id": 29,
"category_id": 116,
"category_id": 121,
"segmentation": [],
"bbox": [
2512.9999999999995,
@ -2017,7 +2071,7 @@
{
"id": 66,
"image_id": 30,
"category_id": 124,
"category_id": 129,
"segmentation": [],
"bbox": [
2440.9999999999995,
@ -2062,7 +2116,7 @@
{
"id": 69,
"image_id": 32,
"category_id": 113,
"category_id": 118,
"segmentation": [],
"bbox": [
1747.0,
@ -2077,7 +2131,7 @@
{
"id": 70,
"image_id": 33,
"category_id": 150,
"category_id": 156,
"segmentation": [],
"bbox": [
1688.0,
@ -2107,7 +2161,7 @@
{
"id": 72,
"image_id": 34,
"category_id": 123,
"category_id": 128,
"segmentation": [],
"bbox": [
76.77271661865221,
@ -2122,7 +2176,7 @@
{
"id": 73,
"image_id": 35,
"category_id": 149,
"category_id": 155,
"segmentation": [],
"bbox": [
2296.991150442478,
@ -2272,7 +2326,7 @@
{
"id": 83,
"image_id": 39,
"category_id": 103,
"category_id": 108,
"segmentation": [],
"bbox": [
2354.336283185841,
@ -2287,7 +2341,7 @@
{
"id": 84,
"image_id": 39,
"category_id": 128,
"category_id": 134,
"segmentation": [],
"bbox": [
2010.731069247442,
@ -2302,7 +2356,7 @@
{
"id": 85,
"image_id": 39,
"category_id": 140,
"category_id": 146,
"segmentation": [],
"bbox": [
2010.138498421424,
@ -2317,7 +2371,7 @@
{
"id": 86,
"image_id": 39,
"category_id": 142,
"category_id": 148,
"segmentation": [],
"bbox": [
1475.0999455437145,
@ -2332,7 +2386,7 @@
{
"id": 87,
"image_id": 39,
"category_id": 147,
"category_id": 153,
"segmentation": [],
"bbox": [
1742.61922198257,
@ -2347,7 +2401,7 @@
{
"id": 88,
"image_id": 39,
"category_id": 146,
"category_id": 152,
"segmentation": [],
"bbox": [
1207.5806691048583,
@ -2362,7 +2416,7 @@
{
"id": 89,
"image_id": 39,
"category_id": 144,
"category_id": 150,
"segmentation": [],
"bbox": [
134.87430187125648,
@ -2377,7 +2431,7 @@
{
"id": 90,
"image_id": 39,
"category_id": 143,
"category_id": 149,
"segmentation": [],
"bbox": [
402.8245815888193,
@ -2392,7 +2446,7 @@
{
"id": 91,
"image_id": 39,
"category_id": 129,
"category_id": 135,
"segmentation": [],
"bbox": [
2010.2654867256613,
@ -2407,7 +2461,7 @@
{
"id": 92,
"image_id": 40,
"category_id": 93,
"category_id": 98,
"segmentation": [],
"bbox": [
2354.336283185841,
@ -2422,7 +2476,7 @@
{
"id": 93,
"image_id": 41,
"category_id": 96,
"category_id": 101,
"segmentation": [],
"bbox": [
2354.336283185841,
@ -2437,7 +2491,7 @@
{
"id": 94,
"image_id": 42,
"category_id": 101,
"category_id": 106,
"segmentation": [],
"bbox": [
2354.336283185841,
@ -2452,7 +2506,7 @@
{
"id": 95,
"image_id": 43,
"category_id": 99,
"category_id": 104,
"segmentation": [],
"bbox": [
2354.336283185841,
@ -2467,7 +2521,7 @@
{
"id": 96,
"image_id": 44,
"category_id": 92,
"category_id": 97,
"segmentation": [],
"bbox": [
2354.336283185841,
@ -2482,7 +2536,7 @@
{
"id": 97,
"image_id": 45,
"category_id": 97,
"category_id": 102,
"segmentation": [],
"bbox": [
2354.336283185841,
@ -2497,7 +2551,7 @@
{
"id": 98,
"image_id": 46,
"category_id": 98,
"category_id": 103,
"segmentation": [],
"bbox": [
2354.336283185841,
@ -2512,7 +2566,7 @@
{
"id": 99,
"image_id": 47,
"category_id": 100,
"category_id": 105,
"segmentation": [],
"bbox": [
2354.336283185841,
@ -2527,7 +2581,7 @@
{
"id": 100,
"image_id": 48,
"category_id": 95,
"category_id": 100,
"segmentation": [],
"bbox": [
2354.336283185841,
@ -2542,7 +2596,7 @@
{
"id": 101,
"image_id": 49,
"category_id": 94,
"category_id": 99,
"segmentation": [],
"bbox": [
2354.336283185841,
@ -2557,7 +2611,7 @@
{
"id": 102,
"image_id": 50,
"category_id": 102,
"category_id": 107,
"segmentation": [],
"bbox": [
2351.1504424778764,
@ -2572,7 +2626,7 @@
{
"id": 103,
"image_id": 50,
"category_id": 145,
"category_id": 151,
"segmentation": [],
"bbox": [
1742.61922198257,
@ -2587,7 +2641,7 @@
{
"id": 104,
"image_id": 51,
"category_id": 104,
"category_id": 109,
"segmentation": [],
"bbox": [
2354.336283185841,
@ -2632,7 +2686,7 @@
{
"id": 107,
"image_id": 54,
"category_id": 121,
"category_id": 126,
"segmentation": [],
"bbox": [
3567.136929460579,
@ -2767,7 +2821,7 @@
{
"id": 116,
"image_id": 61,
"category_id": 148,
"category_id": 154,
"segmentation": [],
"bbox": [
933.8808903432171,
@ -2782,7 +2836,7 @@
{
"id": 117,
"image_id": 61,
"category_id": 130,
"category_id": 136,
"segmentation": [],
"bbox": [
398.2300884955743,
@ -2797,7 +2851,7 @@
{
"id": 118,
"image_id": 61,
"category_id": 131,
"category_id": 137,
"segmentation": [],
"bbox": [
665.840707964601,
@ -2812,7 +2866,7 @@
{
"id": 119,
"image_id": 61,
"category_id": 132,
"category_id": 138,
"segmentation": [],
"bbox": [
1201.0619469026528,
@ -2827,7 +2881,7 @@
{
"id": 120,
"image_id": 62,
"category_id": 133,
"category_id": 139,
"segmentation": [],
"bbox": [
1466.8757841136517,
@ -2902,7 +2956,7 @@
{
"id": 125,
"image_id": 65,
"category_id": 151,
"category_id": 157,
"segmentation": [],
"bbox": [
2926.7772973706797,
@ -2943,6 +2997,96 @@
"ignore": 0,
"iscrowd": 0,
"area": 5835.005530866154
},
{
"id": 128,
"image_id": 68,
"category_id": 88,
"segmentation": [],
"bbox": [
450.3964757709253,
358.4140969162997,
53.920704845814996,
60.26431718061673
],
"ignore": 0,
"iscrowd": 0,
"area": 3249.4944594306126
},
{
"id": 129,
"image_id": 69,
"category_id": 85,
"segmentation": [],
"bbox": [
380.6167400881057,
1941.1453744493397,
206.16740088105732,
104.66960352422902
],
"ignore": 0,
"iscrowd": 0,
"area": 21579.460109841053
},
{
"id": 130,
"image_id": 69,
"category_id": 131,
"segmentation": [],
"bbox": [
220.59609475776048,
576.8490206993973,
31.127128248834328,
32.41756461994754
],
"ignore": 0,
"iscrowd": 0,
"area": 1009.0656914399814
},
{
"id": 131,
"image_id": 70,
"category_id": 87,
"segmentation": [],
"bbox": [
2274.1850220264337,
548.7224669603504,
564.5814977973574,
79.29515418502218
],
"ignore": 0,
"iscrowd": 0,
"area": 44768.57691785222
},
{
"id": 132,
"image_id": 71,
"category_id": 86,
"segmentation": [],
"bbox": [
2321.762114537443,
1420.9691629955933,
152.24669603524578,
247.40088105726826
],
"ignore": 0,
"iscrowd": 0,
"area": 37665.966737177914
},
{
"id": 133,
"image_id": 72,
"category_id": 90,
"segmentation": [],
"bbox": [
149.07488986784142,
1966.5198237885454,
60.2643171806167,
63.43612334801759
],
"ignore": 0,
"iscrowd": 0,
"area": 3822.9346581536565
}
],
"info": {
@ -2951,6 +3095,6 @@
"description": "",
"contributor": "Label Studio",
"url": "",
"date_created": "2025-03-18 17:35:02.638321"
"date_created": "2025-03-22 01:15:49.383036"
}
}

View File

@ -176,8 +176,8 @@ config = {
], 'trigger_tasks': [
["src.task.AutoCombatTask", "AutoCombatTask"],
["src.task.AutoPickTask", "AutoPickTask"],
["src.task.AutoEnhanceEchoTask", "AutoEnhanceEchoTask"],
["src.task.SkipDialogTask", "AutoDialogTask"],
["src.task.MouseResetTask", "MouseResetTask"],
["src.task.AutoLoginTask", "AutoLoginTask"],
]
], 'scene': ["src.scene.WWScene", "WWScene"],
}

View File

@ -3,9 +3,6 @@ ok
config.py
main.py
ok-ww.exe
main.py
main_debug.py
main_gpu.py
readme
README.md
README_cn.md

View File

@ -650,3 +650,21 @@ msgstr ""
msgid "the Nth number in the Tacet Suppression list (F2)"
msgstr ""
msgid "Auto Enhance Echo"
msgstr ""
msgid "Auto Enhance Enhance Echo after you add EXP Material"
msgstr ""
msgid "Login, claim monthly card, farm echo, and claim daily reward"
msgstr ""
msgid "found do_handle_pop_up: Box(name='echo_enhance_btn', x=382, y=1939, width=206, height=105, confidence=98)"
msgstr ""
msgid "found do_handle_pop_up: Box(name='red_dot', x=221, y=577, width=31, height=32, confidence=100)"
msgstr ""
msgid "found red dot feature: Box(name='red_dot', x=221, y=577, width=31, height=32, confidence=100)"
msgstr ""

Binary file not shown.

View File

@ -484,4 +484,11 @@ msgid "Please start in game world and in team!"
msgstr "请在大世界并在队伍中开始!"
msgid "Can't complete daily task, may need to increase stamina manually!"
msgstr "无法完成日常任务, 可能需要手动吃体力药!"
msgstr "无法完成日常任务, 可能需要手动吃体力药!"
msgid "Auto Enhance Echo"
msgstr "自动强化声骸"
msgid "Auto Enhance and Tune Echo after you add EXP Material"
msgstr "在添加经验素材后自动强化声骸和调谐"

View File

@ -37,7 +37,7 @@ numpy==1.26.4
# openvino
# rapidocr-openvino
# shapely
ok-script==0.0.484
ok-script==0.0.489
# via -r .\requirements.in
opencv-contrib-python==4.10.0.84
# via -r .\requirements.in

28
src/scene/WWScene.py Normal file
View File

@ -0,0 +1,28 @@
from qfluentwidgets import FluentIcon
from ok import Logger, BaseScene
from src.task.BaseWWTask import BaseWWTask
logger = Logger.get_logger(__name__)
class WWScene(BaseScene):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._in_team = None
self._echo_enhance_btn = None
def reset(self):
self._in_team = None
self._echo_enhance_btn = None
def in_team(self, fun):
if self._in_team is None:
self._in_team = fun()
return self._in_team
def echo_enhance_btn(self, fun):
if self._echo_enhance_btn is None:
self._echo_enhance_btn = fun()
return self._echo_enhance_btn

View File

@ -1,6 +1,7 @@
from qfluentwidgets import FluentIcon
from ok import TriggerTask, Logger
from src.scene.WWScene import WWScene
from src.task.BaseCombatTask import BaseCombatTask, NotInCombatException, CharDeadException
logger = Logger.get_logger(__name__)
@ -16,6 +17,7 @@ class AutoCombatTask(BaseCombatTask, TriggerTask):
self.description = "Enable auto combat in Abyss, Game World etc"
self.icon = FluentIcon.CALORIES
self.last_is_click = False
self.scene: WWScene | None = None
self.default_config.update({
'Auto Target': True,
})
@ -24,7 +26,11 @@ class AutoCombatTask(BaseCombatTask, TriggerTask):
}
def run(self):
ret = False
if not self.scene.in_team(self.in_team_and_world):
return ret
while self.in_combat():
ret = True
try:
self.get_current_char().perform()
except CharDeadException:
@ -35,9 +41,6 @@ class AutoCombatTask(BaseCombatTask, TriggerTask):
if self.debug:
self.screenshot(f'auto_combat_task_out_of_combat {e}')
break
self.combat_end()
def trigger(self):
if self.in_combat():
self.load_chars()
return True
if ret:
self.combat_end()
return ret

View File

@ -0,0 +1,57 @@
from qfluentwidgets import FluentIcon
from skimage.filters.rank import threshold
from ok import FindFeature, Logger
from ok import TriggerTask
from src.scene.WWScene import WWScene
from src.task.BaseWWTask import BaseWWTask
logger = Logger.get_logger(__name__)
class AutoEnhanceEchoTask(TriggerTask, BaseWWTask, FindFeature):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.name = "Auto Enhance Echo"
self.description = "Auto Enhance and Tune Echo after you add EXP Material"
self.icon = FluentIcon.SHOPPING_CART
self.scene: WWScene | None = None
self.default_config.update({
'_enabled': False,
})
def find_echo_enhance(self):
return self.find_one('echo_enhance_btn')
def run(self):
if self.scene.in_team(self.in_team_and_world):
return
if enhance_button := self.scene.echo_enhance_btn(self.find_echo_enhance):
wait = False
while self.find_one('echo_enhance_to', horizontal_variance=0.01):
self.click(enhance_button, after_sleep=0.5)
wait = True
if wait:
self.wait_until(lambda: self.do_handle_pop_up(1), time_out=6)
if feature := self.wait_feature('red_dot', time_out=3) if wait else self.find_one('red_dot'):
self.log_info(f'found red dot feature: {feature}')
self.click(0.04, 0.29, after_sleep=0.5)
if enhance_button := self.find_echo_enhance():
self.click(enhance_button, after_sleep=1)
self.wait_until(lambda: self.do_handle_pop_up(2), time_out=6)
return True
def do_handle_pop_up(self, step):
if btn := self.find_one('echo_enhance_confirm'):
self.click(btn, after_sleep=1)
elif feature := self.find_one(['echo_enhance_btn', 'red_dot']):
self.log_info(f'found do_handle_pop_up: {feature}')
if self.debug:
self.screenshot('echo_enhance_confirm')
return True
elif step == 1:
self.click(0.51, 0.87, after_sleep=0.5)
else:
self.click(0.04, 0.16, after_sleep=0.5)

View File

@ -1,6 +1,7 @@
from qfluentwidgets import FluentIcon
from ok import TriggerTask, Logger
from src.scene.WWScene import WWScene
from src.task.BaseWWTask import BaseWWTask
logger = Logger.get_logger(__name__)
@ -15,11 +16,12 @@ class AutoLoginTask(BaseWWTask, TriggerTask):
self.name = "Auto Login"
self.description = "Auto Login After Game Starts"
self.icon = FluentIcon.ACCEPT
self.scene: WWScene | None = None
def trigger(self):
def run(self):
if self._logged_in:
pass
elif self.in_team_and_world():
elif self.scene.in_team(self.in_team_and_world):
self._logged_in = True
else:
self.wait_login()
return self.wait_login()

View File

@ -2,6 +2,7 @@ from qfluentwidgets import FluentIcon
from ok import FindFeature, Logger
from ok import TriggerTask
from src.scene.WWScene import WWScene
from src.task.BaseWWTask import BaseWWTask
logger = Logger.get_logger(__name__)
@ -14,13 +15,14 @@ class AutoPickTask(TriggerTask, BaseWWTask, FindFeature):
self.name = "Auto Pick"
self.description = "Auto Pick Flowers in Game World"
self.icon = FluentIcon.SHOPPING_CART
self.scene: WWScene | None = None
self.default_config.update({
'_enabled': True,
'Pick Up White List': ['吸收', 'Absorb'],
'Pick Up Black List': ['开始合成']
})
def run(self):
def send_fs(self):
self.send_key('f')
self.sleep(0.2)
self.send_key('f')
@ -28,12 +30,15 @@ class AutoPickTask(TriggerTask, BaseWWTask, FindFeature):
self.send_key('f')
self.sleep(0.2)
def trigger(self):
def run(self):
if not self.scene.in_team(self.in_team_and_world):
return
if f := self.find_one('pick_up_f_hcenter_vcenter', box=self.f_search_box,
threshold=0.8):
if self.in_realm():
logger.info(f'found f in realm click f')
self.send_key('f', after_sleep=1)
self.send_fs()
return True
dialog_search = f.copy(x_offset=f.width * 3, width_offset=f.width * 2, height_offset=f.height * 2,
y_offset=-f.height,
@ -51,6 +56,7 @@ class AutoPickTask(TriggerTask, BaseWWTask, FindFeature):
target_height=540)
if texts:
logger.info(f'found Pick Up White List {texts}')
self.send_fs()
return True
else:
if self.config.get('Pick Up Black List'):
@ -59,4 +65,5 @@ class AutoPickTask(TriggerTask, BaseWWTask, FindFeature):
if texts:
logger.info(f'found Pick Up Black List: {texts}')
return False
self.send_fs()
return True

View File

@ -46,7 +46,7 @@ class SkipBaseTask(BaseWWTask, FindFeature, OCR):
btn_dialog_close = self.find_one('btn_dialog_close', use_gray_scale=True, threshold=0.8)
if btn_dialog_close:
self.click(btn_dialog_close, move_back=True)
return
return True
btn_dialog_eye = self.find_one('btn_dialog_eye', use_gray_scale=True, threshold=0.8)
if btn_dialog_eye:
self.has_eye_time = time.time()
@ -66,7 +66,7 @@ class SkipBaseTask(BaseWWTask, FindFeature, OCR):
self.click(dots[-1])
logger.info('choose dot')
self.sleep(0.2)
return
return True
dialog_white_color = {

View File

@ -14,7 +14,6 @@ class AutoDialogTask(TriggerTask, SkipBaseTask):
self.name = "Skip Dialog during Quests"
def run(self):
pass
def trigger(self):
self.check_skip()
if self.scene.in_team(self.in_team_and_world):
return
return self.check_skip()