├── .github
└── ISSUE_TEMPLATE
│ ├── bug-report-en.yaml
│ ├── bug-report.yaml
│ ├── new-feature-en.yaml
│ └── new-feature.yaml
├── .gitignore
├── .gitmodules
├── LICENSE
├── README.md
├── README_TC.md
├── config.json
├── config.py
├── doc
├── help.ico
├── help.png
├── money.jpg
└── readme
│ ├── CN
│ ├── gui展示.md
│ ├── 使用方法.md
│ ├── 常见问题.md
│ └── 未来目标.md
│ ├── TC
│ ├── gui展示.md
│ ├── 使用方法.md
│ └── 常见问题.md
│ └── gui
│ ├── avatar.png
│ ├── scripts.png
│ └── setting.png
├── game.py
├── gui
├── icon
│ ├── #04fabc.txt
│ ├── NanJun.png
│ ├── log_d.png
│ ├── log_s.png
│ ├── run_d.png
│ ├── run_s.png
│ ├── script_d.png
│ └── script_s.png
├── main_window.py
└── widgets
│ ├── __init__.py
│ ├── avatar
│ ├── avatar_group.py
│ ├── avatar_interface.py
│ ├── img
│ │ ├── CHNZYX.png
│ │ ├── NanJun.png
│ │ └── zhiyiYo.png
│ └── ui
│ │ ├── avatar_widget.py
│ │ ├── avatar_widget.ui
│ │ ├── one_avatar.py
│ │ └── one_avatar.ui
│ ├── dialog
│ └── warning.py
│ ├── log
│ └── log_interface.py
│ ├── run
│ ├── run_interface.py
│ └── ui
│ │ ├── run_widget.py
│ │ └── run_widget.ui
│ ├── script
│ ├── img
│ │ ├── calyx_gold
│ │ │ ├── 1.png
│ │ │ ├── 2.png
│ │ │ └── 3.png
│ │ ├── calyx_red
│ │ │ ├── 1.png
│ │ │ ├── 2.png
│ │ │ ├── 3.png
│ │ │ ├── 4.png
│ │ │ ├── 5.png
│ │ │ ├── 6.png
│ │ │ └── 7.png
│ │ ├── cavern
│ │ │ ├── 1.png
│ │ │ ├── 2.png
│ │ │ ├── 3.png
│ │ │ ├── 4.png
│ │ │ ├── 5.png
│ │ │ ├── 6.png
│ │ │ └── 7.png
│ │ ├── echo
│ │ │ ├── 1.png
│ │ │ ├── 2.png
│ │ │ └── 3.png
│ │ └── shadow
│ │ │ ├── 1.png
│ │ │ ├── 10.png
│ │ │ ├── 11.png
│ │ │ ├── 12.png
│ │ │ ├── 2.png
│ │ │ ├── 3.png
│ │ │ ├── 4.png
│ │ │ ├── 5.png
│ │ │ ├── 6.png
│ │ │ ├── 7.png
│ │ │ ├── 8.png
│ │ │ └── 9.png
│ ├── info_card.py
│ ├── script_interface.py
│ ├── stamina_window.py
│ ├── ui
│ │ ├── info_card_widget.py
│ │ ├── info_card_widget.ui
│ │ ├── script_widget.py
│ │ ├── script_widget.ui
│ │ ├── stamina.py
│ │ ├── stamina.ui
│ │ ├── universe.py
│ │ └── universe.ui
│ └── universe_window.py
│ ├── setting
│ ├── setting_interface.py
│ └── ui
│ │ ├── settingWidget.py
│ │ └── settingWidget.ui
│ └── sponsorship
│ ├── money.jpg
│ └── zyx.py
├── images
├── QR
│ ├── alipayQR.png
│ └── wechatQR.png
├── addChallenge.png
├── areaNavigation.png
├── autoFight.png
├── autoFight2.png
├── autoFight3.png
├── autoFight4.png
├── ballNavigation.png
├── book.png
├── book2.png
├── calyx_gold
│ ├── 1.png
│ ├── 2.png
│ └── 3.png
├── calyx_red
│ ├── 1.png
│ ├── 2.png
│ ├── 3.png
│ ├── 4.png
│ ├── 5.png
│ ├── 6.png
│ └── 7.png
├── cancel.png
├── cavern
│ ├── 1.png
│ ├── 2.png
│ ├── 3.png
│ ├── 4.png
│ ├── 5.png
│ ├── 6.png
│ └── 7.png
├── challenge.png
├── challengeCompleted.png
├── character
│ ├── arrow.png
│ ├── arrowDown.png
│ ├── arrowLeft.png
│ ├── arrowRight.png
│ └── localArrow.png
├── commission
│ ├── commission.png
│ ├── getCommission.png
│ ├── isCommission.png
│ ├── pending.png
│ ├── pendingCommission.png
│ └── recommission.png
├── confirm.png
├── dailyTask.png
├── dailyTaskSelected.png
├── echo
│ ├── 1.png
│ ├── 2.png
│ └── 3.png
├── enterGame.png
├── exitCopies.png
├── fightIsOver.png
├── fuel.png
├── index.png
├── indexSelected.png
├── mandate.png
├── noStamina.png
├── phone.png
├── selectedConfirm.png
├── selectedFuel.png
├── selectedStellarJade.png
├── shadow
│ ├── 1.png
│ ├── 10.png
│ ├── 11.png
│ ├── 12.png
│ ├── 2.png
│ ├── 3.png
│ ├── 4.png
│ ├── 5.png
│ ├── 6.png
│ ├── 7.png
│ ├── 8.png
│ └── 9.png
├── startChallenge.png
├── startGame.png
├── stellarJade.png
├── transmission.png
└── world
│ ├── questionMask.png
│ ├── selectJar.png
│ ├── selectMonster.png
│ ├── send1.png
│ ├── send2.png
│ ├── send3.png
│ ├── send4.png
│ ├── send5.png
│ ├── sendText.png
│ └── warning.png
├── log.py
├── logs
└── log.txt
├── main.py
├── requirements.txt
├── script
├── abyss
│ └── main.py
├── commission
│ ├── data.py
│ └── main.py
├── daily_task
│ ├── data.py
│ └── main.py
├── interface.py
├── stamina
│ ├── data.py
│ └── main.py
├── universe
│ └── main.py
├── utils
│ ├── __init__.py
│ ├── calculate.py
│ ├── cv_utils.py
│ ├── dialog.py
│ ├── fight.py
│ ├── interface.py
│ ├── mouse.py
│ ├── ocr.py
│ ├── role.py
│ ├── template_path.py
│ └── window.py
└── world
│ ├── data.py
│ ├── debug
│ ├── debug.py
│ └── map_test
│ │ └── 1
│ │ └── 2
│ │ └── 1
│ │ ├── binary.png
│ │ ├── default.png
│ │ ├── line.png
│ │ ├── point.png
│ │ └── target.png
│ ├── draw.py
│ ├── main.py
│ └── map
│ ├── 1
│ ├── 1
│ │ └── 1
│ │ │ ├── binary.png
│ │ │ ├── default.png
│ │ │ ├── line.png
│ │ │ ├── point.png
│ │ │ └── target.png
│ ├── 2
│ │ └── 1
│ │ │ ├── binary.png
│ │ │ ├── default.png
│ │ │ ├── line.png
│ │ │ ├── point.png
│ │ │ └── target.png
│ └── 3
│ │ ├── 1
│ │ ├── binary.png
│ │ ├── default.png
│ │ ├── line.png
│ │ ├── point.png
│ │ └── target.png
│ │ └── 2
│ │ ├── binary.png
│ │ ├── default.png
│ │ ├── line.png
│ │ ├── point.png
│ │ ├── select.png
│ │ └── target.png
│ └── 2
│ ├── 1
│ └── 1
│ │ ├── binary.png
│ │ ├── default.png
│ │ ├── line.png
│ │ ├── point.png
│ │ └── target.png
│ ├── 2
│ ├── 1
│ │ ├── binary.png
│ │ ├── default.png
│ │ ├── line.png
│ │ ├── point.png
│ │ └── target.png
│ └── 2
│ │ ├── binary.png
│ │ ├── default.png
│ │ ├── line.png
│ │ ├── point.png
│ │ └── target.png
│ ├── 3
│ └── 1
│ │ ├── binary.png
│ │ ├── default.png
│ │ ├── line.png
│ │ ├── point.png
│ │ └── target.png
│ ├── 4
│ ├── 1
│ │ ├── binary.png
│ │ ├── default.png
│ │ ├── line.png
│ │ ├── point.png
│ │ ├── select.png
│ │ └── target.png
│ └── 2
│ │ ├── binary.png
│ │ ├── default.png
│ │ ├── line.png
│ │ ├── point.png
│ │ └── target.png
│ ├── 5
│ ├── 1
│ │ ├── binary.png
│ │ ├── default.png
│ │ ├── line.png
│ │ ├── point.png
│ │ └── target.png
│ ├── 2
│ │ ├── binary.png
│ │ ├── default.png
│ │ ├── line.png
│ │ ├── point.png
│ │ └── target.png
│ └── 3
│ │ ├── binary.png
│ │ ├── default.png
│ │ ├── line.png
│ │ ├── point.png
│ │ └── target.png
│ ├── 6
│ ├── 1
│ │ ├── binary.png
│ │ ├── default.png
│ │ ├── line.png
│ │ ├── point.png
│ │ └── target.png
│ └── 2
│ │ ├── binary.png
│ │ ├── default.png
│ │ ├── line.png
│ │ ├── point.png
│ │ └── target.png
│ └── 7
│ └── 1
│ ├── binary.png
│ ├── default.png
│ ├── line.png
│ ├── point.png
│ └── target.png
└── threadpool.py
/.github/ISSUE_TEMPLATE/bug-report-en.yaml:
--------------------------------------------------------------------------------
1 | name: Report bugs
2 | description: Report Auto Simulated Universe's bug
3 | title: '[Bug]: '
4 | labels: [ "bug" ]
5 |
6 | body:
7 | - type: markdown
8 | attributes:
9 | value: |
10 | ## Thank you for your willingness to fill out an error return!
11 | ## Below are some notes, please be sure to read them to make it easier for us to deal with them!
12 |
13 | ### ❗ | Make sure that no ISSUE with the same problem has been raised.
14 | ### 🌎 | Please fill in the environmental information accurately.
15 | ### 🌎 | If you don't know how to phrase a question effectively and accurately, we recommend that you read The Wisdom of Asking Questions first!
16 |
17 | ---
18 | - type: checkboxes
19 | id: terms
20 | attributes:
21 | label: Please make sure you have read the notes above and check the confirmation box below.
22 | options:
23 | - label: "I've tested this using an environment that is clean and free of other non-essential plugins and the problem persists."
24 | required: true
25 | - label: "I have looked in [Issue Tracker](https://github.com/CHNZYX/Auto_Simulated_Universe/issues) for the issue I want to raise and did not find an ISSUE for the same issue."
26 | required: true
27 | - label: I am aware and agree that if this Issue is about something other than the program itself, my Issue may be automatically closed or/and locked unconditionally.
28 | required: true
29 | - label: I am aware and agree that if I do not follow the instructions provided in the template, my Issue may be deleted unconditionally.
30 | required: true
31 |
32 | - type: markdown
33 | attributes:
34 | value: |
35 | ## Environmental information
36 |
37 | - type: input
38 | id: env-Auto-Simulated-Universe-ver
39 | attributes:
40 | label: Auto Simulated Universe version (or Commit Id)
41 | validations:
42 | required: true
43 |
44 | - type: textarea
45 | id: reproduce-steps
46 | attributes:
47 | label: Steps to Reproduce
48 | description: |
49 | What do we need to do to make the bug appear?
50 | Simple and clear reproduction steps can help us pinpoint the problem more quickly.
51 | validations:
52 | required: true
53 |
54 | - type: textarea
55 | id: expected
56 | attributes:
57 | label: What is the desired outcome?
58 | validations:
59 | required: true
60 |
61 | - type: textarea
62 | id: actual
63 | attributes:
64 | label: What are the actual results?
65 | validations:
66 | required: true
67 |
68 | - type: textarea
69 | id: logging
70 | attributes:
71 | label: logs
72 |
73 | - type: textarea
74 | id: extra-desc
75 | attributes:
76 | label: Supplementary note (optional)
77 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug-report.yaml:
--------------------------------------------------------------------------------
1 | name: 回报错误
2 | description: 在使用 Auto Simulated Universe 过程中遇到了错误
3 | title: '[Bug]: '
4 | labels: [ "bug" ]
5 |
6 | body:
7 | - type: markdown
8 | attributes:
9 | value: |
10 | ## 感谢您愿意填写错误回报!
11 | ## 以下是一些注意事项,请务必阅读让我们能够更容易处理
12 |
13 | ### ❗ | 确定没有相同问题的ISSUE已被提出。
14 | ### 🌎| 请准确填写环境信息。
15 | ### 如果您不知道如何有效、精准地表述,我们建议您先阅读《提问的智慧》
16 |
17 | ---
18 | - type: checkboxes
19 | id: terms
20 | attributes:
21 | label: 请确保您已阅读以上注意事项,并勾选下方的确认框。
22 | options:
23 | - label: "我已经使用一个干净且无其它非必要的插件的环境测试过,问题依旧存在。"
24 | required: true
25 | - label: "我已经在 [Issue Tracker](https://github.com/CHNZYX/Auto_Simulated_Universe/issues) 中找过我要提出的问题,没有找到相同问题的ISSUE。"
26 | required: true
27 | - label: 我已知晓并同意,若这个 Issue 是关于其他非程序本身问题,则我的 Issue 可能会被无条件自动关闭或/并锁定。
28 | required: true
29 | - label: 我已知晓并同意,如果我不按照模板提供的指示进行填写,则我的 Issue 可能会被无条件删除。
30 | required: true
31 |
32 | - type: markdown
33 | attributes:
34 | value: |
35 | ## 环境信息
36 |
37 | - type: input
38 | id: env-Auto-Simulated-Universe-ver
39 | attributes:
40 | label: Auto Simulated Universe 版本 (或 Commit Id)
41 | validations:
42 | required: true
43 |
44 | - type: textarea
45 | id: reproduce-steps
46 | attributes:
47 | label: 重现步骤
48 | description: |
49 | 我们需要执行哪些操作才能让 Bug 出现?
50 | 简洁清晰的重现步骤能够帮助我们更迅速地定位问题所在。
51 | validations:
52 | required: true
53 |
54 | - type: textarea
55 | id: expected
56 | attributes:
57 | label: 期望的结果是什么?
58 | validations:
59 | required: true
60 |
61 | - type: textarea
62 | id: actual
63 | attributes:
64 | label: 实际的结果是什么?
65 | validations:
66 | required: true
67 |
68 | - type: textarea
69 | id: logging
70 | attributes:
71 | label: 日志记录
72 |
73 | - type: textarea
74 | id: extra-desc
75 | attributes:
76 | label: 补充说明(可选)
77 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/new-feature-en.yaml:
--------------------------------------------------------------------------------
1 | name: New feature
2 | description: Proposing new features
3 | title: '[Feat]: '
4 | labels: [ "enhancement" ]
5 |
6 | body:
7 | - type: markdown
8 | attributes:
9 | value: |
10 | ## Thank you for your willingness to suggest Auto Simulated Universe!
11 | ## Below are some notes, please be sure to read them to make it easier for us to deal with them!
12 |
13 | ### ❗ | Make sure no Feature with the same problem has been proposed or implemented.
14 | ### 📝 | Make sure that there is no existing PR and code that has an implementation/similarity of the Feature.
15 | ### 📝 | If you don't know how to phrase this effectively and precisely, we suggest you first read The Wisdom of Asking Questions
16 |
17 | ---
18 | - type: checkboxes
19 | id: terms
20 | attributes:
21 | label: Please make sure you have read the notes above and check the confirmation box below.
22 | options:
23 | - label: "I'm sure this is a feature that has never been proposed or implemented."
24 | required: true
25 | - label: "I have looked in [Issue Tracker](https://github.com/CHNZYX/Auto_Simulated_Universe/issues) and [Pull Request](https://github.com/CHNZYX/Auto_Simulated_Universe/pulls) for the feature I'm proposing, and did not find an ISSUE or PR for the same feature."
26 | required: true
27 | - label: I am aware and agree that this is for suggesting new features only. If this Issue is about another off-topic issue, my Issue may be automatically closed or/and locked unconditionally.
28 | required: true
29 | - label: I am aware and agree that if I do not follow the instructions provided in the template, my Issue may be deleted unconditionally.
30 | required: true
31 |
32 | - type: textarea
33 | id: feature-to-add
34 | attributes:
35 | label: Functional content to be added
36 | description: |
37 | Please be specific about the functionality you would like to add, including the simulations implemented (if any)
38 | Is there a similar feature already implemented? If so please affirmatively suggest what is different from the feature/what part of the feature you would like to improve/add.
39 | validations:
40 | required: true
41 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/new-feature.yaml:
--------------------------------------------------------------------------------
1 | name: 新功能提议
2 | description: 提出新功能
3 | title: '[Feat]: '
4 | labels: [ "enhancement" ]
5 |
6 | body:
7 | - type: markdown
8 | attributes:
9 | value: |
10 | ## 感谢您愿意为 Auto Simulated Universe 提出建议!
11 | ## 以下是一些注意事项,请务必阅读让我们能够更容易处理
12 |
13 | ### ❗ | 确定没有相同问题的 Feature 已被提出或实现。
14 | ### 📝 | 确定现有的PR和代码并没有该功能的实现/相似的功能。
15 | ### 如果您不知道如何有效、精准地表述,我们建议您先阅读《提问的智慧》
16 |
17 | ---
18 | - type: checkboxes
19 | id: terms
20 | attributes:
21 | label: 请确保您已阅读以上注意事项,并勾选下方的确认框。
22 | options:
23 | - label: "我确定这是一个从未被提出和实现过的功能。"
24 | required: true
25 | - label: "我已经在 [Issue Tracker](https://github.com/CHNZYX/Auto_Simulated_Universe/issues) 以及 [Pull Request](https://github.com/CHNZYX/Auto_Simulated_Universe/pulls) 中找过我要提出的功能,没有找到相同功能的ISSUE和PR。"
26 | required: true
27 | - label: 我已知晓并同意,此处仅用于建议新功能。若这个 Issue 是关于其他非主题的问题,则我的 Issue 可能会被无条件自动关闭或/并锁定。
28 | required: true
29 | - label: 我已知晓并同意,如果我不按照模板提供的指示进行填写,则我的 Issue 可能会被无条件删除。
30 | required: true
31 |
32 | - type: textarea
33 | id: feature-to-add
34 | attributes:
35 | label: 需要添加的功能内容
36 | description: |
37 | 请具体提出想添加的功能,包括实现的模拟(如有)
38 | 是否有类似的功能已经实现?如有请肯定地提出与该功能不同的地方/想改进/添加该功能的哪一部分。
39 | validations:
40 | required: true
41 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | .idea
3 |
4 | __pycache__
5 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "Auto_Simulated_Universe"]
2 | path = Auto_Simulated_Universe
3 | url = git@github.com:CHNZYX/Auto_Simulated_Universe.git
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 NanJun
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 简体中文 | [繁体中文](./README_TC.md)
2 |
3 |
4 |
5 | !!!目前精力放在重构项目和自动寻路上!!!
6 |
7 |
8 |
9 | # AutoStarRail
10 |
11 | 崩坏:星穹铁道自动化 |崩坏:星穹铁道体力消耗自动化 | 自定义清理体力 | 融合`Auto_Simulated_Universe`以及清理日常于一体的整合包 | 模拟按键 | 图像识别 | 文字识别
12 |
13 |
14 |
15 | ## 免责声明
16 |
17 | 本软件是一个外部工具旨在自动化崩坏星轨的游戏玩法。它被设计成仅通过现有用户界面与游戏交互,并遵守相关法律法规。该软件包旨在提供简化和用户通过功能与游戏交互,并且它不打算以任何方式破坏游戏平衡或提供任何不公平的优势。该软件包不会以任何方式修改任何游戏文件或游戏代码。
18 |
19 | This software is open source, free of charge and for learning and exchange purposes only. The developer team has the final right to interpret this project. All problems arising from the use of this software are not related to this project and the developer team. If you encounter a merchant using this software to practice on your behalf and charging for it, it may be the cost of equipment and time, etc. The problems and consequences arising from this software have nothing to do with it.
20 |
21 | 本软件开源、免费,仅供学习交流使用。开发者团队拥有本项目的最终解释权。使用本软件产生的所有问题与本项目与开发者团队无关。若您遇到商家使用本软件进行代练并收费,可能是设备与时间等费用,产生的问题及后果与本软件无关。
22 |
23 | 请注意,根据MiHoYo的 [崩坏:星穹铁道的公平游戏宣言](https://sr.mihoyo.com/news/111246?nav=news&type=notice):
24 |
25 | ```
26 | "严禁使用外挂、加速器、脚本或其他破坏游戏公平性的第三方工具。"
27 | "一经发现,米哈游(下亦称“我们”)将视违规严重程度及违规次数,采取扣除违规收益、冻结游戏账号、永久封禁游戏账号等措施。"
28 | ```
29 |
30 |
31 |
32 | ## 注意事项
33 |
34 | 1. 识图为识别游戏画面,游戏不能被任何窗口覆盖
35 |
36 | 5. 运行清理体力该功能后尽量不要操作了,断点恢复能力不是很好
37 |
38 | 6. 暂时不支持副本中死亡继续运行脚本,若中途死亡需要重新运行脚本
39 |
40 | 7. 路径中不要有中文路径!!!
41 |
42 | ⭐**如果喜欢,点个星星~**⭐
43 |
44 | ## 运行环境
45 |
46 | Python 3.11.4
47 |
48 | ## 常见问题解答
49 |
50 | - [常见问题解答](./doc/readme/CN/常见问题.md)
51 |
52 | ## 使用方法
53 |
54 | - [使用方法](./doc/readme/CN/使用方法.md)
55 |
56 | ## GUI展示
57 |
58 | - [GUI展示](./doc/readme/CN/gui展示.md)
59 |
60 | ## 参与开发
61 |
62 | - 如何参与项目开发(还没想好咋写)
63 | - [如何正确的提Issues?](https://www.bilibili.com/video/BV18T411z7R4/?spm_id_from=333.999.0.0&vd_source=ec620e4f4feee0d5f5bfc246495f7f84)
64 |
65 | ## ❓我为什么要做这么一个项目
66 |
67 | 对于我来说星铁是一款非常有意思的游戏(指的是每次更新的地图,活动,剧情等),我非常讨厌重复的刷刷刷这让我非常的烦躁,于是我在**github**上寻找相关的项目,当然我找到了,那就是**StarRailAssistant**和**Auto_Simulated_Universe**这两个项目非常有效的延缓我的烦躁,但这还远远不够,我希望每日任务、日常任务、清理体力等都不需要我自己来操作,我还希望每次锄大地都不需要自己录制一下模拟按键只要截下游戏地图然后对地图进行绘制就能实现角色根据路线走路于是我做了这个项目`AutoStarRail`。
68 |
69 |
70 |
71 | ## 未来目标
72 |
73 | 1. ~~GUI~~
74 | 2. ~~清理每日体力~~
75 | 3. ~~锄大地~~
76 | 4. ~~刷模拟宇宙~~
77 | 5. ~~领委托任务~~
78 | 6. ~~深渊~~
79 | 7. 完成每日任务
80 | 8. 使用A-Star算法改进原模拟按键锄大地
81 |
82 |
83 |
84 | ## 感谢
85 |
86 | [Fluent-Widget仓库(GUI)](https://github.com/zhiyiYo/PyQt-Fluent-Widgets)
87 |
88 | [模拟宇宙与深渊作者](https://github.com/CHNZYX)
89 |
90 |
91 |
92 |
93 |
94 | ## 喜欢项目可以请妹妹喝杯奶茶~( ̄▽ ̄)~*
95 |
96 | 
97 |
--------------------------------------------------------------------------------
/README_TC.md:
--------------------------------------------------------------------------------
1 | [简体中文](./README.md) | 繁体中文
2 |
3 | # AutoStarRail
4 |
5 | 崩壞:星穹鐵道自動化 |崩壞:星穹鐵道體力消耗自動化 | 自定義清理體力 | 融合`Auto_Simulated_Universe`和`StarRailAssistant`以及清理體力於一體的整合包 | 類比按鍵 | 圖像識別
6 |
7 |
8 |
9 | ## 免責宣告
10 |
11 | 本軟體是一個外部工具旨在自動化崩壞星軌的遊戲玩法。它被設計成僅通過現有用戶界面與遊戲交互,併遵守相關法律法規。該軟體包旨在提供簡化和用戶通過功能與遊戲交互,併且它不打算以任何方式破壞遊戲平衡或提供任何不公平的優勢。該軟體包不會以任何方式修改任何遊戲文件或遊戲代碼。
12 |
13 | This software is open source, free of charge and for learning and exchange purposes only. The developer team has the final right to interpret this project. All problems arising from the use of this software are not related to this project and the developer team. If you encounter a merchant using this software to practice on your behalf and charging for it, it may be the cost of equipment and time, etc. The problems and consequences arising from this software have nothing to do with it.
14 |
15 | 本軟體開源、免費,僅供學習交流使用。開發者團隊擁有本項目的最終解釋權。使用本軟體產生的所有問題與本項目與開發者團隊無關。若您遇到商家使用本軟體進行代練併收費,可能是設備與時間等費用,產生的問題及後果與本軟體無關。
16 |
17 | 請註意,根據MiHoYo的 [崩壞:星穹鐵道的公平遊戲宣言](https://sr.mihoyo.com/news/111246?nav=news&type=notice):
18 |
19 | ```
20 | "嚴禁使用外掛、加速器、腳本或其他破壞遊戲公平性的第三方工具。"
21 | "一經發現,米哈遊(下亦稱“我們”)將視違規嚴重程度及違規次數,採取扣除違規收益、凍結遊戲賬號、永久封禁遊戲賬號等措施。"
22 | ```
23 |
24 |
25 |
26 | ## 註意事項
27 |
28 | 1. 識圖為識別遊戲畫面,遊戲不能被任何視窗覆蓋
29 |
30 | 2. 不要修改項目根目錄名稱,項目搜索路徑是嚮上搜索項目名稱,若修改路徑則導致項目陷入死循環等。。
31 |
32 | 3. 自定義體力支援 **擬造花萼**,**凝滯虛影**,**侵蝕隧道**,**歴戰余響**
33 |
34 | 4. 清理體力需要角色處於**主界面**(可以看到左上角地圖,左上角任務,右邊角色欄等)
35 |
36 | 5. 運行清理體力該功能後盡量不要操作了,斷點恢復能力不是很好
37 |
38 | 6. 暫時不支援副本中死亡繼續運行腳本,若中途死亡需要重新運行腳本
39 |
40 | 7. 路徑中不要有中文路徑!!!
41 |
42 | ⭐**如果喜歡,點個星星~**⭐
43 |
44 | ## 運行環境
45 |
46 | Python 3.11.4
47 |
48 | ## 常見問題解答
49 |
50 | - [常見問題解答](./doc/readme/TC/常见问题.md)
51 |
52 | ## 使用方法
53 |
54 | - [使用方法](./doc/readme/TC/使用方法.md)
55 |
56 | ## GUI展示
57 |
58 | - [GUI展示](./doc/readme/TC/gui展示.md)
59 |
60 | ## 參與開發
61 |
62 | - 如何参与项目开发(还没想好咋写)
63 | - [如何正确的提Issues?](https://www.bilibili.com/video/BV18T411z7R4/?spm_id_from=333.999.0.0&vd_source=ec620e4f4feee0d5f5bfc246495f7f84)
64 |
65 | ## 未來目標
66 |
67 | 1. ~~GUI~~
68 | 2. ~~清理每日体力~~
69 | 3. ~~锄大地~~
70 | 4. ~~刷模拟宇宙~~
71 | 5. ~~领委托任务~~
72 | 6. 完成每日任務
73 | 7. 使用A-Star算法改進原類比按鍵鋤大地
--------------------------------------------------------------------------------
/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "abyss": {
3 | "order_text": [
4 | 1,
5 | 2,
6 | 3,
7 | 4,
8 | 10,
9 | 9,
10 | 8,
11 | 7
12 | ]
13 | },
14 | "game": {
15 | "auto_fight": false,
16 | "game_path": "D:/星穹铁道/Star Rail/launcher.exe",
17 | "open_map": "m"
18 | },
19 | "commission": {
20 | "state": "已领取",
21 | "time": "2023年9月3日 21:03:46"
22 | },
23 | "stamina": {
24 | "last": {
25 | "cavern_1": 0,
26 | "cavern_2": 0,
27 | "cavern_3": 0,
28 | "cavern_4": 0,
29 | "cavern_5": 0,
30 | "cavern_6": 0,
31 | "cavern_7": 0,
32 | "calyx_gold_1": 1,
33 | "calyx_gold_2": 0,
34 | "calyx_gold_3": 0,
35 | "calyx_red_1": 0,
36 | "calyx_red_2": 0,
37 | "calyx_red_3": 0,
38 | "calyx_red_4": 0,
39 | "calyx_red_5": 0,
40 | "calyx_red_6": 0,
41 | "calyx_red_7": 0,
42 | "echo_1": 0,
43 | "echo_2": 0,
44 | "echo_3": 0,
45 | "shadow_1": 0,
46 | "shadow_2": 0,
47 | "shadow_3": 0,
48 | "shadow_4": 0,
49 | "shadow_5": 0,
50 | "shadow_6": 0,
51 | "shadow_7": 0,
52 | "shadow_8": 0,
53 | "shadow_9": 0,
54 | "shadow_10": 0,
55 | "shadow_11": 0,
56 | "shadow_12": 0
57 | },
58 | "time": "2023年10月02日 21:24:26",
59 | "use_explore": false,
60 | "use_fuel": false
61 | },
62 | "world": {
63 | "last": {},
64 | "angle": 1.0117566128294584
65 | },
66 | "QFluentWidgets": {
67 | "ThemeColor": "#ff009faa",
68 | "ThemeMode": "Auto"
69 | },
70 | "universe": {
71 | "angle": 1.0117566128294584,
72 | "auto_angle": false,
73 | "bonus": false,
74 | "count": 1,
75 | "debug": 0,
76 | "difficulty": 3,
77 | "fate": "丰饶",
78 | "find": 1,
79 | "number": 6,
80 | "show_map": 0,
81 | "speed": 0,
82 | "update": 0
83 | }
84 | }
--------------------------------------------------------------------------------
/config.py:
--------------------------------------------------------------------------------
1 | import os
2 | import sys
3 |
4 | from qfluentwidgets import QConfig, ConfigItem, qconfig
5 |
6 | import log
7 |
8 | version = "0.6.1"
9 | github_url = "https://github.com/JunNanLYS/AutoStarRail"
10 | abspath = os.path.dirname(os.path.abspath(__file__)) # 项目绝对路径
11 |
12 |
13 | class Config(QConfig):
14 | """ Config of application """
15 | # game
16 | game_path = ConfigItem("game", "game_path", "D:/星穹铁道/Star Rail/launcher.exe")
17 | auto_fight = ConfigItem("game", "auto_fight", False)
18 | open_map = ConfigItem("game", "open_map", 'm')
19 |
20 | # stamina
21 | use_fuel = ConfigItem("stamina", "use_fuel", False)
22 | use_explore = ConfigItem("stamina", "use_explore", False)
23 | last_stamina = ConfigItem("stamina", "last", {})
24 | last_stamina_time = ConfigItem("stamina", "time", "2023年9月3日 21:03:46")
25 |
26 | # commission
27 | commission_time = ConfigItem("commission", "time", "2023年9月3日 21:03:46")
28 | commission_state = ConfigItem("commission", "state", "已领取")
29 |
30 | # universe
31 | universe_angle = ConfigItem("universe", "angle", 1.0)
32 | universe_number = ConfigItem("universe", "number", 6)
33 | universe_count = ConfigItem("universe", "count", 1)
34 | universe_auto_angle = ConfigItem("universe", "auto_angle", False)
35 | universe_find = ConfigItem("universe", "find", 1)
36 | universe_debug = ConfigItem("universe", "debug", 0)
37 | universe_show_map = ConfigItem("universe", "show_map", 0)
38 | universe_update = ConfigItem("universe", "update", 0)
39 | universe_speed = ConfigItem("universe", "speed", 0)
40 | universe_bonus = ConfigItem("universe", "bonus", 0)
41 | universe_difficult = ConfigItem("universe", "difficulty", 3)
42 | universe_fate = ConfigItem("universe", "fate", "巡猎")
43 |
44 | # abyss
45 | abyss_list = ConfigItem("abyss", "order_text", [1, 2, 3, 4, 10, 9, 8, 7])
46 |
47 | # world
48 | world_angle = ConfigItem("world", "angle", 1.0)
49 | last_world = ConfigItem("world", "last", {})
50 |
51 | def save(self):
52 | log.info("保存成功")
53 | super().save()
54 |
55 | def set(self, item, value, save=True):
56 | log.info(f"设置{item.name}为{value}")
57 | super().set(item, value, save)
58 |
59 | @property
60 | def sum_stamina(self):
61 | """计算上一次设置的体力总值"""
62 | res = 0
63 | d = {"calyx": 10, "shadow": 30, "cavern": 40, "echo": 30}
64 | for name, cnt in self.last_stamina.value.items():
65 | for prefix, v in d.items():
66 | if prefix in name:
67 | res += v * cnt
68 | break
69 | return res
70 |
71 |
72 | # 创建配置实例并使用配置文件来初始化它
73 | cfg = Config()
74 | qconfig.load(os.path.join(abspath, "config.json"), cfg)
75 | log.info("Config载入成功")
76 | log.info(f"版本号{version}")
77 | log.info(f"该项目为公益开源项目,若从github外购买请立即差评并举报商家,github地址为{github_url}")
78 | cfg.save()
79 |
--------------------------------------------------------------------------------
/doc/help.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/doc/help.ico
--------------------------------------------------------------------------------
/doc/help.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/doc/help.png
--------------------------------------------------------------------------------
/doc/money.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/doc/money.jpg
--------------------------------------------------------------------------------
/doc/readme/CN/gui展示.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/doc/readme/CN/使用方法.md:
--------------------------------------------------------------------------------
1 | # 项目使用方法
2 |
3 | ## 运行项目
4 |
5 | > 本项目不支持打包支持星铁开源作者们的决定
6 |
7 | 1. 下载python3.11版本
8 | 2. win + r 输入 cmd`(powershell和IDE也行)` 回车进入命令框**请使用管理员身份进入命令框**
9 | 3. 输入`cd ` filename请输入AutoStarRail的绝对路径
10 | 4. 安装依赖`pip3 install -r requirements.txt`
11 | 5. 安装完依赖在命令行输入`python ./main.py`运行脚本
12 | 6. 只支持1920*1080(窗口化或全屏)
13 |
14 | ## 清理体力
15 |
16 | 在脚本界面点击卡片设置
17 |
18 | ## 委托
19 |
20 | 在脚本界面点击卡片设置
21 |
22 | ## 模拟宇宙
23 |
24 | 在脚本界面点击卡片设置
25 |
26 | ## 忘却之庭
27 |
28 | 等`Auto_Simulated_Universe`作者修复
29 |
30 | ## 锄大地
31 |
32 | 开发中...
33 |
34 | ## 每日任务
35 |
36 | ...
--------------------------------------------------------------------------------
/doc/readme/CN/常见问题.md:
--------------------------------------------------------------------------------
1 | # 常见问题解答
2 |
3 | ## 运行main.py后使用功能无反应
4 |
5 | ### 日志正常输出,但是脚本没有反应
6 |
7 | 1. 没有使用管理员身份运行脚本
8 | 2. 分辨率不对,该脚本需要以1920*1080运行
9 |
10 | ## ModuleNotFoundError: No module named 'XXX'
11 |
12 | `XXX`是任意库名称,这段报错意为你没有某个库此时有两种方法
13 |
14 | 1. 再次使用`pip install -r requirements.txt`安装一遍库
15 | 2. 直接使用`pip install XXX`,这个方法的问题就是可能会与其他的库不兼容,可以指定与requirements.txt一样的版本,具体指令自己上网搜
16 | 3. 如果使用的是**Anaconda**那么使用`conda install XXX`,conda会为你选择合适且兼容的版本
17 |
18 | ## 无法安装Polygon3
19 |
20 | 一般里面带有`error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
21 | [end of output]`那么说明你缺少c++工具,你可以直接按照他给出的网址去下载,下载完后重新装就可以了。
22 |
23 | [C++Build工具](https://visualstudio.microsoft.com/visual-cpp-build-tools/)
24 |
25 | ## 运行脚本一直在按ESC或者匹配不到图片
26 |
27 | 1. 分辨率问题,游戏分辨率请设置成1920*1080
28 |
29 | ## 模拟宇宙无法运行
30 |
31 | 查看Auto_Simulated_Universe文件夹是否为空,文件夹为空则到[模拟宇宙仓库](https://github.com/CHNZYX/Auto_Simulated_Universe)下载然后替换原空文件夹。
32 |
--------------------------------------------------------------------------------
/doc/readme/CN/未来目标.md:
--------------------------------------------------------------------------------
1 | # 未来目标
2 |
3 | 1. ~~GUI~~
4 | 2. ~~清理每日体力~~
5 | 3. ~~锄大地~~
6 | 4. ~~刷模拟宇宙~~
7 | 5. ~~领委托任务~~
8 | 6. 完成每日任务
9 | 7. 使用A-Star算法改进原模拟按键锄大地
10 |
11 | # 目标细分
12 |
13 | ## 体力
14 |
15 |
16 |
17 | ## 世界
18 |
19 |
20 |
21 | ## 模拟宇宙
22 |
23 |
24 |
25 | ## 委托任务
26 |
27 |
28 |
29 | ## 每日任务
--------------------------------------------------------------------------------
/doc/readme/TC/gui展示.md:
--------------------------------------------------------------------------------
1 | # 清体力
2 |
3 |
4 |
5 | # 世界
6 |
7 |
8 |
9 | # 更多
10 |
11 |
--------------------------------------------------------------------------------
/doc/readme/TC/使用方法.md:
--------------------------------------------------------------------------------
1 | # 項目使用方法
2 |
3 | ## 運行項目
4 |
5 | > 本項目不支援打包支援星鐵開源作者們的決定
6 |
7 | 1. 下載python3.11版本
8 | 2. win + r 輸入 cmd`(powershell也行)` 回車進入命令框**請使用管理員身份進入命令框**
9 | 3. 輸入`cd ` filename請輸入AutoStarRail的絕對路徑
10 | 4. 安裝依賴`pip3 install -r requirements.txt`
11 | 5. 安裝完依賴在命令行輸入`python ./main.py`運行腳本
12 | 6. 只支援1920*1080(視窗化或全屏)
13 |
14 | ## 自定義清體力
15 |
16 | 按照自己需求來增加每個副本的場次,可以在進行過程中點選停止按鈕來停止功能
17 |
18 | ## 鋤大地
19 |
20 | 選擇自己想要的開始的地圖位置點選開始即可
21 |
22 | 在進行途中按下f8將在下一個地點尋路開始時結束鋤大地
23 |
24 | ## 類比宇宙
25 |
26 | 預設世界:比如說如果妳當前類比宇宙預設世界4,但是想自動化世界6,那麽請先進入一次世界6來改變預設世界
27 |
28 | **第一次運行**
29 |
30 | 點選`校准`按鈕(請保證在平地上)等待視角轉換/原地轉圈結束
31 |
32 | 如果改變了滑鼠dpi或遊戲分辨率/熒幕分辨率/視窗縮放倍率,需要重新校准!
33 |
34 | ## 委托
35 |
36 | 開啟遊戲,點選一鍵領取即可
37 |
38 | ## 一鍵運行所有功能
39 |
40 | 如果需要清理體力和鋤大地,那麽就在這兩個功能界面設定一下自己的需求,然後到`更多`這個界面點選一鍵運行。會彈出一個對話框詢問是否沿用上一次運行配置,若妳是第一次運行則直接點選取消即可。後面若想每次都運行和之前一樣的配置則點選確定。(暫時不支援類比宇宙,後面加)
41 |
42 | ## 忠告
43 |
44 | 所有腳本均一樣,運行後就請不要移動視角或者移動了
--------------------------------------------------------------------------------
/doc/readme/TC/常见问题.md:
--------------------------------------------------------------------------------
1 | # 常見問題解答
2 |
3 | ## 運行main.py後使用功能無反應
4 |
5 | ### 日誌正常輸出,但是腳本沒有反應
6 |
7 | 1. 沒有使用管理員身份運行腳本
8 | 2. 分辨率不對,該腳本需要以1920*1080運行
9 |
10 | ## 運行main.py長時間沒有啟動gui
11 |
12 | 1. 路徑utils/tool 中PathTool死循環了,可以自己根據運行環境修改(一般情況下不會出現這種情況)
13 |
14 | ## ModuleNotFoundError: No module named 'XXX'
15 |
16 | `XXX`是任意庫名稱,這段報錯意為妳沒有某個庫此時有兩種方法
17 |
18 | 1. 再次使用`pip install -r requirements.txt`安裝一邊庫
19 | 2. 直接使用`pip install XXX`,這個方法的問題就是可能會與其他的庫不兼容,可以指定與requirements.txt一樣的版本,具體指令自己上網搜
20 | 3. 如果使用的是**Anaconda**那麽使用`conda install XXX`,conda會為妳選擇合適且兼容的版本
21 |
--------------------------------------------------------------------------------
/doc/readme/gui/avatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/doc/readme/gui/avatar.png
--------------------------------------------------------------------------------
/doc/readme/gui/scripts.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/doc/readme/gui/scripts.png
--------------------------------------------------------------------------------
/doc/readme/gui/setting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/doc/readme/gui/setting.png
--------------------------------------------------------------------------------
/game.py:
--------------------------------------------------------------------------------
1 | import ctypes
2 | import time
3 |
4 | import win32gui
5 |
6 | import log
7 |
8 |
9 | def get_somthing():
10 | """获取游戏窗口宽度以及高度,这是缩放后的"""
11 | while True:
12 | hwnd = win32gui.GetForegroundWindow()
13 | text = win32gui.GetWindowText(hwnd)
14 | x1, y1, x2, y2 = win32gui.GetClientRect(hwnd)
15 | w = x2 - x1
16 | h = y2 - y1
17 | # print(x1, y1, x2, y2)
18 | s = ctypes.windll.user32.GetDpiForWindow(hwnd) / 96.0
19 | if text != "崩坏:星穹铁道":
20 | time.sleep(0.3)
21 | else:
22 | return w * s, h * s, s
23 |
24 |
25 | def get_rect():
26 | """
27 | :return: (left, top, right, bottom)
28 | """
29 | from script.utils import window
30 | while True:
31 | hwnd = win32gui.GetForegroundWindow()
32 | text = win32gui.GetWindowText(hwnd)
33 | x1, y1, x2, y2 = win32gui.GetWindowRect(hwnd)
34 | s = window.get_scaling()
35 | x1, y1 = x1 * s, y1 * s
36 | x2, y2 = x2 * s, y2 * s
37 | if text != "崩坏:星穹铁道":
38 | time.sleep(0.3)
39 | print("等待游戏界面")
40 | else:
41 | return x1, y1, x2, y2
42 |
43 |
44 | def get_screenshot():
45 | """
46 | :return: np.ndarray
47 | """
48 | from PIL import ImageGrab
49 | import cv2
50 | import numpy as np
51 | img = ImageGrab.grab(bbox=get_rect())
52 | img = np.array(img)
53 | img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
54 | return img
55 |
56 |
57 | def set_foreground():
58 | """将游戏设置为前台"""
59 | import pythoncom
60 | import win32com.client
61 | pythoncom.CoInitialize()
62 | shell = win32com.client.Dispatch("WScript.Shell")
63 | shell.SendKeys("") # Undocks my focus from Python IDLE
64 | hwnd = win32gui.FindWindow("UnityWndClass", "崩坏:星穹铁道")
65 | win32gui.SetForegroundWindow(hwnd)
66 | time.sleep(0.3)
67 |
68 |
69 | def to_game_main():
70 | """返回游戏主界面"""
71 | import cv2
72 | import pyautogui
73 | from script.utils import template_path, match_template_gray
74 | cnt = 1
75 | template = cv2.imread(template_path.PHONE)
76 | while True:
77 | img = get_screenshot() # 获取游戏内截图
78 | if match_template_gray(img, template) != (-1, -1):
79 | break
80 | log.info(f"尝试回到主界面,这是第{cnt}次尝试")
81 | pyautogui.press('esc')
82 | time.sleep(0.8)
83 | cnt += 1
84 |
85 |
86 | if __name__ == '__main__':
87 | set_foreground()
88 |
--------------------------------------------------------------------------------
/gui/icon/#04fabc.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/icon/#04fabc.txt
--------------------------------------------------------------------------------
/gui/icon/NanJun.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/icon/NanJun.png
--------------------------------------------------------------------------------
/gui/icon/log_d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/icon/log_d.png
--------------------------------------------------------------------------------
/gui/icon/log_s.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/icon/log_s.png
--------------------------------------------------------------------------------
/gui/icon/run_d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/icon/run_d.png
--------------------------------------------------------------------------------
/gui/icon/run_s.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/icon/run_s.png
--------------------------------------------------------------------------------
/gui/icon/script_d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/icon/script_d.png
--------------------------------------------------------------------------------
/gui/icon/script_s.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/icon/script_s.png
--------------------------------------------------------------------------------
/gui/main_window.py:
--------------------------------------------------------------------------------
1 | import os
2 |
3 | from PySide6.QtGui import QIcon
4 | from qfluentwidgets import (NavigationItemPosition, FluentIcon, MSFluentWindow)
5 |
6 | import config
7 | import log
8 | from gui.widgets import (SettingInterface, ScriptInterface, LogInterface, AvatarInterface, RunInterface)
9 |
10 |
11 | def get_icon_path(icon_name: str):
12 | return os.path.join(config.abspath, "gui", "icon", icon_name)
13 |
14 |
15 | class MainWindow(MSFluentWindow):
16 | def __init__(self):
17 | super().__init__()
18 | self.is_first = True
19 |
20 | self.setting_interface = SettingInterface(self)
21 | self.script_interface = ScriptInterface(self)
22 | self.log_interface = LogInterface(self)
23 | self.avatar_interface = AvatarInterface(self)
24 | self.run_interface = RunInterface(self)
25 |
26 | self.__init_widget()
27 |
28 | def update_info_card(self, *args):
29 | self.script_interface.update_info_card()
30 |
31 | def __init_navigation(self):
32 | self.addSubInterface(
33 | self.script_interface,
34 | QIcon(get_icon_path("script_d.png")),
35 | "脚本",
36 | position=NavigationItemPosition.TOP,
37 | selectedIcon=QIcon(get_icon_path("script_s.png"))
38 | )
39 |
40 | self.addSubInterface(
41 | self.log_interface,
42 | QIcon(get_icon_path("log_d.png")),
43 | "日志",
44 | position=NavigationItemPosition.TOP,
45 | selectedIcon=QIcon(get_icon_path("log_s.png"))
46 | )
47 |
48 | self.addSubInterface(
49 | self.run_interface,
50 | QIcon(get_icon_path("run_d.png")),
51 | "运行",
52 | position=NavigationItemPosition.SCROLL,
53 | selectedIcon=QIcon(get_icon_path("run_s.png"))
54 | )
55 |
56 | self.addSubInterface(
57 | self.avatar_interface,
58 | QIcon(get_icon_path("NanJun.png")),
59 | "NanJun",
60 | position=NavigationItemPosition.BOTTOM,
61 | )
62 |
63 | self.addSubInterface(
64 | self.setting_interface,
65 | FluentIcon.SETTING,
66 | "设置",
67 | position=NavigationItemPosition.BOTTOM
68 | )
69 |
70 | def __init_widget(self):
71 | self.resize(900, 600)
72 | self.__init_navigation()
73 | log.set_log_widget(self.log_interface)
74 |
75 |
76 | if __name__ == "__main__":
77 | import sys
78 | from PySide6.QtWidgets import QApplication
79 |
80 | app = QApplication(sys.argv)
81 | window = MainWindow()
82 | window.show()
83 | app.exec()
84 |
--------------------------------------------------------------------------------
/gui/widgets/__init__.py:
--------------------------------------------------------------------------------
1 | from .setting.setting_interface import SettingInterface
2 | from .script.script_interface import ScriptInterface
3 | from .log.log_interface import LogInterface
4 | from .avatar.avatar_interface import AvatarInterface
5 | from .run.run_interface import RunInterface
6 | from .dialog.warning import WarningDialog
7 |
--------------------------------------------------------------------------------
/gui/widgets/avatar/avatar_group.py:
--------------------------------------------------------------------------------
1 | from PySide6.QtGui import QPixmap
2 | from PySide6.QtWidgets import QFrame
3 |
4 | from .ui.one_avatar import Ui_Frame
5 |
6 |
7 | class AvatarGroup(QFrame, Ui_Frame):
8 | def __init__(self, parent=None):
9 | super().__init__(parent)
10 | self.setupUi(self)
11 | self._url = None
12 | self.avatar.clicked.connect(self.to_url)
13 |
14 | def set_name(self, name: str) -> None:
15 | self.name.setText(name)
16 |
17 | def set_pixmap(self, pixmap: QPixmap) -> None:
18 | self.avatar.setImage(pixmap)
19 |
20 | def set_url(self, url: str):
21 | from PySide6.QtCore import QUrl
22 | self._url = QUrl(url)
23 |
24 | def to_url(self):
25 | from PySide6.QtGui import QDesktopServices
26 | if self._url is None:
27 | return
28 | QDesktopServices.openUrl(self._url)
29 |
30 |
--------------------------------------------------------------------------------
/gui/widgets/avatar/avatar_interface.py:
--------------------------------------------------------------------------------
1 | from PySide6.QtGui import QPixmap
2 | from PySide6.QtWidgets import QFrame
3 | from qfluentwidgets import FlowLayout
4 |
5 | from .ui.avatar_widget import Ui_Frame
6 | from .avatar_group import AvatarGroup
7 |
8 |
9 | def get_img_path(name: str) -> str:
10 | import os
11 | f = os.path.dirname(__file__)
12 | path = os.path.join(f, "img", name)
13 | return path
14 |
15 |
16 | class AvatarInterface(QFrame, Ui_Frame):
17 | def __init__(self, parent=None):
18 | super().__init__(parent)
19 | self.setObjectName("NanJun")
20 | self.setStyleSheet(
21 | """
22 | background: rgb(250, 250, 250);
23 | border: none;
24 | border-radius:10px;
25 | """
26 | )
27 | self.setupUi(self)
28 | self.avatar_layout1 = FlowLayout() # dev members
29 | self.avatar_layout2 = FlowLayout() # acknowledgements
30 |
31 | self.__init_widget()
32 |
33 | def __init_layout(self):
34 | self.dev_members_layout.addLayout(self.avatar_layout1)
35 | self.acknowledgements_layout.addLayout(self.avatar_layout2)
36 |
37 | # add dev members to layout
38 | self.avatar_layout1.addWidget(self.NanJun) # NanJun is the main developer of this project
39 |
40 | # add acknowledgements to layout
41 | self.avatar_layout2.addWidget(self.zhiyiYo) # zhiyiYo is the main developer of PySide6-Fluent-Widgets
42 | self.avatar_layout2.addWidget(self.CHNZYX)
43 |
44 | def __init_avatar(self):
45 | # NanJun
46 | self.NanJun = AvatarGroup(self.scroll_widget)
47 | self.NanJun.set_name("NanJun")
48 | self.NanJun.set_pixmap(QPixmap(get_img_path("NanJun.png")))
49 | self.NanJun.set_url(r"https://github.com/JunNanLYS")
50 |
51 | # zhiyiYo
52 | self.zhiyiYo = AvatarGroup(self.scroll_widget)
53 | self.zhiyiYo.set_name("zhiyiYo")
54 | self.zhiyiYo.set_pixmap(QPixmap(get_img_path("zhiyiYo.png")))
55 | self.zhiyiYo.set_url(r"https://github.com/zhiyiYo")
56 |
57 | # CHNZYX
58 | self.CHNZYX = AvatarGroup(self.scroll_widget)
59 | self.CHNZYX.set_name("CHNZYX")
60 | self.CHNZYX.set_pixmap(QPixmap(get_img_path("CHNZYX.png")))
61 | self.CHNZYX.set_url(r"https://github.com/CHNZYX")
62 |
63 | def __init_widget(self):
64 | self.__init_avatar()
65 | self.__init_layout()
66 |
--------------------------------------------------------------------------------
/gui/widgets/avatar/img/CHNZYX.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/avatar/img/CHNZYX.png
--------------------------------------------------------------------------------
/gui/widgets/avatar/img/NanJun.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/avatar/img/NanJun.png
--------------------------------------------------------------------------------
/gui/widgets/avatar/img/zhiyiYo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/avatar/img/zhiyiYo.png
--------------------------------------------------------------------------------
/gui/widgets/avatar/ui/avatar_widget.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | ################################################################################
4 | ## Form generated from reading UI file 'avatar_widget.ui'
5 | ##
6 | ## Created by: Qt User Interface Compiler version 6.4.3
7 | ##
8 | ## WARNING! All changes made in this file will be lost when recompiling UI file!
9 | ################################################################################
10 |
11 | from PySide6.QtCore import (QCoreApplication, QMetaObject, QRect)
12 | from PySide6.QtWidgets import (QSizePolicy, QSpacerItem,
13 | QVBoxLayout, QWidget)
14 |
15 | from qfluentwidgets import (SmoothScrollArea, SubtitleLabel)
16 |
17 | class Ui_Frame(object):
18 | def setupUi(self, Frame):
19 | if not Frame.objectName():
20 | Frame.setObjectName(u"Frame")
21 | Frame.resize(605, 481)
22 | self.verticalLayout = QVBoxLayout(Frame)
23 | self.verticalLayout.setSpacing(0)
24 | self.verticalLayout.setObjectName(u"verticalLayout")
25 | self.verticalLayout.setContentsMargins(0, 0, 0, 0)
26 | self.SmoothScrollArea = SmoothScrollArea(Frame)
27 | self.SmoothScrollArea.setObjectName(u"SmoothScrollArea")
28 | self.SmoothScrollArea.setWidgetResizable(True)
29 | self.scroll_widget = QWidget()
30 | self.scroll_widget.setObjectName(u"scroll_widget")
31 | self.scroll_widget.setGeometry(QRect(0, 0, 603, 479))
32 | self.verticalLayout_2 = QVBoxLayout(self.scroll_widget)
33 | self.verticalLayout_2.setSpacing(20)
34 | self.verticalLayout_2.setObjectName(u"verticalLayout_2")
35 | self.verticalLayout_2.setContentsMargins(5, 5, 5, 5)
36 | self.dev_members_layout = QVBoxLayout()
37 | self.dev_members_layout.setSpacing(10)
38 | self.dev_members_layout.setObjectName(u"dev_members_layout")
39 | self.dev_members_layout.setContentsMargins(10, -1, 10, -1)
40 | self.dev_members_label = SubtitleLabel(self.scroll_widget)
41 | self.dev_members_label.setObjectName(u"dev_members_label")
42 |
43 | self.dev_members_layout.addWidget(self.dev_members_label)
44 |
45 |
46 | self.verticalLayout_2.addLayout(self.dev_members_layout)
47 |
48 | self.acknowledgements_layout = QVBoxLayout()
49 | self.acknowledgements_layout.setSpacing(10)
50 | self.acknowledgements_layout.setObjectName(u"acknowledgements_layout")
51 | self.acknowledgements_layout.setContentsMargins(10, -1, 10, -1)
52 | self.acknowledgements_label = SubtitleLabel(self.scroll_widget)
53 | self.acknowledgements_label.setObjectName(u"acknowledgements_label")
54 |
55 | self.acknowledgements_layout.addWidget(self.acknowledgements_label)
56 |
57 |
58 | self.verticalLayout_2.addLayout(self.acknowledgements_layout)
59 |
60 | self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
61 |
62 | self.verticalLayout_2.addItem(self.verticalSpacer)
63 |
64 | self.SmoothScrollArea.setWidget(self.scroll_widget)
65 |
66 | self.verticalLayout.addWidget(self.SmoothScrollArea)
67 |
68 |
69 | self.retranslateUi(Frame)
70 |
71 | QMetaObject.connectSlotsByName(Frame)
72 | # setupUi
73 |
74 | def retranslateUi(self, Frame):
75 | Frame.setWindowTitle(QCoreApplication.translate("Frame", u"Frame", None))
76 | self.dev_members_label.setText(QCoreApplication.translate("Frame", u"\u5f00\u53d1\u6210\u5458", None))
77 | self.acknowledgements_label.setText(QCoreApplication.translate("Frame", u"\u81f4\u8c22", None))
78 | # retranslateUi
79 |
80 |
--------------------------------------------------------------------------------
/gui/widgets/avatar/ui/avatar_widget.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | Frame
4 |
5 |
6 |
7 | 0
8 | 0
9 | 605
10 | 481
11 |
12 |
13 |
14 | Frame
15 |
16 |
17 |
18 | 0
19 |
20 |
21 | 0
22 |
23 |
24 | 0
25 |
26 |
27 | 0
28 |
29 |
30 | 0
31 |
32 | -
33 |
34 |
35 | true
36 |
37 |
38 |
39 |
40 | 0
41 | 0
42 | 603
43 | 479
44 |
45 |
46 |
47 |
48 | 20
49 |
50 |
51 | 5
52 |
53 |
54 | 5
55 |
56 |
57 | 5
58 |
59 |
60 | 5
61 |
62 |
-
63 |
64 |
65 | 10
66 |
67 |
68 | 10
69 |
70 |
71 | 10
72 |
73 |
-
74 |
75 |
76 | 开发成员
77 |
78 |
79 |
80 |
81 |
82 | -
83 |
84 |
85 | 10
86 |
87 |
88 | 10
89 |
90 |
91 | 10
92 |
93 |
-
94 |
95 |
96 | 致谢
97 |
98 |
99 |
100 |
101 |
102 | -
103 |
104 |
105 | Qt::Vertical
106 |
107 |
108 |
109 | 20
110 | 40
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 | SmoothScrollArea
124 | QScrollArea
125 |
126 | 1
127 |
128 |
129 | SubtitleLabel
130 | QLabel
131 |
132 |
133 |
134 |
135 |
136 |
137 |
--------------------------------------------------------------------------------
/gui/widgets/avatar/ui/one_avatar.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | ################################################################################
4 | ## Form generated from reading UI file 'one_avatar.ui'
5 | ##
6 | ## Created by: Qt User Interface Compiler version 6.4.3
7 | ##
8 | ## WARNING! All changes made in this file will be lost when recompiling UI file!
9 | ################################################################################
10 |
11 | from PySide6.QtCore import (QCoreApplication, QMetaObject, QSize, Qt)
12 | from PySide6.QtWidgets import (QVBoxLayout)
13 |
14 | from qfluentwidgets import (AvatarWidget, StrongBodyLabel)
15 |
16 | class Ui_Frame(object):
17 | def setupUi(self, Frame):
18 | if not Frame.objectName():
19 | Frame.setObjectName(u"Frame")
20 | Frame.resize(106, 125)
21 | self.verticalLayout = QVBoxLayout(Frame)
22 | self.verticalLayout.setSpacing(0)
23 | self.verticalLayout.setObjectName(u"verticalLayout")
24 | self.verticalLayout.setContentsMargins(5, 5, 5, 5)
25 | self.avatar = AvatarWidget(Frame)
26 | self.avatar.setObjectName(u"avatar")
27 | self.avatar.setMinimumSize(QSize(96, 96))
28 | self.avatar.setMaximumSize(QSize(96, 96))
29 |
30 | self.verticalLayout.addWidget(self.avatar)
31 |
32 | self.name = StrongBodyLabel(Frame)
33 | self.name.setObjectName(u"name")
34 | self.name.setMinimumSize(QSize(96, 19))
35 | self.name.setMaximumSize(QSize(96, 19))
36 | self.name.setAlignment(Qt.AlignCenter)
37 |
38 | self.verticalLayout.addWidget(self.name)
39 |
40 |
41 | self.retranslateUi(Frame)
42 |
43 | QMetaObject.connectSlotsByName(Frame)
44 | # setupUi
45 |
46 | def retranslateUi(self, Frame):
47 | Frame.setWindowTitle(QCoreApplication.translate("Frame", u"Frame", None))
48 | self.name.setText(QCoreApplication.translate("Frame", u"name", None))
49 | # retranslateUi
50 |
51 |
--------------------------------------------------------------------------------
/gui/widgets/avatar/ui/one_avatar.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | Frame
4 |
5 |
6 |
7 | 0
8 | 0
9 | 106
10 | 125
11 |
12 |
13 |
14 | Frame
15 |
16 |
17 |
18 | 0
19 |
20 |
21 | 5
22 |
23 |
24 | 5
25 |
26 |
27 | 5
28 |
29 |
30 | 5
31 |
32 | -
33 |
34 |
35 |
36 | 96
37 | 96
38 |
39 |
40 |
41 |
42 | 96
43 | 96
44 |
45 |
46 |
47 |
48 | -
49 |
50 |
51 |
52 | 96
53 | 19
54 |
55 |
56 |
57 |
58 | 96
59 | 19
60 |
61 |
62 |
63 | name
64 |
65 |
66 | Qt::AlignCenter
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 | StrongBodyLabel
75 | QLabel
76 |
77 |
78 |
79 | ImageLabel
80 | QLabel
81 |
82 |
83 |
84 | AvatarWidget
85 | ImageLabel
86 |
87 |
88 |
89 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/gui/widgets/dialog/warning.py:
--------------------------------------------------------------------------------
1 | from PySide6.QtCore import Qt, QTimer, QEventLoop
2 | from PySide6.QtWidgets import QVBoxLayout, QSpacerItem, QSizePolicy
3 | from qfluentwidgets import SimpleCardWidget, TitleLabel, StrongBodyLabel
4 |
5 |
6 | class WarningDialog(SimpleCardWidget):
7 | def __init__(self, parent=None):
8 | super().__init__(parent)
9 | self.v_layout = QVBoxLayout(self)
10 | self.v_layout.setContentsMargins(20, 20, 20, 20)
11 | self.v_layout.setSpacing(20)
12 | self.spacer = QSpacerItem(0, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
13 |
14 | self.__init_widget()
15 | self.show()
16 | loop = QEventLoop()
17 | QTimer.singleShot(10000, loop.quit)
18 | loop.exec()
19 | self.close()
20 |
21 | def __init_label(self):
22 | self.title = TitleLabel(self)
23 | self.title.setText("此软件为免费开源项目,如果你付了钱请立即退款并举报!")
24 | self.title.setAlignment(Qt.AlignmentFlag.AlignTop)
25 |
26 | self.sub_label = StrongBodyLabel(self)
27 | self.sub_label.setText("咸鱼倒狗4000+!你付给倒狗的每一分钱都会让开源自动化更加困难,请退款并举报商家!\n"
28 | "本项目已经因为倒卖行为受到严重威胁,请帮助我们!\n"
29 | "整合包链接:https://github.com/JunNanLYS/AutoStarRail\n"
30 | "模拟宇宙作者链接:https://github.com/CHNZYX/Auto_Simulated_Universe\n"
31 | "QQ群号:831830526\n"
32 | "如果喜欢该项目可以请喝杯奶茶捏\n"
33 | "10s后关闭")
34 | self.sub_label.setAlignment(Qt.AlignmentFlag.AlignTop)
35 |
36 | def __init_layout(self):
37 | self.v_layout.addWidget(self.title)
38 | self.v_layout.addWidget(self.sub_label)
39 |
40 | self.v_layout.addItem(self.spacer)
41 |
42 | def __init_widget(self):
43 | self.__init_label()
44 | self.__init_layout()
45 | self.setFixedSize(770, 240)
46 | self.setBorderRadius(10)
47 | if self.parent():
48 | self.move((self.parent().width() // 2) - (self.width() // 2),
49 | (self.parent().height() // 2) - (self.height() // 2))
50 |
51 |
52 | if __name__ == "__main__":
53 | from PySide6.QtWidgets import QApplication
54 |
55 | app = QApplication([])
56 | warning_dialog = WarningDialog()
57 | print(warning_dialog.size())
58 | app.exec()
59 |
--------------------------------------------------------------------------------
/gui/widgets/log/log_interface.py:
--------------------------------------------------------------------------------
1 | from PySide6.QtCore import Signal
2 | from qfluentwidgets import PlainTextEdit
3 |
4 |
5 | class LogInterface(PlainTextEdit):
6 | add = Signal(str)
7 |
8 | def __init__(self, parent=None):
9 | super().__init__(parent)
10 | self.setObjectName("日志")
11 | self.add.connect(self.append)
12 | self.setReadOnly(True)
13 |
14 | def append(self, text: str) -> None:
15 | self.appendPlainText(text)
16 |
17 |
--------------------------------------------------------------------------------
/gui/widgets/run/run_interface.py:
--------------------------------------------------------------------------------
1 | from PySide6.QtWidgets import QFrame, QPushButton
2 | from qfluentwidgets import PushButton
3 |
4 | from .ui.run_widget import Ui_Frame
5 |
6 |
7 | class RunInterface(QFrame, Ui_Frame):
8 | def __init__(self, parent=None):
9 | super().__init__(parent)
10 | self.setObjectName("运行")
11 | self.setStyleSheet(
12 | """
13 | background: rgb(250, 250, 250);
14 | border: none;
15 | border-radius:10px;
16 | """
17 | )
18 | self.setupUi(self)
19 | self.button_angle = PushButton("校准角度", self)
20 |
21 | self.__init_widget()
22 |
23 | def get_script_name(self):
24 | """get script name"""
25 | return self.combobox.currentText()
26 |
27 | def __connect_signal_to_slot(self):
28 | self.combobox.currentTextChanged.connect(self.__on_combobox_text_changed)
29 |
30 | def __on_combobox_text_changed(self, text):
31 | texts = ["模拟宇宙", "世界", "深渊"]
32 | if text in texts:
33 | self.button_angle.show()
34 | else:
35 | self.button_angle.hide()
36 |
37 | def __init_combobox(self):
38 | items = ["体力", "模拟宇宙", "深渊", "委托", "每日任务", "世界", "运行所有"]
39 | self.combobox.addItems(items)
40 | self.combobox.setCurrentIndex(0)
41 |
42 | def __init_layout(self):
43 | self.button_layout.addWidget(self.button_angle)
44 |
45 | def __init_widget(self):
46 | self.PlainTextEdit.setReadOnly(True)
47 | self.button_angle.hide()
48 |
49 | self.__init_combobox()
50 | self.__init_layout()
51 | self.__connect_signal_to_slot()
52 |
53 |
--------------------------------------------------------------------------------
/gui/widgets/run/ui/run_widget.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | ################################################################################
4 | ## Form generated from reading UI file 'run_widget.ui'
5 | ##
6 | ## Created by: Qt User Interface Compiler version 6.4.3
7 | ##
8 | ## WARNING! All changes made in this file will be lost when recompiling UI file!
9 | ################################################################################
10 |
11 | from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
12 | QMetaObject, QObject, QPoint, QRect,
13 | QSize, QTime, QUrl, Qt)
14 | from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
15 | QFont, QFontDatabase, QGradient, QIcon,
16 | QImage, QKeySequence, QLinearGradient, QPainter,
17 | QPalette, QPixmap, QRadialGradient, QTransform)
18 | from PySide6.QtWidgets import (QApplication, QFrame, QHBoxLayout, QSizePolicy,
19 | QVBoxLayout, QWidget)
20 |
21 | from qfluentwidgets import (ComboBox, PlainTextEdit, PushButton)
22 |
23 | class Ui_Frame(object):
24 | def setupUi(self, Frame):
25 | if not Frame.objectName():
26 | Frame.setObjectName(u"Frame")
27 | Frame.resize(581, 398)
28 | self.verticalLayout = QVBoxLayout(Frame)
29 | self.verticalLayout.setObjectName(u"verticalLayout")
30 | self.PlainTextEdit = PlainTextEdit(Frame)
31 | self.PlainTextEdit.setObjectName(u"PlainTextEdit")
32 |
33 | self.verticalLayout.addWidget(self.PlainTextEdit)
34 |
35 | self.combobox_layout = QHBoxLayout()
36 | self.combobox_layout.setSpacing(10)
37 | self.combobox_layout.setObjectName(u"combobox_layout")
38 | self.combobox_layout.setContentsMargins(5, 5, 5, 5)
39 | self.combobox = ComboBox(Frame)
40 | self.combobox.setObjectName(u"combobox")
41 |
42 | self.combobox_layout.addWidget(self.combobox)
43 |
44 |
45 | self.verticalLayout.addLayout(self.combobox_layout)
46 |
47 | self.button_layout = QHBoxLayout()
48 | self.button_layout.setSpacing(10)
49 | self.button_layout.setObjectName(u"button_layout")
50 | self.button_layout.setContentsMargins(5, 5, 5, 5)
51 | self.button_run = PushButton(Frame)
52 | self.button_run.setObjectName(u"button_run")
53 |
54 | self.button_layout.addWidget(self.button_run)
55 |
56 |
57 | self.verticalLayout.addLayout(self.button_layout)
58 |
59 |
60 | self.retranslateUi(Frame)
61 |
62 | QMetaObject.connectSlotsByName(Frame)
63 | # setupUi
64 |
65 | def retranslateUi(self, Frame):
66 | Frame.setWindowTitle(QCoreApplication.translate("Frame", u"Frame", None))
67 | self.PlainTextEdit.setPlainText(QCoreApplication.translate("Frame", u"\u5012\u5356\u53ef\u803b\uff01\u5012\u5356\u53ef\u803b\uff01\u5012\u5356\u53ef\u803b\uff01\n"
68 | "\u672c\u9879\u76eeAutoStarRail\u4e3a\u5f00\u6e90\u514d\u8d39\u516c\u76ca\u9879\u76ee\u3002\n"
69 | "\u5982\u679c\u4f60\u4eceGithub\u4e4b\u5916\u6e20\u9053\u4ed8\u8d39\u5f97\u5230\u8be5\u9879\u76ee\u8bf7\u7acb\u5373\u5dee\u8bc4\u5e76\u4e3e\u62a5\u5546\u5bb6\uff01\n"
70 | "\u9879\u76ee\u7528\u4e8e\u5b66\u4e60\u4ea4\u6d41\uff01\uff01\uff01\n"
71 | "\n"
72 | "\u6084\u54aa\u54aa\u7684\u544a\u8bc9\u4f60\uff0c\u4e0d\u8981\u4e71\u5220\u6587\u4ef6\uff0c\u5426\u5219\u53ef\u80fd\u65e0\u6cd5\u8fd0\u884c\u811a\u672c\u4e14\u88ab\u9879\u76ee\u5c01\u7981\uff0c\u8fd9\u662f\u4e3a\u4e86\u9632\u6b62\u5012\u5356\u3002", None))
73 | self.button_run.setText(QCoreApplication.translate("Frame", u"\u8fd0\u884c\u811a\u672c", None))
74 | # retranslateUi
75 |
76 |
--------------------------------------------------------------------------------
/gui/widgets/run/ui/run_widget.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | Frame
4 |
5 |
6 |
7 | 0
8 | 0
9 | 581
10 | 398
11 |
12 |
13 |
14 | Frame
15 |
16 |
17 | -
18 |
19 |
20 | 倒卖可耻!倒卖可耻!倒卖可耻!
21 | 本项目AutoStarRail为开源免费公益项目。
22 | 如果你从Github之外渠道付费得到该项目请立即差评并举报商家!
23 | 项目用于学习交流!!!
24 |
25 | 悄咪咪的告诉你,不要乱删文件,否则可能无法运行脚本且被项目封禁,这是为了防止倒卖。
26 |
27 |
28 |
29 | -
30 |
31 |
32 | 10
33 |
34 |
35 | 5
36 |
37 |
38 | 5
39 |
40 |
41 | 5
42 |
43 |
44 | 5
45 |
46 |
-
47 |
48 |
49 |
50 |
51 | -
52 |
53 |
54 | 10
55 |
56 |
57 | 5
58 |
59 |
60 | 5
61 |
62 |
63 | 5
64 |
65 |
66 | 5
67 |
68 |
-
69 |
70 |
71 | 运行脚本
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 | ComboBox
82 | QPushButton
83 |
84 |
85 |
86 | PushButton
87 | QPushButton
88 |
89 |
90 |
91 | PlainTextEdit
92 | QPlainTextEdit
93 |
94 |
95 |
96 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/gui/widgets/script/img/calyx_gold/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/calyx_gold/1.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/calyx_gold/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/calyx_gold/2.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/calyx_gold/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/calyx_gold/3.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/calyx_red/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/calyx_red/1.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/calyx_red/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/calyx_red/2.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/calyx_red/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/calyx_red/3.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/calyx_red/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/calyx_red/4.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/calyx_red/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/calyx_red/5.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/calyx_red/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/calyx_red/6.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/calyx_red/7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/calyx_red/7.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/cavern/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/cavern/1.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/cavern/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/cavern/2.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/cavern/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/cavern/3.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/cavern/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/cavern/4.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/cavern/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/cavern/5.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/cavern/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/cavern/6.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/cavern/7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/cavern/7.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/echo/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/echo/1.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/echo/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/echo/2.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/echo/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/echo/3.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/shadow/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/shadow/1.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/shadow/10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/shadow/10.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/shadow/11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/shadow/11.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/shadow/12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/shadow/12.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/shadow/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/shadow/2.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/shadow/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/shadow/3.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/shadow/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/shadow/4.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/shadow/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/shadow/5.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/shadow/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/shadow/6.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/shadow/7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/shadow/7.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/shadow/8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/shadow/8.png
--------------------------------------------------------------------------------
/gui/widgets/script/img/shadow/9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/script/img/shadow/9.png
--------------------------------------------------------------------------------
/gui/widgets/script/info_card.py:
--------------------------------------------------------------------------------
1 | from typing import Dict
2 |
3 | from .ui.info_card_widget import Ui_Form
4 | from qfluentwidgets import StrongBodyLabel, CaptionLabel, ElevatedCardWidget
5 |
6 |
7 | class InfoCard(ElevatedCardWidget, Ui_Form):
8 | def __init__(self, title: str, parent=None):
9 | super().__init__(parent)
10 | self.setupUi(self)
11 | self._row = 0
12 | self.setStyleSheet(
13 | """
14 | background: rgb(255, 255, 255, 80);
15 | """
16 | )
17 | self.title_label.setText(title)
18 | self.title_label.setStyleSheet(
19 | """
20 | background: rgb(255, 255, 255, 255);
21 | """
22 | )
23 | self.setFixedSize(400, 270)
24 | self.verticalLayout.setSpacing(20)
25 | self.title_to_content_obj: Dict[str, CaptionLabel] = dict()
26 |
27 | def _get_title_label(self, text: str):
28 | from PySide6.QtCore import Qt
29 | label = StrongBodyLabel(self)
30 | label.setStyleSheet(
31 | """
32 | background:rgb(255, 255, 255, 255);
33 | """
34 | )
35 | label.setText(text)
36 | label.setAlignment(Qt.AlignmentFlag.AlignLeft | Qt.AlignmentFlag.AlignTop)
37 | return label
38 |
39 | def _get_content_label(self, text: str):
40 | from PySide6.QtCore import Qt
41 | label = CaptionLabel(self)
42 | label.setStyleSheet(
43 | """
44 | background:rgb(255, 255, 255, 255);
45 | """
46 | )
47 | label.setText(text)
48 | label.setAlignment(Qt.AlignmentFlag.AlignLeft | Qt.AlignmentFlag.AlignTop)
49 | return label
50 |
51 | def add_info(self, title: str, content: str):
52 | if isinstance(content, (int, float)):
53 | content = str(content)
54 | self.grid_layout.addWidget(self._get_title_label(title), self._row, 0)
55 | content_label = self._get_content_label(content)
56 | self.title_to_content_obj[title] = content_label
57 | self.grid_layout.addWidget(content_label, self._row, 1)
58 | self._row += 1
59 |
60 | def set_info(self, title, content):
61 | if isinstance(content, (int, float)):
62 | content = str(content)
63 | if title not in self.title_to_content_obj:
64 | raise AttributeError(f"title not in title_to_content_obj")
65 | content_label = self.title_to_content_obj[title]
66 | content_label.setText(content)
67 |
--------------------------------------------------------------------------------
/gui/widgets/script/script_interface.py:
--------------------------------------------------------------------------------
1 | from PySide6.QtWidgets import QFrame
2 | from qfluentwidgets import FlowLayout
3 |
4 | from .ui.script_widget import Ui_Frame
5 | from .info_card import InfoCard
6 | from .stamina_window import StaminaWindow
7 | from .universe_window import UniverseWindow
8 | from config import cfg
9 |
10 |
11 | class ScriptInterface(QFrame, Ui_Frame):
12 | def __init__(self, parent=None):
13 | super().__init__(parent)
14 | self.setObjectName("脚本")
15 | self.setStyleSheet(
16 | """
17 | background: rgb(250, 250, 250);
18 | border: none;
19 | border-radius:10px;
20 | """
21 | )
22 | self.setupUi(self)
23 | self.flow_layout = FlowLayout(self.scroll_widget)
24 |
25 | # init info card
26 | self.stamina_card = InfoCard("体力")
27 | self.commission_card = InfoCard("委托")
28 | self.universe_card = InfoCard("模拟宇宙")
29 | self.daily_card = InfoCard("每日任务")
30 | self.world_card = InfoCard("世界")
31 | self.abyss_card = InfoCard("深渊")
32 |
33 | self.stamina_window = StaminaWindow()
34 | self.universe_window = UniverseWindow()
35 |
36 | self.__init_widget()
37 |
38 | def update_info_card(self):
39 | """update card"""
40 | from config import cfg
41 | # stamina card
42 | sum_stamina = cfg.sum_stamina
43 | self.stamina_card.set_info("已设置体力", str(sum_stamina))
44 | self.stamina_card.set_info("占比", f"{round(sum_stamina / 240 * 100, 1)}%")
45 | self.stamina_card.set_info("上次运行", cfg.last_stamina_time.value)
46 |
47 | # universe card
48 | self.universe_card.set_info("宇宙", cfg.get(cfg.universe_number))
49 | self.universe_card.set_info("命途", cfg.get(cfg.universe_fate))
50 | self.universe_card.set_info("难度", cfg.get(cfg.universe_difficult))
51 | self.universe_card.set_info("角度误差", cfg.get(cfg.universe_angle))
52 | self.universe_card.set_info("计数", cfg.get(cfg.universe_count))
53 |
54 | def __connect_signal_to_slot(self):
55 | self.stamina_card.clicked.connect(self.stamina_window.show)
56 | self.stamina_window.button_yes.clicked.connect(self.update_info_card)
57 |
58 | self.universe_card.clicked.connect(self.universe_window.show)
59 | self.universe_window.button_yes.clicked.connect(self.update_info_card)
60 |
61 | def __init_layout(self):
62 | self.flow_layout.addWidget(self.stamina_card)
63 | self.flow_layout.addWidget(self.universe_card)
64 | self.flow_layout.addWidget(self.commission_card)
65 | self.flow_layout.addWidget(self.daily_card)
66 | self.flow_layout.addWidget(self.world_card)
67 | self.flow_layout.addWidget(self.abyss_card)
68 |
69 | def __init_info_card(self):
70 | # stamina card
71 | sum_stamina = cfg.sum_stamina
72 | self.stamina_card.add_info("已设置体力", sum_stamina)
73 | self.stamina_card.add_info("占比", f"{round(sum_stamina / 240 * 100, 1)}%")
74 | self.stamina_card.add_info("上次运行", cfg.last_stamina_time.value)
75 | self.stamina_card.add_info("运行", "False")
76 |
77 | # universe card
78 | self.universe_card.add_info("宇宙", cfg.get(cfg.universe_number))
79 | self.universe_card.add_info("命途", cfg.get(cfg.universe_fate))
80 | self.universe_card.add_info("难度", cfg.get(cfg.universe_difficult))
81 | self.universe_card.add_info("角度误差", cfg.get(cfg.universe_angle))
82 | self.universe_card.add_info("计数", cfg.get(cfg.universe_count))
83 | self.universe_card.add_info("运行", "False")
84 |
85 | # commission card
86 | self.commission_card.add_info("状态", "待领取")
87 | self.commission_card.add_info("距离上次", "1天1时1分")
88 | self.commission_card.add_info("运行", "False")
89 |
90 | # daily card
91 | self.daily_card.add_info("上次运行", "...")
92 | self.daily_card.add_info("运行", "False")
93 |
94 | # world card
95 | self.world_card.add_info("起始", "空间站-基座舱段-1")
96 | self.world_card.add_info("角度误差", "1.0")
97 | self.world_card.add_info("距离上次", "1天1时1分")
98 | self.world_card.add_info("运行", "False")
99 |
100 | # abyss card
101 | self.abyss_card.add_info("配队1", "1 2 3 4")
102 | self.abyss_card.add_info("配队2", "5 6 7 8")
103 | self.abyss_card.add_info("...", "...")
104 |
105 | def __init_widget(self):
106 | self.__init_layout()
107 | self.__init_info_card()
108 | self.__connect_signal_to_slot()
109 |
--------------------------------------------------------------------------------
/gui/widgets/script/stamina_window.py:
--------------------------------------------------------------------------------
1 | import os
2 |
3 | from qfluentwidgets import SimpleCardWidget, ImageLabel, SpinBox, FlowLayout
4 | from qframelesswindow import FramelessDialog
5 | from PySide6.QtWidgets import QHBoxLayout
6 |
7 | import config
8 | from .ui.stamina import Ui_Frame
9 |
10 |
11 | class StaminaCard(SimpleCardWidget):
12 | def __init__(self, img: str, parent):
13 | super().__init__(parent)
14 | self.layout = QHBoxLayout(self)
15 | self.image = ImageLabel(img, self)
16 | self.spin_box = SpinBox(self)
17 |
18 | # add to layout
19 | self.layout.addWidget(self.image)
20 | self.layout.addWidget(self.spin_box)
21 |
22 | @property
23 | def value(self):
24 | return self.spin_box.value()
25 |
26 |
27 | class StaminaWindow(FramelessDialog, Ui_Frame):
28 | def __init__(self, parent=None):
29 | super().__init__(parent)
30 | self.setupUi(self)
31 | self._path = os.path.dirname(__file__)
32 | self._dict = dict()
33 |
34 | # creat a layout on view of card
35 | self.calyx_gold_card_layout = FlowLayout()
36 | self.calyx_red_card_layout = FlowLayout()
37 | self.shadow_card_layout = FlowLayout()
38 | self.cavern_card_layout = FlowLayout()
39 | self.echo_card_layout = FlowLayout()
40 |
41 | self.__init_widget()
42 | self.titleBar.raise_()
43 |
44 | def get_stamina(self):
45 | """获取每个参数"""
46 | lis = self.cavern_card.view.children() + self.calyx_gold_card.view.children() + \
47 | self.calyx_red_card.view.children() + self.echo_card.view.children() + \
48 | self.shadow_card.view.children()
49 |
50 | for widget in lis:
51 | if isinstance(widget, StaminaCard):
52 | self._dict[widget.objectName()] = widget.value
53 |
54 | return self._dict
55 |
56 | def __add_card_to_layout(self, name):
57 | from config import cfg
58 | NAME_TO_VIEW = {"calyx_gold": self.calyx_gold_card.view,
59 | "calyx_red": self.calyx_red_card.view,
60 | "shadow": self.shadow_card.view,
61 | "cavern": self.cavern_card.view,
62 | "echo": self.echo_card.view}
63 | NAME_TO_LAYOUT = {"calyx_gold": self.calyx_gold_card_layout,
64 | "calyx_red": self.calyx_red_card_layout,
65 | "shadow": self.shadow_card_layout,
66 | "cavern": self.cavern_card_layout,
67 | "echo": self.echo_card_layout}
68 | parent = NAME_TO_VIEW[name]
69 | layout = NAME_TO_LAYOUT[name]
70 | path = self.__get_img_root_path(name)
71 | n = len(os.listdir(path))
72 | for i in range(1, n + 1):
73 | card = StaminaCard(os.path.join(path, str(i) + '.png'), parent)
74 | object_name = name + "_" + str(i)
75 | card.setObjectName(object_name)
76 | card.spin_box.setValue(cfg.last_stamina.value.get(object_name, 0))
77 | layout.addWidget(card)
78 |
79 | def __on_yes_button_clicked(self):
80 | """yes button clicked slot"""
81 | from config import cfg
82 | stamina = self.get_stamina()
83 | cfg.set(cfg.last_stamina, stamina)
84 |
85 | def __connect_signal_to_slot(self):
86 | self.button_yes.clicked.connect(self.hide)
87 | self.button_yes.clicked.connect(self.__on_yes_button_clicked)
88 | self.button_no.clicked.connect(self.hide)
89 |
90 | def __get_img_root_path(self, name):
91 | return os.path.join(self._path, "img", name)
92 |
93 | def __init_layout(self):
94 | # add flow layout to card view layout
95 | self.calyx_gold_card.viewLayout.addLayout(self.calyx_gold_card_layout)
96 | self.calyx_red_card.viewLayout.addLayout(self.calyx_red_card_layout)
97 | self.shadow_card.viewLayout.addLayout(self.shadow_card_layout)
98 | self.cavern_card.viewLayout.addLayout(self.cavern_card_layout)
99 | self.echo_card.viewLayout.addLayout(self.echo_card_layout)
100 |
101 | self.__add_card_to_layout("calyx_gold")
102 | self.__add_card_to_layout("calyx_red")
103 | self.__add_card_to_layout("shadow")
104 | self.__add_card_to_layout("cavern")
105 | self.__add_card_to_layout("echo")
106 |
107 | def __init_widget(self):
108 | self.__init_layout()
109 | self.__connect_signal_to_slot()
110 |
111 | self.calyx_gold_card.setTitle("拟造花萼(金)")
112 | self.calyx_red_card.setTitle("拟造花萼(红)")
113 | self.shadow_card.setTitle("凝滞虚影")
114 | self.cavern_card.setTitle("侵蚀隧道")
115 | self.echo_card.setTitle("历战回响")
116 |
117 | self.titleBar.closeBtn.clicked.disconnect(self.close)
118 | self.titleBar.closeBtn.clicked.connect(self.hide)
119 |
120 | self.resize(1240, 800)
121 |
--------------------------------------------------------------------------------
/gui/widgets/script/ui/info_card_widget.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | ################################################################################
4 | ## Form generated from reading UI file 'info_card_widget.ui'
5 | ##
6 | ## Created by: Qt User Interface Compiler version 6.4.3
7 | ##
8 | ## WARNING! All changes made in this file will be lost when recompiling UI file!
9 | ################################################################################
10 |
11 | from PySide6.QtCore import (QCoreApplication, QMetaObject)
12 | from PySide6.QtWidgets import (QGridLayout, QSizePolicy, QSpacerItem,
13 | QVBoxLayout)
14 |
15 | from qfluentwidgets import (SubtitleLabel)
16 |
17 | class Ui_Form(object):
18 | def setupUi(self, Form):
19 | if not Form.objectName():
20 | Form.setObjectName(u"Form")
21 | Form.resize(276, 185)
22 | self.verticalLayout = QVBoxLayout(Form)
23 | self.verticalLayout.setSpacing(0)
24 | self.verticalLayout.setObjectName(u"verticalLayout")
25 | self.verticalLayout.setContentsMargins(10, 10, 10, 10)
26 | self.title_label = SubtitleLabel(Form)
27 | self.title_label.setObjectName(u"title_label")
28 |
29 | self.verticalLayout.addWidget(self.title_label)
30 |
31 | self.grid_layout = QGridLayout()
32 | self.grid_layout.setObjectName(u"grid_layout")
33 | self.grid_layout.setHorizontalSpacing(5)
34 | self.grid_layout.setVerticalSpacing(15)
35 | self.grid_layout.setContentsMargins(20, -1, -1, -1)
36 |
37 | self.verticalLayout.addLayout(self.grid_layout)
38 |
39 | self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
40 |
41 | self.verticalLayout.addItem(self.verticalSpacer)
42 |
43 |
44 | self.retranslateUi(Form)
45 |
46 | QMetaObject.connectSlotsByName(Form)
47 | # setupUi
48 |
49 | def retranslateUi(self, Form):
50 | Form.setWindowTitle(QCoreApplication.translate("Form", u"Form", None))
51 | self.title_label.setText(QCoreApplication.translate("Form", u"Script name", None))
52 | # retranslateUi
53 |
54 |
--------------------------------------------------------------------------------
/gui/widgets/script/ui/info_card_widget.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | Form
4 |
5 |
6 |
7 | 0
8 | 0
9 | 276
10 | 185
11 |
12 |
13 |
14 | Form
15 |
16 |
17 |
18 | 0
19 |
20 |
21 | 10
22 |
23 |
24 | 10
25 |
26 |
27 | 10
28 |
29 |
30 | 10
31 |
32 | -
33 |
34 |
35 | Script name
36 |
37 |
38 |
39 | -
40 |
41 |
42 | 20
43 |
44 |
45 | 5
46 |
47 |
48 | 15
49 |
50 |
51 |
52 | -
53 |
54 |
55 | Qt::Vertical
56 |
57 |
58 |
59 | 20
60 | 40
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | CardWidget
70 | QFrame
71 |
72 | 1
73 |
74 |
75 | ElevatedCardWidget
76 | SimpleCardWidget
77 |
78 | 1
79 |
80 |
81 | SimpleCardWidget
82 | CardWidget
83 |
84 | 1
85 |
86 |
87 | SubtitleLabel
88 | QLabel
89 |
90 |
91 |
92 |
93 |
94 |
95 |
--------------------------------------------------------------------------------
/gui/widgets/script/ui/script_widget.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | ################################################################################
4 | ## Form generated from reading UI file 'script_widget.ui'
5 | ##
6 | ## Created by: Qt User Interface Compiler version 6.4.3
7 | ##
8 | ## WARNING! All changes made in this file will be lost when recompiling UI file!
9 | ################################################################################
10 |
11 | from PySide6.QtCore import (QCoreApplication, QMetaObject, QRect)
12 | from PySide6.QtWidgets import (QVBoxLayout,
13 | QWidget)
14 |
15 | from qfluentwidgets import SmoothScrollArea
16 |
17 |
18 | class Ui_Frame(object):
19 | def setupUi(self, Frame):
20 | if not Frame.objectName():
21 | Frame.setObjectName(u"Frame")
22 | Frame.resize(561, 408)
23 | self.verticalLayout = QVBoxLayout(Frame)
24 | self.verticalLayout.setSpacing(0)
25 | self.verticalLayout.setObjectName(u"verticalLayout")
26 | self.verticalLayout.setContentsMargins(0, 0, 0, 0)
27 | self.SmoothScrollArea = SmoothScrollArea(Frame)
28 | self.SmoothScrollArea.setObjectName(u"SmoothScrollArea")
29 | self.SmoothScrollArea.setWidgetResizable(True)
30 | self.scroll_widget = QWidget()
31 | self.scroll_widget.setObjectName(u"scroll_widget")
32 | self.scroll_widget.setGeometry(QRect(0, 0, 559, 406))
33 | self.SmoothScrollArea.setWidget(self.scroll_widget)
34 |
35 | self.verticalLayout.addWidget(self.SmoothScrollArea)
36 |
37 | self.retranslateUi(Frame)
38 |
39 | QMetaObject.connectSlotsByName(Frame)
40 |
41 | # setupUi
42 |
43 | def retranslateUi(self, Frame):
44 | Frame.setWindowTitle(QCoreApplication.translate("Frame", u"Frame", None))
45 | # retranslateUi
46 |
--------------------------------------------------------------------------------
/gui/widgets/script/ui/script_widget.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | Frame
4 |
5 |
6 |
7 | 0
8 | 0
9 | 561
10 | 408
11 |
12 |
13 |
14 | Frame
15 |
16 |
17 |
18 | 0
19 |
20 |
21 | 0
22 |
23 |
24 | 0
25 |
26 |
27 | 0
28 |
29 |
30 | 0
31 |
32 | -
33 |
34 |
35 | true
36 |
37 |
38 |
39 |
40 | 0
41 | 0
42 | 559
43 | 406
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | SmoothScrollArea
54 | QScrollArea
55 |
56 | 1
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/gui/widgets/script/ui/stamina.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | ################################################################################
4 | ## Form generated from reading UI file 'stamina.ui'
5 | ##
6 | ## Created by: Qt User Interface Compiler version 6.4.3
7 | ##
8 | ## WARNING! All changes made in this file will be lost when recompiling UI file!
9 | ################################################################################
10 |
11 | from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
12 | QMetaObject, QObject, QPoint, QRect,
13 | QSize, QTime, QUrl, Qt)
14 | from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
15 | QFont, QFontDatabase, QGradient, QIcon,
16 | QImage, QKeySequence, QLinearGradient, QPainter,
17 | QPalette, QPixmap, QRadialGradient, QTransform)
18 | from PySide6.QtWidgets import (QApplication, QFrame, QHBoxLayout, QSizePolicy,
19 | QSpacerItem, QVBoxLayout, QWidget)
20 |
21 | from qfluentwidgets import (CardWidget, HeaderCardWidget, PushButton, SimpleCardWidget,
22 | SmoothScrollArea)
23 |
24 | class Ui_Frame(object):
25 | def setupUi(self, Frame):
26 | if not Frame.objectName():
27 | Frame.setObjectName(u"Frame")
28 | Frame.resize(639, 517)
29 | self.verticalLayout = QVBoxLayout(Frame)
30 | self.verticalLayout.setSpacing(10)
31 | self.verticalLayout.setObjectName(u"verticalLayout")
32 | self.verticalLayout.setContentsMargins(0, 0, 0, 0)
33 | self.SmoothScrollArea = SmoothScrollArea(Frame)
34 | self.SmoothScrollArea.setObjectName(u"SmoothScrollArea")
35 | self.SmoothScrollArea.setWidgetResizable(True)
36 | self.scroll_widget = QWidget()
37 | self.scroll_widget.setObjectName(u"scroll_widget")
38 | self.scroll_widget.setGeometry(QRect(0, 0, 637, 565))
39 | self.scroll_layout = QVBoxLayout(self.scroll_widget)
40 | self.scroll_layout.setSpacing(10)
41 | self.scroll_layout.setObjectName(u"scroll_layout")
42 | self.scroll_layout.setContentsMargins(10, 10, 10, 10)
43 | self.calyx_gold_card = HeaderCardWidget(self.scroll_widget)
44 | self.calyx_gold_card.setObjectName(u"calyx_gold_card")
45 | self.calyx_gold_card.setBorderRadius(5)
46 |
47 | self.scroll_layout.addWidget(self.calyx_gold_card)
48 |
49 | self.calyx_red_card = HeaderCardWidget(self.scroll_widget)
50 | self.calyx_red_card.setObjectName(u"calyx_red_card")
51 |
52 | self.scroll_layout.addWidget(self.calyx_red_card)
53 |
54 | self.shadow_card = HeaderCardWidget(self.scroll_widget)
55 | self.shadow_card.setObjectName(u"shadow_card")
56 |
57 | self.scroll_layout.addWidget(self.shadow_card)
58 |
59 | self.cavern_card = HeaderCardWidget(self.scroll_widget)
60 | self.cavern_card.setObjectName(u"cavern_card")
61 |
62 | self.scroll_layout.addWidget(self.cavern_card)
63 |
64 | self.echo_card = HeaderCardWidget(self.scroll_widget)
65 | self.echo_card.setObjectName(u"echo_card")
66 |
67 | self.scroll_layout.addWidget(self.echo_card)
68 |
69 | self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
70 |
71 | self.scroll_layout.addItem(self.verticalSpacer)
72 |
73 | self.scroll_layout.setStretch(0, 1)
74 | self.scroll_layout.setStretch(1, 1)
75 | self.scroll_layout.setStretch(2, 1)
76 | self.scroll_layout.setStretch(4, 1)
77 | self.scroll_layout.setStretch(5, 1)
78 | self.SmoothScrollArea.setWidget(self.scroll_widget)
79 |
80 | self.verticalLayout.addWidget(self.SmoothScrollArea)
81 |
82 | self.horizontalLayout = QHBoxLayout()
83 | self.horizontalLayout.setSpacing(5)
84 | self.horizontalLayout.setObjectName(u"horizontalLayout")
85 | self.horizontalLayout.setContentsMargins(5, 5, 5, 5)
86 | self.button_no = PushButton(Frame)
87 | self.button_no.setObjectName(u"button_no")
88 |
89 | self.horizontalLayout.addWidget(self.button_no)
90 |
91 | self.button_yes = PushButton(Frame)
92 | self.button_yes.setObjectName(u"button_yes")
93 |
94 | self.horizontalLayout.addWidget(self.button_yes)
95 |
96 |
97 | self.verticalLayout.addLayout(self.horizontalLayout)
98 |
99 |
100 | self.retranslateUi(Frame)
101 |
102 | QMetaObject.connectSlotsByName(Frame)
103 | # setupUi
104 |
105 | def retranslateUi(self, Frame):
106 | Frame.setWindowTitle(QCoreApplication.translate("Frame", u"Frame", None))
107 | self.calyx_gold_card.setTitle("")
108 | self.button_no.setText(QCoreApplication.translate("Frame", u"\u53d6\u6d88", None))
109 | self.button_yes.setText(QCoreApplication.translate("Frame", u"\u786e\u5b9a", None))
110 | # retranslateUi
111 |
112 |
--------------------------------------------------------------------------------
/gui/widgets/script/ui/stamina.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | Frame
4 |
5 |
6 |
7 | 0
8 | 0
9 | 639
10 | 517
11 |
12 |
13 |
14 | Frame
15 |
16 |
17 |
18 | 10
19 |
20 |
21 | 0
22 |
23 |
24 | 0
25 |
26 |
27 | 0
28 |
29 |
30 | 0
31 |
32 | -
33 |
34 |
35 | true
36 |
37 |
38 |
39 |
40 | 0
41 | 0
42 | 637
43 | 565
44 |
45 |
46 |
47 |
48 | 10
49 |
50 |
51 | 10
52 |
53 |
54 | 10
55 |
56 |
57 | 10
58 |
59 |
60 | 10
61 |
62 |
-
63 |
71 |
72 | -
73 |
74 |
75 | -
76 |
77 |
78 | -
79 |
80 |
81 | -
82 |
83 |
84 | -
85 |
86 |
87 | Qt::Vertical
88 |
89 |
90 |
91 | 20
92 | 40
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 | -
102 |
103 |
104 | 5
105 |
106 |
107 | 5
108 |
109 |
110 | 5
111 |
112 |
113 | 5
114 |
115 |
116 | 5
117 |
118 |
-
119 |
120 |
121 | 取消
122 |
123 |
124 |
125 | -
126 |
127 |
128 | 确定
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 | PushButton
139 | QPushButton
140 |
141 |
142 |
143 | CardWidget
144 | QFrame
145 |
146 | 1
147 |
148 |
149 | SimpleCardWidget
150 | CardWidget
151 |
152 | 1
153 |
154 |
155 | HeaderCardWidget
156 | SimpleCardWidget
157 |
158 | 1
159 |
160 |
161 | SmoothScrollArea
162 | QScrollArea
163 |
164 | 1
165 |
166 |
167 |
168 |
169 |
170 |
--------------------------------------------------------------------------------
/gui/widgets/script/ui/universe.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | Frame
4 |
5 |
6 |
7 | 0
8 | 0
9 | 400
10 | 181
11 |
12 |
13 |
14 |
15 | 400
16 | 0
17 |
18 |
19 |
20 | Frame
21 |
22 |
23 |
24 | 5
25 |
26 |
27 | 10
28 |
29 |
30 | 32
31 |
32 |
33 | 10
34 |
35 |
36 | 10
37 |
38 | -
39 |
40 |
41 | 5
42 |
43 |
-
44 |
45 |
46 | 显示地图
47 |
48 |
49 | false
50 |
51 |
52 |
53 | -
54 |
55 |
56 | 调试模式
57 |
58 |
59 | false
60 |
61 |
62 |
63 | -
64 |
65 |
66 | 速通模式
67 |
68 |
69 | false
70 |
71 |
72 |
73 | -
74 |
75 |
76 | 强制更新
77 |
78 |
79 | false
80 |
81 |
82 |
83 |
84 |
85 | -
86 |
87 |
88 | 10
89 |
90 |
-
91 |
92 |
93 | 10
94 |
95 |
-
96 |
97 |
98 | 难度
99 |
100 |
101 | Qt::AlignBottom|Qt::AlignHCenter
102 |
103 |
104 |
105 | -
106 |
107 |
108 |
109 |
110 | -
111 |
112 |
113 | 10
114 |
115 |
-
116 |
117 |
118 | 命途
119 |
120 |
121 | Qt::AlignBottom|Qt::AlignHCenter
122 |
123 |
124 |
125 | -
126 |
127 |
128 |
129 |
130 | -
131 |
132 |
133 | 10
134 |
135 |
-
136 |
137 |
138 | 模拟宇宙编号
139 |
140 |
141 | Qt::AlignBottom|Qt::AlignHCenter
142 |
143 |
144 |
145 | -
146 |
147 |
148 |
149 |
150 |
151 |
152 | -
153 |
154 |
155 | 5
156 |
157 |
158 | 5
159 |
160 |
-
161 |
162 |
163 | 取消
164 |
165 |
166 |
167 | -
168 |
169 |
170 | 保存
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 | CheckBox
181 | QCheckBox
182 |
183 |
184 |
185 | ComboBox
186 | QPushButton
187 |
188 |
189 |
190 | PushButton
191 | QPushButton
192 |
193 |
194 |
195 | StrongBodyLabel
196 | QLabel
197 |
198 |
199 |
200 |
201 |
202 |
203 |
--------------------------------------------------------------------------------
/gui/widgets/script/universe_window.py:
--------------------------------------------------------------------------------
1 | from qframelesswindow import FramelessDialog
2 |
3 | from .ui.universe import Ui_Frame
4 |
5 |
6 | class UniverseWindow(FramelessDialog, Ui_Frame):
7 | def __init__(self, parent=None):
8 | super().__init__(parent)
9 | self.setupUi(self)
10 | self.__init_widget()
11 |
12 | def __init_combobox(self):
13 | from config import cfg
14 | difficulty = ["1", "2", "3", "4", "5"]
15 | fate = ["存护", "记忆", "虚无", "丰饶", "巡猎", "毁灭", "欢愉", "繁育"]
16 | number = ["3", "4", "5", "6", "7"]
17 | self.combobox_difficulty.addItems(difficulty)
18 | self.combobox_difficulty.setCurrentText(str(cfg.get(cfg.universe_difficult)))
19 |
20 | self.combobox_fate.addItems(fate)
21 | self.combobox_fate.setCurrentText(str(cfg.get(cfg.universe_fate)))
22 |
23 | self.combobox_number.addItems(number)
24 | self.combobox_number.setCurrentText(str(cfg.get(cfg.universe_number)))
25 |
26 | def __init_checkbox(self):
27 | from config import cfg
28 | self.checkbox_show_map.setChecked(cfg.get(cfg.universe_show_map))
29 | self.checkbox_speed.setChecked(cfg.get(cfg.universe_speed))
30 | self.checkbox_debug.setChecked(cfg.get(cfg.universe_debug))
31 | self.checkbox_update.setChecked(cfg.get(cfg.universe_update))
32 |
33 | def __on_yes_button_clicked(self):
34 | """yes button clicked slot"""
35 | from config import cfg
36 | difficulty = self.combobox_difficulty.currentText()
37 | fate = self.combobox_fate.currentText()
38 | number = self.combobox_number.currentText()
39 | show_map = int(self.checkbox_show_map.isChecked())
40 | speed = int(self.checkbox_speed.isChecked())
41 | debug = int(self.checkbox_debug.isChecked())
42 | update = int(self.checkbox_update.isChecked())
43 |
44 | cfg.set(cfg.universe_difficult, int(difficulty))
45 | cfg.set(cfg.universe_fate, fate)
46 | cfg.set(cfg.universe_number, int(number))
47 | cfg.set(cfg.universe_show_map, show_map)
48 | cfg.set(cfg.universe_speed, speed)
49 | cfg.set(cfg.universe_debug, debug)
50 | cfg.set(cfg.universe_update, update)
51 |
52 | def __connect_signal_to_slot(self):
53 | # close button disconnect and connect to hide slot
54 | self.titleBar.closeBtn.clicked.disconnect(self.close)
55 | self.titleBar.closeBtn.clicked.connect(self.hide)
56 |
57 | self.button_no.clicked.connect(self.__init_checkbox)
58 | self.button_no.clicked.connect(self.__init_combobox)
59 | self.button_no.clicked.connect(self.hide)
60 |
61 | self.button_yes.clicked.connect(self.__on_yes_button_clicked)
62 | self.button_yes.clicked.connect(self.hide)
63 |
64 | def __init_widget(self):
65 | self.__init_checkbox()
66 | self.__init_combobox()
67 | self.__connect_signal_to_slot()
68 |
--------------------------------------------------------------------------------
/gui/widgets/setting/ui/settingWidget.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | ################################################################################
4 | ## Form generated from reading UI file 'settingWidget.ui'
5 | ##
6 | ## Created by: Qt User Interface Compiler version 6.4.3
7 | ##
8 | ## WARNING! All changes made in this file will be lost when recompiling UI file!
9 | ################################################################################
10 |
11 | from PySide6.QtCore import (QCoreApplication, QMetaObject, QRect)
12 | from PySide6.QtWidgets import (QVBoxLayout,
13 | QWidget)
14 |
15 | from qfluentwidgets import SmoothScrollArea
16 |
17 |
18 | class Ui_Frame(object):
19 | def setupUi(self, Frame):
20 | if not Frame.objectName():
21 | Frame.setObjectName(u"Frame")
22 | Frame.resize(629, 561)
23 | self.verticalLayout = QVBoxLayout(Frame)
24 | self.verticalLayout.setSpacing(0)
25 | self.verticalLayout.setObjectName(u"verticalLayout")
26 | self.verticalLayout.setContentsMargins(0, 0, 0, 0)
27 | self.SmoothScrollArea = SmoothScrollArea(Frame)
28 | self.SmoothScrollArea.setObjectName(u"SmoothScrollArea")
29 | self.SmoothScrollArea.setWidgetResizable(True)
30 | self.scrollWidget = QWidget()
31 | self.scrollWidget.setObjectName(u"scrollWidget")
32 | self.scrollWidget.setGeometry(QRect(0, 0, 627, 559))
33 | self.SmoothScrollArea.setWidget(self.scrollWidget)
34 |
35 | self.verticalLayout.addWidget(self.SmoothScrollArea)
36 |
37 | self.retranslateUi(Frame)
38 |
39 | QMetaObject.connectSlotsByName(Frame)
40 |
41 | # setupUi
42 |
43 | def retranslateUi(self, Frame):
44 | Frame.setWindowTitle(QCoreApplication.translate("Frame", u"Frame", None))
45 | # retranslateUi
46 |
--------------------------------------------------------------------------------
/gui/widgets/setting/ui/settingWidget.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | Frame
4 |
5 |
6 |
7 | 0
8 | 0
9 | 629
10 | 561
11 |
12 |
13 |
14 | Frame
15 |
16 |
17 |
18 | 0
19 |
20 |
21 | 0
22 |
23 |
24 | 0
25 |
26 |
27 | 0
28 |
29 |
30 | 0
31 |
32 | -
33 |
34 |
35 | true
36 |
37 |
38 |
39 |
40 | 0
41 | 0
42 | 627
43 | 559
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | SmoothScrollArea
54 | QScrollArea
55 |
56 | 1
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/gui/widgets/sponsorship/money.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/sponsorship/money.jpg
--------------------------------------------------------------------------------
/gui/widgets/sponsorship/zyx.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/gui/widgets/sponsorship/zyx.py
--------------------------------------------------------------------------------
/images/QR/alipayQR.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/QR/alipayQR.png
--------------------------------------------------------------------------------
/images/QR/wechatQR.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/QR/wechatQR.png
--------------------------------------------------------------------------------
/images/addChallenge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/addChallenge.png
--------------------------------------------------------------------------------
/images/areaNavigation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/areaNavigation.png
--------------------------------------------------------------------------------
/images/autoFight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/autoFight.png
--------------------------------------------------------------------------------
/images/autoFight2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/autoFight2.png
--------------------------------------------------------------------------------
/images/autoFight3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/autoFight3.png
--------------------------------------------------------------------------------
/images/autoFight4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/autoFight4.png
--------------------------------------------------------------------------------
/images/ballNavigation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/ballNavigation.png
--------------------------------------------------------------------------------
/images/book.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/book.png
--------------------------------------------------------------------------------
/images/book2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/book2.png
--------------------------------------------------------------------------------
/images/calyx_gold/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/calyx_gold/1.png
--------------------------------------------------------------------------------
/images/calyx_gold/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/calyx_gold/2.png
--------------------------------------------------------------------------------
/images/calyx_gold/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/calyx_gold/3.png
--------------------------------------------------------------------------------
/images/calyx_red/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/calyx_red/1.png
--------------------------------------------------------------------------------
/images/calyx_red/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/calyx_red/2.png
--------------------------------------------------------------------------------
/images/calyx_red/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/calyx_red/3.png
--------------------------------------------------------------------------------
/images/calyx_red/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/calyx_red/4.png
--------------------------------------------------------------------------------
/images/calyx_red/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/calyx_red/5.png
--------------------------------------------------------------------------------
/images/calyx_red/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/calyx_red/6.png
--------------------------------------------------------------------------------
/images/calyx_red/7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/calyx_red/7.png
--------------------------------------------------------------------------------
/images/cancel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/cancel.png
--------------------------------------------------------------------------------
/images/cavern/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/cavern/1.png
--------------------------------------------------------------------------------
/images/cavern/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/cavern/2.png
--------------------------------------------------------------------------------
/images/cavern/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/cavern/3.png
--------------------------------------------------------------------------------
/images/cavern/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/cavern/4.png
--------------------------------------------------------------------------------
/images/cavern/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/cavern/5.png
--------------------------------------------------------------------------------
/images/cavern/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/cavern/6.png
--------------------------------------------------------------------------------
/images/cavern/7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/cavern/7.png
--------------------------------------------------------------------------------
/images/challenge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/challenge.png
--------------------------------------------------------------------------------
/images/challengeCompleted.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/challengeCompleted.png
--------------------------------------------------------------------------------
/images/character/arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/character/arrow.png
--------------------------------------------------------------------------------
/images/character/arrowDown.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/character/arrowDown.png
--------------------------------------------------------------------------------
/images/character/arrowLeft.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/character/arrowLeft.png
--------------------------------------------------------------------------------
/images/character/arrowRight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/character/arrowRight.png
--------------------------------------------------------------------------------
/images/character/localArrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/character/localArrow.png
--------------------------------------------------------------------------------
/images/commission/commission.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/commission/commission.png
--------------------------------------------------------------------------------
/images/commission/getCommission.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/commission/getCommission.png
--------------------------------------------------------------------------------
/images/commission/isCommission.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/commission/isCommission.png
--------------------------------------------------------------------------------
/images/commission/pending.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/commission/pending.png
--------------------------------------------------------------------------------
/images/commission/pendingCommission.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/commission/pendingCommission.png
--------------------------------------------------------------------------------
/images/commission/recommission.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/commission/recommission.png
--------------------------------------------------------------------------------
/images/confirm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/confirm.png
--------------------------------------------------------------------------------
/images/dailyTask.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/dailyTask.png
--------------------------------------------------------------------------------
/images/dailyTaskSelected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/dailyTaskSelected.png
--------------------------------------------------------------------------------
/images/echo/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/echo/1.png
--------------------------------------------------------------------------------
/images/echo/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/echo/2.png
--------------------------------------------------------------------------------
/images/echo/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/echo/3.png
--------------------------------------------------------------------------------
/images/enterGame.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/enterGame.png
--------------------------------------------------------------------------------
/images/exitCopies.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/exitCopies.png
--------------------------------------------------------------------------------
/images/fightIsOver.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/fightIsOver.png
--------------------------------------------------------------------------------
/images/fuel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/fuel.png
--------------------------------------------------------------------------------
/images/index.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/index.png
--------------------------------------------------------------------------------
/images/indexSelected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/indexSelected.png
--------------------------------------------------------------------------------
/images/mandate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/mandate.png
--------------------------------------------------------------------------------
/images/noStamina.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/noStamina.png
--------------------------------------------------------------------------------
/images/phone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/phone.png
--------------------------------------------------------------------------------
/images/selectedConfirm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/selectedConfirm.png
--------------------------------------------------------------------------------
/images/selectedFuel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/selectedFuel.png
--------------------------------------------------------------------------------
/images/selectedStellarJade.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/selectedStellarJade.png
--------------------------------------------------------------------------------
/images/shadow/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/shadow/1.png
--------------------------------------------------------------------------------
/images/shadow/10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/shadow/10.png
--------------------------------------------------------------------------------
/images/shadow/11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/shadow/11.png
--------------------------------------------------------------------------------
/images/shadow/12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/shadow/12.png
--------------------------------------------------------------------------------
/images/shadow/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/shadow/2.png
--------------------------------------------------------------------------------
/images/shadow/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/shadow/3.png
--------------------------------------------------------------------------------
/images/shadow/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/shadow/4.png
--------------------------------------------------------------------------------
/images/shadow/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/shadow/5.png
--------------------------------------------------------------------------------
/images/shadow/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/shadow/6.png
--------------------------------------------------------------------------------
/images/shadow/7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/shadow/7.png
--------------------------------------------------------------------------------
/images/shadow/8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/shadow/8.png
--------------------------------------------------------------------------------
/images/shadow/9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/shadow/9.png
--------------------------------------------------------------------------------
/images/startChallenge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/startChallenge.png
--------------------------------------------------------------------------------
/images/startGame.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/startGame.png
--------------------------------------------------------------------------------
/images/stellarJade.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/stellarJade.png
--------------------------------------------------------------------------------
/images/transmission.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/transmission.png
--------------------------------------------------------------------------------
/images/world/questionMask.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/world/questionMask.png
--------------------------------------------------------------------------------
/images/world/selectJar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/world/selectJar.png
--------------------------------------------------------------------------------
/images/world/selectMonster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/world/selectMonster.png
--------------------------------------------------------------------------------
/images/world/send1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/world/send1.png
--------------------------------------------------------------------------------
/images/world/send2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/world/send2.png
--------------------------------------------------------------------------------
/images/world/send3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/world/send3.png
--------------------------------------------------------------------------------
/images/world/send4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/world/send4.png
--------------------------------------------------------------------------------
/images/world/send5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/world/send5.png
--------------------------------------------------------------------------------
/images/world/sendText.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/world/sendText.png
--------------------------------------------------------------------------------
/images/world/warning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/images/world/warning.png
--------------------------------------------------------------------------------
/log.py:
--------------------------------------------------------------------------------
1 | import logging
2 | from datetime import datetime
3 |
4 | auto_sr = logging.getLogger("")
5 | auto_sr.setLevel(logging.DEBUG)
6 |
7 | stream_handler = logging.StreamHandler()
8 | stream_handler.setLevel(logging.DEBUG)
9 | formatter = logging.Formatter("%(levelname)s - %(message)s")
10 | stream_handler.setFormatter(formatter)
11 | auto_sr.addHandler(stream_handler)
12 |
13 |
14 | class Logger:
15 | widget = None
16 |
17 | @classmethod
18 | def transmit(cls, message, filename, function, level=logging.DEBUG):
19 | if cls.widget is None:
20 | return
21 | level_to_str = {logging.DEBUG: "DEBUG", logging.INFO: "INFO",
22 | logging.WARNING: "WARNING", logging.ERROR: "ERROR",
23 | logging.CRITICAL: "CRITICAL"}
24 | level_str = level_to_str[level]
25 | m = f"[{level_str}] {get_time()} [{filename}({function})]: {message}"
26 | cls.widget.add.emit(m)
27 |
28 |
29 | def get_stack():
30 | import inspect
31 | stack = inspect.stack()[2]
32 | return stack.filename, stack.function
33 |
34 |
35 | def get_time():
36 | time = datetime.now()
37 | return time.strftime("%Y-%m-%d %H:%M:%S")
38 |
39 |
40 | def info(mes):
41 | filename, function = get_stack()
42 | auto_sr.info(f"{get_time()} [{filename}({function})]: {mes}")
43 | Logger.transmit(mes, filename, function, level=logging.INFO)
44 |
45 |
46 | def debug(mes):
47 | filename, function = get_stack()
48 | auto_sr.debug(f"{get_time()} [{filename}({function})]: {mes}")
49 | Logger.transmit(mes, filename, function, level=logging.DEBUG)
50 |
51 |
52 | def warning(mes):
53 | filename, function = get_stack()
54 | auto_sr.warning(f"{get_time()} [{filename}({function})]: {mes}")
55 | Logger.transmit(mes, filename, function, level=logging.WARNING)
56 |
57 |
58 | def error(mes):
59 | filename, function = get_stack()
60 | auto_sr.error(f"{get_time()} [{filename}({function})]: {mes}")
61 | Logger.transmit(mes, filename, function, level=logging.ERROR)
62 |
63 |
64 | def critical(mes):
65 | filename, function = get_stack()
66 | auto_sr.critical(f"{get_time()} [{filename}({function})]: {mes}")
67 | Logger.transmit(mes, filename, function, level=logging.CRITICAL)
68 |
69 |
70 | def set_log_widget(widget):
71 | Logger.widget = widget
72 |
73 |
74 | if __name__ == '__main__':
75 | info("test")
76 | debug("test")
77 | warning("test")
78 | error("test")
79 | critical("test")
80 | pass
81 |
--------------------------------------------------------------------------------
/logs/log.txt:
--------------------------------------------------------------------------------
1 | ERROR [2023-09-11 20:34:11,537] [log.py:60] 2023-09-11 20:34:11 [F:\AutoStarRail\main.py(exception_message)]: 捕获到异常: ModuleNotFoundError, No module named 'yaml'
2 |
--------------------------------------------------------------------------------
/main.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import os
3 | from concurrent.futures import Future
4 | from typing import Tuple, Callable
5 |
6 | from PySide6.QtCore import Signal
7 | from PySide6.QtGui import QIcon
8 | from PySide6.QtWidgets import QApplication
9 |
10 | import config
11 | import log
12 | import threadpool
13 | from config import cfg
14 | from gui.main_window import MainWindow
15 |
16 |
17 | def get_time():
18 | from datetime import datetime
19 | return datetime.now().strftime("%Y年%m月%d日 %H:%M:%S")
20 |
21 |
22 | class AutoStarRail(MainWindow):
23 | exception_message_signal = Signal(Future)
24 | not_func_message_signal = Signal()
25 |
26 | def __init__(self):
27 | super().__init__()
28 |
29 | self.__init_widget()
30 |
31 | def exception_message(self, f: Future):
32 | """捕获异常并弹出对话框"""
33 | from qfluentwidgets import MessageBox
34 | try:
35 | f.result()
36 | except Exception as e:
37 | log.error(f"捕获到异常: {type(e).__name__}, {e}")
38 | dialog = MessageBox(type(e).__name__, str(e), self.window())
39 | dialog.exec()
40 |
41 | def not_function_message(self):
42 | from qfluentwidgets import MessageBox
43 | dialog = MessageBox("温馨提示", "该功能暂不开放", self.window())
44 | dialog.exec()
45 |
46 | def text_to_method(self, text) -> Tuple[Callable, bool]:
47 | from gui.widgets import WarningDialog
48 | from script.stamina.main import Stamina
49 | from script.universe.main import Universe
50 | from script.commission.main import Commission
51 | from script.abyss.main import Abyss
52 | d = {
53 | "体力": Stamina.run,
54 | "模拟宇宙": Universe.run_universe,
55 | "委托": Commission.run,
56 | "深渊": Abyss.run,
57 | }
58 | if self.is_first:
59 | WarningDialog(self.window())
60 | self.is_first = False
61 | if text not in d:
62 | return self.not_func_message_signal.emit, True
63 | return d[text], False
64 |
65 | def __on_run_interface_button_clicked_slot(self):
66 | combobox = self.run_interface.combobox
67 | text = combobox.currentText()
68 | method, err = self.text_to_method(text)
69 | # 运行脚本
70 | future = threadpool.script_thread.submit(method)
71 | future.add_done_callback(self.exception_message_signal.emit)
72 | future.add_done_callback(self.update_info_card)
73 |
74 | if text == "体力":
75 | now = get_time()
76 | cfg.set(cfg.last_stamina_time, now)
77 |
78 | def __on_angle_button_slot(self):
79 | from script.universe.main import Universe
80 | future = threadpool.script_thread.submit(Universe.run_align_angle)
81 | future.add_done_callback(self.exception_message_signal.emit)
82 | future.add_done_callback(self.update_info_card)
83 |
84 | def __connect_signal_to_slot(self):
85 | # AutoStarRail
86 | self.exception_message_signal.connect(self.exception_message)
87 | self.not_func_message_signal.connect(self.not_function_message)
88 | # run interface
89 | self.run_interface.button_run.clicked.connect(self.__on_run_interface_button_clicked_slot)
90 | self.run_interface.button_angle.clicked.connect(self.__on_angle_button_slot)
91 |
92 | def __init_widget(self):
93 | import ctypes
94 | self.__connect_signal_to_slot()
95 |
96 | icon = os.path.join(config.abspath, "doc", "help.ico")
97 | self.setWindowIcon(QIcon(icon))
98 | self.setWindowTitle("AutoStarRail")
99 |
100 | # 设置应用程序
101 | appid = 'AutoStarRail' # 应用程序名称
102 | ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(appid) # 注册应用使系统能识别
103 |
104 |
105 | # 将Auto_Simulated_Universe添加到搜索路径
106 | sys.path.append(os.path.join(config.abspath, "Auto_Simulated_Universe"))
107 |
108 | # 设置应用程序图标
109 | app = QApplication(sys.argv)
110 | auto_star_rail = AutoStarRail()
111 | auto_star_rail.show()
112 | sys.exit(app.exec())
113 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | certifi
2 | charset-normalizer
3 | coloredlogs
4 | darkdetect
5 | decorator
6 | EasyProcess
7 | entrypoint2
8 | flatbuffers
9 | humanfriendly
10 | idna
11 | keyboard
12 | MouseInfo
13 | mpmath
14 | mss
15 | numpy
16 | onnxruntime
17 | opencv-python
18 | packaging
19 | Pillow
20 | ppocr-onnx
21 | protobuf
22 | PyAutoGUI
23 | pyclipper
24 | PyGetWindow
25 | PyMsgBox
26 | pyperclip
27 | pyreadline3
28 | PyRect
29 | pyscreenshot
30 | PyScreeze
31 | PySide6
32 | PySide6-Addons
33 | PySide6-Essentials
34 | PySide6-Fluent-Widgets
35 | PySideSix-Frameless-Window
36 | pytweening
37 | pyuac
38 | pywin32
39 | requests
40 | shapely
41 | shiboken6
42 | sympy
43 | tee
44 | urllib3
45 | pynput
46 | plyer
47 | winotify
--------------------------------------------------------------------------------
/script/abyss/main.py:
--------------------------------------------------------------------------------
1 | import os
2 | import shutil
3 |
4 | import log
5 | import game
6 | from config import abspath
7 | from script.utils.interface import AbyssUtils
8 |
9 |
10 | class Abyss:
11 | @classmethod
12 | def run(cls):
13 | from Auto_Simulated_Universe.abyss import Abyss as Auto_Su_Abyss
14 | cls.check_file_exist()
15 | cls.config_to_auto_su_config()
16 | game.set_foreground()
17 | abyss_utils = AbyssUtils()
18 | abyss_utils.start()
19 | abyss_utils.into_abyss()
20 | abyss_utils.stop()
21 |
22 | os.chdir(os.path.join(abspath, "Auto_Simulated_Universe"))
23 | abyss = Auto_Su_Abyss()
24 | abyss.start_abyss()
25 | os.chdir(abspath)
26 |
27 | @classmethod
28 | def config_to_auto_su_config(cls):
29 | """配队数据传递至abyss的info.yml"""
30 | import yaml
31 | from config import cfg
32 | path = os.path.join(abspath, r"Auto_Simulated_Universe\abyss\info.yml")
33 | with open(path, 'w', encoding='utf-8') as f:
34 | d = {
35 | "order_text": cfg.get(cfg.abyss_list)
36 | }
37 | yaml.dump(d, f)
38 |
39 | @classmethod
40 | def check_file_exist(cls):
41 | path = os.path.join(abspath, r"Auto_Simulated_Universe\abyss\info_example.yml")
42 | target = os.path.join(abspath, r"Auto_Simulated_Universe\abyss\info.yml")
43 | if not os.path.exists(target):
44 | try:
45 | log.debug("info.yml不存在,复制info_example.yml")
46 | shutil.copyfile(path, target)
47 | except Exception as e:
48 | log.error("info_example.yml不存在,自己创建一个")
49 | # 有点懒,有空再写 0。0
50 | pass
51 | else:
52 | log.debug("info.yml存在")
53 |
54 |
55 | if __name__ == "__main__":
56 | Abyss.run()
57 |
--------------------------------------------------------------------------------
/script/commission/data.py:
--------------------------------------------------------------------------------
1 | TITLE_TO_COMMISSION = {
2 | "专属材料": ["九十亿个名字", "毁灭者的覆灭", "寒冬的战士们", "生而服从", "根除恶孽", "火帝动炉销剑戟"],
3 | "经验材料/信用点": ["无名之地,无名之人", "阿卡夏记录", "看不见的手"],
4 | "合成材料": ["生命之泉", "被废弃与损害的", "黄金大地", "风暴中怒放的花", "偃师传说", "赡养人类"],
5 | }
6 | TITLE_COUNT = len(TITLE_TO_COMMISSION)
7 |
--------------------------------------------------------------------------------
/script/commission/main.py:
--------------------------------------------------------------------------------
1 | import time
2 |
3 | import cv2
4 | import numpy as np
5 | import pyautogui
6 |
7 | import log
8 | import game
9 | from script.commission.data import TITLE_COUNT
10 | from script.utils import (get_text_position, wait_text, window, mouse, template_path, cv_utils, win_message,
11 | wait_img, match_template)
12 |
13 |
14 | class Commission:
15 | message = False
16 |
17 | @classmethod
18 | def to_commission(cls):
19 | log.debug("尝试打开委托界面")
20 | pyautogui.press("esc")
21 | pos = wait_text(window.get_screenshot, "委托")
22 | mouse.click_positions(pos)
23 | wait_img(template_path.IS_COMMISSION)
24 |
25 | @classmethod
26 | def get_pending_point(cls) -> list:
27 | """
28 | 查找所有感叹号的位置
29 | """
30 | screenshot = window.get_screenshot()
31 | template = cv2.imread(template_path.PENDING)
32 | h, w, _ = template.shape # 获取模板图宽和高
33 |
34 | # 转HSV
35 | screenshot_hsv = cv2.cvtColor(screenshot, cv2.COLOR_BGR2HSV)
36 | template_hsv = cv2.cvtColor(template, cv2.COLOR_BGR2HSV)
37 |
38 | lower = np.array([0, 0, 63])
39 | upper = np.array([2, 255, 255])
40 |
41 | mask1 = cv2.inRange(screenshot_hsv, lower, upper)
42 | mask2 = cv2.inRange(template_hsv, lower, upper)
43 |
44 | screenshot = cv2.bitwise_and(screenshot, screenshot, mask=mask1)
45 | template = cv2.bitwise_and(template, template, mask=mask2)
46 |
47 | result = cv2.matchTemplate(screenshot, template, cv2.TM_CCOEFF_NORMED)
48 |
49 | # 设定阈值
50 | threshold = 0.85
51 |
52 | # 找到所有匹配位置
53 | loc = np.where(result >= threshold)
54 | point = [] # 存储感叹号全局坐标
55 |
56 | for pt in zip(*loc[::-1]):
57 | top_left = pt
58 | point.append(top_left)
59 |
60 | return cv_utils.remove_same_position(point, 3)
61 |
62 | @classmethod
63 | def run(cls):
64 | game.set_foreground()
65 | game.to_game_main()
66 | cls.to_commission()
67 | time.sleep(1)
68 | if not cls.get_pending_point():
69 | log.info("没有需要清理的委托")
70 | win_message("委托", "没有需要清理的委托")
71 | return
72 | while cls.get_pending_point():
73 | pending_pos = cls.get_pending_point()
74 | pending_pos.sort(key=lambda x: x[1]) # 按y排序
75 | title_y = pending_pos[0][1]
76 | error_v = 3
77 | title_y_lower, title_y_upper = title_y - error_v, title_y + error_v
78 | title_pos = [point for point in pending_pos if title_y_lower <= point[1] <= title_y_upper]
79 | if len(title_pos) > TITLE_COUNT:
80 | log.error(f"委托标题应为{TITLE_COUNT},实际为{len(title_pos)}")
81 |
82 | for point in title_pos:
83 | log.info("移动至委托标题")
84 | mouse.click_position(point)
85 | time.sleep(1.5)
86 |
87 | while commission_pos := cls.get_pending_point():
88 | for commission_point in commission_pos:
89 | if title_y_lower <= commission_point[1] <= title_y_upper:
90 | # 跳过标题
91 | continue
92 | else:
93 | # 委托任务
94 | mouse.click_position(commission_point)
95 | time.sleep(1)
96 |
97 | wait_img(template_path.GET_COMMISSION)
98 | get_pos = match_template(window.get_screenshot(),
99 | template_path.GET_COMMISSION)
100 | mouse.click_position(get_pos, direction="bottomRight", val=30)
101 |
102 | wait_img(template_path.RE_COMMISSION)
103 | again = match_template(window.get_screenshot(),
104 | template_path.RE_COMMISSION,
105 | threshold=0.9)
106 | mouse.click_position(again)
107 | time.sleep(1)
108 | mouse.click_position(again, direction="bottomRight", val=30)
109 | break
110 | else:
111 | # 只剩标题
112 | break
113 | win_message("委托", "委托自动化完成")
114 |
115 |
116 | if __name__ == '__main__':
117 | Commission.run()
118 |
--------------------------------------------------------------------------------
/script/daily_task/data.py:
--------------------------------------------------------------------------------
1 | title = {"遗器", "忘却之庭", "模拟宇宙"}
--------------------------------------------------------------------------------
/script/daily_task/main.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/daily_task/main.py
--------------------------------------------------------------------------------
/script/interface.py:
--------------------------------------------------------------------------------
1 | """
2 | 脚本接口
3 | 用于调用所有接口
4 | """
--------------------------------------------------------------------------------
/script/stamina/data.py:
--------------------------------------------------------------------------------
1 | CN_NAME = {
2 | "calyx_gold": "金",
3 | "calyx_red": "赤",
4 | "cavern": "侵蚀隧洞",
5 | "shadow": "凝滞虚影",
6 | "echo": "历战余响"
7 | }
8 |
9 |
10 | def name_to_template(name: str):
11 | from script.utils import template_path
12 | name = name.upper()
13 | template = "template_path." + name
14 | return eval(template)
15 |
--------------------------------------------------------------------------------
/script/stamina/main.py:
--------------------------------------------------------------------------------
1 | import time
2 | from math import sqrt, pow, inf
3 |
4 | import cv2
5 | import pyautogui
6 |
7 | import game
8 | import log
9 | from script.utils import (match_template, match_template_gray, template_path, window, mouse, wait_img,
10 | get_text_position, where_img, wait_text, Role, win_message)
11 | from script.stamina.data import CN_NAME, name_to_template
12 |
13 |
14 | class Stamina:
15 | @classmethod
16 | def click_book(cls):
17 | log.info("点击书本")
18 | pos = match_template_gray(window.get_screenshot(), template_path.BOOK)
19 | pyautogui.keyDown('alt')
20 | mouse.click_position(pos)
21 | pyautogui.keyUp('alt')
22 |
23 | @classmethod
24 | def click_index(cls):
25 | log.info("点击生存索引")
26 | pos = match_template(window.get_screenshot(), template_path.INDEX)
27 | if pos == (-1, -1):
28 | pos = match_template(window.get_screenshot(), template_path.INDEX_SELECTED)
29 | mouse.click_position(pos)
30 |
31 | @classmethod
32 | def run(cls):
33 | from config import cfg
34 | game.set_foreground() # 将游戏设置到前台
35 | for name, count in cfg.last_stamina.value.items():
36 | log.info(f"副本{name},次数{count}")
37 | if count == 0:
38 | continue
39 | while count > 0:
40 | game.to_game_main()
41 | Stamina.click_book()
42 | wait_img(template_path.BOOK2, mode="gray")
43 | time.sleep(2)
44 | Stamina.click_index()
45 | time.sleep(1) # 等待过渡动画结束
46 | split_name = name.split('_')
47 | # 特殊判断,拟造花萼金和赤
48 | if split_name[1] in ["gold", "red"]:
49 | split_name = split_name[0] + '_' + split_name[1]
50 | else:
51 | split_name = split_name[0]
52 | target = CN_NAME[split_name]
53 | pos = get_text_position(window.get_screenshot(), "模拟宇宙")
54 | mouse.click_positions(pos)
55 | if target == "侵蚀隧洞" or target == "历战余响":
56 | mouse.mouse_scroll(2)
57 | time.sleep(1)
58 | target_pos = get_text_position(window.get_screenshot(), target)
59 | mouse.click_positions(target_pos)
60 | time.sleep(1)
61 |
62 | template = name_to_template(split_name + '_' + '1')
63 | pos = match_template(window.get_screenshot(), template)
64 | mouse.click_position(pos)
65 |
66 | template = name_to_template(name)
67 | while True:
68 | pos = match_template(window.get_screenshot(), template)
69 | if pos != (-1, -1):
70 | break
71 | mouse.mouse_scroll(3)
72 | mouse.click_position(pos)
73 | h, w = cv2.imread(template).shape[:2]
74 | template_center = (pos[0] + w // 2, pos[1] + h // 2)
75 |
76 | # 处理传送点坐标位置
77 | log.info("计算对应传送点按钮位置")
78 | position_list = where_img(window.get_screenshot(), template_path.TRANSMISSION) # 获取所有传送按钮坐标
79 | d = inf
80 | pos = (-1, -1)
81 | for positions in position_list:
82 | d_temp = sqrt(pow(positions[0] - template_center[0], 2) + pow(positions[1] - template_center[1], 2))
83 | if d_temp < d:
84 | d = d_temp
85 | pos = positions
86 | h, w = cv2.imread(template_path.TRANSMISSION).shape[:2]
87 | mouse.click_position((pos[0] + w // 2, pos[1] + h // 2))
88 | time.sleep(2)
89 |
90 | # 根据需求增加挑战次数,若超出6次则只增加6次
91 | log.info("添加挑战次数")
92 | wait_text(window.get_screenshot, "挑战")
93 | pos = match_template(window.get_screenshot(), template_path.ADD_CHALLENGE)
94 | if count >= 6:
95 | for _ in range(5):
96 | mouse.click_position(pos)
97 | time.sleep(0.1)
98 | count -= 6
99 | else:
100 | for _ in range(count - 1):
101 | mouse.click_position(pos)
102 | time.sleep(0.1)
103 | count = 0
104 |
105 | # 点击挑战
106 | challenge_pos = wait_text(window.get_screenshot, "挑战")
107 | mouse.click_positions(challenge_pos)
108 |
109 | # 点击开始挑战
110 | start_challenge_pos = wait_text(window.get_screenshot, "开始挑战")
111 | mouse.click_positions(start_challenge_pos)
112 |
113 | # 凝滞虚影需要手动攻击
114 | if "shadow" in name:
115 | log.info("需要移动后攻击")
116 | time.sleep(1)
117 | pyautogui.keyDown('w')
118 | time.sleep(3)
119 | pyautogui.keyUp('w')
120 | pyautogui.click()
121 |
122 | wait_text(game.get_screenshot, "战斗开始") # 等待进入战斗界面
123 | auto_fight_pos = match_template_gray(window.get_screenshot(), template_path.AUTO_FIGHT, threshold=0.9)
124 | if auto_fight_pos != (-1, -1):
125 | mouse.click_position(auto_fight_pos)
126 |
127 | wait_img(template_path.EXIT_COPIES)
128 | exit_pos = match_template(window.get_screenshot(), template_path.EXIT_COPIES)
129 | h, w = cv2.imread(template_path.EXIT_COPIES).shape[:2]
130 | mouse.click_position((exit_pos[0] + w // 2, exit_pos[1] + h // 2))
131 | log.info("运行结束")
132 | win_message("AutoStarRail", "体力脚本运行结束")
133 |
134 |
135 | if __name__ == "__main__":
136 | time.sleep(0.5)
137 | Stamina.run()
138 |
--------------------------------------------------------------------------------
/script/universe/main.py:
--------------------------------------------------------------------------------
1 | import os
2 | import sys
3 | import traceback
4 |
5 | import game
6 | import log
7 | from config import cfg, abspath
8 | from script.utils.interface import UniverseUtils as Utiles
9 |
10 | sys.path.append(os.path.join(abspath, "Auto_Simulated_Universe"))
11 |
12 |
13 | class Universe:
14 | su = None
15 |
16 | @classmethod
17 | def run_universe(cls):
18 | from Auto_Simulated_Universe.states import SimulatedUniverse
19 | game.set_foreground()
20 | my_utiles = Utiles()
21 | my_utiles.start()
22 | my_utiles.into_universe()
23 | my_utiles.stop()
24 | # 改变工作目录,Auto_Simulated_Universe使用了大量相对路径
25 | os.chdir(os.path.join(abspath, "Auto_Simulated_Universe"))
26 | cls.config_to_auto_simulated_universe_config()
27 | cls.su = SimulatedUniverse(cfg.get(cfg.universe_find), cfg.get(cfg.universe_debug),
28 | cfg.get(cfg.universe_show_map), cfg.get(cfg.universe_speed),
29 | bonus=cfg.get(cfg.universe_bonus), update=cfg.get(cfg.universe_update))
30 | try:
31 | cls.su.start()
32 | except Exception:
33 | traceback.print_exc()
34 | finally:
35 | cls.su.stop()
36 | os.chdir(abspath)
37 |
38 | @classmethod
39 | def run_align_angle(cls):
40 | from Auto_Simulated_Universe import align_angle
41 | from utils.config import config # 不这样导入就只有第一次校准有效
42 | os.chdir(os.path.join(abspath, "Auto_Simulated_Universe"))
43 | align_angle.main()
44 | cfg.set(cfg.universe_angle, config.multi) # 更新角度误差
45 | os.chdir(abspath)
46 |
47 | @classmethod
48 | def stop_universe(cls):
49 | cls.su.stop()
50 | os.chdir(abspath)
51 |
52 | @classmethod
53 | def config_to_auto_simulated_universe_config(cls):
54 | """AutoStarRail to Auto_Simulated_Universe"""
55 | from config import cfg
56 | from Auto_Simulated_Universe.utils.config import config
57 | log.info("数据同步至Auto_Simulated_Universe")
58 | config.angle = cfg.get(cfg.universe_angle)
59 | config.fate = cfg.get(cfg.universe_fate)
60 | config.difficult = cfg.get(cfg.universe_difficult)
61 |
62 | config.speed_mode = cfg.get(cfg.universe_speed)
63 | config.debug_mode = cfg.get(cfg.universe_debug)
64 | config.show_map_mode = cfg.get(cfg.universe_show_map)
65 | config.force_update = cfg.get(cfg.universe_update)
66 | config.bonus = cfg.get(cfg.universe_bonus)
67 |
68 | config.save()
69 |
70 |
71 | if __name__ == '__main__':
72 | log.info("universe模块测试")
73 | Universe.run_align_angle()
74 |
--------------------------------------------------------------------------------
/script/utils/__init__.py:
--------------------------------------------------------------------------------
1 | from .cv_utils import (rotate_image, in_range_color, template_in_img,
2 | match_template, match_template_gray, wait_img, where_img)
3 | from .ocr import get_text_position, wait_text, text_in_img
4 | from .dialog import win_message
5 | from .role import Role, MoveDirection
6 |
--------------------------------------------------------------------------------
/script/utils/calculate.py:
--------------------------------------------------------------------------------
1 | from typing import List, Tuple, Union
2 | from math import sqrt, inf
3 |
4 |
5 | def calculate_length(pos1, pos2):
6 | """calculate position1 to position2 length"""
7 | return sqrt(pow(pos2[0] - pos1[0], 2) + pow(pos2[1] - pos1[1], 2))
8 |
9 |
10 | def calculate_shortest_position(position: Tuple[Union[int, float], Union[int, float]],
11 | positions: List[Tuple]) -> Tuple[Union[int, float], Union[int, float]]:
12 | """
13 | :param position:
14 | :param positions:
15 | :return: shortest position
16 | """
17 | shortest = inf
18 | pos = (-1, -1)
19 | for p in positions:
20 | temp = calculate_length(position, p)
21 | if temp < shortest:
22 | shortest = temp
23 | pos = p
24 | return pos
25 |
26 |
27 | def calculate_angle(pos1, pos2):
28 | pass
29 |
--------------------------------------------------------------------------------
/script/utils/cv_utils.py:
--------------------------------------------------------------------------------
1 | from copy import deepcopy
2 | from typing import Union
3 |
4 | import cv2
5 | import numpy as np
6 | from numpy import ndarray
7 |
8 | import log
9 |
10 |
11 | def is_same_position(position1: tuple, position2: tuple, error_value: int):
12 | """
13 | 传入两个坐标位置,判断这两个位置是否是同一个位置
14 | :param position1: 点1
15 | :param position2: 点2
16 | :param error_value: 误差值
17 | """
18 | top_left = (position1[0] - error_value, position1[1] - error_value)
19 | bottom_right = (position1[0] + error_value, position1[1] + error_value)
20 | if top_left[0] <= position2[0] <= bottom_right[0] and top_left[1] <= position2[1] <= bottom_right[1]:
21 | return True
22 | return False
23 |
24 |
25 | def remove_same_position(positions: list, error_value: int):
26 | flag = set() # 记录需要被删除的下标
27 | cur = 0
28 | while cur < len(positions) - 1:
29 | nex = cur + 1
30 | while nex < len(positions):
31 | # 跳过被标记的下标
32 | if nex in flag:
33 | nex += 1
34 | continue
35 | # 判断是否是同一个点
36 | if is_same_position(positions[cur], positions[nex], error_value):
37 | flag.add(nex)
38 | nex += 1
39 | cur += 1
40 | # 跳过被标记的下标
41 | while cur in flag:
42 | cur += 1
43 | return [position for i, position in enumerate(positions) if i not in flag]
44 |
45 |
46 | def rotate_image(image, angle):
47 | """
48 | 旋转图片
49 | :param image: 需要旋转的图像
50 | :param angle: 旋转角度
51 | """
52 | h, w = image.shape[:2]
53 | matrix = cv2.getRotationMatrix2D((w // 2, h // 2), angle, 1.0) # 获取旋转矩阵
54 | rotated_image = cv2.warpAffine(image, matrix, (w, h)) # 获取旋转后的图像
55 | return rotated_image
56 |
57 |
58 | def in_range_color(image, lower_color: list, upper_color: list):
59 | """
60 | 保留图像中颜色范围内的颜色,方法内自带深拷贝,不会污染原图像
61 | :param image: 图像
62 | :param lower_color: 下限
63 | :param upper_color: 上限
64 | :return: image
65 | """
66 | img = deepcopy(image)
67 | lower_color = np.array(lower_color)
68 | upper_color = np.array(upper_color)
69 | img[np.sum(img - lower_color, axis=-1) < 0] = [0, 0, 0]
70 | img[np.sum(img - upper_color, axis=-1) > 0] = [0, 0, 0]
71 | return img
72 |
73 |
74 | def to_ndarray(img: Union[str, ndarray]) -> ndarray:
75 | """
76 | 将图片装换为numpy.ndarray
77 | """
78 | if isinstance(img, str):
79 | img = cv2.imread(img)
80 | return img
81 |
82 |
83 | def template_in_img(img: Union[str, ndarray], template: Union[str, ndarray], threshold=0.8) -> bool:
84 | """
85 | 判断模板图是否在img中
86 | """
87 | img = to_ndarray(img)
88 | template = to_ndarray(template)
89 | res = cv2.matchTemplate(img, template, cv2.TM_CCOEFF_NORMED)
90 | _, max_val, _, _ = cv2.minMaxLoc(res)
91 | return max_val >= threshold
92 |
93 |
94 | def match_template(img: Union[str, ndarray], template: Union[str, ndarray], threshold=0.8) -> tuple:
95 | """
96 | 模板匹配,匹配成功返回模板图左上角坐标,失败返回(-1, -1)
97 | """
98 | img = to_ndarray(img)
99 | template = to_ndarray(template)
100 | res = cv2.matchTemplate(img, template, cv2.TM_CCOEFF_NORMED)
101 | _, max_val, _, max_loc = cv2.minMaxLoc(res)
102 | if max_val >= threshold:
103 | return max_loc
104 | log.info(f"模板匹配失败, val={max_val}, threshold={threshold}")
105 | return -1, -1
106 |
107 |
108 | def match_template_gray(img: Union[str, ndarray], template: Union[str, ndarray], threshold=0.8):
109 | """
110 | 模板匹配(灰),匹配成功返回模板左上角坐标,失败返回(-1, -1)
111 | """
112 | img = to_ndarray(img)
113 | template = to_ndarray(template)
114 | img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
115 | template = cv2.cvtColor(template, cv2.COLOR_BGR2GRAY)
116 | res = cv2.matchTemplate(img, template, cv2.TM_CCOEFF_NORMED)
117 | _, max_val, _, max_loc = cv2.minMaxLoc(res)
118 | if max_val >= threshold:
119 | return max_loc
120 | log.info(f"模板匹配失败, val={max_val}, threshold={threshold}")
121 | return -1, -1
122 |
123 |
124 | def wait_img(template, threshold=0.8, mode="default"):
125 | """等待模板图"""
126 | import time
127 | import game
128 | log.info("等待模板图")
129 | if mode == "default":
130 | method = match_template
131 | elif mode == 'gray':
132 | method = match_template_gray
133 | else:
134 | raise ValueError(f"mode={mode} is not supported")
135 | screenshot = game.get_screenshot()
136 | while method(screenshot, template, threshold=threshold) == (-1, -1):
137 | time.sleep(0.1)
138 | screenshot = game.get_screenshot()
139 |
140 |
141 | def where_img(img: Union[str, ndarray], template: Union[str, ndarray], threshold=0.8) -> list:
142 | """
143 | :return: list[(y, x), (y, x)]
144 | """
145 | img = to_ndarray(img)
146 | template = to_ndarray(template)
147 | res = cv2.matchTemplate(img, template, cv2.TM_CCOEFF_NORMED)
148 | positions = np.where(res >= threshold)
149 | return list(zip(*positions[::-1]))
150 |
151 |
152 | def get_max_min_hsv(img: Union[str, ndarray]):
153 | """
154 | 获取图像最大最小HSV値
155 | :param img:
156 | :return:
157 | """
158 | from math import inf
159 | img = to_ndarray(img)
160 | hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
161 | hsv = hsv.reshape(-1, 3)
162 | ma = [-inf, -inf, -inf]
163 | mi = [inf, inf, inf]
164 | for i in range(len(hsv)):
165 | h, s, v = hsv[i]
166 | ma[0] = max(ma[0], h)
167 | ma[1] = max(ma[1], s)
168 | ma[2] = max(ma[2], v)
169 |
170 | mi[0] = min(mi[0], h)
171 | mi[1] = min(mi[1], s)
172 | mi[2] = min(mi[2], v)
173 | return np.array(ma), np.array(mi)
174 |
175 |
176 | if __name__ == '__main__':
177 | pass
178 |
--------------------------------------------------------------------------------
/script/utils/dialog.py:
--------------------------------------------------------------------------------
1 | import os
2 |
3 | import config
4 |
5 | from winotify import Notification
6 |
7 |
8 | def win_message(title, content):
9 | Notification(
10 | app_id="AutoStarRail", title=title, msg=content,
11 | icon=os.path.join(config.abspath, r"doc\help.ico")
12 | ).show()
13 |
14 |
15 | if __name__ == '__main__':
16 | win_message("Test", "Hello World")
17 |
--------------------------------------------------------------------------------
/script/utils/fight.py:
--------------------------------------------------------------------------------
1 | import time
2 | from multiprocessing import Lock, Value, Process
3 | from typing import Optional
4 |
5 | import cv2
6 | import pyautogui
7 | import numpy as np
8 | from numpy import ndarray
9 |
10 | import log
11 |
12 | __image: Optional[ndarray] = None
13 | __process: Optional[Process] = None
14 | __fighting = Value('b', False)
15 | __stop = Value('b', True)
16 | __close = Value('b', False)
17 | __fighting_lock = Lock()
18 | __stop_lock = Lock()
19 |
20 |
21 | def fire() -> None:
22 | """游戏角色开火(主界面)"""
23 | pyautogui.click()
24 | time.sleep(0.5)
25 |
26 |
27 | def have_jar() -> bool:
28 | """
29 | 查找是否有锁定罐子
30 | """
31 | from script.utils import in_range_color, template_in_img, template_path
32 | img = in_range_color(__image, [255, 255, 240], [255, 255, 255])
33 | template = cv2.imread(template_path.SELECT_JAR)
34 | return template_in_img(img, template, threshold=0.7)
35 |
36 |
37 | def have_monster(switch=False, debug=False) -> bool:
38 | """
39 | 静止的小地图
40 | 远程角色索敌范围半径30像素
41 | 近战角色索敌范围半径15像素
42 | 默认按照远程角色来搜索
43 | """
44 | if switch:
45 | radius = 15
46 | else:
47 | radius = 30
48 | local_map = get_local_map()
49 | h, w = local_map.shape[:2]
50 | lower = np.array([46, 46, 163])
51 | upper = np.array([124, 114, 233])
52 | mask = cv2.inRange(local_map, lower, upper)
53 |
54 | center = (w // 2, h // 2)
55 | x1, y1 = center[0] - radius, center[1] - radius
56 | x2, y2 = center[0] + radius, center[1] + radius
57 |
58 | local_map = cv2.bitwise_and(local_map, local_map, mask=mask)
59 | local_map = local_map[y1: y2, x1: x2]
60 | if debug:
61 | cv2.imshow("monster", local_map)
62 | cv2.waitKey(10)
63 | return np.sum(local_map) != 0
64 |
65 |
66 | def get_local_map() -> ndarray:
67 | """get top left map"""
68 | from copy import deepcopy
69 | local = deepcopy(__image[131:131 + 128, 88: 88 + 128])
70 | return local
71 |
72 |
73 | def in_fighting() -> bool:
74 | """
75 | 匹配未开启的自动战斗模板图
76 | 匹配3种不同的自动战斗模板图
77 | 匹配不到前自动战斗模板则匹配手机模板
78 | """
79 | from script.utils import template_in_img, match_template_gray, template_path
80 | templates = [template_path.AUTO_FIGHT, template_path.AUTO_FIGHT_2,
81 | template_path.AUTO_FIGHT_3, template_path.AUTO_FIGHT_4]
82 | for template in templates:
83 | if template_in_img(__image, template):
84 | return True
85 | res = match_template_gray(__image, template_path.PHONE)
86 | if res == (-1, -1):
87 | return True
88 | return False
89 |
90 |
91 | def is_fighting() -> bool:
92 | """返回是否在战斗"""
93 | with __fighting_lock:
94 | res = __fighting.value
95 | return bool(res)
96 |
97 |
98 | def update_img() -> None:
99 | """
100 | 更新游戏图像
101 | """
102 | import game
103 | global __image
104 | __image = game.get_screenshot()
105 |
106 |
107 | def main(_stop: Value, _stop_lock: Lock, _fighting: Value, _fighting_lock: Lock, _close: Value) -> None:
108 | while not _close.value:
109 | with _stop_lock:
110 | c_stop = _stop.value
111 | # 暂停
112 | if c_stop:
113 | time.sleep(1)
114 | continue
115 | # 更新游戏截图
116 | update_img()
117 | if in_fighting():
118 | with _fighting_lock:
119 | _fighting.value = True
120 | time.sleep(2)
121 | continue
122 | else:
123 | with _fighting_lock:
124 | _fighting.value = False
125 | if have_jar():
126 | log.info("发现罐子")
127 | fire()
128 | elif have_monster():
129 | log.info("发现怪物")
130 | fire()
131 |
132 |
133 | def start() -> None:
134 | """开启战斗模块"""
135 | import log
136 | # 已创建子进程则无需再创建
137 | global __process
138 | if __process:
139 | with __stop_lock:
140 | __stop.value = False
141 | log.info("开启战斗模块")
142 | else:
143 | log.info("创建子进程")
144 | __stop.value = False
145 | __process = Process(target=main, args=(__stop, __stop_lock, __fighting, __fighting_lock, __close))
146 | __process.start()
147 |
148 |
149 | def stop() -> None:
150 | """暂停战斗模块"""
151 | import log
152 | if __process:
153 | with __stop_lock:
154 | __stop.value = True
155 | log.info("暂停战斗模块")
156 | else:
157 | raise Exception("未创建子进程")
158 |
159 |
160 | def close() -> None:
161 | """关闭战斗模块"""
162 | import log
163 | global __process
164 | if __process:
165 | # 防止内存泄漏或者僵尸进程
166 | log.info("尝试关闭子进程")
167 | __close.value = True
168 | __process.join()
169 | __process = None
170 | __close.value = False
171 | log.info("子进程已关闭")
172 | log.info("关闭战斗模块")
173 | else:
174 | raise Exception("未创建子进程")
175 |
176 |
177 | if __name__ == '__main__':
178 | # 开启子进程
179 | start()
180 | time.sleep(100)
181 | close()
182 |
--------------------------------------------------------------------------------
/script/utils/mouse.py:
--------------------------------------------------------------------------------
1 | import pyautogui
2 |
3 | import log
4 |
5 |
6 | def click_position(position, direction=None, val=0, game_pos=False):
7 | """
8 | 鼠标移动至position并点击
9 | direction: [topLeft, topRight, bottomLeft, bottomRight]
10 | """
11 | import win32api
12 | import win32con
13 | import time
14 | import game
15 | x, y = int(position[0]), int(position[1])
16 | if direction == 'topLeft':
17 | x -= val
18 | y -= val
19 | elif direction == 'topRight':
20 | x += val
21 | y -= val
22 | elif direction == 'bottomLeft':
23 | x -= val
24 | y += val
25 | elif direction == 'bottomRight':
26 | x += val
27 | y += val
28 | if game_pos:
29 | x1, y1, _, _ = game.get_rect()
30 | x += x1
31 | y += y1
32 | x, y = int(x), int(y) # x,y必须是int类型
33 | win32api.SetCursorPos((x, y))
34 | log.info(f"点击({x},{y})")
35 | win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y, 0, 0)
36 | time.sleep(0.15) # 过快的点击将导致游戏反应不过来最终导致点击失效
37 | win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y, 0, 0)
38 |
39 |
40 | def click_positions(positions, direction=None, val=0, game_pos=False):
41 | """
42 | 传入单个值则点击该值,多个值则取索引为 元素个数/2 的坐标
43 | direction: [topLeft, topRight, bottomLeft, bottomRight]
44 | 将game_pos设置为true则由全局坐标转至游戏坐标
45 | """
46 | length = len(positions)
47 | mid = length // 2 - 1
48 | if mid < 0:
49 | mid = 0
50 | pos = positions[mid]
51 | x, y = int(pos[0]), int(pos[1])
52 | click_position((x, y), direction=direction, val=val, game_pos=game_pos)
53 |
54 |
55 | def mouse_scroll(count: int):
56 | """
57 | 鼠标滚轮
58 | """
59 | import pyautogui
60 | log.info("鼠标滚轮滚动")
61 | for _ in range(count):
62 | for _ in range(6):
63 | pyautogui.scroll(-10)
64 |
65 |
66 | def down_move(start: tuple, end: tuple, button='left'):
67 | x1, y1 = start[0], start[1]
68 | x2, y2 = end[0], end[1]
69 | pyautogui.mouseDown(x1, y1, button)
70 | pyautogui.moveTo(x2, y2, duration=1)
71 | pyautogui.mouseUp(x1, y1)
72 |
--------------------------------------------------------------------------------
/script/utils/ocr.py:
--------------------------------------------------------------------------------
1 | import time
2 |
3 | from ppocronnx import TextSystem
4 | from numpy import ndarray, array
5 |
6 | import log
7 |
8 | text_sys = TextSystem(use_angle_cls=False)
9 |
10 |
11 | def get_text_position(img: ndarray, target: str) -> ndarray:
12 | """
13 | 获取文字坐标,没有查询到文字则返回空数组
14 | """
15 | res = text_sys.detect_and_ocr(img)
16 | val = 0
17 | pos = None
18 | for i in range(len(res)):
19 | box = res[i]
20 | if box.ocr_text == target:
21 | if box.score > val:
22 | val = box.score
23 | pos = box.box
24 | if pos is not None:
25 | return pos
26 |
27 | for i in range(len(res)):
28 | box = res[i]
29 | if target in box.ocr_text:
30 | if box.score > val:
31 | val = box.score
32 | pos = box.box
33 | if pos is not None:
34 | return pos
35 | return array([])
36 |
37 |
38 | def text_in_img(img: ndarray, target: str) -> bool:
39 | """
40 | 判断图片中是否包含文字
41 | """
42 | res = get_text_position(img, target)
43 | if res.size == 0:
44 | return False
45 | return True
46 |
47 |
48 | def wait_text(method, target: str, timeout: int = 60):
49 | """
50 | :param method: 获取屏幕截图的方法,这个方法返回的必须是ndarray
51 | :param target: 目标文字
52 | :param timeout: 最长等待时长
53 | 等待某个文字,若超过timeout时间未等到某个文字则抛出错误
54 | """
55 | start = time.time()
56 | while time.time() - start < timeout:
57 | pos = get_text_position(method(), target)
58 | if pos.size != 0:
59 | return pos
60 | time.sleep(2)
61 | log.critical("等待超时")
62 | raise Exception("等待超时")
63 |
--------------------------------------------------------------------------------
/script/utils/role.py:
--------------------------------------------------------------------------------
1 | import time
2 | from enum import Enum
3 | from copy import deepcopy
4 |
5 | import cv2
6 | import numpy as np
7 | import win32api
8 | import win32con
9 | import pyautogui
10 |
11 | import threadpool
12 | from script.utils import template_path
13 | from config import cfg
14 |
15 |
16 | class MoveDirection(Enum):
17 | ONWARD = 'onward' # 前
18 | BACKWARD = 'backward' # 后
19 | LEFT = 'left' # 左
20 | RIGHT = 'right' # 右
21 |
22 |
23 | def _mouse_move(x, y):
24 | win32api.mouse_event(win32con.MOUSEEVENTF_MOVE, x, y)
25 |
26 |
27 | class Role:
28 | angle = 0
29 | direct = 'w'
30 | obs = 0
31 |
32 | @classmethod
33 | def move_view(cls, angle):
34 | """
35 | 移动角色视角,正angle右转,负angle左转。
36 | 本代码参考自github项目Auto_Simulated_Universe
37 | :param angle: 角度
38 | """
39 | import game
40 |
41 | if angle > 30:
42 | y = 30
43 | elif angle < -30:
44 | y = -30
45 | else:
46 | y = angle
47 | # 分多次移动,防止鼠标移动离开游戏窗口
48 | _, _, s = game.get_somthing()
49 | dx = int(16.5 * y * cfg.get(cfg.world_angle) * s)
50 | win32api.mouse_event(win32con.MOUSEEVENTF_MOVE, dx, 0) # 进行视角移动
51 | time.sleep(0.05)
52 | if angle != y:
53 | Role.move_view(angle - y)
54 |
55 | @classmethod
56 | def move(cls):
57 | pyautogui.keyDown('w')
58 | pyautogui.press('shift')
59 | cls.direct = 'w'
60 |
61 | @classmethod
62 | def random_move(cls):
63 | """
64 | 随便移动
65 | """
66 | from random import randint
67 | moves = ['w', 'a', 's', 'd']
68 | d = moves[randint(0, 3)]
69 | pyautogui.keyDown(d)
70 | time.sleep(1)
71 | pyautogui.keyUp(d)
72 |
73 | @classmethod
74 | def obstacles(cls):
75 | """越障"""
76 | moves = ['a', 'd']
77 | cls.obs ^= 1
78 | d = moves[cls.obs]
79 | pyautogui.keyDown('s')
80 | time.sleep(1)
81 | pyautogui.keyUp('s')
82 | pyautogui.keyDown(d)
83 | time.sleep(0.8)
84 | pyautogui.keyUp(d)
85 |
86 | @classmethod
87 | def stop_move(cls):
88 | """
89 | 停止角色移动
90 | """
91 | pyautogui.keyUp(cls.direct)
92 |
93 | @classmethod
94 | def set_angle(cls, current: int, target: int):
95 | """传入当前角度和期望角度,该方法将计算需要移动的角度"""
96 | angle = target - current
97 |
98 | if angle > 0:
99 | if angle <= 180:
100 | cls.move_view(-angle)
101 | else:
102 | cls.move_view(360 - angle)
103 | else:
104 | angle = abs(angle)
105 | if angle <= 180:
106 | cls.move_view(angle)
107 | else:
108 | cls.move_view(-(360 - angle))
109 |
110 | cls.angle = target
111 |
--------------------------------------------------------------------------------
/script/utils/template_path.py:
--------------------------------------------------------------------------------
1 | """模板图目录"""
2 |
3 | import os
4 | import config
5 |
6 | IMAGE_ROOT_PATH = os.path.join(config.abspath, "images\\") # 图片根目录
7 | CALYX_GOLD_PATH = IMAGE_ROOT_PATH + "calyx_gold\\" # 拟造花萼的目录
8 | CALYX_RED_PATH = IMAGE_ROOT_PATH + "calyx_red\\" # 拟造花萼(赤)目录
9 | SHADOW_PATH = IMAGE_ROOT_PATH + "shadow\\" # 凝滞虚影的目录
10 | CAVERN_PATH = IMAGE_ROOT_PATH + "cavern\\" # 侵蚀隧道的目录
11 | ECHO_OF_WAR_PATH = IMAGE_ROOT_PATH + "echo\\" # 历战回响的目录
12 | COMMISSION_PATH = IMAGE_ROOT_PATH + "commission\\" # 委托任务的目录
13 | CHARACTER_PATH = IMAGE_ROOT_PATH + "character\\" # 角色的目录
14 | WORLD_PATH = IMAGE_ROOT_PATH + "world\\" # 世界的目录
15 |
16 | # 杂 more
17 | PHONE = IMAGE_ROOT_PATH + r"phone.png" # 手机
18 | MANDATE = IMAGE_ROOT_PATH + r"mandate.png" # 任务书
19 | BOOK = IMAGE_ROOT_PATH + r"book.png" # 星际和平书
20 | BOOK2 = IMAGE_ROOT_PATH + r"book2.png" # 星际和平书界面
21 | INDEX = IMAGE_ROOT_PATH + r"index.png" # 生存索引
22 | INDEX_SELECTED = IMAGE_ROOT_PATH + r"indexSelected.png" # 选中状态下的"生存索引"
23 | DAILY_TASK = IMAGE_ROOT_PATH + r"dailyTask.png" # 每日任务
24 | DAILY_TASK_SELECTED = IMAGE_ROOT_PATH + r"dailyTaskSelected.png" # 选中状态下的"每日任务"
25 | NO_STAMINA = IMAGE_ROOT_PATH + r"noStamina.png" # 没有体力
26 | CANCEL = IMAGE_ROOT_PATH + r"cancel.png" # 取消按钮
27 | CONFIRM = IMAGE_ROOT_PATH + r"confirm.png" # 确认按钮
28 | SELECTED_CONFIRM = IMAGE_ROOT_PATH + r"selectedConfirm.png" # 被选中的确认按钮
29 | FUEL = IMAGE_ROOT_PATH + r"fuel.png" # 燃料
30 | SELECTED_FUEL = IMAGE_ROOT_PATH + r"selectedFuel.png" # 被选中的燃料
31 | STELLAR_JADE = IMAGE_ROOT_PATH + r"stellarJade.png" # 星穹
32 | SELECTED_STELLAR_JADE = IMAGE_ROOT_PATH + r"selectedStellarJade.png" # 被选中的星穹
33 | AUTO_FIGHT = IMAGE_ROOT_PATH + r"autoFight.png" # 自动战斗(未开启)
34 | AUTO_FIGHT_2 = IMAGE_ROOT_PATH + r"autoFight2.png" # 自动战斗(开启)
35 | AUTO_FIGHT_3 = IMAGE_ROOT_PATH + r"autoFight3.png" # 自动战斗(开启)
36 | AUTO_FIGHT_4 = IMAGE_ROOT_PATH + r"autoFight4.png" # 自动战斗(开启)
37 | AREA_NAVIGATION = IMAGE_ROOT_PATH + r"areaNavigation.png" # 区域导航
38 | BALL_NAVIGATION = IMAGE_ROOT_PATH + r"ballNavigation.png" # 星球导航
39 |
40 | # 拟造花萼 calyx
41 | CALYX_GOLD_1 = CALYX_GOLD_PATH + "1.png"
42 | CALYX_GOLD_2 = CALYX_GOLD_PATH + r"2.png"
43 | CALYX_GOLD_3 = CALYX_GOLD_PATH + r"3.png"
44 | CALYX_RED_1 = CALYX_RED_PATH + r"1.png"
45 | CALYX_RED_2 = CALYX_RED_PATH + r"2.png"
46 | CALYX_RED_3 = CALYX_RED_PATH + r"3.png"
47 | CALYX_RED_4 = CALYX_RED_PATH + r"4.png"
48 | CALYX_RED_5 = CALYX_RED_PATH + r'5.png'
49 | CALYX_RED_6 = CALYX_RED_PATH + r"6.png"
50 | CALYX_RED_7 = CALYX_RED_PATH + r"7.png"
51 |
52 | # 凝滞虚影 Stagnant shadow
53 | SHADOW_1 = SHADOW_PATH + r"1.png" # 空海之形
54 | SHADOW_2 = SHADOW_PATH + r"2.png" # 巽风之形
55 | SHADOW_3 = SHADOW_PATH + r"3.png" # 鸣雷之形
56 | SHADOW_4 = SHADOW_PATH + r"4.png" # 炎华之形
57 | SHADOW_5 = SHADOW_PATH + r"5.png" # 锋芒之形
58 | SHADOW_6 = SHADOW_PATH + r"6.png" # 霜晶之形
59 | SHADOW_7 = SHADOW_PATH + r"7.png" # 幻光之形
60 | SHADOW_8 = SHADOW_PATH + r"8.png" # 冰凌之形
61 | SHADOW_9 = SHADOW_PATH + r"9.png" # 震厄之形
62 | SHADOW_10 = SHADOW_PATH + r"10.png" # 天人之形
63 | SHADOW_11 = SHADOW_PATH + r"11.png"
64 | SHADOW_12 = SHADOW_PATH + r"12.png"
65 |
66 | # 侵蚀隧道 cavern
67 | CAVERN_1 = CAVERN_PATH + r"1.png"
68 | CAVERN_2 = CAVERN_PATH + r"2.png"
69 | CAVERN_3 = CAVERN_PATH + r"3.png"
70 | CAVERN_4 = CAVERN_PATH + r"4.png"
71 | CAVERN_5 = CAVERN_PATH + r"5.png"
72 | CAVERN_6 = CAVERN_PATH + r"6.png"
73 | CAVERN_7 = CAVERN_PATH + r"7.png"
74 |
75 | # 历战余响 Echo Of War
76 | ECHO_1 = ECHO_OF_WAR_PATH + r"1.png" # 毁灭回响
77 | ECHO_2 = ECHO_OF_WAR_PATH + r"2.png" # 存护回响
78 | ECHO_3 = ECHO_OF_WAR_PATH + r"3.png" # 丰饶回响
79 |
80 | # 副本 Copies
81 | CHALLENGE = IMAGE_ROOT_PATH + r"challenge.png" # 副本的挑战按钮
82 | CHALLENGE_COMPLETED = IMAGE_ROOT_PATH + r"challengeCompleted.png" # 挑战成功
83 | START_CHALLENGE = IMAGE_ROOT_PATH + r"startChallenge.png" # 开始挑战按钮
84 | ADD_CHALLENGE = IMAGE_ROOT_PATH + r"addChallenge.png" # 添加挑战副本的次数按钮
85 | TRANSMISSION = IMAGE_ROOT_PATH + r"transmission.png" # 传送按钮
86 |
87 | # 委托
88 | COMMISSION = COMMISSION_PATH + r"commission.png" # 委托按钮
89 | COMMISSION_PENDING = COMMISSION_PATH + r"commissionPending.png" # 右上角有感叹号的委托按钮
90 | IS_COMMISSION = COMMISSION_PATH + r"isCommission.png" # 委托界面
91 | PENDING = COMMISSION_PATH + r"pending.png" # 待领取
92 | GET_COMMISSION = COMMISSION_PATH + r"getCommission.png" # 领取委托的奖励按钮
93 | RE_COMMISSION = COMMISSION_PATH + r"recommission.png" # 重新委托按钮
94 |
95 | START_GAME = IMAGE_ROOT_PATH + r"startGame.png" # 启动器的开始游戏
96 | ENTER_GAME = IMAGE_ROOT_PATH + r"enterGame.png" # 进入游戏
97 | EXIT_COPIES = IMAGE_ROOT_PATH + r"exitCopies.png" # 退出挑战
98 |
99 | # 角色
100 | ARROW = CHARACTER_PATH + r"arrow.png" # 向上箭头
101 | ARROW_DOWN = CHARACTER_PATH + r"arrowDown.png" # 向下箭头
102 | ARROW_LEFT = CHARACTER_PATH + r"arrowLeft.png" # 向左箭头
103 | ARROW_RIGHT = CHARACTER_PATH + r"arrowRight.png" # 后右箭头
104 | LOCAL_ARROW = CHARACTER_PATH + r"localArrow.png" # 本地箭够
105 |
106 | # 世界
107 | QUESTION_MASK = WORLD_PATH + r"questionMask.png" # 问号
108 | WARNING = WORLD_PATH + r"warning.png" # 感叹号
109 | SELECT_MONSTER = WORLD_PATH + r"selectMonster.png" # 选中敌人
110 | SELECT_JAR = WORLD_PATH + r"selectJar.png" # 选中罐子
111 | SEND1 = WORLD_PATH + r"send1.png" # 普通传送点
112 | SEND2 = WORLD_PATH + r"send2.png" # 拟造花萼(金)传送点
113 | SEND3 = WORLD_PATH + r"send3.png" # 拟造花草(赤)传送点
114 | SEND4 = WORLD_PATH + r"send4.png" # 凝滞虚影传送点
115 | SEND5 = WORLD_PATH + r"send5.png" # 侵蚀隧洞传送点
116 | SEND_TEXT = WORLD_PATH + r"sendText.png" # 传送
117 |
--------------------------------------------------------------------------------
/script/utils/window.py:
--------------------------------------------------------------------------------
1 | import win32con
2 | import win32api
3 | import win32gui
4 | import win32print
5 | from numpy import ndarray
6 | from PIL import ImageGrab
7 |
8 |
9 | def get_read_size():
10 | """获取真实分辨率"""
11 | hDC = win32gui.GetDC(0)
12 | w = win32print.GetDeviceCaps(hDC, win32con.DESKTOPHORZRES)
13 | h = win32print.GetDeviceCaps(hDC, win32con.DESKTOPVERTRES)
14 | return w, h
15 |
16 |
17 | def get_screen_size():
18 | """缩放后的分辨率"""
19 | w = win32api.GetSystemMetrics(0)
20 | h = win32api.GetSystemMetrics(1)
21 | return w, h
22 |
23 |
24 | def get_scaling():
25 | """获取缩放率"""
26 | return round(get_read_size()[0] / get_screen_size()[0], 2)
27 |
28 |
29 | def get_screenshot() -> ndarray:
30 | """获取屏幕截图"""
31 | import cv2
32 | import numpy as np
33 | img = ImageGrab.grab()
34 | img = np.array(img)
35 | img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
36 | return img
37 |
--------------------------------------------------------------------------------
/script/world/debug/debug.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/debug/debug.py
--------------------------------------------------------------------------------
/script/world/debug/map_test/1/2/1/binary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/debug/map_test/1/2/1/binary.png
--------------------------------------------------------------------------------
/script/world/debug/map_test/1/2/1/default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/debug/map_test/1/2/1/default.png
--------------------------------------------------------------------------------
/script/world/debug/map_test/1/2/1/line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/debug/map_test/1/2/1/line.png
--------------------------------------------------------------------------------
/script/world/debug/map_test/1/2/1/point.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/debug/map_test/1/2/1/point.png
--------------------------------------------------------------------------------
/script/world/debug/map_test/1/2/1/target.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/debug/map_test/1/2/1/target.png
--------------------------------------------------------------------------------
/script/world/draw.py:
--------------------------------------------------------------------------------
1 | import os.path
2 | import time
3 | from copy import deepcopy
4 |
5 | import cv2
6 | import numpy as np
7 | from pynput import keyboard
8 |
9 | from script.utils import template_path, where_img
10 | from script.utils.interface import WorldUtils
11 |
12 |
13 | class Image:
14 | def __init__(self, path):
15 | self.path = path
16 | self.default = cv2.imread(os.path.join(path, "default.png"))
17 |
18 | @property
19 | def binary(self):
20 | return cv2.imread(os.path.join(self.path, 'binary.png'))
21 |
22 | def save_binary(self, img):
23 | cv2.imwrite(os.path.join(self.path, 'binary.png'), img)
24 |
25 | def save_line(self, img):
26 | cv2.imwrite(os.path.join(self.path, 'line.png'), img)
27 |
28 | def save_target(self, img):
29 | cv2.imwrite(os.path.join(self.path, 'target.png'), img)
30 |
31 | def reload(self):
32 | self.default = cv2.imread(os.path.join(self.path, "default.png"))
33 |
34 |
35 | class DrawMap(WorldUtils):
36 | def __init__(self, m: Image, mode=0):
37 | super().__init__()
38 | self._stop = False
39 | self._pause = False
40 |
41 | self.draw_listener = keyboard.Listener()
42 | self.draw_listener.on_press = self._on_press
43 | self.img = m
44 | self.mode = mode
45 |
46 | def draw(self):
47 | gray = np.array([55, 55, 55])
48 | white = np.array([210, 210, 210])
49 | find = 1
50 | big_map = self.img.default
51 | bw_map = np.zeros(big_map.shape[:2], dtype=np.uint8)
52 | # 灰块、白线:小地图中的可移动区域、可移动区域的边缘
53 | # b_map:当前像素点是否是灰块。只允许灰块附近(2像素)的像素被识别为白线
54 | b_map = deepcopy(bw_map)
55 | b_map[
56 | np.sum((big_map - gray) ** 2, axis=-1) <= 3200 + find * 1600
57 | ] = 255
58 | kernel = np.zeros((5, 5), np.uint8) # 设置kenenel大小
59 | kernel += 1
60 | b_map = cv2.dilate(b_map, kernel, iterations=1)
61 | bw_map[
62 | (np.sum((big_map - white) ** 2, axis=-1) <= 3200 + find * 1600)
63 | & (b_map > 200)
64 | ] = 255
65 | # 创建一个和arr形状相同的布尔数组,其中arr中的0被标记为True,255被标记为False
66 | mask = b_map == 0
67 |
68 | # 使用布尔索引将arr中的0替换为255,255替换为0
69 | b_map[mask] = 255
70 | b_map[~mask] = 0
71 |
72 | # 查找传送点将其所在位置设置为黑
73 | upper = np.array([0, 0, 228])
74 | lower = np.array([0, 0, 137])
75 | m = deepcopy(self.img.default)
76 | hsv = cv2.cvtColor(m, cv2.COLOR_BGR2HSV)
77 | mask = cv2.inRange(hsv, lower, upper)
78 | m[np.where(mask != 0)] = [57, 57, 57]
79 | send_paths = [template_path.SEND1, template_path.SEND2, template_path.SEND3,
80 | template_path.SEND4, template_path.SEND5]
81 | if self.mode:
82 | for send_path in send_paths:
83 | send = where_img(m, send_path, threshold=0.68)
84 | positions = send
85 | for top_left in positions:
86 | width = 40
87 | bottom_right = (top_left[0] + width, top_left[1] + width)
88 | b_map[top_left[1]:bottom_right[1], top_left[0]:bottom_right[0]] = 0
89 | self.img.save_line(bw_map)
90 | self.img.save_binary(b_map) # 保存黑白图
91 | self.img.reload()
92 |
93 | target = self.img.binary
94 |
95 | while not self._stop:
96 | if self._pause:
97 | time.sleep(0.3)
98 | continue
99 | w, h, top_left = self.get_match_pos(bw_map, m_default=self.img.default)
100 | x1, y1 = top_left[0], top_left[1]
101 | x2, y2 = x1 + w, y1 + h
102 | changed = deepcopy(target[y1: y2, x1: x2])
103 | if self.role_state.is_moving:
104 | self.local_map = cv2.resize(self.local_map, (0, 0), fx=1.256, fy=1.256)
105 |
106 | # 找小地图上的怪点
107 | lower = np.array([46, 46, 183])
108 | upper = np.array([124, 114, 233])
109 | mask = cv2.inRange(self.local_map, lower, upper)
110 |
111 | changed[mask > 0] = [46, 46, 214]
112 | # 创建一个新的mask,将changed中不为白色的部分设置为True
113 | not_white = np.all(changed != [255, 255, 255], axis=-1)
114 | # 使用numpy的逻辑与运算符找到同时满足两个条件的像素
115 | mask_black = np.logical_and(mask == 0, not_white)
116 | # 将这些像素设置为黑色
117 | changed[mask_black] = [0, 0, 0]
118 | target[y1: y2, x1: x2] = changed
119 |
120 | cv2.imshow("big map", target)
121 | cv2.moveWindow("big map", 0, 0)
122 | cv2.waitKey(100)
123 |
124 | self.img.save_target(target) # 保存怪点
125 |
126 | def start(self):
127 | self.draw_listener.start()
128 | self.draw()
129 |
130 | def stop(self):
131 | self._stop = True
132 | self.draw_listener.stop()
133 |
134 | def pause(self):
135 | self._pause = not self._pause
136 | if self._pause:
137 | print("已暂停")
138 |
139 | def _on_press(self, key):
140 | try:
141 | if key == keyboard.Key.f8:
142 | self.stop()
143 | elif key == keyboard.Key.f7:
144 | self.pause()
145 | except AttributeError:
146 | pass
147 | except Exception:
148 | pass
149 |
150 |
151 | if __name__ == '__main__':
152 | my_map = Image(r"F:\AutoStarRail\script\world\map\2\7\1") # 修改地图路径则可以绘制地图
153 | draw = DrawMap(my_map, mode=1)
154 | draw.start()
155 |
--------------------------------------------------------------------------------
/script/world/map/1/1/1/binary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/1/1/1/binary.png
--------------------------------------------------------------------------------
/script/world/map/1/1/1/default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/1/1/1/default.png
--------------------------------------------------------------------------------
/script/world/map/1/1/1/line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/1/1/1/line.png
--------------------------------------------------------------------------------
/script/world/map/1/1/1/point.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/1/1/1/point.png
--------------------------------------------------------------------------------
/script/world/map/1/1/1/target.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/1/1/1/target.png
--------------------------------------------------------------------------------
/script/world/map/1/2/1/binary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/1/2/1/binary.png
--------------------------------------------------------------------------------
/script/world/map/1/2/1/default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/1/2/1/default.png
--------------------------------------------------------------------------------
/script/world/map/1/2/1/line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/1/2/1/line.png
--------------------------------------------------------------------------------
/script/world/map/1/2/1/point.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/1/2/1/point.png
--------------------------------------------------------------------------------
/script/world/map/1/2/1/target.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/1/2/1/target.png
--------------------------------------------------------------------------------
/script/world/map/1/3/1/binary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/1/3/1/binary.png
--------------------------------------------------------------------------------
/script/world/map/1/3/1/default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/1/3/1/default.png
--------------------------------------------------------------------------------
/script/world/map/1/3/1/line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/1/3/1/line.png
--------------------------------------------------------------------------------
/script/world/map/1/3/1/point.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/1/3/1/point.png
--------------------------------------------------------------------------------
/script/world/map/1/3/1/target.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/1/3/1/target.png
--------------------------------------------------------------------------------
/script/world/map/1/3/2/binary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/1/3/2/binary.png
--------------------------------------------------------------------------------
/script/world/map/1/3/2/default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/1/3/2/default.png
--------------------------------------------------------------------------------
/script/world/map/1/3/2/line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/1/3/2/line.png
--------------------------------------------------------------------------------
/script/world/map/1/3/2/point.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/1/3/2/point.png
--------------------------------------------------------------------------------
/script/world/map/1/3/2/select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/1/3/2/select.png
--------------------------------------------------------------------------------
/script/world/map/1/3/2/target.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/1/3/2/target.png
--------------------------------------------------------------------------------
/script/world/map/2/1/1/binary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/1/1/binary.png
--------------------------------------------------------------------------------
/script/world/map/2/1/1/default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/1/1/default.png
--------------------------------------------------------------------------------
/script/world/map/2/1/1/line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/1/1/line.png
--------------------------------------------------------------------------------
/script/world/map/2/1/1/point.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/1/1/point.png
--------------------------------------------------------------------------------
/script/world/map/2/1/1/target.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/1/1/target.png
--------------------------------------------------------------------------------
/script/world/map/2/2/1/binary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/2/1/binary.png
--------------------------------------------------------------------------------
/script/world/map/2/2/1/default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/2/1/default.png
--------------------------------------------------------------------------------
/script/world/map/2/2/1/line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/2/1/line.png
--------------------------------------------------------------------------------
/script/world/map/2/2/1/point.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/2/1/point.png
--------------------------------------------------------------------------------
/script/world/map/2/2/1/target.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/2/1/target.png
--------------------------------------------------------------------------------
/script/world/map/2/2/2/binary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/2/2/binary.png
--------------------------------------------------------------------------------
/script/world/map/2/2/2/default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/2/2/default.png
--------------------------------------------------------------------------------
/script/world/map/2/2/2/line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/2/2/line.png
--------------------------------------------------------------------------------
/script/world/map/2/2/2/point.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/2/2/point.png
--------------------------------------------------------------------------------
/script/world/map/2/2/2/target.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/2/2/target.png
--------------------------------------------------------------------------------
/script/world/map/2/3/1/binary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/3/1/binary.png
--------------------------------------------------------------------------------
/script/world/map/2/3/1/default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/3/1/default.png
--------------------------------------------------------------------------------
/script/world/map/2/3/1/line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/3/1/line.png
--------------------------------------------------------------------------------
/script/world/map/2/3/1/point.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/3/1/point.png
--------------------------------------------------------------------------------
/script/world/map/2/3/1/target.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/3/1/target.png
--------------------------------------------------------------------------------
/script/world/map/2/4/1/binary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/4/1/binary.png
--------------------------------------------------------------------------------
/script/world/map/2/4/1/default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/4/1/default.png
--------------------------------------------------------------------------------
/script/world/map/2/4/1/line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/4/1/line.png
--------------------------------------------------------------------------------
/script/world/map/2/4/1/point.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/4/1/point.png
--------------------------------------------------------------------------------
/script/world/map/2/4/1/select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/4/1/select.png
--------------------------------------------------------------------------------
/script/world/map/2/4/1/target.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/4/1/target.png
--------------------------------------------------------------------------------
/script/world/map/2/4/2/binary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/4/2/binary.png
--------------------------------------------------------------------------------
/script/world/map/2/4/2/default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/4/2/default.png
--------------------------------------------------------------------------------
/script/world/map/2/4/2/line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/4/2/line.png
--------------------------------------------------------------------------------
/script/world/map/2/4/2/point.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/4/2/point.png
--------------------------------------------------------------------------------
/script/world/map/2/4/2/target.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/4/2/target.png
--------------------------------------------------------------------------------
/script/world/map/2/5/1/binary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/5/1/binary.png
--------------------------------------------------------------------------------
/script/world/map/2/5/1/default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/5/1/default.png
--------------------------------------------------------------------------------
/script/world/map/2/5/1/line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/5/1/line.png
--------------------------------------------------------------------------------
/script/world/map/2/5/1/point.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/5/1/point.png
--------------------------------------------------------------------------------
/script/world/map/2/5/1/target.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/5/1/target.png
--------------------------------------------------------------------------------
/script/world/map/2/5/2/binary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/5/2/binary.png
--------------------------------------------------------------------------------
/script/world/map/2/5/2/default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/5/2/default.png
--------------------------------------------------------------------------------
/script/world/map/2/5/2/line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/5/2/line.png
--------------------------------------------------------------------------------
/script/world/map/2/5/2/point.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/5/2/point.png
--------------------------------------------------------------------------------
/script/world/map/2/5/2/target.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/5/2/target.png
--------------------------------------------------------------------------------
/script/world/map/2/5/3/binary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/5/3/binary.png
--------------------------------------------------------------------------------
/script/world/map/2/5/3/default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/5/3/default.png
--------------------------------------------------------------------------------
/script/world/map/2/5/3/line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/5/3/line.png
--------------------------------------------------------------------------------
/script/world/map/2/5/3/point.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/5/3/point.png
--------------------------------------------------------------------------------
/script/world/map/2/5/3/target.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/5/3/target.png
--------------------------------------------------------------------------------
/script/world/map/2/6/1/binary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/6/1/binary.png
--------------------------------------------------------------------------------
/script/world/map/2/6/1/default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/6/1/default.png
--------------------------------------------------------------------------------
/script/world/map/2/6/1/line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/6/1/line.png
--------------------------------------------------------------------------------
/script/world/map/2/6/1/point.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/6/1/point.png
--------------------------------------------------------------------------------
/script/world/map/2/6/1/target.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/6/1/target.png
--------------------------------------------------------------------------------
/script/world/map/2/6/2/binary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/6/2/binary.png
--------------------------------------------------------------------------------
/script/world/map/2/6/2/default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/6/2/default.png
--------------------------------------------------------------------------------
/script/world/map/2/6/2/line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/6/2/line.png
--------------------------------------------------------------------------------
/script/world/map/2/6/2/point.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/6/2/point.png
--------------------------------------------------------------------------------
/script/world/map/2/6/2/target.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/6/2/target.png
--------------------------------------------------------------------------------
/script/world/map/2/7/1/binary.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/7/1/binary.png
--------------------------------------------------------------------------------
/script/world/map/2/7/1/default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/7/1/default.png
--------------------------------------------------------------------------------
/script/world/map/2/7/1/line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/7/1/line.png
--------------------------------------------------------------------------------
/script/world/map/2/7/1/point.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/7/1/point.png
--------------------------------------------------------------------------------
/script/world/map/2/7/1/target.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JunNanLYS/AutoStarRail/6215215cacfb33879397bf6f3f0d1d6c0a6d498c/script/world/map/2/7/1/target.png
--------------------------------------------------------------------------------
/threadpool.py:
--------------------------------------------------------------------------------
1 | from concurrent.futures import ThreadPoolExecutor
2 |
3 | print("开启线程池")
4 | script_thread = ThreadPoolExecutor(max_workers=1) # 脚本线程
5 | function_thread = ThreadPoolExecutor(max_workers=4) # 方法线程
6 | print("线程池开启完毕")
7 |
--------------------------------------------------------------------------------