@bettergi/types 0.1.16 → 0.1.18
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.
- package/bindings/Color.d.ts +12 -0
- package/bindings/Pen.d.ts +12 -0
- package/bindings/characterDevelopmentTask.d.ts +11 -0
- package/index.d.ts +3 -0
- package/package.json +1 -1
- package/types/BetterGenshinImpact/Core/BgiVision/BvFlow.d.ts +243 -0
- package/types/BetterGenshinImpact/Core/BgiVision/BvFlowAction.d.ts +249 -0
- package/types/BetterGenshinImpact/Core/BgiVision/BvPage.d.ts +22 -0
- package/types/BetterGenshinImpact/Core/Recognition/RecognitionObject.d.ts +3 -3
- package/types/BetterGenshinImpact/Core/Recognition/SearchOptions.d.ts +116 -3
- package/types/BetterGenshinImpact/Core/Script/Dependence/AutoPathingScript.d.ts +1 -1
- package/types/BetterGenshinImpact/Core/Script/Dependence/Dispatcher.d.ts +1 -1
- package/types/BetterGenshinImpact/Core/Script/Dependence/Genshin.d.ts +29 -3
- package/types/BetterGenshinImpact/GameTask/AutoBoss/AutoBossConfig.d.ts +6 -0
- package/types/BetterGenshinImpact/GameTask/AutoBoss/AutoBossParam.d.ts +6 -0
- package/types/BetterGenshinImpact/GameTask/AutoDomain/AutoDomainTask.d.ts +3 -0
- package/types/BetterGenshinImpact/GameTask/AutoFight/AutoFightConfig.d.ts +101 -3
- package/types/BetterGenshinImpact/GameTask/AutoFight/AutoFightParam.d.ts +58 -2
- package/types/BetterGenshinImpact/GameTask/AutoFight/AutoFightTask.d.ts +173 -0
- package/types/BetterGenshinImpact/GameTask/AutoFight/Model/Avatar.d.ts +2 -26
- package/types/BetterGenshinImpact/GameTask/AutoLeyLineOutcrop/AutoLeyLineOutcropFightConfig.d.ts +30 -0
- package/types/BetterGenshinImpact/GameTask/AutoPathing/PathingScriptNames.d.ts +2 -0
- package/types/BetterGenshinImpact/GameTask/CharacterDevelopment/CharacterDevelopmentTask.d.ts +158 -0
- package/types/BetterGenshinImpact/GameTask/Model/Area/Region.d.ts +5 -0
- package/types/BetterGenshinImpact/GameTask/Model/GameUI/GridScreenName.d.ts +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "../types/BetterGenshinImpact/GameTask/CharacterDevelopment/CharacterDevelopmentTask";
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
/**
|
|
5
|
+
* 角色养成信息识别任务
|
|
6
|
+
* @since 0.63.0
|
|
7
|
+
*/
|
|
8
|
+
const characterDevelopmentTask: BetterGenshinImpact.GameTask.CharacterDevelopment.CharacterDevelopmentTask;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export {};
|
package/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import "./bindings/keyMouseScript"; // 录制回放
|
|
5
5
|
import "./bindings/pathingScript"; // 地图追踪
|
|
6
6
|
import "./bindings/genshin"; // 游戏相关
|
|
7
|
+
import "./bindings/characterDevelopmentTask"; // 角色养成信息识别
|
|
7
8
|
import "./bindings/log"; // 日志
|
|
8
9
|
import "./bindings/file"; // 受限文件读写
|
|
9
10
|
import "./bindings/http"; // 受限 HTTP 请求
|
|
@@ -63,6 +64,8 @@ import "./bindings/DesktopRegion"; // 桌面区域
|
|
|
63
64
|
import "./bindings/GameCaptureRegion"; // 游戏截图区域
|
|
64
65
|
import "./bindings/ImageRegion"; // 图像区域
|
|
65
66
|
import "./bindings/Region"; // 通用屏幕区域
|
|
67
|
+
import "./bindings/Pen"; // System.Drawing 画笔
|
|
68
|
+
import "./bindings/Color"; // System.Drawing 颜色
|
|
66
69
|
|
|
67
70
|
// 战斗场景与角色宿主类型
|
|
68
71
|
import "./bindings/CombatScenes";
|
package/package.json
CHANGED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ClrHostValue,
|
|
3
|
+
DoubleHost,
|
|
4
|
+
HostType,
|
|
5
|
+
Int32Host,
|
|
6
|
+
ReferenceTypeTrait,
|
|
7
|
+
StrongNumeric
|
|
8
|
+
} from "../../../Microsoft/ClearScript/HostType";
|
|
9
|
+
import "../../../OpenCvSharp/Rect";
|
|
10
|
+
import "../../../System/Collections/Generic/IEnumerable";
|
|
11
|
+
import type { KeyCode } from "../../Helpers/User32Helper";
|
|
12
|
+
import type { BvFlowAction } from "./BvFlowAction";
|
|
13
|
+
import type { BvLocator } from "./BvLocator";
|
|
14
|
+
import type { BvPage } from "./BvPage";
|
|
15
|
+
|
|
16
|
+
type Int32Value = number | StrongNumeric<Int32Host>;
|
|
17
|
+
type DoubleValue = number | StrongNumeric<DoubleHost>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* 流程中的脚本回调,可同步完成或返回 Promise
|
|
21
|
+
* @since 0.63.0
|
|
22
|
+
*/
|
|
23
|
+
export type BvFlowCallback = () => void | Promise<void>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* BgiVision 链式流程,按添加顺序执行等待、输入与脚本动作
|
|
27
|
+
* @since 0.63.0
|
|
28
|
+
*/
|
|
29
|
+
declare const bvFlowBrand: unique symbol;
|
|
30
|
+
export interface BvFlow extends ClrHostValue {
|
|
31
|
+
readonly [bvFlowBrand]: true;
|
|
32
|
+
/**
|
|
33
|
+
* 设置后续等待步骤的默认超时时间;添加步骤后不可修改
|
|
34
|
+
* @param milliseconds 超时时间(毫秒),必须大于 0
|
|
35
|
+
* @returns 当前流程
|
|
36
|
+
* @since 0.63.0
|
|
37
|
+
*/
|
|
38
|
+
withDefaultTimeout(milliseconds: Int32Value): BvFlow;
|
|
39
|
+
/**
|
|
40
|
+
* 设置后续等待步骤的默认重试间隔;添加步骤后不可修改
|
|
41
|
+
* @param milliseconds 重试间隔(毫秒),必须大于 0
|
|
42
|
+
* @returns 当前流程
|
|
43
|
+
* @since 0.63.0
|
|
44
|
+
*/
|
|
45
|
+
withDefaultRetryInterval(milliseconds: Int32Value): BvFlow;
|
|
46
|
+
/**
|
|
47
|
+
* 添加脚本回调动作
|
|
48
|
+
* @param action 同步或异步脚本回调
|
|
49
|
+
* @returns 可附加重试条件的动作
|
|
50
|
+
* @since 0.63.0
|
|
51
|
+
*/
|
|
52
|
+
do(action: BvFlowCallback): BvFlowAction;
|
|
53
|
+
/**
|
|
54
|
+
* 添加键盘单击动作
|
|
55
|
+
* @param key 虚拟键名称
|
|
56
|
+
* @returns 可附加重试条件的动作
|
|
57
|
+
* @since 0.63.0
|
|
58
|
+
*/
|
|
59
|
+
keyPress(key: KeyCode): BvFlowAction;
|
|
60
|
+
/**
|
|
61
|
+
* 添加鼠标左键单击动作;省略坐标时使用上一步匹配区域中心
|
|
62
|
+
* @returns 可附加重试条件的动作
|
|
63
|
+
* @since 0.63.0
|
|
64
|
+
*/
|
|
65
|
+
click(): BvFlowAction;
|
|
66
|
+
click(x: DoubleValue, y: DoubleValue): BvFlowAction;
|
|
67
|
+
/**
|
|
68
|
+
* 添加鼠标右键单击动作;省略坐标时使用上一步匹配区域中心
|
|
69
|
+
* @returns 可附加重试条件的动作
|
|
70
|
+
* @since 0.63.0
|
|
71
|
+
*/
|
|
72
|
+
rightClick(): BvFlowAction;
|
|
73
|
+
rightClick(x: DoubleValue, y: DoubleValue): BvFlowAction;
|
|
74
|
+
/**
|
|
75
|
+
* 添加鼠标中键单击动作;省略坐标时使用上一步匹配区域中心
|
|
76
|
+
* @returns 可附加重试条件的动作
|
|
77
|
+
* @since 0.63.0
|
|
78
|
+
*/
|
|
79
|
+
middleClick(): BvFlowAction;
|
|
80
|
+
middleClick(x: DoubleValue, y: DoubleValue): BvFlowAction;
|
|
81
|
+
/**
|
|
82
|
+
* 添加鼠标移动动作;省略坐标时使用上一步匹配区域中心
|
|
83
|
+
* @returns 可附加重试条件的动作
|
|
84
|
+
* @since 0.63.0
|
|
85
|
+
*/
|
|
86
|
+
moveTo(): BvFlowAction;
|
|
87
|
+
moveTo(x: DoubleValue, y: DoubleValue): BvFlowAction;
|
|
88
|
+
/**
|
|
89
|
+
* 添加指定起止坐标的拖动动作
|
|
90
|
+
* @param duration 拖动时长(毫秒),省略时为 300
|
|
91
|
+
* @returns 可附加重试条件的动作
|
|
92
|
+
* @since 0.63.0
|
|
93
|
+
*/
|
|
94
|
+
drag(fromX: DoubleValue, fromY: DoubleValue, toX: DoubleValue, toY: DoubleValue): BvFlowAction;
|
|
95
|
+
drag(
|
|
96
|
+
fromX: DoubleValue,
|
|
97
|
+
fromY: DoubleValue,
|
|
98
|
+
toX: DoubleValue,
|
|
99
|
+
toY: DoubleValue,
|
|
100
|
+
duration: Int32Value
|
|
101
|
+
): BvFlowAction;
|
|
102
|
+
/**
|
|
103
|
+
* 从上一步匹配区域中心拖动到指定坐标
|
|
104
|
+
* @param duration 拖动时长(毫秒),省略时为 300
|
|
105
|
+
* @returns 可附加重试条件的动作
|
|
106
|
+
* @since 0.63.0
|
|
107
|
+
*/
|
|
108
|
+
dragTo(toX: DoubleValue, toY: DoubleValue): BvFlowAction;
|
|
109
|
+
dragTo(toX: DoubleValue, toY: DoubleValue, duration: Int32Value): BvFlowAction;
|
|
110
|
+
/**
|
|
111
|
+
* 从指定坐标拖动到上一步匹配区域中心
|
|
112
|
+
* @param duration 拖动时长(毫秒),省略时为 300
|
|
113
|
+
* @returns 可附加重试条件的动作
|
|
114
|
+
* @since 0.63.0
|
|
115
|
+
*/
|
|
116
|
+
dragFrom(fromX: DoubleValue, fromY: DoubleValue): BvFlowAction;
|
|
117
|
+
dragFrom(fromX: DoubleValue, fromY: DoubleValue, duration: Int32Value): BvFlowAction;
|
|
118
|
+
/**
|
|
119
|
+
* 等待指定文本出现
|
|
120
|
+
* @param rect 感兴趣区域;省略时搜索整幅画面
|
|
121
|
+
* @param timeout 超时时间(毫秒);null 使用流程默认值
|
|
122
|
+
* @param retryInterval 重试间隔(毫秒);null 使用流程默认值
|
|
123
|
+
* @returns 当前流程
|
|
124
|
+
* @since 0.63.0
|
|
125
|
+
*/
|
|
126
|
+
waitUntilText(text: string): BvFlow;
|
|
127
|
+
waitUntilText(text: string, rect: OpenCvSharp.Rect): BvFlow;
|
|
128
|
+
waitUntilText(text: string, rect: OpenCvSharp.Rect, timeout: Int32Value | null): BvFlow;
|
|
129
|
+
waitUntilText(
|
|
130
|
+
text: string,
|
|
131
|
+
rect: OpenCvSharp.Rect,
|
|
132
|
+
timeout: Int32Value | null,
|
|
133
|
+
retryInterval: Int32Value | null
|
|
134
|
+
): BvFlow;
|
|
135
|
+
/**
|
|
136
|
+
* 等待任一指定文本出现
|
|
137
|
+
* @param texts 字符串集合或 ClearScript JS Array
|
|
138
|
+
* @returns 当前流程
|
|
139
|
+
* @since 0.63.0
|
|
140
|
+
*/
|
|
141
|
+
waitUntilAnyText(
|
|
142
|
+
texts: readonly string[] | System.Collections.Generic.IEnumerableInput<string>
|
|
143
|
+
): BvFlow;
|
|
144
|
+
waitUntilAnyText(
|
|
145
|
+
texts: readonly string[] | System.Collections.Generic.IEnumerableInput<string>,
|
|
146
|
+
rect: OpenCvSharp.Rect
|
|
147
|
+
): BvFlow;
|
|
148
|
+
waitUntilAnyText(
|
|
149
|
+
texts: readonly string[] | System.Collections.Generic.IEnumerableInput<string>,
|
|
150
|
+
rect: OpenCvSharp.Rect,
|
|
151
|
+
timeout: Int32Value | null
|
|
152
|
+
): BvFlow;
|
|
153
|
+
waitUntilAnyText(
|
|
154
|
+
texts: readonly string[] | System.Collections.Generic.IEnumerableInput<string>,
|
|
155
|
+
rect: OpenCvSharp.Rect,
|
|
156
|
+
timeout: Int32Value | null,
|
|
157
|
+
retryInterval: Int32Value | null
|
|
158
|
+
): BvFlow;
|
|
159
|
+
/**
|
|
160
|
+
* 等待定位器目标出现
|
|
161
|
+
* @returns 当前流程
|
|
162
|
+
* @since 0.63.0
|
|
163
|
+
*/
|
|
164
|
+
waitUntil(target: BvLocator): BvFlow;
|
|
165
|
+
waitUntil(target: BvLocator, timeout: Int32Value | null): BvFlow;
|
|
166
|
+
waitUntil(
|
|
167
|
+
target: BvLocator,
|
|
168
|
+
timeout: Int32Value | null,
|
|
169
|
+
retryInterval: Int32Value | null
|
|
170
|
+
): BvFlow;
|
|
171
|
+
/**
|
|
172
|
+
* 等待任一定位器目标出现
|
|
173
|
+
* @param targets 定位器集合或 ClearScript JS Array
|
|
174
|
+
* @returns 当前流程
|
|
175
|
+
* @since 0.63.0
|
|
176
|
+
*/
|
|
177
|
+
waitUntilAny(
|
|
178
|
+
targets: readonly BvLocator[] | System.Collections.Generic.IEnumerableInput<BvLocator>
|
|
179
|
+
): BvFlow;
|
|
180
|
+
waitUntilAny(
|
|
181
|
+
targets: readonly BvLocator[] | System.Collections.Generic.IEnumerableInput<BvLocator>,
|
|
182
|
+
timeout: Int32Value | null
|
|
183
|
+
): BvFlow;
|
|
184
|
+
waitUntilAny(
|
|
185
|
+
targets: readonly BvLocator[] | System.Collections.Generic.IEnumerableInput<BvLocator>,
|
|
186
|
+
timeout: Int32Value | null,
|
|
187
|
+
retryInterval: Int32Value | null
|
|
188
|
+
): BvFlow;
|
|
189
|
+
/**
|
|
190
|
+
* 等待定位器目标消失
|
|
191
|
+
* @returns 当前流程
|
|
192
|
+
* @since 0.63.0
|
|
193
|
+
*/
|
|
194
|
+
waitUntilDisappear(target: BvLocator): BvFlow;
|
|
195
|
+
waitUntilDisappear(target: BvLocator, timeout: Int32Value | null): BvFlow;
|
|
196
|
+
waitUntilDisappear(
|
|
197
|
+
target: BvLocator,
|
|
198
|
+
timeout: Int32Value | null,
|
|
199
|
+
retryInterval: Int32Value | null
|
|
200
|
+
): BvFlow;
|
|
201
|
+
/**
|
|
202
|
+
* 等待全部定位器目标消失
|
|
203
|
+
* @param targets 定位器集合或 ClearScript JS Array
|
|
204
|
+
* @returns 当前流程
|
|
205
|
+
* @since 0.63.0
|
|
206
|
+
*/
|
|
207
|
+
waitUntilAllDisappear(
|
|
208
|
+
targets: readonly BvLocator[] | System.Collections.Generic.IEnumerableInput<BvLocator>
|
|
209
|
+
): BvFlow;
|
|
210
|
+
waitUntilAllDisappear(
|
|
211
|
+
targets: readonly BvLocator[] | System.Collections.Generic.IEnumerableInput<BvLocator>,
|
|
212
|
+
timeout: Int32Value | null
|
|
213
|
+
): BvFlow;
|
|
214
|
+
waitUntilAllDisappear(
|
|
215
|
+
targets: readonly BvLocator[] | System.Collections.Generic.IEnumerableInput<BvLocator>,
|
|
216
|
+
timeout: Int32Value | null,
|
|
217
|
+
retryInterval: Int32Value | null
|
|
218
|
+
): BvFlow;
|
|
219
|
+
/**
|
|
220
|
+
* 添加固定等待步骤
|
|
221
|
+
* @param milliseconds 等待时长(毫秒),不得小于 0
|
|
222
|
+
* @returns 当前流程
|
|
223
|
+
* @since 0.63.0
|
|
224
|
+
*/
|
|
225
|
+
wait(milliseconds: Int32Value): BvFlow;
|
|
226
|
+
/**
|
|
227
|
+
* 执行流程;同一流程不可并发执行,开始后不可再添加步骤
|
|
228
|
+
* @returns 在任务完成后兑现所属页面的 Promise
|
|
229
|
+
* @since 0.63.0
|
|
230
|
+
*/
|
|
231
|
+
run(): Promise<BvPage>;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
declare global {
|
|
235
|
+
namespace BetterGenshinImpact.Core.BgiVision {
|
|
236
|
+
type BvFlow = import("./BvFlow").BvFlow;
|
|
237
|
+
type BvFlowCallback = import("./BvFlow").BvFlowCallback;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export interface BvFlowHostType extends HostType<BvFlow, ReferenceTypeTrait> {}
|
|
242
|
+
|
|
243
|
+
export {};
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ClrHostValue,
|
|
3
|
+
DoubleHost,
|
|
4
|
+
HostType,
|
|
5
|
+
Int32Host,
|
|
6
|
+
ReferenceTypeTrait,
|
|
7
|
+
StrongNumeric
|
|
8
|
+
} from "../../../Microsoft/ClearScript/HostType";
|
|
9
|
+
import "../../../OpenCvSharp/Rect";
|
|
10
|
+
import "../../../System/Collections/Generic/IEnumerable";
|
|
11
|
+
import type { KeyCode } from "../../Helpers/User32Helper";
|
|
12
|
+
import type { BvFlow, BvFlowCallback } from "./BvFlow";
|
|
13
|
+
import type { BvLocator } from "./BvLocator";
|
|
14
|
+
import type { BvPage } from "./BvPage";
|
|
15
|
+
|
|
16
|
+
type Int32Value = number | StrongNumeric<Int32Host>;
|
|
17
|
+
type DoubleValue = number | StrongNumeric<DoubleHost>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* 尚未提交的 BgiVision 流程动作,可配置重试条件或衔接下一动作
|
|
21
|
+
* @since 0.63.0
|
|
22
|
+
*/
|
|
23
|
+
declare const bvFlowActionBrand: unique symbol;
|
|
24
|
+
export interface BvFlowAction extends ClrHostValue {
|
|
25
|
+
readonly [bvFlowActionBrand]: true;
|
|
26
|
+
/**
|
|
27
|
+
* 设置条件动作的超时时间
|
|
28
|
+
* @param milliseconds 超时时间(毫秒),必须大于 0
|
|
29
|
+
* @returns 当前动作
|
|
30
|
+
* @since 0.63.0
|
|
31
|
+
*/
|
|
32
|
+
withTimeout(milliseconds: Int32Value): BvFlowAction;
|
|
33
|
+
/**
|
|
34
|
+
* 设置条件动作的重试间隔
|
|
35
|
+
* @param milliseconds 重试间隔(毫秒),必须大于 0
|
|
36
|
+
* @returns 当前动作
|
|
37
|
+
* @since 0.63.0
|
|
38
|
+
*/
|
|
39
|
+
withRetryInterval(milliseconds: Int32Value): BvFlowAction;
|
|
40
|
+
/**
|
|
41
|
+
* 将当前动作作为一次性步骤提交,并添加脚本回调动作
|
|
42
|
+
* @since 0.63.0
|
|
43
|
+
*/
|
|
44
|
+
do(action: BvFlowCallback): BvFlowAction;
|
|
45
|
+
/**
|
|
46
|
+
* 将当前动作作为一次性步骤提交,并添加键盘单击动作
|
|
47
|
+
* @since 0.63.0
|
|
48
|
+
*/
|
|
49
|
+
keyPress(key: KeyCode): BvFlowAction;
|
|
50
|
+
/**
|
|
51
|
+
* 将当前动作作为一次性步骤提交,并添加鼠标左键单击动作
|
|
52
|
+
* @since 0.63.0
|
|
53
|
+
*/
|
|
54
|
+
click(): BvFlowAction;
|
|
55
|
+
click(x: DoubleValue, y: DoubleValue): BvFlowAction;
|
|
56
|
+
/**
|
|
57
|
+
* 将当前动作作为一次性步骤提交,并添加鼠标右键单击动作
|
|
58
|
+
* @since 0.63.0
|
|
59
|
+
*/
|
|
60
|
+
rightClick(): BvFlowAction;
|
|
61
|
+
rightClick(x: DoubleValue, y: DoubleValue): BvFlowAction;
|
|
62
|
+
/**
|
|
63
|
+
* 将当前动作作为一次性步骤提交,并添加鼠标中键单击动作
|
|
64
|
+
* @since 0.63.0
|
|
65
|
+
*/
|
|
66
|
+
middleClick(): BvFlowAction;
|
|
67
|
+
middleClick(x: DoubleValue, y: DoubleValue): BvFlowAction;
|
|
68
|
+
/**
|
|
69
|
+
* 将当前动作作为一次性步骤提交,并添加鼠标移动动作
|
|
70
|
+
* @since 0.63.0
|
|
71
|
+
*/
|
|
72
|
+
moveTo(): BvFlowAction;
|
|
73
|
+
moveTo(x: DoubleValue, y: DoubleValue): BvFlowAction;
|
|
74
|
+
/**
|
|
75
|
+
* 将当前动作作为一次性步骤提交,并添加指定起止坐标的拖动动作
|
|
76
|
+
* @since 0.63.0
|
|
77
|
+
*/
|
|
78
|
+
drag(fromX: DoubleValue, fromY: DoubleValue, toX: DoubleValue, toY: DoubleValue): BvFlowAction;
|
|
79
|
+
drag(
|
|
80
|
+
fromX: DoubleValue,
|
|
81
|
+
fromY: DoubleValue,
|
|
82
|
+
toX: DoubleValue,
|
|
83
|
+
toY: DoubleValue,
|
|
84
|
+
duration: Int32Value
|
|
85
|
+
): BvFlowAction;
|
|
86
|
+
/**
|
|
87
|
+
* 将当前动作作为一次性步骤提交,并从上一步匹配区域中心拖动到指定坐标
|
|
88
|
+
* @since 0.63.0
|
|
89
|
+
*/
|
|
90
|
+
dragTo(toX: DoubleValue, toY: DoubleValue): BvFlowAction;
|
|
91
|
+
dragTo(toX: DoubleValue, toY: DoubleValue, duration: Int32Value): BvFlowAction;
|
|
92
|
+
/**
|
|
93
|
+
* 将当前动作作为一次性步骤提交,并从指定坐标拖动到上一步匹配区域中心
|
|
94
|
+
* @since 0.63.0
|
|
95
|
+
*/
|
|
96
|
+
dragFrom(fromX: DoubleValue, fromY: DoubleValue): BvFlowAction;
|
|
97
|
+
dragFrom(fromX: DoubleValue, fromY: DoubleValue, duration: Int32Value): BvFlowAction;
|
|
98
|
+
/**
|
|
99
|
+
* 将当前动作作为一次性步骤提交,再等待指定文本出现
|
|
100
|
+
* @since 0.63.0
|
|
101
|
+
*/
|
|
102
|
+
waitUntilText(text: string): BvFlow;
|
|
103
|
+
waitUntilText(text: string, rect: OpenCvSharp.Rect): BvFlow;
|
|
104
|
+
waitUntilText(text: string, rect: OpenCvSharp.Rect, timeout: Int32Value | null): BvFlow;
|
|
105
|
+
waitUntilText(
|
|
106
|
+
text: string,
|
|
107
|
+
rect: OpenCvSharp.Rect,
|
|
108
|
+
timeout: Int32Value | null,
|
|
109
|
+
retryInterval: Int32Value | null
|
|
110
|
+
): BvFlow;
|
|
111
|
+
/**
|
|
112
|
+
* 将当前动作作为一次性步骤提交,再等待任一指定文本出现
|
|
113
|
+
* @since 0.63.0
|
|
114
|
+
*/
|
|
115
|
+
waitUntilAnyText(
|
|
116
|
+
texts: readonly string[] | System.Collections.Generic.IEnumerableInput<string>
|
|
117
|
+
): BvFlow;
|
|
118
|
+
waitUntilAnyText(
|
|
119
|
+
texts: readonly string[] | System.Collections.Generic.IEnumerableInput<string>,
|
|
120
|
+
rect: OpenCvSharp.Rect
|
|
121
|
+
): BvFlow;
|
|
122
|
+
waitUntilAnyText(
|
|
123
|
+
texts: readonly string[] | System.Collections.Generic.IEnumerableInput<string>,
|
|
124
|
+
rect: OpenCvSharp.Rect,
|
|
125
|
+
timeout: Int32Value | null
|
|
126
|
+
): BvFlow;
|
|
127
|
+
waitUntilAnyText(
|
|
128
|
+
texts: readonly string[] | System.Collections.Generic.IEnumerableInput<string>,
|
|
129
|
+
rect: OpenCvSharp.Rect,
|
|
130
|
+
timeout: Int32Value | null,
|
|
131
|
+
retryInterval: Int32Value | null
|
|
132
|
+
): BvFlow;
|
|
133
|
+
/**
|
|
134
|
+
* 将当前动作作为一次性步骤提交,再等待定位器目标出现
|
|
135
|
+
* @since 0.63.0
|
|
136
|
+
*/
|
|
137
|
+
waitUntil(target: BvLocator): BvFlow;
|
|
138
|
+
waitUntil(target: BvLocator, timeout: Int32Value | null): BvFlow;
|
|
139
|
+
waitUntil(
|
|
140
|
+
target: BvLocator,
|
|
141
|
+
timeout: Int32Value | null,
|
|
142
|
+
retryInterval: Int32Value | null
|
|
143
|
+
): BvFlow;
|
|
144
|
+
/**
|
|
145
|
+
* 将当前动作作为一次性步骤提交,再等待任一定位器目标出现
|
|
146
|
+
* @since 0.63.0
|
|
147
|
+
*/
|
|
148
|
+
waitUntilAny(
|
|
149
|
+
targets: readonly BvLocator[] | System.Collections.Generic.IEnumerableInput<BvLocator>
|
|
150
|
+
): BvFlow;
|
|
151
|
+
waitUntilAny(
|
|
152
|
+
targets: readonly BvLocator[] | System.Collections.Generic.IEnumerableInput<BvLocator>,
|
|
153
|
+
timeout: Int32Value | null
|
|
154
|
+
): BvFlow;
|
|
155
|
+
waitUntilAny(
|
|
156
|
+
targets: readonly BvLocator[] | System.Collections.Generic.IEnumerableInput<BvLocator>,
|
|
157
|
+
timeout: Int32Value | null,
|
|
158
|
+
retryInterval: Int32Value | null
|
|
159
|
+
): BvFlow;
|
|
160
|
+
/**
|
|
161
|
+
* 将当前动作作为一次性步骤提交,再等待定位器目标消失
|
|
162
|
+
* @since 0.63.0
|
|
163
|
+
*/
|
|
164
|
+
waitUntilDisappear(target: BvLocator): BvFlow;
|
|
165
|
+
waitUntilDisappear(target: BvLocator, timeout: Int32Value | null): BvFlow;
|
|
166
|
+
waitUntilDisappear(
|
|
167
|
+
target: BvLocator,
|
|
168
|
+
timeout: Int32Value | null,
|
|
169
|
+
retryInterval: Int32Value | null
|
|
170
|
+
): BvFlow;
|
|
171
|
+
/**
|
|
172
|
+
* 将当前动作作为一次性步骤提交,再等待全部定位器目标消失
|
|
173
|
+
* @since 0.63.0
|
|
174
|
+
*/
|
|
175
|
+
waitUntilAllDisappear(
|
|
176
|
+
targets: readonly BvLocator[] | System.Collections.Generic.IEnumerableInput<BvLocator>
|
|
177
|
+
): BvFlow;
|
|
178
|
+
waitUntilAllDisappear(
|
|
179
|
+
targets: readonly BvLocator[] | System.Collections.Generic.IEnumerableInput<BvLocator>,
|
|
180
|
+
timeout: Int32Value | null
|
|
181
|
+
): BvFlow;
|
|
182
|
+
waitUntilAllDisappear(
|
|
183
|
+
targets: readonly BvLocator[] | System.Collections.Generic.IEnumerableInput<BvLocator>,
|
|
184
|
+
timeout: Int32Value | null,
|
|
185
|
+
retryInterval: Int32Value | null
|
|
186
|
+
): BvFlow;
|
|
187
|
+
/**
|
|
188
|
+
* 将当前动作作为一次性步骤提交,再添加固定等待步骤
|
|
189
|
+
* @since 0.63.0
|
|
190
|
+
*/
|
|
191
|
+
wait(milliseconds: Int32Value): BvFlow;
|
|
192
|
+
/**
|
|
193
|
+
* 重复当前动作直到指定文本出现
|
|
194
|
+
* @since 0.63.0
|
|
195
|
+
*/
|
|
196
|
+
untilText(text: string): BvFlow;
|
|
197
|
+
untilText(text: string, rect: OpenCvSharp.Rect): BvFlow;
|
|
198
|
+
/**
|
|
199
|
+
* 重复当前动作直到任一指定文本出现
|
|
200
|
+
* @since 0.63.0
|
|
201
|
+
*/
|
|
202
|
+
untilAnyText(
|
|
203
|
+
texts: readonly string[] | System.Collections.Generic.IEnumerableInput<string>
|
|
204
|
+
): BvFlow;
|
|
205
|
+
untilAnyText(
|
|
206
|
+
texts: readonly string[] | System.Collections.Generic.IEnumerableInput<string>,
|
|
207
|
+
rect: OpenCvSharp.Rect
|
|
208
|
+
): BvFlow;
|
|
209
|
+
/**
|
|
210
|
+
* 重复当前动作直到定位器目标出现
|
|
211
|
+
* @since 0.63.0
|
|
212
|
+
*/
|
|
213
|
+
until(target: BvLocator): BvFlow;
|
|
214
|
+
/**
|
|
215
|
+
* 重复当前动作直到任一定位器目标出现
|
|
216
|
+
* @since 0.63.0
|
|
217
|
+
*/
|
|
218
|
+
untilAny(
|
|
219
|
+
targets: readonly BvLocator[] | System.Collections.Generic.IEnumerableInput<BvLocator>
|
|
220
|
+
): BvFlow;
|
|
221
|
+
/**
|
|
222
|
+
* 重复当前动作直到定位器目标消失
|
|
223
|
+
* @since 0.63.0
|
|
224
|
+
*/
|
|
225
|
+
untilDisappear(target: BvLocator): BvFlow;
|
|
226
|
+
/**
|
|
227
|
+
* 重复当前动作直到全部定位器目标消失
|
|
228
|
+
* @since 0.63.0
|
|
229
|
+
*/
|
|
230
|
+
untilAllDisappear(
|
|
231
|
+
targets: readonly BvLocator[] | System.Collections.Generic.IEnumerableInput<BvLocator>
|
|
232
|
+
): BvFlow;
|
|
233
|
+
/**
|
|
234
|
+
* 将当前动作作为一次性步骤提交并执行流程
|
|
235
|
+
* @returns 在任务完成后兑现所属页面的 Promise
|
|
236
|
+
* @since 0.63.0
|
|
237
|
+
*/
|
|
238
|
+
run(): Promise<BvPage>;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
declare global {
|
|
242
|
+
namespace BetterGenshinImpact.Core.BgiVision {
|
|
243
|
+
type BvFlowAction = import("./BvFlowAction").BvFlowAction;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export interface BvFlowActionHostType extends HostType<BvFlowAction, ReferenceTypeTrait> {}
|
|
248
|
+
|
|
249
|
+
export {};
|
|
@@ -10,11 +10,13 @@ import type {
|
|
|
10
10
|
} from "../../../Microsoft/ClearScript/HostType";
|
|
11
11
|
import type { VoidResult } from "../../../Microsoft/ClearScript/VoidResult";
|
|
12
12
|
import "../../../OpenCvSharp/Rect";
|
|
13
|
+
import "../../../System/Collections/Generic/IEnumerable";
|
|
13
14
|
import "../../../System/Collections/Generic/List";
|
|
14
15
|
import "../../../System/Threading/CancellationToken";
|
|
15
16
|
import "../../GameTask/Model/Area/ImageRegion";
|
|
16
17
|
import "../../GameTask/Model/Area/Region";
|
|
17
18
|
import "../Recognition/RecognitionObject";
|
|
19
|
+
import "./BvFlow";
|
|
18
20
|
import "./BvImage";
|
|
19
21
|
import "./BvLocator";
|
|
20
22
|
|
|
@@ -45,6 +47,12 @@ export interface BvPage extends ClrHostValue {
|
|
|
45
47
|
* @since 0.57.0
|
|
46
48
|
*/
|
|
47
49
|
defaultRetryInterval: number;
|
|
50
|
+
/**
|
|
51
|
+
* 创建使用当前超时与重试间隔的链式流程
|
|
52
|
+
* @returns 新的空流程
|
|
53
|
+
* @since 0.63.0
|
|
54
|
+
*/
|
|
55
|
+
flow(): BetterGenshinImpact.Core.BgiVision.BvFlow;
|
|
48
56
|
/**
|
|
49
57
|
* 截取当前游戏画面为图像区域
|
|
50
58
|
* @returns 当前游戏画面的图像区域
|
|
@@ -97,6 +105,20 @@ export interface BvPage extends ClrHostValue {
|
|
|
97
105
|
getByText(): BetterGenshinImpact.Core.BgiVision.BvLocator;
|
|
98
106
|
getByText(text: string): BetterGenshinImpact.Core.BgiVision.BvLocator;
|
|
99
107
|
getByText(text: string, rect: OpenCvSharp.Rect): BetterGenshinImpact.Core.BgiVision.BvLocator;
|
|
108
|
+
/**
|
|
109
|
+
* 按任一指定文本创建定位器
|
|
110
|
+
* @param texts 字符串集合或 ClearScript JS Array
|
|
111
|
+
* @param rect 感兴趣区域;省略时搜索整幅画面
|
|
112
|
+
* @returns 对应目标的定位器
|
|
113
|
+
* @since 0.63.0
|
|
114
|
+
*/
|
|
115
|
+
getByAnyText(
|
|
116
|
+
texts: readonly string[] | System.Collections.Generic.IEnumerableInput<string>
|
|
117
|
+
): BetterGenshinImpact.Core.BgiVision.BvLocator;
|
|
118
|
+
getByAnyText(
|
|
119
|
+
texts: readonly string[] | System.Collections.Generic.IEnumerableInput<string>,
|
|
120
|
+
rect: OpenCvSharp.Rect
|
|
121
|
+
): BetterGenshinImpact.Core.BgiVision.BvLocator;
|
|
100
122
|
/**
|
|
101
123
|
* 按图像创建定位器
|
|
102
124
|
* @param image BgiVision 模板图像
|
|
@@ -46,17 +46,17 @@ export interface RecognitionObject extends ClrHostValue {
|
|
|
46
46
|
name: string;
|
|
47
47
|
/**
|
|
48
48
|
* 模板图或识别区域所在捕获画布的尺寸,例如 1920×1080、3840×2160,对应模板截取来源图像大小
|
|
49
|
-
* @since
|
|
49
|
+
* @since 0.63.0
|
|
50
50
|
*/
|
|
51
51
|
referenceImageSize: OpenCvSharp.Size | null;
|
|
52
52
|
/**
|
|
53
53
|
* 模板图或识别区域在截取来源图像中的位置与大小;模板匹配时宽高通常等于模板图尺寸,语义接近 bbox
|
|
54
|
-
* @since
|
|
54
|
+
* @since 0.63.0
|
|
55
55
|
*/
|
|
56
56
|
referenceBoundingBox: OpenCvSharp.Rect | null;
|
|
57
57
|
/**
|
|
58
58
|
* 查找位置时的搜索选项;未指定时使用默认机制
|
|
59
|
-
* @since
|
|
59
|
+
* @since 0.63.0
|
|
60
60
|
*/
|
|
61
61
|
searchOptions: BetterGenshinImpact.Core.Recognition.SearchOptions;
|
|
62
62
|
/**
|