MaaFw 2.1.0b1__py3-none-win_amd64.whl → 2.1.1__py3-none-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of MaaFw might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: MaaFw
3
- Version: 2.1.0b1
3
+ Version: 2.1.1
4
4
  Summary: An automation black-box testing framework based on image recognition
5
5
  Author: MaaXYZ
6
6
  Project-URL: Homepage, https://github.com/MaaXYZ/MaaFramework
@@ -96,7 +96,10 @@ _✨ 基于图像识别的自动化黑盒测试框架 ✨_
96
96
 
97
97
  - [MET](https://github.com/shanchuan001/MET) 悠久之树 小助手 ![Pipeline](https://img.shields.io/badge/Pipeline-%23454545?logo=paddypower&logoColor=%23FFFFFF)
98
98
  基于全新架构的 悠久之树 小助手。图像技术 + 模拟控制,解放双手!由 MaaFramework 强力驱动!
99
-
99
+
100
+ - [MaaYYs](https://github.com/TanyaShue/MaaYYs) 阴阳师小助手 ![python](https://img.shields.io/badge/Python-3776AB?logo=python&logoColor=white) ![qt](https://img.shields.io/badge/Qt6-41CD52?logo=Qt&logoColor=white)
101
+ 基于全新架构的 阴阳师小助手。图像技术 + 模拟控制,当赛博屯屯鼠,自动日常,解放你的双手!由 MaaFramework 强力驱动!
102
+
100
103
  ## 生态共建
101
104
 
102
105
  MAA 正计划建设为一类项目,而非舟的单一软件。
@@ -0,0 +1,28 @@
1
+ maa/__init__.py,sha256=rBIC5X_VsfFXOMJRdKjgDyO428XHgeWAT3t6ZYmqO1M,207
2
+ maa/buffer.py,sha256=E0tuasXPm6A_4r22PGSwObgGXb2qCMJrT5yrAvcgk6I,17424
3
+ maa/context.py,sha256=Y71T92tIAGq6x8bJfYX8emUPEmPUA7nhnWgqOHh390E,5722
4
+ maa/controller.py,sha256=BpAotY8qlxLSKU0ZO249YDhJWU35B5avnwCTE5PxItQ,22160
5
+ maa/custom_action.py,sha256=pqPjDK7nVkGL8fceJadwb7IkeGjYc2X8RaXZOnVZXQs,2527
6
+ maa/custom_recognition.py,sha256=Y3Asdgb19YZioOVZZVs_hLSW6uBg7WDZDQPR2XfZpFU,3087
7
+ maa/define.py,sha256=nFPEOa7asyf4UG9kkeQrQaarXWbN0w-tSHoQWdZi_4s,11032
8
+ maa/job.py,sha256=Vj6q3sFPlmo260mxJWBnPuO2oT2LdZ-92vdDvrqBZYU,1777
9
+ maa/library.py,sha256=nDTBUFC6_91gmyy8SfkTTccMZET9XGU8IxvuVUEwQ6E,2099
10
+ maa/notification_handler.py,sha256=KjQlu66fNVwGGli8kuhNdSZPj2vO_oXjaNt_B1i_5wA,5251
11
+ maa/resource.py,sha256=bvS02sCCS9DRw_zJZeyCk8_DrZry6KBlUIvcfpKoUIg,8243
12
+ maa/tasker.py,sha256=6FOzU-PxWSA0dK8vEmiPVaJThvUMwNDi6EC6V-TcQmM,14758
13
+ maa/toolkit.py,sha256=TlF8MoaGcWLklpISIlQNvc_rpTFBFrpDbLgctfQ_zqo,11325
14
+ maa/bin/DirectML.dll,sha256=it3PSVO_NoJUHvoqZSbiQOjiMd-RqChTBrK5cl9CKWE,27383832
15
+ maa/bin/MaaAdbControlUnit.dll,sha256=sO2mxnHgCy0sKIl2ByxHk4kDtaJCNhjRDWwDvFiJarY,776192
16
+ maa/bin/MaaDbgControlUnit.dll,sha256=d3kOPkaEF69ihYRbiz34KocdJ5nAMRLZB__pF0s8rSg,424448
17
+ maa/bin/MaaFramework.dll,sha256=kdP-ZtfZGBQc6viL8T0AXmurhFBhExGqTiMMjQrFYx8,1377792
18
+ maa/bin/MaaToolkit.dll,sha256=REyHnio8ON1c9vPio5J2e5gE9gNHt9DH5rUZHymmugs,695808
19
+ maa/bin/MaaUtils.dll,sha256=vnzdAWue35eqLf1ri9M159MOkNoKw45tNcuByj1drLo,541696
20
+ maa/bin/MaaWin32ControlUnit.dll,sha256=bgvNZ3a3hfkI1CcjIDLmlhbOF1Vzu3HivQi8ovUt2EY,368128
21
+ maa/bin/fastdeploy_ppocr_maa.dll,sha256=4ri3FE9bJemUgZu3bsvDSPbqsioIFki1J-Ifk3qkKvg,564736
22
+ maa/bin/onnxruntime_maa.dll,sha256=cu4Z-EwQuqMuphxCt4Pho7XPlUcIEenPK9Tk90alBhc,14653440
23
+ maa/bin/opencv_world4_maa.dll,sha256=NtWJEx6Dg29Qqk493eAAU8O8zZ7Ym5UV6RQ0N0RG9RU,18230272
24
+ MaaFw-2.1.1.dist-info/LICENSE.md,sha256=RG51X65V_wNLuyG-RGcLXxFsKyZnlH5wNvK_5mMlOag,7560
25
+ MaaFw-2.1.1.dist-info/METADATA,sha256=U_0LGG0Bd78RVEThDEk2FOUVom-uQXenO9a9lTJ5MdU,9817
26
+ MaaFw-2.1.1.dist-info/WHEEL,sha256=1lcNv5ya_rmBEsTRObX12WYzMCEm6jtegLvKau9-dKM,96
27
+ MaaFw-2.1.1.dist-info/top_level.txt,sha256=G8r2L__aYaMq4S3R70G6NsfEROiVp08kUcWvATzk2J8,4
28
+ MaaFw-2.1.1.dist-info/RECORD,,
Binary file
Binary file
maa/bin/MaaFramework.dll CHANGED
Binary file
maa/bin/MaaToolkit.dll CHANGED
Binary file
maa/bin/MaaUtils.dll CHANGED
Binary file
Binary file
maa/define.py CHANGED
@@ -105,13 +105,25 @@ class MaaCtrlOptionEnum:
105
105
  Recording = 5
106
106
 
107
107
 
108
+ # enum MaaInferenceDeviceEnum
109
+ # {
110
+ # MaaInferenceDevice_CPU = -2,
111
+ # MaaInferenceDevice_Auto = -1,
112
+ # MaaInferenceDevice_GPU0 = 0,
113
+ # MaaInferenceDevice_GPU1 = 1,
114
+ # // and more gpu id...
115
+ # };
116
+ MaaInferenceDevice = ctypes.c_int32
117
+
108
118
  class MaaResOptionEnum:
109
119
  Invalid = 0
110
120
 
111
- # Use the specified inference device, the default is INT32_MAX, which means CPU.
121
+ # Use the specified inference device.
112
122
  # Please set this option before loading the model.
113
- # value: int32_t, eg: 0; val_size: sizeof(int32_t)
114
- GpuId = 1
123
+ #
124
+ # value: MaaInferenceDevice, eg: 0; val_size: sizeof(MaaInferenceDevice)
125
+ # default value is MaaInferenceDevice_Auto
126
+ InferenceDevice = 1
115
127
 
116
128
 
117
129
  MaaAdbScreencapMethod = ctypes.c_uint64
@@ -33,7 +33,7 @@ class NotificationHandler(ABC):
33
33
  path: str
34
34
 
35
35
  def on_resource_loading(
36
- self, type: NotificationType, detail: ResourceLoadingDetail
36
+ self, noti_type: NotificationType, detail: ResourceLoadingDetail
37
37
  ):
38
38
  pass
39
39
 
@@ -44,7 +44,7 @@ class NotificationHandler(ABC):
44
44
  action: str
45
45
 
46
46
  def on_controller_action(
47
- self, type: NotificationType, detail: ControllerActionDetail
47
+ self, noti_type: NotificationType, detail: ControllerActionDetail
48
48
  ):
49
49
  pass
50
50
 
@@ -55,7 +55,7 @@ class NotificationHandler(ABC):
55
55
  uuid: str
56
56
  hash: str
57
57
 
58
- def on_tasker_task(self, type: NotificationType, detail: TaskerTaskDetail):
58
+ def on_tasker_task(self, noti_type: NotificationType, detail: TaskerTaskDetail):
59
59
  pass
60
60
 
61
61
  @dataclass
@@ -64,7 +64,9 @@ class NotificationHandler(ABC):
64
64
  name: str
65
65
  next_list: list[str]
66
66
 
67
- def on_task_next_list(self, type: NotificationType, detail: TaskNextListDetail):
67
+ def on_task_next_list(
68
+ self, noti_type: NotificationType, detail: TaskNextListDetail
69
+ ):
68
70
  pass
69
71
 
70
72
  @dataclass
@@ -74,7 +76,7 @@ class NotificationHandler(ABC):
74
76
  name: str
75
77
 
76
78
  def on_task_recognition(
77
- self, type: NotificationType, detail: TaskRecognitionDetail
79
+ self, noti_type: NotificationType, detail: TaskRecognitionDetail
78
80
  ):
79
81
  pass
80
82
 
@@ -84,7 +86,7 @@ class NotificationHandler(ABC):
84
86
  node_id: int
85
87
  name: str
86
88
 
87
- def on_task_action(self, type: NotificationType, detail: TaskActionDetail):
89
+ def on_task_action(self, noti_type: NotificationType, detail: TaskActionDetail):
88
90
  pass
89
91
 
90
92
  def on_unknown_notification(self, msg: str, details: dict):
@@ -92,7 +94,7 @@ class NotificationHandler(ABC):
92
94
 
93
95
  def on_raw_notification(self, msg: str, details: dict):
94
96
 
95
- type = NotificationHandler._notification_type(msg)
97
+ noti_type = NotificationHandler._notification_type(msg)
96
98
 
97
99
  if msg.startswith("Resource.Loading"):
98
100
  detail = self.ResourceLoadingDetail(
@@ -100,7 +102,7 @@ class NotificationHandler(ABC):
100
102
  hash=details["hash"],
101
103
  path=details["path"],
102
104
  )
103
- self.on_resource_loading(type, detail)
105
+ self.on_resource_loading(noti_type, detail)
104
106
 
105
107
  elif msg.startswith("Controller.Action"):
106
108
  detail = self.ControllerActionDetail(
@@ -108,7 +110,7 @@ class NotificationHandler(ABC):
108
110
  uuid=details["uuid"],
109
111
  action=details["action"],
110
112
  )
111
- self.on_controller_action(type, detail)
113
+ self.on_controller_action(noti_type, detail)
112
114
 
113
115
  elif msg.startswith("Tasker.Task"):
114
116
  detail = self.TaskerTaskDetail(
@@ -117,7 +119,7 @@ class NotificationHandler(ABC):
117
119
  uuid=details["uuid"],
118
120
  hash=details["hash"],
119
121
  )
120
- self.on_tasker_task(type, detail)
122
+ self.on_tasker_task(noti_type, detail)
121
123
 
122
124
  elif msg.startswith("Task.NextList"):
123
125
  detail = self.TaskNextListDetail(
@@ -125,7 +127,7 @@ class NotificationHandler(ABC):
125
127
  name=details["name"],
126
128
  next_list=details["list"],
127
129
  )
128
- self.on_task_next_list(type, detail)
130
+ self.on_task_next_list(noti_type, detail)
129
131
 
130
132
  elif msg.startswith("Task.Recognition"):
131
133
  detail = self.TaskRecognitionDetail(
@@ -133,7 +135,7 @@ class NotificationHandler(ABC):
133
135
  reco_id=details["reco_id"],
134
136
  name=details["name"],
135
137
  )
136
- self.on_task_recognition(type, detail)
138
+ self.on_task_recognition(noti_type, detail)
137
139
 
138
140
  elif msg.startswith("Task.Action"):
139
141
  detail = self.TaskActionDetail(
@@ -141,7 +143,7 @@ class NotificationHandler(ABC):
141
143
  node_id=details["node_id"],
142
144
  name=details["name"],
143
145
  )
144
- self.on_task_action(type, detail)
146
+ self.on_task_action(noti_type, detail)
145
147
 
146
148
  else:
147
149
  self.on_unknown_notification(msg, details)
maa/resource.py CHANGED
@@ -60,20 +60,18 @@ class Resource:
60
60
  def clear(self) -> bool:
61
61
  return bool(Library.framework.MaaResourceClear(self._handle))
62
62
 
63
- def set_gpu(self, device_id: int) -> bool:
64
- cint = ctypes.c_int32(device_id)
65
- return bool(
66
- Library.framework.MaaResourceSetOption(
67
- self._handle,
68
- MaaResOptionEnum.GpuId,
69
- ctypes.pointer(cint),
70
- ctypes.sizeof(ctypes.c_int32),
71
- )
72
- )
63
+ def set_gpu(self, gpu_id: int) -> bool:
64
+ if gpu_id < 0:
65
+ return False
66
+ return self.set_inference_device(gpu_id)
73
67
 
74
68
  def set_cpu(self) -> bool:
75
- INT32_MAX = 2147483647 # means CPU
76
- return self.set_gpu(INT32_MAX)
69
+ MaaInferenceDevice_CPU = -2
70
+ return self.set_inference_device(MaaInferenceDevice_CPU)
71
+
72
+ def set_auto_device(self) -> bool:
73
+ MaaInferenceDevice_Auto = -1
74
+ return self.set_inference_device(MaaInferenceDevice_Auto)
77
75
 
78
76
  def register_custom_recognition(
79
77
  self, name: str, recognition: "CustomRecognition" # type: ignore
@@ -151,6 +149,17 @@ class Resource:
151
149
 
152
150
  ### private ###
153
151
 
152
+ def set_inference_device(self, device_id: int) -> bool:
153
+ cint = ctypes.c_int32(device_id)
154
+ return bool(
155
+ Library.framework.MaaResourceSetOption(
156
+ self._handle,
157
+ MaaResOptionEnum.InferenceDevice,
158
+ ctypes.pointer(cint),
159
+ ctypes.sizeof(ctypes.c_int32),
160
+ )
161
+ )
162
+
154
163
  def _status(self, id: int) -> ctypes.c_int32:
155
164
  return Library.framework.MaaResourceStatus(self._handle, id)
156
165
 
@@ -1,28 +0,0 @@
1
- maa/__init__.py,sha256=rBIC5X_VsfFXOMJRdKjgDyO428XHgeWAT3t6ZYmqO1M,207
2
- maa/buffer.py,sha256=E0tuasXPm6A_4r22PGSwObgGXb2qCMJrT5yrAvcgk6I,17424
3
- maa/context.py,sha256=Y71T92tIAGq6x8bJfYX8emUPEmPUA7nhnWgqOHh390E,5722
4
- maa/controller.py,sha256=BpAotY8qlxLSKU0ZO249YDhJWU35B5avnwCTE5PxItQ,22160
5
- maa/custom_action.py,sha256=pqPjDK7nVkGL8fceJadwb7IkeGjYc2X8RaXZOnVZXQs,2527
6
- maa/custom_recognition.py,sha256=Y3Asdgb19YZioOVZZVs_hLSW6uBg7WDZDQPR2XfZpFU,3087
7
- maa/define.py,sha256=pYgO5_djp0TBP2sq9SUYb_I-sNjJ2Uv6dfdgVxq2hy0,10745
8
- maa/job.py,sha256=Vj6q3sFPlmo260mxJWBnPuO2oT2LdZ-92vdDvrqBZYU,1777
9
- maa/library.py,sha256=nDTBUFC6_91gmyy8SfkTTccMZET9XGU8IxvuVUEwQ6E,2099
10
- maa/notification_handler.py,sha256=HtGmTFgTj7ibTdAIVNr5-LBn38trv_j6beHvYXUVFeg,5172
11
- maa/resource.py,sha256=9BHZ6XCLTomfvQAO6xv272DH364r3sl8zMGDXJOQ_HU,7913
12
- maa/tasker.py,sha256=6FOzU-PxWSA0dK8vEmiPVaJThvUMwNDi6EC6V-TcQmM,14758
13
- maa/toolkit.py,sha256=TlF8MoaGcWLklpISIlQNvc_rpTFBFrpDbLgctfQ_zqo,11325
14
- maa/bin/DirectML.dll,sha256=it3PSVO_NoJUHvoqZSbiQOjiMd-RqChTBrK5cl9CKWE,27383832
15
- maa/bin/MaaAdbControlUnit.dll,sha256=3IgE33l7ekOFv-BvuBWkfLjvTy-7lO22YPYKQolHDMg,768512
16
- maa/bin/MaaDbgControlUnit.dll,sha256=-w_bTx4DrjPc2ofOZZhOtoKPR2GsSuDX2pycC9vi8Sg,424448
17
- maa/bin/MaaFramework.dll,sha256=J3cH8tC9oWJ35ErHG-gIPw5IkVQAxIr6mN39Ky67t9U,1376768
18
- maa/bin/MaaToolkit.dll,sha256=_3Ur93nMh0p1DCVhhUcffEDjvzvcUdrWkZqoWzpF268,691712
19
- maa/bin/MaaUtils.dll,sha256=siweB3fuxj_uIc--1fmVtMrcS-C3FJ5cSivw6I3tLik,536064
20
- maa/bin/MaaWin32ControlUnit.dll,sha256=D2NpATClXH5XVcTmDvjrlAXTHDhYA2MzLMdg_r1kHIQ,367104
21
- maa/bin/fastdeploy_ppocr_maa.dll,sha256=4ri3FE9bJemUgZu3bsvDSPbqsioIFki1J-Ifk3qkKvg,564736
22
- maa/bin/onnxruntime_maa.dll,sha256=cu4Z-EwQuqMuphxCt4Pho7XPlUcIEenPK9Tk90alBhc,14653440
23
- maa/bin/opencv_world4_maa.dll,sha256=NtWJEx6Dg29Qqk493eAAU8O8zZ7Ym5UV6RQ0N0RG9RU,18230272
24
- MaaFw-2.1.0b1.dist-info/LICENSE.md,sha256=RG51X65V_wNLuyG-RGcLXxFsKyZnlH5wNvK_5mMlOag,7560
25
- MaaFw-2.1.0b1.dist-info/METADATA,sha256=7zB3Lo59K4fjZDHekp7Oe9PBijw7RcnUD3QY2YqqGqE,9430
26
- MaaFw-2.1.0b1.dist-info/WHEEL,sha256=1lcNv5ya_rmBEsTRObX12WYzMCEm6jtegLvKau9-dKM,96
27
- MaaFw-2.1.0b1.dist-info/top_level.txt,sha256=G8r2L__aYaMq4S3R70G6NsfEROiVp08kUcWvATzk2J8,4
28
- MaaFw-2.1.0b1.dist-info/RECORD,,
File without changes