@bettergi/types 0.1.15 → 0.1.17
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/RealtimeTimer.d.ts +1 -1
- package/bindings/characterDevelopmentTask.d.ts +11 -0
- package/bindings/getAvatars.d.ts +3 -2
- 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/BvLocator.d.ts +16 -21
- package/types/BetterGenshinImpact/Core/BgiVision/BvPage.d.ts +22 -0
- package/types/BetterGenshinImpact/Core/Recognition/RecognitionObject.d.ts +3 -3
- package/types/BetterGenshinImpact/Core/Script/Dependence/AutoPathingScript.d.ts +1 -1
- package/types/BetterGenshinImpact/Core/Script/Dependence/Dispatcher.d.ts +5 -4
- package/types/BetterGenshinImpact/Core/Script/Dependence/Genshin.d.ts +29 -11
- package/types/BetterGenshinImpact/Core/Script/Dependence/Http.d.ts +1 -0
- package/types/BetterGenshinImpact/Core/Script/Dependence/KeyMouseHook.d.ts +1 -0
- package/types/BetterGenshinImpact/Core/Script/Dependence/LimitedFile.d.ts +12 -5
- package/types/BetterGenshinImpact/Core/Script/Dependence/Model/RealtimeTimer.d.ts +63 -8
- package/types/BetterGenshinImpact/Core/Script/Dependence/Model/SoloTask.d.ts +4 -1
- package/types/BetterGenshinImpact/GameTask/AutoBoss/AutoBossConfig.d.ts +68 -3
- package/types/BetterGenshinImpact/GameTask/AutoBoss/AutoBossParam.d.ts +12 -4
- package/types/BetterGenshinImpact/GameTask/AutoDomain/AutoDomainParam.d.ts +11 -9
- package/types/BetterGenshinImpact/GameTask/AutoDomain/AutoDomainTask.d.ts +61 -0
- package/types/BetterGenshinImpact/GameTask/AutoFight/AutoFightConfig.d.ts +102 -2
- package/types/BetterGenshinImpact/GameTask/AutoFight/AutoFightParam.d.ts +49 -6
- package/types/BetterGenshinImpact/GameTask/AutoFight/Config/CombatAvatar.d.ts +153 -5
- package/types/BetterGenshinImpact/GameTask/AutoFight/Model/Avatar.d.ts +137 -31
- package/types/BetterGenshinImpact/GameTask/AutoFight/Model/CombatScenes.d.ts +13 -13
- package/types/BetterGenshinImpact/GameTask/AutoFight/Script/CombatCommand.d.ts +3 -3
- package/types/BetterGenshinImpact/GameTask/AutoFight/Script/CombatScript.d.ts +3 -2
- package/types/BetterGenshinImpact/GameTask/AutoFight/Script/Method.d.ts +63 -3
- package/types/BetterGenshinImpact/GameTask/AutoLeyLineOutcrop/AutoLeyLineOutcropFightConfig.d.ts +4 -3
- package/types/BetterGenshinImpact/GameTask/AutoLeyLineOutcrop/AutoLeyLineOutcropParam.d.ts +1 -0
- package/types/BetterGenshinImpact/GameTask/AutoPathing/PathingScriptNames.d.ts +50 -0
- package/types/BetterGenshinImpact/GameTask/AutoSkip/AutoSkipConfig.d.ts +2 -0
- package/types/BetterGenshinImpact/GameTask/AutoStygianOnslaught/AutoStygianOnslaughtConfig.d.ts +5 -3
- package/types/BetterGenshinImpact/GameTask/AutoStygianOnslaught/AutoStygianOnslaughtParam.d.ts +6 -4
- package/types/BetterGenshinImpact/GameTask/CharacterDevelopment/CharacterDevelopmentTask.d.ts +158 -0
- package/types/BetterGenshinImpact/GameTask/Common/Job/CraftMaterialTask.d.ts +19 -2
- package/types/BetterGenshinImpact/GameTask/Common/Map/MapScriptNames.d.ts +9 -0
- package/types/BetterGenshinImpact/GameTask/Model/Area/GameCaptureRegion.d.ts +6 -7
- package/types/BetterGenshinImpact/GameTask/Model/Area/ImageRegion.d.ts +18 -15
- package/types/BetterGenshinImpact/GameTask/Model/Area/Region.d.ts +5 -0
- package/types/BetterGenshinImpact/GameTask/Model/GameUI/GridScreenName.d.ts +1 -1
- package/types/BetterGenshinImpact/Helpers/User32Helper.d.ts +7 -0
|
@@ -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/bindings/getAvatars.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { AvatarName } from "../types/BetterGenshinImpact/GameTask/AutoFight/Model/Avatar";
|
|
1
2
|
import type { HostArray, HostDelegate } from "../types/Microsoft/ClearScript/HostType";
|
|
2
3
|
|
|
3
4
|
interface getAvatarsHostDelegate extends HostDelegate {
|
|
4
|
-
(): HostArray<
|
|
5
|
-
invoke(): HostArray<
|
|
5
|
+
(): HostArray<AvatarName>;
|
|
6
|
+
invoke(): HostArray<AvatarName>;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
declare global {
|
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 {};
|
|
@@ -6,14 +6,20 @@ import type {
|
|
|
6
6
|
StrongNumeric
|
|
7
7
|
} from "../../../Microsoft/ClearScript/HostType";
|
|
8
8
|
import "../../../OpenCvSharp/Rect";
|
|
9
|
-
import "../../../System/Action";
|
|
10
9
|
import "../../../System/Collections/Generic/List";
|
|
11
|
-
import "../../../System/Func";
|
|
12
10
|
import "../../../System/Nullable";
|
|
13
11
|
import "../../../System/Threading/CancellationToken";
|
|
14
12
|
import "../../GameTask/Model/Area/Region";
|
|
15
13
|
import "../Recognition/RecognitionObject";
|
|
16
14
|
|
|
15
|
+
/**
|
|
16
|
+
* 重试前回调:收到当前匹配区域列表;可为同步或返回 Promise 的异步脚本函数
|
|
17
|
+
* @since 0.61.0
|
|
18
|
+
*/
|
|
19
|
+
export type BvLocatorRetryAction = (
|
|
20
|
+
regions: System.Collections.Generic.List<BetterGenshinImpact.GameTask.Model.Area.Region>
|
|
21
|
+
) => void | Promise<void>;
|
|
22
|
+
|
|
17
23
|
/**
|
|
18
24
|
* BgiVision 定位器,按识别配置查找并操作匹配区域
|
|
19
25
|
* @since 0.57.0
|
|
@@ -27,13 +33,10 @@ export interface BvLocator extends ClrHostValue {
|
|
|
27
33
|
*/
|
|
28
34
|
readonly recognitionObject: BetterGenshinImpact.Core.Recognition.RecognitionObject;
|
|
29
35
|
/**
|
|
30
|
-
*
|
|
36
|
+
* 每次重试前执行的回调;脚本侧可直接赋函数,`null` 清除
|
|
31
37
|
* @since 0.57.0
|
|
32
38
|
*/
|
|
33
|
-
retryAction:
|
|
34
|
-
System.Collections.Generic.List<BetterGenshinImpact.GameTask.Model.Area.Region>,
|
|
35
|
-
Promise<void>
|
|
36
|
-
>;
|
|
39
|
+
retryAction: BvLocatorRetryAction | null;
|
|
37
40
|
/**
|
|
38
41
|
* 按当前识别配置查找全部匹配区域;不建议脚本直接调用
|
|
39
42
|
* @returns 匹配到的区域列表
|
|
@@ -118,12 +121,12 @@ export interface BvLocator extends ClrHostValue {
|
|
|
118
121
|
tryWaitForDisappear(timeout: number | StrongNumeric<Int32Host> | null | null): Promise<void>;
|
|
119
122
|
/**
|
|
120
123
|
* 设置感兴趣区域(ROI),覆盖识别配置中的 RegionOfInterest
|
|
121
|
-
* @param deltaFunc 由当前最大 1080P 捕获矩形计算 ROI
|
|
124
|
+
* @param deltaFunc 由当前最大 1080P 捕获矩形计算 ROI 的脚本回调
|
|
122
125
|
* @returns 当前定位器,便于链式调用
|
|
123
126
|
* @since 0.57.0
|
|
124
127
|
*/
|
|
125
128
|
withRoi(
|
|
126
|
-
deltaFunc:
|
|
129
|
+
deltaFunc: (captureRect: OpenCvSharp.Rect) => OpenCvSharp.Rect
|
|
127
130
|
): BetterGenshinImpact.Core.BgiVision.BvLocator;
|
|
128
131
|
/**
|
|
129
132
|
* 设置感兴趣区域(ROI),覆盖识别配置中的 RegionOfInterest
|
|
@@ -151,28 +154,20 @@ export interface BvLocator extends ClrHostValue {
|
|
|
151
154
|
retryInterval: number | StrongNumeric<Int32Host>
|
|
152
155
|
): BetterGenshinImpact.Core.BgiVision.BvLocator;
|
|
153
156
|
/**
|
|
154
|
-
*
|
|
155
|
-
* @param action
|
|
157
|
+
* 设置每次重试前执行的回调;支持同步与异步脚本函数(对应上游 `Action` 与 `dynamic` 重载)
|
|
158
|
+
* @param action 收到当前匹配区域列表时调用的脚本回调;传入 null 清除回调
|
|
156
159
|
* @returns 当前定位器,便于链式调用
|
|
157
160
|
* @since 0.61.0
|
|
158
161
|
*/
|
|
159
162
|
withRetryAction(
|
|
160
|
-
action:
|
|
161
|
-
System.Collections.Generic.List<BetterGenshinImpact.GameTask.Model.Area.Region>
|
|
162
|
-
> | null
|
|
163
|
+
action: BvLocatorRetryAction | null
|
|
163
164
|
): BetterGenshinImpact.Core.BgiVision.BvLocator;
|
|
164
|
-
/**
|
|
165
|
-
* 设置每次重试前执行的回调;供脚本传入无法隐式转为 Action 的函数
|
|
166
|
-
* @param action 脚本回调;可为同步函数或返回 Promise 的异步函数
|
|
167
|
-
* @returns 当前定位器,便于链式调用
|
|
168
|
-
* @since 0.61.0
|
|
169
|
-
*/
|
|
170
|
-
withRetryAction(action: unknown): BetterGenshinImpact.Core.BgiVision.BvLocator;
|
|
171
165
|
}
|
|
172
166
|
|
|
173
167
|
declare global {
|
|
174
168
|
namespace BetterGenshinImpact.Core.BgiVision {
|
|
175
169
|
type BvLocator = import("./BvLocator").BvLocator;
|
|
170
|
+
type BvLocatorRetryAction = import("./BvLocator").BvLocatorRetryAction;
|
|
176
171
|
}
|
|
177
172
|
}
|
|
178
173
|
|