@deafwave/osrs-botmaker-types 0.7.33 → 0.7.34
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/dist/src/types/sox/api/bot/equipment.d.ts +12 -8
- package/dist/src/types/sox/api/bot/grandExchange.d.ts +3 -2
- package/dist/src/types/sox/api/bot/index.d.ts +1 -0
- package/dist/src/types/sox/api/bot/magic.d.ts +1 -1
- package/dist/src/types/sox/api/bot/net.d.ts +11 -3
- package/dist/src/types/sox/api/bot/prayer.d.ts +3 -3
- package/dist/src/types/sox/api/bot/types.d.ts +41 -1
- package/dist/src/types/sox/api/bot/variables.d.ts +7 -7
- package/dist/src/types/sox/api/bot/walking.d.ts +17 -0
- package/dist/src/types/sox/api/bot/web.d.ts +12 -6
- package/dist/src/types/sox/api/bot/widgets.d.ts +24 -14
- package/package.json +1 -1
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
/// <reference path="../../../runelite/index.d.ts" />
|
|
4
|
+
|
|
3
5
|
declare namespace bot {
|
|
4
6
|
/**
|
|
5
7
|
* Interface for interacting with the player's equipped items
|
|
6
8
|
* Provides methods to check and manage equipment
|
|
7
9
|
*/
|
|
8
|
-
type Item = {
|
|
9
|
-
id: number;
|
|
10
|
-
quantity: number;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
10
|
interface equipment {
|
|
14
11
|
/**
|
|
15
12
|
* Checks if the player has all the specified items equipped by their IDs
|
|
@@ -54,9 +51,16 @@ declare namespace bot {
|
|
|
54
51
|
containsName: (name: string) => boolean;
|
|
55
52
|
|
|
56
53
|
/**
|
|
57
|
-
*
|
|
58
|
-
* @returns Array of equipped items
|
|
54
|
+
* Returns an array of all equipped items
|
|
55
|
+
* @returns Array of equipped items (net.runelite.api.Item)
|
|
56
|
+
*/
|
|
57
|
+
getEquipment: () => net.runelite.api.Item[];
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Unequips an item with the given ID from the equipment
|
|
61
|
+
* @param id The item ID to unequip
|
|
62
|
+
* @returns True if the item was unequipped, false otherwise
|
|
59
63
|
*/
|
|
60
|
-
|
|
64
|
+
unequip: (id: number) => boolean;
|
|
61
65
|
}
|
|
62
66
|
}
|
|
@@ -12,7 +12,7 @@ declare namespace bot {
|
|
|
12
12
|
/** Gets the quantity of the item being bought or sold */
|
|
13
13
|
getQuantity(): number;
|
|
14
14
|
/** Gets the slot number used for this exchange request */
|
|
15
|
-
getSlot(): GrandExchangeOffer;
|
|
15
|
+
getSlot(): net.runelite.api.GrandExchangeOffer;
|
|
16
16
|
/** Checks if the request has been aborted */
|
|
17
17
|
isAborted(): boolean;
|
|
18
18
|
/** Checks if the request is in the process of being aborted */
|
|
@@ -25,6 +25,7 @@ declare namespace bot {
|
|
|
25
25
|
setMaxAttempts(maxAttempts: number): void;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
|
|
28
29
|
/**
|
|
29
30
|
* Interface for interacting with the Grand Exchange
|
|
30
31
|
* Provides methods to buy/sell items and check GE status
|
|
@@ -38,7 +39,7 @@ declare namespace bot {
|
|
|
38
39
|
* @param walkToAndOpenGE Whether to automatically walk to and open the GE
|
|
39
40
|
* @returns An ExchangeRequest object representing the buy order
|
|
40
41
|
*/
|
|
41
|
-
addBuyToQueue: (itemId: number, quantity: number, walkToAndOpenGE: boolean) =>
|
|
42
|
+
addBuyToQueue: (itemId: number, quantity: number, walkToAndOpenGE: boolean) => bot.ExchangeRequest;
|
|
42
43
|
|
|
43
44
|
/**
|
|
44
45
|
* Gets the current size of the Grand Exchange queue
|
|
@@ -107,7 +107,7 @@ declare namespace bot {
|
|
|
107
107
|
* @param spellName The name of the spell to cast
|
|
108
108
|
* @param tileItem The tile item to cast the spell on
|
|
109
109
|
*/
|
|
110
|
-
castOnTileItem: (spellName: SpellName, tileItem:
|
|
110
|
+
castOnTileItem: (spellName: SpellName, tileItem: net.runelite.api.TileItem) => void;
|
|
111
111
|
|
|
112
112
|
/**
|
|
113
113
|
* Casts a magic spell on a tile object (game object in the world)
|
|
@@ -7,15 +7,23 @@ declare namespace bot {
|
|
|
7
7
|
*/
|
|
8
8
|
interface net {
|
|
9
9
|
/**
|
|
10
|
-
* Sends a message to specified
|
|
11
|
-
* @param targetIds Array of
|
|
10
|
+
* Sends a BotMaker message to the specified Discord IDs via the socket server
|
|
11
|
+
* @param targetIds Array of Discord IDs to send the message to
|
|
12
12
|
* @param message The message content to send
|
|
13
13
|
* @param includeSelf Whether to include the sender in the recipients
|
|
14
14
|
*/
|
|
15
15
|
sendMessage: (targetIds: string[], message: string, includeSelf: boolean) => void;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* Sends a message to
|
|
18
|
+
* Sends a BotMaker message to the specified RuneScape names via the socket server
|
|
19
|
+
* @param rsNames Array of RuneScape display names to send the message to
|
|
20
|
+
* @param message The message content to send
|
|
21
|
+
* @param includeSelf Whether to include the sender in the recipients
|
|
22
|
+
*/
|
|
23
|
+
sendMessageToRsns: (rsNames: string[], message: string, includeSelf: boolean) => void;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Sends a BotMaker message to all nearby local players via the socket server
|
|
19
27
|
* @param message The message content to send
|
|
20
28
|
* @param includeSelf Whether to include the sender in the recipients
|
|
21
29
|
*/
|
|
@@ -7,9 +7,9 @@ declare namespace bot {
|
|
|
7
7
|
*/
|
|
8
8
|
interface prayer {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
* @param prayer The Prayer enum value to
|
|
12
|
-
* @param bypassMouseClicks
|
|
10
|
+
* Enables the specified prayer. Use bypassMouseClicks to send the action without a click.
|
|
11
|
+
* @param prayer The Prayer enum value to enable
|
|
12
|
+
* @param bypassMouseClicks True to toggle without mouse clicks, false to use mouse clicks
|
|
13
13
|
*/
|
|
14
14
|
togglePrayer: (prayer: net.runelite.api.Prayer, bypassMouseClicks: boolean) => void;
|
|
15
15
|
}
|
|
@@ -2,8 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
declare namespace bot {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Result of finding the nearest reachable point (e.g. from findNearestPointAsync).
|
|
6
6
|
*/
|
|
7
|
+
interface NearestPointResult {
|
|
8
|
+
/** The nearest reachable world point */
|
|
9
|
+
getDestination: () => net.runelite.api.coords.WorldPoint;
|
|
10
|
+
getPathCost: () => number;
|
|
11
|
+
getPathDistance: () => number;
|
|
12
|
+
getStartPoint: () => net.runelite.api.coords.WorldPoint;
|
|
13
|
+
isFound: () => boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
7
16
|
interface TileItemInfo {
|
|
8
17
|
/** The tile where the item is located */
|
|
9
18
|
tile: net.runelite.api.Tile;
|
|
@@ -65,4 +74,35 @@ declare namespace bot {
|
|
|
65
74
|
*/
|
|
66
75
|
stop: () => void;
|
|
67
76
|
}
|
|
77
|
+
|
|
78
|
+
interface types {
|
|
79
|
+
asActor: (obj: unknown) => net.runelite.api.Actor;
|
|
80
|
+
asExchangeRequest: (obj: unknown) => bot.ExchangeRequest;
|
|
81
|
+
asGraphicsObject: (obj: unknown) => net.runelite.api.GraphicsObject;
|
|
82
|
+
asGraphicsObjectArray: (obj: unknown) => net.runelite.api.GraphicsObject[];
|
|
83
|
+
asGrandExchangeOffer: (obj: unknown) => net.runelite.api.GrandExchangeOffer;
|
|
84
|
+
asHeadIcon: (obj: unknown) => net.runelite.api.HeadIcon;
|
|
85
|
+
asItem: (obj: unknown) => net.runelite.api.Item;
|
|
86
|
+
asItemArray: (obj: unknown) => net.runelite.api.Item[];
|
|
87
|
+
asNearestPointResult: (obj: unknown) => bot.NearestPointResult;
|
|
88
|
+
asNPC: (obj: unknown) => net.runelite.api.NPC;
|
|
89
|
+
asNPCArray: (obj: unknown) => net.runelite.api.NPC[];
|
|
90
|
+
asObjectComposition: (obj: unknown) => net.runelite.api.ObjectComposition;
|
|
91
|
+
asPlayer: (obj: unknown) => net.runelite.api.Player;
|
|
92
|
+
asPlayerArray: (obj: unknown) => net.runelite.api.Player[];
|
|
93
|
+
asPrayer: (obj: unknown) => net.runelite.api.Prayer;
|
|
94
|
+
asProjectile: (obj: unknown) => net.runelite.api.Projectile;
|
|
95
|
+
asProjectileArray: (obj: unknown) => net.runelite.api.Projectile[];
|
|
96
|
+
asTile: (obj: unknown) => net.runelite.api.Tile;
|
|
97
|
+
asTileItem: (obj: unknown) => net.runelite.api.TileItem;
|
|
98
|
+
asTileItemInfo: (obj: unknown) => bot.TileItemInfo;
|
|
99
|
+
asTileItemInfoArray: (obj: unknown) => bot.TileItemInfo[];
|
|
100
|
+
asTileObject: (obj: unknown) => net.runelite.api.TileObject;
|
|
101
|
+
asTileObjectArray: (obj: unknown) => net.runelite.api.TileObject[];
|
|
102
|
+
asWidget: (obj: unknown) => net.runelite.api.widgets.Widget;
|
|
103
|
+
asWidgetArray: (obj: unknown) => net.runelite.api.widgets.Widget[];
|
|
104
|
+
asWorldPoint: (obj: unknown) => net.runelite.api.coords.WorldPoint;
|
|
105
|
+
asWorldPointArray: (obj: unknown) => net.runelite.api.coords.WorldPoint[];
|
|
106
|
+
createWorldPoint: (x: number, y: number, plane: number) => net.runelite.api.coords.WorldPoint;
|
|
107
|
+
}
|
|
68
108
|
}
|
|
@@ -9,43 +9,43 @@ declare namespace bot {
|
|
|
9
9
|
/**
|
|
10
10
|
* Gets a boolean variable by name
|
|
11
11
|
* @param variableName The name of the variable to retrieve
|
|
12
|
-
* @returns The boolean value
|
|
12
|
+
* @returns The boolean value
|
|
13
13
|
*/
|
|
14
14
|
getBooleanVariable: (variableName: string) => boolean;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Gets an array of integers variable by name
|
|
18
18
|
* @param variableName The name of the variable to retrieve
|
|
19
|
-
* @returns The array
|
|
19
|
+
* @returns The integer array
|
|
20
20
|
*/
|
|
21
21
|
getIntArrayVariable: (variableName: string) => number[];
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Gets an integer variable by name
|
|
25
25
|
* @param variableName The name of the variable to retrieve
|
|
26
|
-
* @returns The integer value
|
|
26
|
+
* @returns The integer value
|
|
27
27
|
*/
|
|
28
28
|
getIntVariable: (variableName: string) => number;
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Gets an array of strings variable by name
|
|
32
32
|
* @param variableName The name of the variable to retrieve
|
|
33
|
-
* @returns The array
|
|
33
|
+
* @returns The string array
|
|
34
34
|
*/
|
|
35
35
|
getStringArrayVariable: (variableName: string) => string[];
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* Gets a string variable by name
|
|
39
39
|
* @param variableName The name of the variable to retrieve
|
|
40
|
-
* @returns The string value
|
|
40
|
+
* @returns The string value
|
|
41
41
|
*/
|
|
42
42
|
getStringVariable: (variableName: string) => string;
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* Sets a variable of any type by name
|
|
46
46
|
* @param variableName The name of the variable to set
|
|
47
|
-
* @param value The value to set
|
|
47
|
+
* @param value The value to set
|
|
48
48
|
*/
|
|
49
|
-
setVariable: (variableName: string, value:
|
|
49
|
+
setVariable: (variableName: string, value: number | number[] | string | string[] | boolean) => void;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference path="../../../runelite/index.d.ts" />
|
|
2
|
+
/// <reference path="./types.d.ts" />
|
|
2
3
|
|
|
3
4
|
declare namespace bot {
|
|
4
5
|
/**
|
|
@@ -67,6 +68,22 @@ declare namespace bot {
|
|
|
67
68
|
*/
|
|
68
69
|
webWalkToNearestBank: () => void;
|
|
69
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Web walks to the nearest point from an array of destinations
|
|
73
|
+
* @param destinations Array of WorldPoint destinations to choose from
|
|
74
|
+
*/
|
|
75
|
+
webWalkToNearest: (destinations: net.runelite.api.coords.WorldPoint[]) => void;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Finds the nearest reachable point from an array of destinations. Callback receives NearestPointResult (or null on error).
|
|
79
|
+
* @param destinations Array of WorldPoint destinations to choose from
|
|
80
|
+
* @param callback Called with the result or null on error
|
|
81
|
+
*/
|
|
82
|
+
findNearestPointAsync: (
|
|
83
|
+
destinations: net.runelite.api.coords.WorldPoint[],
|
|
84
|
+
callback: (result: bot.NearestPointResult | null) => void
|
|
85
|
+
) => void;
|
|
86
|
+
|
|
70
87
|
/**
|
|
71
88
|
* Starts web walking with full configuration options for food, stamina, teleports, and more
|
|
72
89
|
* @param worldPoint The WorldPoint destination to walk to
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
/// <reference path="../../../java/BufferedImage.d.ts" />
|
|
4
4
|
|
|
5
|
+
declare namespace bot {
|
|
5
6
|
interface web {
|
|
7
|
+
/**
|
|
8
|
+
* Fetches the content of the given URL as a string. Only allows http/https URLs from whitelisted domains. Returns an empty string on error.
|
|
9
|
+
* @param requestURL The URL to fetch
|
|
10
|
+
* @returns The response body as a string, or empty string on error
|
|
11
|
+
*/
|
|
12
|
+
readString: (requestURL: string) => string;
|
|
6
13
|
|
|
7
14
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* @
|
|
11
|
-
* @returns The string read from the web
|
|
15
|
+
* Fetches an image from a whitelisted URL. Returns null on error.
|
|
16
|
+
* @param requestURL The URL to fetch the image from
|
|
17
|
+
* @returns The image as a BufferedImage, or null on error
|
|
12
18
|
*/
|
|
13
|
-
|
|
19
|
+
readImage: (requestURL: string) => BufferedImage | null;
|
|
14
20
|
}
|
|
15
21
|
}
|
|
@@ -7,31 +7,41 @@ declare namespace bot {
|
|
|
7
7
|
*/
|
|
8
8
|
interface widgets {
|
|
9
9
|
/**
|
|
10
|
-
* Handles dialogue
|
|
10
|
+
* Handles dialogue options by clicking continue or selecting from the provided dialogue options
|
|
11
|
+
* @param dialogues Array of dialogue option texts to select (for continue-only use e.g. [] or ["Continue"])
|
|
12
|
+
* @returns True if dialogue was handled, false otherwise
|
|
11
13
|
*/
|
|
12
|
-
handleDialogue: (dialogues: []) => boolean;
|
|
14
|
+
handleDialogue: (dialogues: string[]) => boolean;
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
|
-
* Interacts with a
|
|
16
|
-
* @param packedWidgetId The packed ID of the widget to interact with
|
|
17
|
-
* @param identifier The identifier for the interaction
|
|
18
|
-
* @param opcode The operation code for the interaction
|
|
19
|
-
* @param p0 The first parameter for the interaction
|
|
20
|
-
* @param p1 The second parameter for the interaction (optional)
|
|
17
|
+
* Interacts with a widget using packed widget ID, identifier, opcode, param0, and param1
|
|
21
18
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Interacts with a widget using packed widget ID, identifier, opcode, param0, and optionally param1.
|
|
21
|
+
*
|
|
22
|
+
* @param packedWidgetId The packed widget ID
|
|
23
|
+
* @param identifier The identifier for the widget action
|
|
24
|
+
* @param opcode The opcode specifying the action
|
|
25
|
+
* @param param0 The first parameter for the action
|
|
26
|
+
* @param param1 (Optional) The second parameter for the action
|
|
27
|
+
*/
|
|
28
|
+
interactSpecifiedWidget(
|
|
24
29
|
packedWidgetId: number,
|
|
25
30
|
identifier: number,
|
|
26
31
|
opcode: number,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
)
|
|
32
|
+
param0: number,
|
|
33
|
+
param1?: number
|
|
34
|
+
): void;
|
|
30
35
|
|
|
31
36
|
/**
|
|
32
|
-
* Interacts with a widget by matching its text content
|
|
37
|
+
* Interacts with a widget by matching its text content.
|
|
33
38
|
* @param text The text to search for in widgets
|
|
34
39
|
*/
|
|
35
40
|
interactWidgetText: (text: string) => void;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Enables special attack
|
|
44
|
+
*/
|
|
45
|
+
enableSpecialAttack: () => void;
|
|
36
46
|
}
|
|
37
47
|
}
|