-
Notifications
You must be signed in to change notification settings - Fork 9
/
Ground.simba
110 lines (89 loc) · 2.07 KB
/
Ground.simba
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
(*
R_GetGroundItemByID
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Returns the RSTile of a specific item ID.
Example:
Mouse.Move(R_GetGroundItemByID(526)[0]);
*)
Function R_GetGroundItem(ItemID: Int32): Array of RSTile;
var
I: Integer;
Items: Array of RSTile;
begin
Items := RSGroundObject.GetTileByID(ItemID);
if Length(Items) < 1 then
Exit;
for I := 0 to Length(Items) - 1 do
Result += RSTile(Items[i]);
//RSTypeArray(Items).Free;
end;
(*
R_GetGroundItemByIDs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Returns the RSTile of a specific item ID.
Example:
Mouse.Move(R_GetGroundItemByIDs([526])[0]);
*)
Function R_GetGroundItems(ItemIDs: Array of Int32): Array of RSTile;
var
I: Integer;
Items: Array of RSTile;
begin
Items := RSGroundObject.GetTilesByIDs(ItemIDs);
if Length(Items) < 1 then
Exit;
for I := 0 to Length(Items) - 1 do
Result += RSTile(Items[i]);
//RSTypeArray(Items).Free;
end;
(*
R_IsGroundItemOnTile
~~~~~~~~~~~~~~~~~~~~~~~~~~
Returns the True if ground item is on a specific tile.
Example:
writeln(R_IsGroundItemOnTile(314, player.Tile.X, player.Tile.Y));
*)
Function R_IsGroundItemOnTile(ItemID, X, Y: Int32): Boolean;
var
I: Integer;
Items: Array of RSGroundItem;
begin
Items := RSGroundObject.GetItemsAt(X, Y);
if Length(Items) < 1 then
Exit;
for I := 0 to Length(Items) - 1 do
begin
if Items[I].ID = ItemID then
begin
RSTypeArray(Items).Free;
Exit(True);
end;
end;
RSTypeArray(Items).Free;
end;
(*
R_GetGroundItemStackSize
~~~~~~~~~~~~~~~~~~~~~~~~~~
Returns the number count of ground items of a given ID
on a specific tile.
Example:
writeln(R_GetGroundItemStackSize(314, player.Tile.X, player.Tile.Y));
*)
Function R_GetGroundItemStackSize(ItemID, X, Y: Int32): Int32;
var
I: Integer;
Items: Array of RSGroundItem;
begin
Items := RSGroundObject.GetItemsAt(X, Y);
if Length(Items) < 1 then
Exit;
for I := 0 to Length(Items) - 1 do
begin
if Items[I].ID = ItemID then
begin
RSTypeArray(Items).Free;
Exit(Items[I].StackSize);
end;
end;
RSTypeArray(Items).Free;
end;