Skip to content

Commit

Permalink
Merge pull request #142 from runhey/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
runhey authored Dec 4, 2023
2 parents 1502cb6 + f8f6c9e commit 75bbb89
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 19 deletions.
1 change: 1 addition & 0 deletions module/gui/qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
<file>qml/Component/RuleFile2.qml</file>
<file>qml/Content/NotifyTest.qml</file>
<file>qml/Content/TaskList.qml</file>
<file>qml/Component/Notity.qml</file>
</qresource>
</RCC>
15 changes: 15 additions & 0 deletions module/gui/qml/Component/Notity.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Window
import QtQuick.Controls
import FluentUI

FluContentDialog{
title:"全新GUI"
message:"我们打算在2024.1.1全面切换新到GUI: OASX"
negativeText:"了解"
positiveText:"详情"
onPositiveClicked:{
Qt.openUrlExternally('https://github.com/runhey/OASX')
}
}
5 changes: 5 additions & 0 deletions module/gui/qml/MainWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ FluWindow {
// process_manager.create_all()
}
}
Notity{
id: notity
}

FluNavigationView{
id:nav_view
Expand All @@ -83,6 +86,8 @@ FluWindow {
footerItems.navigationView = nav_view
nav_view.setCurrentIndex(0)
items.addFluPaneItems()

notity.open()
}
}
Component.onCompleted:{
Expand Down
4 changes: 4 additions & 0 deletions tasks/Exploration/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ class ExplorationAssets:
I_BATTLE_REWARD = RuleImage(roi_front=(647,395,31,21), roi_back=(1,1,1278,718), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_battle_reward.png")
# 妖
I_EXPLORATION_TITLE = RuleImage(roi_front=(1133,124,47,43), roi_back=(1133,124,47,43), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_exploration_title.png")
# description
I_BATTLE_START = RuleImage(roi_front=(555,688,39,27.5), roi_back=(221,677,561,41), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_battle_start.png")
# description
I_GET_REWARD = RuleImage(roi_front=(464,231,339,44), roi_back=(464,231,339,44), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_get_reward.png")


# Ocr Rule Assets
Expand Down
18 changes: 18 additions & 0 deletions tasks/Exploration/res/image.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,23 @@
"method": "Template matching",
"threshold": 0.8,
"description": ""
},
{
"itemName": "battle_start",
"imageName": "res_battle_start.png",
"roiFront": "555,688,39,27.5",
"roiBack": "221,677,561,41",
"method": "Template matching",
"threshold": 0.8,
"description": "description"
},
{
"itemName": "get_reward",
"imageName": "res_get_reward.png",
"roiFront": "464,231,339,44",
"roiBack": "464,231,339,44",
"method": "Template matching",
"threshold": 0.8,
"description": "description"
}
]
Binary file added tasks/Exploration/res/res_battle_start.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tasks/Exploration/res/res_e_exploration_click.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tasks/Exploration/res/res_exploration_title.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tasks/Exploration/res/res_get_reward.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 14 additions & 16 deletions tasks/Exploration/script_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ def run(self):
if explorationConfig.exploration_config.attack_number == AttackNumber.SEVEN:
count = 0
while count < 7:
self.screenshot()
time.sleep(0.5)
if self.appear_then_click(self.I_E_EXPLORATION_CLICK):
if self.wait_until_appear(self.I_E_EXPLORATION_CLICK, wait_time=1):
self.click(self.I_E_EXPLORATION_CLICK)
count += 1
# 进入战斗环节
self.battle_process()
Expand All @@ -90,7 +89,7 @@ def open_expect_level(self):
# 判断当前章节有无目标章节
result = set(text1).intersection({explorationConfig.exploration_config.exploration_level})
# 有则跳出检测
if result and len(result) > 0:
if self.appear(self.I_E_EXPLORATION_CLICK) or result and len(result) > 0:
break
self.device.click_record_clear()
self.swipe(self.S_SWIPE_LEVEL_UP)
Expand All @@ -103,7 +102,7 @@ def open_expect_level(self):
self.screenshot()
self.O_E_EXPLORATION_LEVEL_NUMBER.keyword = explorationConfig.exploration_config.exploration_level
if self.ocr_appear_click(self.O_E_EXPLORATION_LEVEL_NUMBER):
self.wait_until_appear(self.I_E_EXPLORATION_CLICK)
self.wait_until_appear(self.I_E_EXPLORATION_CLICK, wait_time=3)
if self.appear(self.I_E_EXPLORATION_CLICK):
break

Expand Down Expand Up @@ -183,23 +182,22 @@ def do_battle(self):
while 1:
self.screenshot()
# 战后奖励
self.appear_then_click(self.I_BATTLE_REWARD)
if self.appear(self.I_BATTLE_REWARD) and not self.appear(self.I_GET_REWARD):
self.click(self.I_BATTLE_REWARD)
# boss 战
if self.appear_then_click(self.I_BOSS_BATTLE_BUTTON):
time.sleep(0.5)
self.screenshot()
if self.appear(self.I_BOSS_BATTLE_BUTTON):
if self.wait_until_appear(self.I_BATTLE_START, wait_time=5):
self.run_general_battle(self.config.exploration.general_battle_config)
else:
continue
self.run_general_battle(self.config.exploration.general_battle_config)
# 小怪 战
if self.appear_then_click(self.I_NORMAL_BATTLE_BUTTON):
time.sleep(0.5)
self.screenshot()
if self.appear(self.I_NORMAL_BATTLE_BUTTON):
if self.wait_until_appear(self.I_BATTLE_START, wait_time=5):
self.run_general_battle(self.config.exploration.general_battle_config)
else:
continue
self.run_general_battle(self.config.exploration.general_battle_config)
self.screenshot()
elif self.appear(self.I_E_AUTO_ROTATE_ON) and not self.appear(self.I_BATTLE_REWARD):
# 滑动
elif self.appear(self.I_E_AUTO_ROTATE_ON) or self.appear(self.I_GET_REWARD):
self.swipe(self.S_SWIPE_BACKGROUND_RIGHT)
# 结束流程
if self.appear(self.I_E_EXPLORATION_CLICK) or self.appear(self.I_EXPLORATION_TITLE):
Expand Down
2 changes: 1 addition & 1 deletion tasks/RichMan/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ class RichManAssets:
# 购买低级盘
I_SP_BUY_LOW = RuleImage(roi_front=(176,148,144,108), roi_back=(128,142,902,449), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/special/special_sp_buy_low.png")
# 判断是否滑动到底
I_SP_SWIPE_CHECK = RuleImage(roi_front=(866,445,103,96), roi_back=(829,424,164,143), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/special/special_sp_swipe_check.png")
I_SP_SWIPE_CHECK = RuleImage(roi_front=(866,439,170,102), roi_back=(759,374,341,193), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/special/special_sp_swipe_check.png")


# Ocr Rule Assets
Expand Down
4 changes: 2 additions & 2 deletions tasks/RichMan/mall/special/image.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
{
"itemName": "sp_swipe_check",
"imageName": "special_sp_swipe_check.png",
"roiFront": "866,445,103,96",
"roiBack": "829,424,164,143",
"roiFront": "866,439,170,102",
"roiBack": "759,374,341,193",
"method": "Template matching",
"threshold": 0.8,
"description": "判断是否滑动到底"
Expand Down
Binary file modified tasks/RichMan/mall/special/special_sp_swipe_check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 75bbb89

Please sign in to comment.