Compare commits
9 Commits
v4.1.1_bet
...
v4.1.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c4e5eb5cc | ||
|
|
cd42f45a1f | ||
|
|
ec38895765 | ||
|
|
fc30579bbc | ||
|
|
3e6223e4e5 | ||
|
|
27c71124ff | ||
|
|
3a8a8a36f5 | ||
|
|
ed6de5e806 | ||
|
|
bf8a5befa3 |
6
.github/workflows/python-app.yml
vendored
6
.github/workflows/python-app.yml
vendored
@@ -83,7 +83,13 @@ jobs:
|
||||
- name: Create Zip
|
||||
id: create_zip
|
||||
run: |
|
||||
move gui\ui\updater.ui .\
|
||||
move gui\ico\AUTO_MAA_Updater.ico .\
|
||||
Compress-Archive -Path gui,res,AUTO_MAA.py,Updater.py,package.py,dist/AUTO_MAA.exe,requirements.txt,README.md,LICENSE -DestinationPath AUTO_MAA_${{ env.AUTO_MAA_version }}.zip
|
||||
del gui\ui\main.ui
|
||||
del gui\ico\AUTO_MAA.ico
|
||||
move updater.ui gui\ui
|
||||
move AUTO_MAA_Updater.ico gui\ico
|
||||
Compress-Archive -Path gui,dist/Updater.exe -DestinationPath Updater_${{ env.updater_version }}.zip
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
|
||||
28
AUTO_MAA.py
28
AUTO_MAA.py
@@ -112,7 +112,7 @@ class MaaRunner(QtCore.QThread):
|
||||
all_index = [
|
||||
_
|
||||
for _ in range(len(self.data))
|
||||
if (self.data[_][3] > 0 and self.data[_][4] == "y")
|
||||
if (self.data[_][3] != 0 and self.data[_][4] == "y")
|
||||
]
|
||||
# 日常代理模式
|
||||
if self.mode == "日常代理":
|
||||
@@ -253,7 +253,7 @@ class MaaRunner(QtCore.QThread):
|
||||
time.sleep(10)
|
||||
break
|
||||
if run_book[0] and run_book[1]:
|
||||
if self.data[index][14] == 0:
|
||||
if self.data[index][14] == 0 and self.data[index][3] != -1:
|
||||
self.data[index][3] -= 1
|
||||
self.data[index][14] += 1
|
||||
over_index.append(index)
|
||||
@@ -1084,7 +1084,7 @@ class Main(QWidget):
|
||||
]
|
||||
|
||||
self.ui = uiLoader.load(self.app_path + "/gui/ui/main.ui")
|
||||
self.ui.setWindowIcon(QIcon(self.app_path + "/res/AUTO_MAA.ico"))
|
||||
self.ui.setWindowIcon(QIcon(self.app_path + "/gui/ico/AUTO_MAA.ico"))
|
||||
# 检查文件完整性
|
||||
self.initialize()
|
||||
self.check_config()
|
||||
@@ -1599,6 +1599,8 @@ class Main(QWidget):
|
||||
self.user_column[j],
|
||||
)
|
||||
)
|
||||
elif j == 3 and value == -1:
|
||||
item = QTableWidgetItem("无限")
|
||||
elif j == 5:
|
||||
curdate = server_date()
|
||||
if curdate != value:
|
||||
@@ -1654,6 +1656,8 @@ class Main(QWidget):
|
||||
self.user_column[j],
|
||||
)
|
||||
)
|
||||
elif j == 3 and value == -1:
|
||||
item = QTableWidgetItem("无限")
|
||||
elif j == 5:
|
||||
curdate = server_date()
|
||||
if curdate != value:
|
||||
@@ -1740,7 +1744,6 @@ class Main(QWidget):
|
||||
self.over_text.setPlainText(over_text)
|
||||
self.error_text.setPlainText(error_text)
|
||||
self.log_text.setPlainText(log_text)
|
||||
self.log_text.ensureCursorVisible()
|
||||
self.log_text.verticalScrollBar().setValue(
|
||||
self.log_text.verticalScrollBar().maximum()
|
||||
)
|
||||
@@ -2009,7 +2012,11 @@ class Main(QWidget):
|
||||
text = item.text()
|
||||
if mode == "simple":
|
||||
if item.column() == 3:
|
||||
text = int(text)
|
||||
try:
|
||||
text = max(int(text), -1)
|
||||
except ValueError:
|
||||
self.update_user_info("normal")
|
||||
return None
|
||||
if item.column() in [6, 7, 8]:
|
||||
# 导入与应用特殊关卡规则
|
||||
games = {}
|
||||
@@ -2029,7 +2036,11 @@ class Main(QWidget):
|
||||
)
|
||||
elif mode == "beta":
|
||||
if item.column() == 1:
|
||||
text = int(text)
|
||||
try:
|
||||
text = max(int(text), -1)
|
||||
except ValueError:
|
||||
self.update_user_info("normal")
|
||||
return None
|
||||
if item.column() == 6:
|
||||
text = self.encryptx(text)
|
||||
if text != "":
|
||||
@@ -2403,6 +2414,7 @@ class Main(QWidget):
|
||||
self.app_path,
|
||||
"AUTO_MAA更新器",
|
||||
version_remote["updater_download_url"],
|
||||
version_remote["updater_version"],
|
||||
)
|
||||
if main_version_remote > main_version_current:
|
||||
self.updater.update_process.accomplish.connect(self.update_main)
|
||||
@@ -2424,7 +2436,7 @@ class Main(QWidget):
|
||||
"""将版本号列表转为可读的文本信息"""
|
||||
if version_numb[3] == 0:
|
||||
version = f"v{'.'.join(str(_) for _ in version_numb[0:3])}"
|
||||
elif version_numb[3] == 1:
|
||||
else:
|
||||
version = f"v{'.'.join(str(_) for _ in version_numb[0:3])}_beta"
|
||||
return version
|
||||
|
||||
@@ -2434,7 +2446,7 @@ class Main(QWidget):
|
||||
title=title,
|
||||
message=message,
|
||||
app_name="AUTO_MAA",
|
||||
app_icon=self.app_path + "/res/AUTO_MAA.ico",
|
||||
app_icon=self.app_path + "/gui/ico/AUTO_MAA.ico",
|
||||
timeout=t,
|
||||
ticker=ticker,
|
||||
toast=True,
|
||||
|
||||
@@ -132,7 +132,7 @@ MAA多账号管理与自动化软件
|
||||
- `用户名`:展示在执行界面的用户名,用于区分不同用户。
|
||||
- `账号ID`:MAA进行账号切换所需的凭据,官服用户请输入手机号码、B服请输入B站ID。
|
||||
- `服务器`:当前支持官服、B服。
|
||||
- `代理天数`:剩余需要进行代理的天数,当剩余天数为0时不再代理或排查。
|
||||
- `代理天数`:剩余需要进行代理的天数,输入`任意负数`可设置为无限代理天数,当剩余天数为0时不再代理或排查。
|
||||
- `状态`:用户的状态,禁用时将不再对其进行代理或排查。
|
||||
- `执行情况`:当日执行情况,不可编辑。
|
||||
- `关卡`、`备选关卡-1`、`备选关卡-2`:关卡号。
|
||||
|
||||
28
Updater.py
28
Updater.py
@@ -49,12 +49,13 @@ class UpdateProcess(QThread):
|
||||
progress = Signal(int, int, int)
|
||||
accomplish = Signal()
|
||||
|
||||
def __init__(self, app_path, name, download_url):
|
||||
def __init__(self, app_path, name, download_url, version):
|
||||
super(UpdateProcess, self).__init__()
|
||||
|
||||
self.app_path = app_path
|
||||
self.name = name
|
||||
self.download_url = download_url
|
||||
self.version = version
|
||||
self.download_path = app_path + "/AUTO_MAA_Update.zip" # 临时下载文件的路径
|
||||
self.version_path = app_path + "/res/version.json"
|
||||
|
||||
@@ -100,17 +101,27 @@ class UpdateProcess(QThread):
|
||||
e = str(e)
|
||||
e = "\n".join([e[_ : _ + 75] for _ in range(0, len(e), 75)])
|
||||
self.info.emit(f"解压更新时出错:\n{e}")
|
||||
|
||||
with open(self.version_path, "r", encoding="utf-8") as f:
|
||||
version_info = json.load(f)
|
||||
if self.name == "AUTO_MAA更新器":
|
||||
version_info["updater_version"] = self.version
|
||||
elif self.name == "AUTO_MAA主程序":
|
||||
version_info["main_version"] = self.version
|
||||
with open(self.version_path, "w", encoding="utf-8") as f:
|
||||
json.dump(version_info, f, indent=4)
|
||||
|
||||
self.accomplish.emit()
|
||||
|
||||
|
||||
class Updater(QObject):
|
||||
|
||||
def __init__(self, app_path, name, download_url):
|
||||
def __init__(self, app_path, name, download_url, version):
|
||||
super().__init__()
|
||||
|
||||
self.ui = uiLoader.load(app_path + "/gui/ui/updater.ui")
|
||||
self.ui.setWindowTitle("AUTO_MAA更新器")
|
||||
self.ui.setWindowIcon(QIcon(app_path + "/res/AUTO_MAA.ico"))
|
||||
self.ui.setWindowIcon(QIcon(app_path + "/gui/ico/AUTO_MAA_Updater.ico"))
|
||||
|
||||
self.info = self.ui.findChild(QLabel, "label")
|
||||
self.info.setText("正在初始化")
|
||||
@@ -118,7 +129,7 @@ class Updater(QObject):
|
||||
self.progress = self.ui.findChild(QProgressBar, "progressBar")
|
||||
self.progress.setRange(0, 0)
|
||||
|
||||
self.update_process = UpdateProcess(app_path, name, download_url)
|
||||
self.update_process = UpdateProcess(app_path, name, download_url, version)
|
||||
|
||||
self.update_process.info.connect(self.update_info)
|
||||
self.update_process.progress.connect(self.update_progress)
|
||||
@@ -134,10 +145,10 @@ class Updater(QObject):
|
||||
|
||||
|
||||
class AUTO_MAA_Updater(QApplication):
|
||||
def __init__(self, app_path, name, download_url):
|
||||
def __init__(self, app_path, name, download_url, version):
|
||||
super().__init__()
|
||||
|
||||
self.main = Updater(app_path, name, download_url)
|
||||
self.main = Updater(app_path, name, download_url, version)
|
||||
self.main.ui.show()
|
||||
|
||||
|
||||
@@ -157,6 +168,9 @@ if __name__ == "__main__":
|
||||
|
||||
if main_version_remote > main_version_current:
|
||||
app = AUTO_MAA_Updater(
|
||||
app_path, "AUTO_MAA主程序", version_remote["main_download_url"]
|
||||
app_path,
|
||||
"AUTO_MAA主程序",
|
||||
version_remote["main_download_url"],
|
||||
version_remote["main_version"],
|
||||
)
|
||||
sys.exit(app.exec())
|
||||
|
||||
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
BIN
gui/ico/AUTO_MAA_Updater.ico
Normal file
BIN
gui/ico/AUTO_MAA_Updater.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
@@ -189,7 +189,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>88</width>
|
||||
<width>98</width>
|
||||
<height>74</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -1037,7 +1037,7 @@
|
||||
<property name="title">
|
||||
<string>AUTO_MAA设置</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4" rowstretch="1,1" columnstretch="1,1,1,1">
|
||||
<layout class="QGridLayout" name="gridLayout_4" columnstretch="1,1,1,1">
|
||||
<item row="0" column="0">
|
||||
<widget class="QFrame" name="frame_routine_3">
|
||||
<property name="frameShape">
|
||||
|
||||
50
package.py
50
package.py
@@ -28,23 +28,39 @@ v4.1
|
||||
import os
|
||||
import json
|
||||
|
||||
os.system(
|
||||
"pyinstaller -F --version-file res/AUTO_MAA_info.txt -w --icon=res/AUTO_MAA.ico AUTO_MAA.py --hidden-import plyer.platforms.win.notification"
|
||||
)
|
||||
os.system(
|
||||
"pyinstaller -F --version-file res/Updater_info.txt -w --icon=res/AUTO_MAA.ico Updater.py"
|
||||
)
|
||||
|
||||
def version_text(version_numb):
|
||||
"""将版本号列表转为可读的文本信息"""
|
||||
if version_numb[3] == 0:
|
||||
version = f"v{'.'.join(str(_) for _ in version_numb[0:3])}"
|
||||
else:
|
||||
version = f"v{'.'.join(str(_) for _ in version_numb[0:3])}_beta"
|
||||
return version
|
||||
|
||||
|
||||
with open("res/version.json", "r", encoding="utf-8") as f:
|
||||
version = json.load(f)
|
||||
main_version = list(map(int, version["main_version"].split(".")))
|
||||
updater_version = list(map(int, version["updater_version"].split(".")))
|
||||
if main_version[3] == 0:
|
||||
main_version = f"v{'.'.join(str(_) for _ in main_version[0:3])}"
|
||||
elif main_version[3] == 1:
|
||||
main_version = f"v{'.'.join(str(_) for _ in main_version[0:3])}_beta"
|
||||
if updater_version[3] == 0:
|
||||
updater_version = f"v{'.'.join(str(_) for _ in updater_version[0:3])}"
|
||||
elif updater_version[3] == 1:
|
||||
updater_version = f"v{'.'.join(str(_) for _ in updater_version[0:3])}_beta"
|
||||
|
||||
main_version_numb = list(map(int, version["main_version"].split(".")))
|
||||
updater_version_numb = list(map(int, version["updater_version"].split(".")))
|
||||
|
||||
main_info = f"# UTF-8\n#\nVSVersionInfo(\n ffi=FixedFileInfo(\n # filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)\n # Set not needed items to zero 0.\n filevers=({', '.join(str(_) for _ in main_version_numb)}),\n prodvers=(0, 0, 0, 0),\n # Contains a bitmask that specifies the valid bits 'flags'r\n mask=0x3f,\n # Contains a bitmask that specifies the Boolean attributes of the file.\n flags=0x0,\n # The operating system for which this file was designed.\n # 0x4 - NT and there is no need to change it.\n OS=0x4,\n # The general type of file.\n # 0x1 - the file is an application.\n fileType=0x1,\n # The function of the file.\n # 0x0 - the function is not defined for this fileType\n subtype=0x0,\n # Creation date and time stamp.\n date=(0, 0)\n ),\n kids=[\n VarFileInfo([VarStruct('Translation', [0, 1200])]), \n StringFileInfo(\n [\n StringTable(\n '000004b0',\n [StringStruct('Comments', 'https://github.com/DLmaster361/AUTO_MAA/'),\n StringStruct('CompanyName', 'AUTO_MAA Team'),\n StringStruct('FileDescription', 'AUTO_MAA Component'),\n StringStruct('FileVersion', '{version["main_version"]}'),\n StringStruct('InternalName', 'AUTO_MAA'),\n StringStruct('LegalCopyright', 'Copyright © 2024 DLmaster361'),\n StringStruct('OriginalFilename', 'AUTO_MAA.py'),\n StringStruct('ProductName', 'AUTO_MAA'),\n StringStruct('ProductVersion', 'v{version["main_version"]}'),\n StringStruct('Assembly Version', 'v{version["main_version"]}')])\n ])\n ]\n)"
|
||||
updater_info = f"# UTF-8\n#\nVSVersionInfo(\n ffi=FixedFileInfo(\n # filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)\n # Set not needed items to zero 0.\n filevers=({', '.join(str(_) for _ in updater_version_numb)}),\n prodvers=(0, 0, 0, 0),\n # Contains a bitmask that specifies the valid bits 'flags'r\n mask=0x3f,\n # Contains a bitmask that specifies the Boolean attributes of the file.\n flags=0x0,\n # The operating system for which this file was designed.\n # 0x4 - NT and there is no need to change it.\n OS=0x4,\n # The general type of file.\n # 0x1 - the file is an application.\n fileType=0x1,\n # The function of the file.\n # 0x0 - the function is not defined for this fileType\n subtype=0x0,\n # Creation date and time stamp.\n date=(0, 0)\n ),\n kids=[\n VarFileInfo([VarStruct('Translation', [0, 1200])]), \n StringFileInfo(\n [\n StringTable(\n '000004b0',\n [StringStruct('Comments', 'https://github.com/DLmaster361/AUTO_MAA/'),\n StringStruct('CompanyName', 'AUTO_MAA Team'),\n StringStruct('FileDescription', 'AUTO_MAA Component'),\n StringStruct('FileVersion', '{version["updater_version"]}'),\n StringStruct('InternalName', 'AUTO_MAA_Updater'),\n StringStruct('LegalCopyright', 'Copyright © 2024 DLmaster361'),\n StringStruct('OriginalFilename', 'Updater.py'),\n StringStruct('ProductName', 'AUTO_MAA_Updater'),\n StringStruct('ProductVersion', 'v{version["updater_version"]}'),\n StringStruct('Assembly Version', 'v{version["updater_version"]}')])\n ])\n ]\n)"
|
||||
|
||||
with open("AUTO_MAA_info.txt", "w", encoding="utf-8") as f:
|
||||
print(main_info, end="", file=f)
|
||||
with open("Updater_info.txt", "w", encoding="utf-8") as f:
|
||||
print(updater_info, end="", file=f)
|
||||
|
||||
os.system(
|
||||
"pyinstaller -F --version-file AUTO_MAA_info.txt -w --icon=gui/ico/AUTO_MAA.ico AUTO_MAA.py --hidden-import plyer.platforms.win.notification"
|
||||
)
|
||||
os.system(
|
||||
"pyinstaller -F --version-file Updater_info.txt -w --icon=gui/ico/AUTO_MAA_Updater.ico Updater.py"
|
||||
)
|
||||
|
||||
with open("update_info.txt", "w", encoding="utf-8") as f:
|
||||
print(f"{main_version}\n{updater_version}\n{version["announcement"]}", file=f)
|
||||
print(
|
||||
f"{version_text(main_version_numb)}\n{version_text(updater_version_numb)}{version["announcement"]}",
|
||||
file=f,
|
||||
)
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
# UTF-8
|
||||
#
|
||||
VSVersionInfo(
|
||||
ffi=FixedFileInfo(
|
||||
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
|
||||
# Set not needed items to zero 0.
|
||||
filevers=(4, 1, 1, 1),
|
||||
prodvers=(0, 0, 0, 0),
|
||||
# Contains a bitmask that specifies the valid bits 'flags'r
|
||||
mask=0x3f,
|
||||
# Contains a bitmask that specifies the Boolean attributes of the file.
|
||||
flags=0x0,
|
||||
# The operating system for which this file was designed.
|
||||
# 0x4 - NT and there is no need to change it.
|
||||
OS=0x4,
|
||||
# The general type of file.
|
||||
# 0x1 - the file is an application.
|
||||
fileType=0x1,
|
||||
# The function of the file.
|
||||
# 0x0 - the function is not defined for this fileType
|
||||
subtype=0x0,
|
||||
# Creation date and time stamp.
|
||||
date=(0, 0)
|
||||
),
|
||||
kids=[
|
||||
VarFileInfo([VarStruct('Translation', [0, 1200])]),
|
||||
StringFileInfo(
|
||||
[
|
||||
StringTable(
|
||||
'000004b0',
|
||||
[StringStruct('Comments', 'https://github.com/DLmaster361/AUTO_MAA/'),
|
||||
StringStruct('CompanyName', 'AUTO_MAA Team'),
|
||||
StringStruct('FileDescription', 'AUTO_MAA Component'),
|
||||
StringStruct('FileVersion', '4.1.1.1'),
|
||||
StringStruct('InternalName', 'AUTO_MAA'),
|
||||
StringStruct('LegalCopyright', 'Copyright © 2024 DLmaster361'),
|
||||
StringStruct('OriginalFilename', 'AUTO_MAA.py'),
|
||||
StringStruct('ProductName', 'AUTO_MAA'),
|
||||
StringStruct('ProductVersion', 'v4.1.1.1'),
|
||||
StringStruct('Assembly Version', 'v4.1.1.1')])
|
||||
])
|
||||
]
|
||||
)
|
||||
@@ -1,43 +0,0 @@
|
||||
# UTF-8
|
||||
#
|
||||
VSVersionInfo(
|
||||
ffi=FixedFileInfo(
|
||||
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
|
||||
# Set not needed items to zero 0.
|
||||
filevers=(1, 0, 0, 0),
|
||||
prodvers=(0, 0, 0, 0),
|
||||
# Contains a bitmask that specifies the valid bits 'flags'r
|
||||
mask=0x3f,
|
||||
# Contains a bitmask that specifies the Boolean attributes of the file.
|
||||
flags=0x0,
|
||||
# The operating system for which this file was designed.
|
||||
# 0x4 - NT and there is no need to change it.
|
||||
OS=0x4,
|
||||
# The general type of file.
|
||||
# 0x1 - the file is an application.
|
||||
fileType=0x1,
|
||||
# The function of the file.
|
||||
# 0x0 - the function is not defined for this fileType
|
||||
subtype=0x0,
|
||||
# Creation date and time stamp.
|
||||
date=(0, 0)
|
||||
),
|
||||
kids=[
|
||||
VarFileInfo([VarStruct('Translation', [0, 1200])]),
|
||||
StringFileInfo(
|
||||
[
|
||||
StringTable(
|
||||
'000004b0',
|
||||
[StringStruct('Comments', 'https://github.com/DLmaster361/AUTO_MAA/'),
|
||||
StringStruct('CompanyName', 'AUTO_MAA Team'),
|
||||
StringStruct('FileDescription', 'AUTO_MAA Component'),
|
||||
StringStruct('FileVersion', '1.0.0.0'),
|
||||
StringStruct('InternalName', 'AUTO_MAA_Updater'),
|
||||
StringStruct('LegalCopyright', 'Copyright © 2024 DLmaster361'),
|
||||
StringStruct('OriginalFilename', 'Updater.py'),
|
||||
StringStruct('ProductName', 'AUTO_MAA_Updater'),
|
||||
StringStruct('ProductVersion', 'v1.0.0.0'),
|
||||
StringStruct('Assembly Version', 'v1.0.0.0')])
|
||||
])
|
||||
]
|
||||
)
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"main_version": "4.1.1.1",
|
||||
"main_download_url": "https://ghp.ci/https://github.com/DLmaster361/AUTO_MAA/releases/download/v4.1.1_beta/AUTO_MAA_v4.1.1_beta.zip",
|
||||
"updater_version": "1.0.0.0",
|
||||
"updater_download_url": "https://ghp.ci/https://github.com/DLmaster361/AUTO_MAA/releases/download/v4.1.1_beta/Updater_v1.0.0.zip",
|
||||
"announcement": "\n# 开发中的版本!非开发者勿直接更新!!否则后果自负!!!\n## 新增功能\n- 添加`启动AUTO_MAA后直接代理`功能"
|
||||
"main_version": "4.1.2.0",
|
||||
"main_download_url": "https://ghp.ci/https://github.com/DLmaster361/AUTO_MAA/releases/download/v4.1.1_beta/AUTO_MAA_v4.1.2.zip",
|
||||
"updater_version": "1.0.2.0",
|
||||
"updater_download_url": "https://ghp.ci/https://github.com/DLmaster361/AUTO_MAA/releases/download/v4.1.1_beta/Updater_v1.0.2.zip",
|
||||
"announcement": "\n# 公测版,若出现问题请及时反馈给项目组!\n## 新增功能\n- 添加`启动AUTO_MAA后直接代理`功能\n- 添加无限代理天数模式\n## 修复BUG\n- 尝试解决卡日志情况\n## 程序优化\n- Updater.exe图标更换\n- 更新逻辑优化"
|
||||
}
|
||||
Reference in New Issue
Block a user