@bettergi/types 0.1.0 → 0.1.2

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.
Files changed (89) hide show
  1. package/index.d.ts +43 -12
  2. package/{modules → objects}/dispatcher.d.ts +21 -9
  3. package/{modules → objects}/genshin.d.ts +14 -5
  4. package/{modules → objects}/globalMethod.d.ts +11 -3
  5. package/{modules → objects}/http.d.ts +5 -2
  6. package/{modules → objects}/log.d.ts +4 -4
  7. package/package.json +1 -1
  8. package/types/BetterGenshinImpact/Core/Script/Dependence/ServerTime.d.ts +11 -0
  9. package/types/BetterGenshinImpact/Core/Script/Dependence/Simulator/PostMessage.d.ts +18 -0
  10. package/{csharp → types}/BetterGenshinImpact/GameTask/AutoDomain/AutoDomainParam.d.ts +3 -1
  11. package/{csharp → types}/BetterGenshinImpact/GameTask/AutoFight/AutoFightParam.d.ts +3 -1
  12. package/types/BetterGenshinImpact/GameTask/AutoFight/Config/CombatAvatar.d.ts +33 -0
  13. package/types/BetterGenshinImpact/GameTask/AutoFight/Model/Avatar.d.ts +171 -0
  14. package/types/BetterGenshinImpact/GameTask/AutoFight/Model/AvatarActiveCheckContext.d.ts +11 -0
  15. package/types/BetterGenshinImpact/GameTask/AutoFight/Model/CombatScenes.d.ts +72 -0
  16. package/types/BetterGenshinImpact/GameTask/AutoFight/Model/MultiGameStatus.d.ts +19 -0
  17. package/types/BetterGenshinImpact/GameTask/Model/Area/DesktopRegion.d.ts +31 -0
  18. package/types/BetterGenshinImpact/GameTask/Model/Area/GameCaptureRegion.d.ts +85 -0
  19. package/types/BetterGenshinImpact/GameTask/Model/Area/ImageRegion.d.ts +104 -0
  20. package/{csharp → types}/BetterGenshinImpact/GameTask/Model/Area/Region.d.ts +53 -10
  21. package/{csharp → types}/BetterGenshinImpact/View/Drawable/RectDrawable.d.ts +5 -3
  22. package/types/Fischless/WindowsInput/IKeyboardSimulator.d.ts +67 -0
  23. package/types/Fischless/WindowsInput/IMouseSimulator.d.ts +61 -0
  24. package/{csharp → types}/System/Collections/Generic/List.d.ts +6 -2
  25. package/types/System/DateTime.d.ts +8 -0
  26. package/types/System/Exception.d.ts +8 -0
  27. package/csharp/BetterGenshinImpact/GameTask/Model/Area/ImageRegion.d.ts +0 -67
  28. /package/{modules → objects}/file.d.ts +0 -0
  29. /package/{modules → objects}/keyMouseScript.d.ts +0 -0
  30. /package/{modules → objects}/notification.d.ts +0 -0
  31. /package/{modules → objects}/pathingScript.d.ts +0 -0
  32. /package/{modules → objects}/settings.d.ts +0 -0
  33. /package/{csharp → types}/BetterGenshinImpact/Core/Recognition/OcrEngineTypes.d.ts +0 -0
  34. /package/{csharp → types}/BetterGenshinImpact/Core/Recognition/RecognitionObject.d.ts +0 -0
  35. /package/{csharp → types}/BetterGenshinImpact/Core/Recognition/RecognitionTypes.d.ts +0 -0
  36. /package/{csharp → types}/BetterGenshinImpact/Core/Script/Dependence/Model/RealtimeTimer.d.ts +0 -0
  37. /package/{csharp → types}/BetterGenshinImpact/Core/Script/Dependence/Model/SoloTask.d.ts +0 -0
  38. /package/{csharp → types}/BetterGenshinImpact/GameTask/AutoDomain/AutoDomainTask.d.ts +0 -0
  39. /package/{csharp → types}/BetterGenshinImpact/GameTask/AutoFight/AutoFightTask.d.ts +0 -0
  40. /package/{csharp → types}/BetterGenshinImpact/GameTask/ISoloTask.d.ts +0 -0
  41. /package/{csharp → types}/BetterGenshinImpact/GameTask/Model/Area/Converter/INodeConverter.d.ts +0 -0
  42. /package/{csharp → types}/BetterGenshinImpact/GameTask/Model/BaseTaskParam.d.ts +0 -0
  43. /package/{csharp → types}/BetterGenshinImpact/Helpers/User32Helper.d.ts +0 -0
  44. /package/{csharp → types}/BetterGenshinImpact/View/Drawable/DrawContent.d.ts +0 -0
  45. /package/{csharp → types}/BetterGenshinImpact/View/Drawable/LineDrawable.d.ts +0 -0
  46. /package/{csharp → types}/Microsoft/Extensions/Localization/IStringLocalizer.d.ts +0 -0
  47. /package/{csharp → types}/Microsoft/Extensions/Localization/LocalizedString.d.ts +0 -0
  48. /package/{csharp → types}/SixLabors/ImageSharp/Image.d.ts +0 -0
  49. /package/{csharp → types}/System/Collections/DictionaryEntry.d.ts +0 -0
  50. /package/{csharp → types}/System/Collections/Generic/Dictionary.d.ts +0 -0
  51. /package/{csharp → types}/System/Collections/Generic/ICollection.d.ts +0 -0
  52. /package/{csharp → types}/System/Collections/Generic/IDictionary.d.ts +0 -0
  53. /package/{csharp → types}/System/Collections/Generic/IEnumerable.d.ts +0 -0
  54. /package/{csharp → types}/System/Collections/Generic/IEnumerator.d.ts +0 -0
  55. /package/{csharp → types}/System/Collections/Generic/IEqualityComparer.d.ts +0 -0
  56. /package/{csharp → types}/System/Collections/Generic/IList.d.ts +0 -0
  57. /package/{csharp → types}/System/Collections/Generic/IReadOnlyCollection.d.ts +0 -0
  58. /package/{csharp → types}/System/Collections/Generic/IReadOnlyDictionary.d.ts +0 -0
  59. /package/{csharp → types}/System/Collections/Generic/IReadOnlyList.d.ts +0 -0
  60. /package/{csharp → types}/System/Collections/Generic/KeyValuePair.d.ts +0 -0
  61. /package/{csharp → types}/System/Collections/ICollection.d.ts +0 -0
  62. /package/{csharp → types}/System/Collections/IDictionary.d.ts +0 -0
  63. /package/{csharp → types}/System/Collections/IDictionaryEnumerator.d.ts +0 -0
  64. /package/{csharp → types}/System/Collections/IEnumerable.d.ts +0 -0
  65. /package/{csharp → types}/System/Collections/IEnumerator.d.ts +0 -0
  66. /package/{csharp → types}/System/Collections/IList.d.ts +0 -0
  67. /package/{csharp → types}/System/DateTimeOffset.d.ts +0 -0
  68. /package/{csharp → types}/System/Drawing/Bitmap.d.ts +0 -0
  69. /package/{csharp → types}/System/Drawing/Color.d.ts +0 -0
  70. /package/{csharp → types}/System/Drawing/Image.d.ts +0 -0
  71. /package/{csharp → types}/System/Drawing/KnownColor.d.ts +0 -0
  72. /package/{csharp → types}/System/Drawing/Pen.d.ts +0 -0
  73. /package/{csharp → types}/System/Globalization/CultureInfo.d.ts +0 -0
  74. /package/{csharp → types}/System/IAsyncDisposable.d.ts +0 -0
  75. /package/{csharp → types}/System/IDisposable.d.ts +0 -0
  76. /package/{csharp → types}/System/IEquatable.d.ts +0 -0
  77. /package/{csharp → types}/System/Runtime/Serialization/IDeserializationCallback.d.ts +0 -0
  78. /package/{csharp → types}/System/Runtime/Serialization/ISerializable.d.ts +0 -0
  79. /package/{csharp → types}/System/Threading/CancellationToken.d.ts +0 -0
  80. /package/{csharp → types}/System/Threading/CancellationTokenRegistration.d.ts +0 -0
  81. /package/{csharp → types}/System/Threading/CancellationTokenSource.d.ts +0 -0
  82. /package/{csharp → types}/System/Threading/ITimer.d.ts +0 -0
  83. /package/{csharp → types}/System/Threading/Tasks/ValueTask.d.ts +0 -0
  84. /package/{csharp → types}/System/Threading/WaitHandle.d.ts +0 -0
  85. /package/{csharp → types}/System/TimeProvider.d.ts +0 -0
  86. /package/{csharp → types}/System/TimeSpan.d.ts +0 -0
  87. /package/{csharp → types}/System/Windows/Media/Matrix.d.ts +0 -0
  88. /package/{csharp → types}/System/Windows/Point.d.ts +0 -0
  89. /package/{csharp → types}/System/Windows/Vector.d.ts +0 -0
package/index.d.ts CHANGED
@@ -1,29 +1,60 @@
1
- // 全局方法
2
- /// <reference path="./modules/globalMethod.d.ts" />
3
-
4
1
  // 录像回放
5
- /// <reference path="./modules/keyMouseScript.d.ts" />
2
+ /// <reference path="./objects/keyMouseScript.d.ts" />
6
3
 
7
4
  // 地图追踪
8
- /// <reference path="./modules/pathingScript.d.ts" />
5
+ /// <reference path="./objects/pathingScript.d.ts" />
9
6
 
10
7
  // 游戏内操作
11
- /// <reference path="./modules/genshin.d.ts" />
8
+ /// <reference path="./objects/genshin.d.ts" />
12
9
 
13
10
  // 日志输出
14
- /// <reference path="./modules/log.d.ts" />
11
+ /// <reference path="./objects/log.d.ts" />
15
12
 
16
13
  // 文件访问(受限)
17
- /// <reference path="./modules/file.d.ts" />
14
+ /// <reference path="./objects/file.d.ts" />
18
15
 
19
16
  // 网络请求(受限)
20
- /// <reference path="./modules/http.d.ts" />
17
+ /// <reference path="./objects/http.d.ts" />
21
18
 
22
19
  // 消息通知
23
- /// <reference path="./modules/notification.d.ts" />
20
+ /// <reference path="./objects/notification.d.ts" />
24
21
 
25
22
  // 任务调用
26
- /// <reference path="./modules/dispatcher.d.ts" />
23
+ /// <reference path="./objects/dispatcher.d.ts" />
24
+
25
+ // 实时任务
26
+ /// <reference path="./types/BetterGenshinImpact/Core/Script/Dependence/Model/RealtimeTimer.d.ts" />
27
+
28
+ // 独立任务
29
+ /// <reference path="./types/BetterGenshinImpact/Core/Script/Dependence/Model/SoloTask.d.ts" />
30
+
31
+ // 取消令牌
32
+ /// <reference path="./types/System/Threading/CancellationTokenSource.d.ts" />
33
+ /// <reference path="./types/System/Threading/CancellationToken.d.ts" />
34
+
35
+ // 指令发送
36
+ /// <reference path="./types/BetterGenshinImpact/Core/Script/Dependence/Simulator/PostMessage.d.ts" />
37
+
38
+ // 全局方法
39
+ /// <reference path="./objects/globalMethod.d.ts" />
40
+
41
+ // 识图模块
42
+ /// <reference path="./types/BetterGenshinImpact/Core/Recognition/RecognitionObject.d.ts" />
43
+ /// <reference path="./types/BetterGenshinImpact/GameTask/Model/Area/DesktopRegion.d.ts" />
44
+ /// <reference path="./types/BetterGenshinImpact/GameTask/Model/Area/GameCaptureRegion.d.ts" />
45
+ /// <reference path="./types/BetterGenshinImpact/GameTask/Model/Area/ImageRegion.d.ts" />
46
+ /// <reference path="./types/BetterGenshinImpact/GameTask/Model/Area/Region.d.ts" />
47
+
48
+ // 战斗队伍
49
+ /// <reference path="./types/BetterGenshinImpact/GameTask/AutoFight/Model/CombatScenes.d.ts" />
50
+ /// <reference path="./types/BetterGenshinImpact/GameTask/AutoFight/Model/Avatar.d.ts" />
51
+
52
+ // 服务器时间
53
+ /// <reference path="./types/BetterGenshinImpact/Core/Script/Dependence/ServerTime.d.ts" />
54
+
55
+ // 任务参数
56
+ /// <reference path="./types/BetterGenshinImpact/GameTask/AutoDomain/AutoDomainParam" />
57
+ /// <reference path="./types/BetterGenshinImpact/GameTask/AutoFight/AutoFightParam" />
27
58
 
28
59
  /// 设置
29
- /// <reference path="./modules/settings.d.ts" />
60
+ /// <reference path="./objects/settings.d.ts" />
@@ -1,9 +1,9 @@
1
- import "../csharp/BetterGenshinImpact/Core/Script/Dependence/Model/RealtimeTimer";
2
- import "../csharp/BetterGenshinImpact/Core/Script/Dependence/Model/SoloTask";
3
- import "../csharp/BetterGenshinImpact/GameTask/AutoDomain/AutoDomainParam";
4
- import "../csharp/BetterGenshinImpact/GameTask/AutoFight/AutoFightParam";
5
- import "../csharp/System/Threading/CancellationToken";
6
- import "../csharp/System/Threading/CancellationTokenSource";
1
+ import "../types/BetterGenshinImpact/Core/Script/Dependence/Model/RealtimeTimer";
2
+ import "../types/BetterGenshinImpact/Core/Script/Dependence/Model/SoloTask";
3
+ import "../types/BetterGenshinImpact/GameTask/AutoDomain/AutoDomainParam";
4
+ import "../types/BetterGenshinImpact/GameTask/AutoFight/AutoFightParam";
5
+ import "../types/System/Threading/CancellationToken";
6
+ import "../types/System/Threading/CancellationTokenSource";
7
7
 
8
8
  declare global {
9
9
  /** @since 0.32.5 */
@@ -45,9 +45,13 @@ declare global {
45
45
  * @param soloTask 独立任务
46
46
  * @since 0.45.1
47
47
  */
48
+ function runTask(
49
+ soloTask: BetterGenshinImpact.Core.Script.Dependence.Model.SoloTask
50
+ ): Promise<void>;
51
+ // overload
48
52
  function runTask(
49
53
  soloTask: BetterGenshinImpact.Core.Script.Dependence.Model.SoloTask,
50
- customCt?: System.Threading.CancellationToken
54
+ customCt: System.Threading.CancellationToken | null
51
55
  ): Promise<void>;
52
56
 
53
57
  /**
@@ -67,9 +71,13 @@ declare global {
67
71
  * @param param 秘境任务参数
68
72
  * @since 0.52.0
69
73
  */
74
+ function runAutoDomainTask(
75
+ param: BetterGenshinImpact.GameTask.AutoDomain.AutoDomainParam
76
+ ): Promise<void>;
77
+ // overload
70
78
  function runAutoDomainTask(
71
79
  param: BetterGenshinImpact.GameTask.AutoDomain.AutoDomainParam,
72
- customCt?: System.Threading.CancellationToken
80
+ customCt: System.Threading.CancellationToken | null
73
81
  ): Promise<void>;
74
82
 
75
83
  /**
@@ -77,9 +85,13 @@ declare global {
77
85
  * @param param 战斗任务参数
78
86
  * @since 0.52.0
79
87
  */
88
+ function runAutoFightTask(
89
+ param: BetterGenshinImpact.GameTask.AutoFight.AutoFightParam
90
+ ): Promise<void>;
91
+ // overload
80
92
  function runAutoFightTask(
81
93
  param: BetterGenshinImpact.GameTask.AutoFight.AutoFightParam,
82
- customCt?: System.Threading.CancellationToken
94
+ customCt: System.Threading.CancellationToken | null
83
95
  ): Promise<void>;
84
96
  }
85
97
  }
@@ -79,7 +79,9 @@ declare global {
79
79
  * @param forceCountry 强制指定移动大地图时先切换的国家(默认值:无)
80
80
  * @since 0.44.2
81
81
  */
82
- function moveMapTo(x: number, y: number, forceCountry?: Area): Promise<void>;
82
+ function moveMapTo(x: number, y: number): Promise<void>;
83
+ // overload
84
+ function moveMapTo(x: number, y: number, forceCountry: Area | null): Promise<void>;
83
85
 
84
86
  /**
85
87
  * 移动[指定大地图]到指定坐标
@@ -89,11 +91,13 @@ declare global {
89
91
  * @param forceCountry 强制指定移动大地图时先切换的国家(默认值:无)
90
92
  * @since 0.44.9
91
93
  */
94
+ function moveIndependentMapTo(x: number, y: number, mapName: BigMap): Promise<void>;
95
+ // overload
92
96
  function moveIndependentMapTo(
93
97
  x: number,
94
98
  y: number,
95
99
  mapName: BigMap,
96
- forceCountry?: Area
100
+ forceCountry: Area | null
97
101
  ): Promise<void>;
98
102
 
99
103
  /**
@@ -142,7 +146,9 @@ declare global {
142
146
  * @param cacheTimeMs 缓存时间(毫秒,默认值:900)
143
147
  * @since 0.44.9
144
148
  */
145
- function getPositionFromMap(mapName: BigMap, cacheTimeMs?: number): Point2f;
149
+ function getPositionFromMap(mapName: BigMap): Point2f;
150
+ // overload
151
+ function getPositionFromMap(mapName: BigMap, cacheTimeMs: number | null): Point2f;
146
152
 
147
153
  /**
148
154
  * 获取当前在小地图上的 [指定大地图] 位置坐标(仅在给定坐标附近匹配)
@@ -179,10 +185,13 @@ declare global {
179
185
  * @param isOrange 是否为橙色选项(默认值:false)
180
186
  * @since 0.37.4
181
187
  */
188
+ function chooseTalkOption(option: string): Promise<void>;
189
+ // overload
190
+ function chooseTalkOption(option: string, skipTimes: number | null): Promise<void>;
182
191
  function chooseTalkOption(
183
192
  option: string,
184
- skipTimes?: number,
185
- isOrange?: boolean
193
+ skipTimes: number | null,
194
+ isOrange: boolean | null
186
195
  ): Promise<void>;
187
196
 
188
197
  /**
@@ -1,5 +1,5 @@
1
- import "../csharp/BetterGenshinImpact/GameTask/Model/Area/ImageRegion";
2
- import { KeyCode } from "../csharp/BetterGenshinImpact/Helpers/User32Helper";
1
+ import "../types/BetterGenshinImpact/GameTask/Model/Area/ImageRegion";
2
+ import { KeyCode } from "../types/BetterGenshinImpact/Helpers/User32Helper";
3
3
 
4
4
  declare global {
5
5
  /**
@@ -37,7 +37,15 @@ declare global {
37
37
  * @param dpi - DPI(默认值:1)
38
38
  * @since 0.34.5
39
39
  */
40
- function setGameMetrics(w: number, h: number, dpi?: number): void;
40
+ function setGameMetrics(w: number, h: number): void;
41
+ // overload
42
+ function setGameMetrics(w: number, h: number, dpi: number | null): void;
43
+
44
+ /**
45
+ * 获取游戏窗口尺寸和显示缩放
46
+ * @since 0.53.0
47
+ */
48
+ function getGameMetrics(): number[];
41
49
 
42
50
  /**
43
51
  * 相对当前鼠标位置移动光标
@@ -9,11 +9,14 @@ declare global {
9
9
  * @param headersJson 请求头(可选)
10
10
  * @since 0.52.0
11
11
  */
12
+ function request(method: HttpMethod, url: string): Promise<HttpReponse>;
13
+ // overload
14
+ function request(method: HttpMethod, url: string, body: string | null): Promise<HttpReponse>;
12
15
  function request(
13
16
  method: HttpMethod,
14
17
  url: string,
15
- body?: string,
16
- headersJson?: string
18
+ body: string | null,
19
+ headersJson: string | null
17
20
  ): Promise<HttpReponse>;
18
21
  }
19
22
  }
@@ -7,7 +7,7 @@ declare global {
7
7
  * @param args 占位参数
8
8
  * @since 0.32.0
9
9
  */
10
- function debug(message?: string, ...args: any[]): void;
10
+ function debug(message: string, ...args: any[]): void;
11
11
 
12
12
  /**
13
13
  * 输出提示信息
@@ -15,7 +15,7 @@ declare global {
15
15
  * @param args 占位参数
16
16
  * @since 0.32.0
17
17
  */
18
- function info(message?: string, ...args: any[]): void;
18
+ function info(message: string, ...args: any[]): void;
19
19
 
20
20
  /**
21
21
  * 输出警告信息
@@ -23,7 +23,7 @@ declare global {
23
23
  * @param args 占位参数
24
24
  * @since 0.32.0
25
25
  */
26
- function warn(message?: string, ...args: any[]): void;
26
+ function warn(message: string, ...args: any[]): void;
27
27
 
28
28
  /**
29
29
  * 输出错误信息
@@ -31,7 +31,7 @@ declare global {
31
31
  * @param args 占位参数
32
32
  * @since 0.32.0
33
33
  */
34
- function error(message?: string, ...args: any[]): void;
34
+ function error(message: string, ...args: any[]): void;
35
35
  }
36
36
  }
37
37
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bettergi/types",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "TypeScript Definitions for BetterGI JavaScript",
5
5
  "type": "module",
6
6
  "author": "Bread Grocery<https://github.com/breadgrocery>",
@@ -0,0 +1,11 @@
1
+ declare global {
2
+ namespace BetterGenshinImpact.Core.Script.Dependence {
3
+ class ServerTime {
4
+ /** 获取服务器时区偏移量(单位:毫秒) */
5
+ static getServerTimeZoneOffset(): number;
6
+ }
7
+ }
8
+ export import ServerTime = BetterGenshinImpact.Core.Script.Dependence.ServerTime;
9
+ }
10
+
11
+ export {};
@@ -0,0 +1,18 @@
1
+ declare global {
2
+ namespace BetterGenshinImpact.Core.Script.Dependence.Simulator {
3
+ class PostMessage {
4
+ keyDown(key: string): void;
5
+
6
+ keyUp(key: string): void;
7
+
8
+ keyPress(key: string): void;
9
+
10
+ click(): void;
11
+
12
+ constructor();
13
+ }
14
+ }
15
+ export import PostMessage = BetterGenshinImpact.Core.Script.Dependence.Simulator.PostMessage;
16
+ }
17
+
18
+ export {};
@@ -51,7 +51,9 @@ declare global {
51
51
  * 设置战斗策略路径
52
52
  * @param strategyName 策略名称
53
53
  */
54
- setCombatStrategyPath(strategyName?: string): void;
54
+ setCombatStrategyPath(strategyName: string): void;
55
+ // overload
56
+ setCombatStrategyPath(strategyName: string | null): void;
55
57
 
56
58
  /**
57
59
  * 设置使用树脂优先级
@@ -72,7 +72,9 @@ declare global {
72
72
  * 设置战斗策略路径
73
73
  * @param strategyName 战斗策略名称
74
74
  */
75
- setCombatStrategyPath(strategyName?: string): void;
75
+ setCombatStrategyPath(strategyName: string): void;
76
+ // overload
77
+ setCombatStrategyPath(strategyName: string | null): void;
76
78
 
77
79
  /** 设置默认值 */
78
80
  setDefault(): void;
@@ -0,0 +1,33 @@
1
+ import "../../../../System/Collections/Generic/List";
2
+
3
+ declare global {
4
+ namespace BetterGenshinImpact.GameTask.AutoFight.Config {
5
+ class CombatAvatar {
6
+ /** 唯一标识 */
7
+ id: string;
8
+
9
+ /** 角色中文名 */
10
+ name: string;
11
+
12
+ /** 角色英文名 */
13
+ nameEn: string;
14
+
15
+ /** 武器类型 */
16
+ weapon: string;
17
+
18
+ /** 元素战技CD */
19
+ skillCd: number;
20
+
21
+ /** 长按元素战技CD */
22
+ skillHoldCd: number;
23
+
24
+ /** 元素爆发CD */
25
+ burstCd: number;
26
+
27
+ /** 别名 */
28
+ alias: System.Collections.Generic.List<string>;
29
+ }
30
+ }
31
+ }
32
+
33
+ export {};
@@ -0,0 +1,171 @@
1
+ import { Rect } from "mirada/dist/src/types/opencv";
2
+ import "../../../../System/DateTime";
3
+ import "../../../../System/Exception";
4
+ import "../../../../System/Threading/CancellationToken";
5
+ import "../../../GameTask/Model/Area/ImageRegion";
6
+ import "../../AutoFight/Model/CombatScenes";
7
+ import "../Config/CombatAvatar";
8
+
9
+ declare global {
10
+ namespace BetterGenshinImpact.GameTask.AutoFight.Model {
11
+ /** 队伍内的角色 */
12
+ class Avatar {
13
+ /** 配置文件中的角色信息 */
14
+ combatAvatar: BetterGenshinImpact.GameTask.AutoFight.Config.CombatAvatar;
15
+
16
+ /** 角色名称 中文 */
17
+ name: string;
18
+
19
+ /** 队伍内序号 */
20
+ index: number;
21
+
22
+ /** 最近一次OCR识别出的CD到期时间 */
23
+ ocrSkillCd: System.DateTime;
24
+
25
+ /** 手动配置的技能CD,有它就不使用OCR,小于0为自动 */
26
+ manualSkillCd: number;
27
+
28
+ /** 最近一次使用元素战技的时间 */
29
+ lastSkillTime: System.DateTime;
30
+
31
+ /** 元素爆发是否就绪 */
32
+ isBurstReady: boolean;
33
+
34
+ /** 名字所在矩形位置 */
35
+ nameRect: Rect;
36
+
37
+ /** 名字右边的编号位置 */
38
+ indexRect: Rect;
39
+
40
+ /** 任务取消令牌 */
41
+ ct: System.Threading.CancellationToken;
42
+
43
+ /** 战斗场景 */
44
+ combatScenes: BetterGenshinImpact.GameTask.AutoFight.Model.CombatScenes;
45
+
46
+ /** 切换到本角色 切换cd是1秒,如果切换失败,会尝试再次切换,最多尝试5次 */
47
+ switch(): void;
48
+
49
+ /** 尝试切换到本角色 */
50
+ trySwitch(): boolean;
51
+ // overload
52
+ trySwitch(tryTimes: number): boolean;
53
+ trySwitch(tryTimes: number, needLog: boolean): boolean;
54
+
55
+ /** 切换到本角色 切换cd是1秒,如果切换失败,会尝试再次切换,最多尝试5次 */
56
+ switchWithoutCts(): void;
57
+
58
+ /** 是否出战状态 */
59
+ isActive(region: BetterGenshinImpact.GameTask.Model.Area.ImageRegion): boolean;
60
+
61
+ /** 普通攻击 */
62
+ attack(): void;
63
+ // overload
64
+ attack(ms: number): void;
65
+
66
+ /** 使用元素战技 E */
67
+ useSkill(): void;
68
+ // overload
69
+ useSkill(hold: boolean): void;
70
+
71
+ /** 使用完元素战技的回调,注意,不会在这里检测是不是需要跑七天神像 */
72
+ afterUseSkill(): void;
73
+ // overload
74
+ afterUseSkill(givenRegion: BetterGenshinImpact.GameTask.Model.Area.ImageRegion | null): void;
75
+
76
+ /** 使用元素爆发 Q Q释放等待 2s 超时认为没有Q技能 */
77
+ useBurst(): void;
78
+
79
+ /** 冲刺 */
80
+ dash(): void;
81
+ // overload
82
+ dash(ms: number): void;
83
+
84
+ /** 移动 */
85
+ walk(key: string, ms: number): void;
86
+
87
+ /** 移动摄像机 */
88
+ moveCamera(pixelDeltaX: number, pixelDeltaY: number): void;
89
+
90
+ /** 等待 */
91
+ wait(ms: number): void;
92
+
93
+ /** 根据cd推算E技能是否好了 */
94
+ isSkillReady(): boolean;
95
+ // overload
96
+ isSkillReady(printLog: boolean): boolean;
97
+
98
+ /** 计算上一次使用技能到现在还剩下多长时间的cd */
99
+ getSkillCdSeconds(): number;
100
+
101
+ /** 等待技能CD */
102
+ waitSkillCd(): Promise<void>;
103
+ // overload
104
+ waitSkillCd(ct: System.Threading.CancellationToken): Promise<void>;
105
+
106
+ /** 跳跃 */
107
+ jump(): void;
108
+
109
+ /** 重击 */
110
+ charge(): void;
111
+ // overload
112
+ charge(ms: number): void;
113
+
114
+ /** 鼠标按下 */
115
+ mouseDown(): void;
116
+ // overload
117
+ mouseDown(key: string): void;
118
+
119
+ /** 鼠标抬起 */
120
+ mouseUp(): void;
121
+ // overload
122
+ mouseUp(key: string): void;
123
+
124
+ /** 鼠标点击 */
125
+ click(): void;
126
+ // overload
127
+ click(key: string): void;
128
+
129
+ /** 鼠标相对移动 */
130
+ moveBy(x: number, y: number): void;
131
+
132
+ /** 按下按键 */
133
+ keyDown(key: string): void;
134
+
135
+ /** 抬起按键 */
136
+ keyUp(key: string): void;
137
+
138
+ /** 按下并抬起按键 */
139
+ keyPress(key: string): void;
140
+
141
+ /** 从配置字符串中查找角色cd 仅有角色名时返回 -1 ,没找到角色返回null */
142
+ parseActionSchedulerByCd(avatarName: string, input: string): number | null;
143
+
144
+ constructor(
145
+ combatScenes: BetterGenshinImpact.GameTask.AutoFight.Model.CombatScenes,
146
+ name: string,
147
+ index: number,
148
+ nameRect: Rect
149
+ );
150
+ constructor(
151
+ combatScenes: BetterGenshinImpact.GameTask.AutoFight.Model.CombatScenes,
152
+ name: string,
153
+ index: number,
154
+ nameRect: Rect,
155
+ manualSkillCd: number
156
+ );
157
+
158
+ /** 是否存在角色被击败 通过判断确认按钮 */
159
+ static throwWhenDefeated(
160
+ region: BetterGenshinImpact.GameTask.Model.Area.ImageRegion,
161
+ ct: System.Threading.CancellationToken
162
+ ): void;
163
+
164
+ /** tp 到七天神像恢复 */
165
+ static tpForRecover(ct: System.Threading.CancellationToken, ex: System.Exception): void;
166
+ }
167
+ }
168
+ export import Avatar = BetterGenshinImpact.GameTask.AutoFight.Model.Avatar;
169
+ }
170
+
171
+ export {};
@@ -0,0 +1,11 @@
1
+ declare global {
2
+ namespace BetterGenshinImpact.GameTask.AutoFight.Model {
3
+ class AvatarActiveCheckContext {
4
+ activeIndexByArrowCount: number[];
5
+
6
+ totalCheckFailedCount: number;
7
+ }
8
+ }
9
+ }
10
+
11
+ export {};
@@ -0,0 +1,72 @@
1
+ import "../../../../SixLabors/ImageSharp/Image";
2
+ import "../../../../System/Collections/Generic/List";
3
+ import "../../../../System/IDisposable";
4
+ import "../../../../System/Threading/CancellationToken";
5
+ import "../../../GameTask/Model/Area/ImageRegion";
6
+ import "./Avatar";
7
+ import "./AvatarActiveCheckContext";
8
+ import "./MultiGameStatus";
9
+
10
+ declare global {
11
+ namespace BetterGenshinImpact.GameTask.AutoFight.Model {
12
+ class CombatScenes implements System.IDisposable {
13
+ avatarCount: number;
14
+
15
+ /** 最近一次识别出的出战角色编号,从1开始,-1表示未识别 */
16
+ lastActiveAvatarIndex: number;
17
+
18
+ currentMultiGameStatus: BetterGenshinImpact.GameTask.AutoFight.Model.MultiGameStatus;
19
+
20
+ expectedTeamAvatarNumber: number;
21
+
22
+ getAvatars(): System.Collections.Generic.List<BetterGenshinImpact.GameTask.AutoFight.Model.Avatar>;
23
+
24
+ initializeTeam(
25
+ imageRegion: BetterGenshinImpact.GameTask.Model.Area.ImageRegion
26
+ ): BetterGenshinImpact.GameTask.AutoFight.Model.CombatScenes;
27
+
28
+ refreshTeamAvatarIndexRectList(
29
+ imageRegion: BetterGenshinImpact.GameTask.Model.Area.ImageRegion
30
+ ): boolean;
31
+
32
+ classifyAvatarCnName(img: SixLabors.ImageSharp.Image, index: number): object;
33
+
34
+ classifyAvatarName(img: SixLabors.ImageSharp.Image, index: number): string;
35
+
36
+ checkTeamInitialized(): boolean;
37
+
38
+ updateActionSchedulerByCd(cdConfig: string): System.Collections.Generic.List<string>;
39
+
40
+ beforeTask(ct: System.Threading.CancellationToken): void;
41
+
42
+ afterTask(): void;
43
+
44
+ selectAvatar(name: string): BetterGenshinImpact.GameTask.AutoFight.Model.Avatar;
45
+
46
+ selectAvatar(avatarIndex: number): BetterGenshinImpact.GameTask.AutoFight.Model.Avatar;
47
+
48
+ currentAvatar(): string | null;
49
+ // overload
50
+ currentAvatar(force: boolean | null): string | null;
51
+ currentAvatar(
52
+ force: boolean | null,
53
+ region: BetterGenshinImpact.GameTask.Model.Area.ImageRegion | null
54
+ ): string | null;
55
+ currentAvatar(
56
+ force: boolean | null,
57
+ region: BetterGenshinImpact.GameTask.Model.Area.ImageRegion | null,
58
+ ct: System.Threading.CancellationToken | null
59
+ ): string | null;
60
+
61
+ getActiveAvatarIndex(
62
+ imageRegion: BetterGenshinImpact.GameTask.Model.Area.ImageRegion,
63
+ context: BetterGenshinImpact.GameTask.AutoFight.Model.AvatarActiveCheckContext
64
+ ): number;
65
+
66
+ dispose(): void;
67
+ }
68
+ }
69
+ export import CombatScenes = BetterGenshinImpact.GameTask.AutoFight.Model.CombatScenes;
70
+ }
71
+
72
+ export {};
@@ -0,0 +1,19 @@
1
+ declare global {
2
+ namespace BetterGenshinImpact.GameTask.AutoFight.Model {
3
+ class MultiGameStatus {
4
+ /** 是否在联机状态 */
5
+ isInMultiGame: boolean;
6
+
7
+ /** 是不是房主 */
8
+ isHost: boolean;
9
+
10
+ /** 玩家数量 */
11
+ playerCount: number;
12
+
13
+ /** 我能控制的最大角色数量 */
14
+ maxControlAvatarCount: number;
15
+ }
16
+ }
17
+ }
18
+
19
+ export {};
@@ -0,0 +1,31 @@
1
+ import { Mat } from "mirada/dist/src/types/opencv";
2
+ import "../../../../Fischless/WindowsInput/IMouseSimulator";
3
+
4
+ declare global {
5
+ namespace BetterGenshinImpact.GameTask.Model.Area {
6
+ class DesktopRegion extends BetterGenshinImpact.GameTask.Model.Area.Region {
7
+ desktopRegionClick(x: number, y: number, w: number, h: number): void;
8
+
9
+ desktopRegionMove(captureMat: Mat, x: number, y: number): void;
10
+
11
+ derive(x: number, y: number, w: number, h: number): void;
12
+
13
+ constructor(w: number, h: number);
14
+
15
+ constructor(w: number, h: number, iMouse: Fischless.WindowsInput.IMouseSimulator | null);
16
+
17
+ constructor();
18
+
19
+ constructor(iMouse: Fischless.WindowsInput.IMouseSimulator);
20
+
21
+ static desktopRegionClick(cx: number, cy: number): void;
22
+
23
+ static desktopRegionMove(cx: number, cy: number): void;
24
+
25
+ static desktopRegionMoveBy(dx: number, dy: number): void;
26
+ }
27
+ }
28
+ export import DesktopRegion = BetterGenshinImpact.GameTask.Model.Area.DesktopRegion;
29
+ }
30
+
31
+ export {};