-
Notifications
You must be signed in to change notification settings - Fork 9
/
Skills.simba
174 lines (158 loc) · 4 KB
/
Skills.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
{$include_once Internal/Reflection.simba}
{$include_once Constants.simba}
type
TSkill = (
R_SKILL_ATTACK = 0,
R_SKILL_DEFENCE,
R_SKILL_STRENGTH,
R_SKILL_HITPOINTS,
R_SKILL_RANGED,
R_SKILL_PRAYER,
R_SKILL_MAGIC,
R_SKILL_COOKING,
R_SKILL_WOODCUTTING,
R_SKILL_FLETCHING,
R_SKILL_FISHING,
R_SKILL_FIREMAKING,
R_SKILL_CRAFTING,
R_SKILL_SMITHING,
R_SKILL_MINING,
R_SKILL_HERBLORE,
R_SKILL_AGILITY,
R_SKILL_THIEVING,
R_SKILL_SLAYER,
R_SKILL_FARMING,
R_SKILL_RUNECRAFT,
R_SKILL_HUNTER,
R_SKILL_CONSTRUCTION,
R_SKILL_TOTALLEVEL);
TSkillIndex = (
R_SKILL_TAB_INDEX_ATTACK = 1,
R_SKILL_TAB_INDEX_STRENGTH,
R_SKILL_TAB_INDEX_DEFENCE,
R_SKILL_TAB_INDEX_RANGED,
R_SKILL_TAB_INDEX_PRAYER,
R_SKILL_TAB_INDEX_MAGIC,
R_SKILL_TAB_INDEX_RUNECRAFT,
R_SKILL_TAB_INDEX_CONSTRUCTION,
R_SKILL_TAB_INDEX_HITPOINTS,
R_SKILL_TAB_INDEX_AGILITY,
R_SKILL_TAB_INDEX_HERBLORE,
R_SKILL_TAB_INDEX_THIEVING,
R_SKILL_TAB_INDEX_CRAFTING,
R_SKILL_TAB_INDEX_FLETCHING,
R_SKILL_TAB_INDEX_SLAYER,
R_SKILL_TAB_INDEX_HUNTER,
R_SKILL_TAB_INDEX_MINING,
R_SKILL_TAB_INDEX_SMITHING,
R_SKILL_TAB_INDEX_FISHING,
R_SKILL_TAB_INDEX_COOKING,
R_SKILL_TAB_INDEX_FIREMAKING,
R_SKILL_TAB_INDEX_WOODCUTTING,
R_SKILL_TAB_INDEX_FARMING,
R_SKILL_TAB_INDEX_TOTALLEVEL);
{*
R_GetSkillLevel
~~~~~~~~~~~~~~~~~~~~~~
Returns the level of the specified skill.
Example:
CurrentSkillLevel := R_GetSkillLevel(R_SKILL_ATTACK);
*}
Function R_GetSkillLevel(Skill: TSkill): Int32;
var
Skills: Pointer;
begin
Skills := RGetStaticArray(R_EIOS, CLIENT_CURRENTLEVELS);
Result := RGetIntArray(R_EIOS, Skills, Ord(Skill));
RFreeObject(R_EIOS, Skills);
end;
{*
R_GetSkillMaxLevel
~~~~~~~~~~~~~~~~~~~~~~
Returns the maximum level of the specified skill.
Example:
MaxLevel := R_GetSkillMaxLevel(R_SKILL_ATTACK);
*}
Function R_GetSkillMaxLevel(Skill: TSkill): Int32;
var
Skills: Pointer;
begin
Skills := RGetStaticArray(R_EIOS, CLIENT_REALLEVELS);
Result := RGetIntArray(R_EIOS, Skills, Ord(Skill));
RFreeObject(R_EIOS, Skills);
end;
{*
R_GetSkillExperience
~~~~~~~~~~~~~~~~~~~~~~
Returns the total experience earned in the specified skill.
Example:
AttackXP := R_GetSkillExperience(R_SKILL_ATTACK);
*}
Function R_GetSkillExperience(Skill: TSkill): Int32;
var
Experiences: Pointer;
begin
Experiences := RGetStaticArray(R_EIOS, CLIENT_EXPERIENCES);
Result := RGetIntArray(R_EIOS, Experiences, Ord(Skill));
RFreeObject(R_EIOS, Experiences);
end;
{*
R_GetSkillTabBounds
~~~~~~~~~~~~~~~~~~~~~~
Returns a TBox containing the bounds of the specified skill.
Example:
Mouse.Move(R_GetSkillTabBounds(R_SKILL_TAB_INDEX_ATTACK));
*}
Function R_GetSkillTabBounds(Skill: TSkillIndex): TBox;
var
Widget: RSWidget;
begin
Widget := RSWidget.Get(R_INTERFACE_SKILLS, Ord(Skill));
Result := Widget.Bounds;
Widget.Free;
end;
{*
R_GetSkillTabLevel
~~~~~~~~~~~~~~~~~~~~~~
Returns the level of the specified skill.
Example:
Writeln(R_GetSkillTabLevel(R_SKILL_TAB_INDEX_ATTACK));
*}
Function R_GetSkillTabLevel(Skill: TSkillIndex): Int32;
var
Widget: RSWidget;
begin
Widget := RSWidget.Get(R_INTERFACE_SKILLS, Ord(Skill), 3);
Result := StrToInt(Widget.Text);
Widget.Free;
end;
{*
R_GetSkillTabMaxLevel
~~~~~~~~~~~~~~~~~~~~~~
Returns the max level of the specified skill.
Example:
Writeln(R_GetSkillTabMaxLevel(R_SKILL_TAB_INDEX_ATTACK));
*}
Function R_GetSkillTabMaxLevel(Skill: TSkillIndex): Int32;
var
Widget: RSWidget;
begin
Widget := RSWidget.Get(R_INTERFACE_SKILLS, Ord(Skill), 4);
Result := StrToInt(Widget.Text);
Widget.Free;
end;
{*
R_GetSkillTabTotalLevel
~~~~~~~~~~~~~~~~~~~~~~
Returns the player's total level.
Example:
Writeln(R_GetSkillTabTotalLevel);
*}
Function R_GetSkillTabTotalLevel: Int32;
var
Widget: RSWidget;
begin
Widget := RSWidget.Get(R_INTERFACE_SKILLS, Ord(R_SKILL_TAB_INDEX_TOTALLEVEL) + 3);
Result := StrToInt(copy(Widget.Text, pos(':', Widget.Text) + 1, High(Widget.Text)));
Widget.Free;
end;