Skip to content

Commit 0b2d63e

Browse files
committed
more work on TRSMake
added more docs
1 parent 6da1c61 commit 0b2d63e

File tree

8 files changed

+152
-12
lines changed

8 files changed

+152
-12
lines changed

osrs.simba

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ They should be self-explanatory.
4949
{$IFNDEF SRLT_GAMETAB_INCLUDED} {$INCLUDE_ONCE osrs/interfaces/gametabs/gametab.simba}
5050
{$IFNDEF SRLT_CHAT_TABS_INCLUDED} {$INCLUDE_ONCE osrs/interfaces/chat/chattabs.simba}
5151
{$IFNDEF SRLT_CHAT_INCLUDED} {$INCLUDE_ONCE osrs/interfaces/chat/chat.simba}
52+
{$IFNDEF SRLT_MAKE_INCLUDED} {$INCLUDE_ONCE osrs/interfaces/chat/make.simba}
5253
{$IFNDEF SRLT_MAINSCREEN_INCLUDED} {$INCLUDE_ONCE osrs/interfaces/mainscreen/mainscreen.simba}
5354
{$IFNDEF SRLT_INTERFACE_AREA_INCLUDED} {$INCLUDE_ONCE osrs/interfaces/interfacearea.simba}
5455

@@ -131,3 +132,4 @@ They should be self-explanatory.
131132
{$ENDIF}
132133
{$ENDIF}
133134
{$ENDIF}
135+
{$ENDIF}

osrs/interfaces/chat/make.simba

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,90 @@ type
1515

1616
TRSMake = record
1717
Items: array of TRSMakeItem;
18+
QuantityButtons: TBoxArray;
19+
{%codetools on}
20+
_IsOpenHelper, _QuantityHelper, _ItemsHelper: TBox;
21+
{%codetools on}
1822
const QUANTITY_ALL: Integer = 0;
23+
const TEXT_COLOR: TColor = $203040;
1924
end;
2025

26+
(*
27+
## Make.SetupInterface
28+
```pascal
29+
procedure TRSMake.SetupInterface();
30+
```
31+
Internal method used to setup the {ref}`TRSMake` coordinates.
32+
33+
This is automatically called for you on the {ref}`Make variable`.
34+
*)
35+
procedure TRSMake.SetupInterface();
36+
begin
37+
with Chat.Bounds do
38+
begin
39+
Self._IsOpenHelper.X1 := X1 + 40;
40+
Self._IsOpenHelper.Y1 := Y1 + 12;
41+
Self._IsOpenHelper.X2 := X1 + 300;
42+
Self._IsOpenHelper.Y2 := Y1 + 34;
43+
end;
44+
45+
with Chat.Bounds do
46+
begin
47+
Self._QuantityHelper.X1 := X2 - 193;
48+
Self._QuantityHelper.Y1 := Y1 + 15;
49+
Self._QuantityHelper.X2 := X2 - 19;
50+
Self._QuantityHelper.Y2 := Y1 + 44;
51+
end;
52+
53+
with Chat.Bounds do
54+
begin
55+
Self._ItemsHelper.X1 := X1 + 8;
56+
Self._ItemsHelper.Y1 := Y1 + 51;
57+
Self._ItemsHelper.X2 := X2 - 8;
58+
Self._ItemsHelper.Y2 := Y2 - 19;
59+
end;
60+
end;
61+
62+
(*
63+
## Make.IsOpen
64+
```pascal
65+
function TRSMake.IsOpen(): Boolean;
66+
```
67+
Returns True/False if the {ref}`Make` if open.
2168

69+
Example:
70+
```pascal
71+
WriteLn Make.IsOpen();
72+
```
73+
*)
74+
function TRSMake.IsOpen(): Boolean;
75+
begin
76+
Result := Target.HasColor(Self.TEXT_COLOR, 0, 500, Self._IsOpenHelper);
77+
end;
78+
79+
(*
80+
## Make.WaitOpen
81+
```pascal
82+
function TRSMake.WaitOpen(time: Integer = 600; interval: Integer = -1): Boolean;
83+
```
84+
Returns True if the {ref}`Make` opens within `time` milliseconds.
85+
86+
Example:
87+
```pascal
88+
WriteLn Make.WaitOpen();
89+
```
90+
*)
91+
function TRSMake.WaitOpen(time: Integer = 600; interval: Integer = -1): Boolean;
92+
begin
93+
if interval < 0 then interval := RandomMode(100, 50, 1500);
94+
Result := SleepUntil(Self.IsOpen(), interval, time);
95+
end;
96+
97+
98+
var
99+
(*
100+
(Make variable)=
101+
## var Make
102+
Global {ref}`TRSMake` variable.
103+
*)
104+
Make: TRSMake;

osrs/interfaces/gametabs/equipment.simba

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,23 @@ Enumerator of the equipment buttons.
3434
(*
3535
(TRSEquipment)=
3636
## type TRSEquipment
37-
Main equipment type reponsible for handling it.
37+
Main record reponsible for handling the equipment gametab.
3838
*)
3939
TRSEquipment = record
4040
Slots: TRSSlotInterface;
4141
Items: TRSItemInterface;
4242
Buttons: array [ERSEquipmentButton] of TRSButton;
4343
end;
4444

45+
(*
46+
## Equipment.SetupInterface
47+
```pascal
48+
procedure TRSEquipment.SetupInterface();
49+
```
50+
Internal method used to setup the {ref}`TRSEquipment` coordinates.
51+
52+
This is automatically called for you on the {ref}`Equipment variable`.
53+
*)
4554
procedure TRSEquipment.SetupInterface();
4655
var
4756
slots, btns: TBoxArray;
@@ -101,4 +110,9 @@ begin
101110
end;
102111

103112
var
113+
(*
114+
(Equipment variable)=
115+
## var Equipment
116+
Global {ref}`TRSEquipment` variable.
117+
*)
104118
Equipment: TRSEquipment;

osrs/interfaces/gametabs/gametab.simba

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,31 @@
11
(*
22
# GameTab
3-
Gametabs interfaces core
3+
Gametabs interfaces core.
4+
Whenever you want to use gametab coordinates that are not unique to a specific
5+
tab you should use this.
6+
7+
Check {ref}`TRSInterface` to see what coordinates it has available.
48
*)
59
{$DEFINE SRLT_GAMETAB_INCLUDED}
610
{$INCLUDE_ONCE SRLT/osrs.simba}
711

812
type
13+
(*
14+
(TRSGameTab)=
15+
## type TRSGameTab
16+
GameTab type that holds the core coordinates of a gametab.
17+
*)
918
TRSGameTab = type TRSInterface;
1019

20+
(*
21+
## GameTab.SetupInterface
22+
```pascal
23+
procedure TRSGameTab.SetupInterface();
24+
```
25+
Internal method used to setup the {ref}`TRSGameTab` coordinates.
26+
27+
This is automatically called for you on the {ref}`GameTab variable`.
28+
*)
1129
procedure TRSGameTab.SetupInterface();
1230
begin
1331
case RSClient.Mode of
@@ -49,4 +67,9 @@ begin
4967
end;
5068

5169
var
70+
(*
71+
(GameTab variable)=
72+
## var GameTab
73+
Global {ref}`TRSGameTab` variable.
74+
*)
5275
GameTab: TRSGameTab;

osrs/interfaces/gametabs/inventory.simba

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ type
1313
ShiftEnabled: Boolean;
1414
end;
1515

16+
(*
17+
## Inventory.SetupInterface
18+
```pascal
19+
procedure TRSInventory.SetupInterface();
20+
```
21+
Internal method used to setup the {ref}`TRSInventory` coordinates.
22+
23+
This is automatically called for you on the {ref}`Inventory variable`.
24+
*)
1625
procedure TRSInventory.SetupInterface();
1726
begin
1827
Self.Slots.Setup('Inventory.Slots', TBoxArray.Create(GameTab.TopLeft.Offset(13,9), 4, 7, 31, 31, [11, 5]));
@@ -377,8 +386,8 @@ end;
377386

378387
var
379388
(*
380-
(Inventory)=
389+
(Inventory variable)=
381390
## var Inventory
382-
Global TRSInventory variable.
391+
Global {ref}`TRSInventory` variable.
383392
*)
384393
Inventory: TRSInventory;

osrs/interfaces/gametabs/magic.simba

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ const
7575
]);
7676

7777
type
78+
(*
79+
(TRSMagic)=
80+
## type TRSMagic
81+
Main record reponsible for handling the magic gametab.
82+
*)
7883
TRSMagic = record
7984
SpellCache: array [ERSSpell] of record
8085
Box: TBox;
@@ -591,9 +596,10 @@ begin
591596
Result += 1;
592597
end;
593598

599+
var
594600
(*
601+
(Magic variable)=
595602
## var Magic
596-
Global Magic variable.
603+
Global {ref}`TRSMagic` variable.
597604
*)
598-
var
599605
Magic: TRSMagic;

osrs/interfaces/mainscreen/bank.simba

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,10 @@ end;
114114
(*
115115
## Bank.SetupInterface
116116
```pascal
117-
procedure Bank.SetupInterface;
118-
```
119-
Initializes Bank interface coordinates.
120-
121-
```{note}
122-
This is automatically called on the {ref}`Bank` variable.
117+
procedure TRSBank.SetupInterface();
123118
```
119+
Internal method used to setup the {ref}`TRSBank` coordinates.
120+
This is automatically called for you on the {ref}`Bank variable`.
124121
*)
125122
procedure TRSBank.SetupInterface();
126123
var
@@ -1071,4 +1068,9 @@ end;
10711068

10721069

10731070
var
1071+
(*
1072+
(Bank variable)=
1073+
## var Bank
1074+
Global {ref}`TRSBank` variable.
1075+
*)
10741076
Bank: TRSBank;

osrs/interfaces/setup.simba

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ begin
1717
Logout.SetupInterface();
1818
MM2MS.Setup();
1919
Chat.SetupInterface();
20+
Make.SetupInterface();
2021
InterfaceArea.SetupInterface();
2122
RSInterface.SetupInterface();
2223
XPBar.SetupInterface();

0 commit comments

Comments
 (0)