-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGlobals.scar
293 lines (258 loc) · 8.62 KB
/
Globals.scar
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
{==============================================================================\
| MSI Group Scripting Include |
| Globals.scar |
|==============================================================================|
| Used to store all necessary global types, consts and vars |
| |
\_____________________________________________________________________________}
const
MSI_VERSION_NUMBER = '1.0';
{
Abbreviations:
- FS: Fishing Spot
- GS: General Store
- GE: Grand Exchange
- VE: Varrock East
- VW: Varrock West
- FW: Falador West
- FE: Falador East
- CG: Castle Guards
- DW: Dark Wizards
- V: Volcan
- SO: Stronghold Of *
- AK: Al Kharid
- SW: Spinning Wheel
- LB: Lumby
- EV: EdgeVille
- BV: Barbarian Village
}
{ const Debug
Description: The several debugging levels, so the user receives as much
detail as he wishes to receive. }
const
DEBUG_FORCE = 10; // For MSI SLs to force it to be debuged, not for Script Users!
DEBUG_PROGGIE = 7; // Only debug proggie and more important things
DEBUG_PLAYER_ACTIONS = 5; // Only debug proggie, Player Actions and more important things
DEBUG_FUNCTIONS = 3; // Debug the at the start of each function, Player Actions, Proggie and +
DEBUG_SMALL_DETAILS = 1; // Debug small details and more important
DEBUG_EVERYTHING = 0; // For Script Users to have everything in debug box.
{ const Other
Description: Represents miscellaneous constants }
const
STATS_LINK = 'http://scriptmanager.freehostia.com/submit.php'; //for stats
WALK_TOL = 8; //the tolerance for a color point compared to a reflection point
ANTI_BAN_CHANCE = 10; //the chance (in %) of antiban
{ const Stats
Description: Represents all the custom variables to add to the stats }
const
STATS_LOGINS = 1;
STATS_BANKS = 2;
STATS_LOADS = 3;
STATS_RANDOMS = 4;
STATS_LEVELS = 5;
STATS_EXP = 6;
STATS_LOGS = 7;
STATS_ORES = 8;
{ const Players
Constants representing the different Players array records. }
const
// Integers
P_LOC = 0;
// Booleans
P_BANK = 0;
{ const Location Constants
Description: Constants used to represent player locations }
const
LOC_POWER_SKILL = 0;
LOC_LOST = 1;
LOC_VE_TREES = 2;
LOC_VE_BANK = 3;
LOC_IN_RANDOM = 4;
{ const AutoColor
Description: Constants used for autocoloring the minimap }
const
COLOR_ROAD_GENERAL = 6579821;
COLOR_ROAD_VARROCK = 8686729;
COLOR_ROAD_FALLY = 7831173;
COLOR_ROAD_LUMBY = 8225677;
COLOR_ROAD_DIRT = 1853272;
COLOR_BANKER = 1179390;
COLOR_WATER = 10850700;
COLOR_ROCK = 5789528;
COLOR_SAND = 0;
COLOR_TREE = 1532978;
{ const Walking
Description: Constants representing the color walking points }
const
WALK_WC_VE_TREE_1 = 0; // rock
WALK_WC_VE_TREE_2 = 1; // road
WALK_WC_VE_TREE_3 = 2; // path
WALK_WC_VE_TREE_4 = 3; // final
WALK_WC_VE_BANK_1 = 4; // rock
WALK_WC_VE_BANK_2 = 5; // path
WALK_WC_VE_BANK_3 = 6; // road
WALK_WC_VE_BANK_4 = 7; // final
{ const Banking
Description: Constants used in bank procedures }
const
BANK_SYMBOL_ACCURACY = 0.45; // The symbol accuracy of the bank
INC_TOL = 5; // How much to increase the tolerance by
MAX_TOL = 40; // The max tolerance reached before the object cannot be found.
{ const DDTM
Description: Constants representing the DDTM points }
const
DTM_TOLERANCE = 12;
DTM_POINT_1 = 0; //corresponds to the TPA returned in MSI_GetDTMPoints
DTM_POINT_2 = 1;
DTM_POINT_3 = 2;
DTM_POINT_4 = 3;
DTM_POINT_5 = 4;
{ const Hatchet/Pickaze requirements.
Constants representing the requirements to use each tool }
const
//hatchets and pickaxes
REQ_BRONZE = 1;
REQ_IRON = 1;
REQ_STEEL = 6;
REQ_MITHRIL = 21;
REQ_ADAMANT = 31;
REQ_RUNE = 41;
REQ_MAX_LEVEL = 99;
{ const Item Info
Description: Constants representing all the items used in MSI. }
const
MSI_ITEM_COUNT = 17; //change this to the number of items in ItemInfo.scar
{
PICKAXE_BRONZE = 0;
PICKAXE_IRON = 1;
PICKAXE_STEEL = 2;
PICKAXE_MITHRIL = 3;
PICKAXE_ADAMANT = 4;
PICKAXE_RUNE = 5;
}
HATCHET_BRONZE = 6;
HATCHET_IRON = 7;
HATCHET_STEEL = 8;
HATCHET_MITHRIL = 9;
HATCHET_ADAMANT = 10;
HATCHET_RUNE = 11;
LOGS_NORMAL = 12;
LOGS_OAK = 13;
LOGS_WILLOW = 14;
LOGS_MAPLE = 15;
LOGS_YEW = 16;
{ const Objects
Description: Constants representing all the main screen objects used in MSI }
const
OBJ_TREE_NORMAL = 0;
OBJ_TREE_OAK = 1;
OBJ_TREE_WILLOW = 2;
OBJ_TREE_MAPLE = 3;
OBJ_TREE_YEW = 4;
OBJ_TREE_MAGIC = 5;
{
OBJ_ROCK_CLAY = 4;
OBJ_ROCK_TIN = 5;
OBJ_ROCK_COPPER = 6;
OBJ_ROCK_IRON = 7;
OBJ_ROCK_SILVER = 8;
}
OBJ_BANK_VE = 9;
{ Type TMSObject
Description: To be used for finding on the MS. Stores all necessary
information. }
Type
TMSObject = Record
X, Y : Integer;
Name : String;
UpText : String;
Option : String;
Exp : Extended;
Colors : TIntegerArray;
FindAllColors : Boolean; // Result False if not ALL colors are found
Tol : Integer;
Hue : Extended;
Sat : Extended;
W, H : Integer;
Accuracy : Integer; // Min pixels to be found
ExcludeSelf : Boolean; // Exclude pixels in a box, the box might need revamping / making it dynamic
RightClickOnly : Boolean;
Tries : Integer;
Anim : Boolean; // Result False if not animating
WaitToMove : Boolean; // When ClickLeft, wait till we have stopped moving?
BadColors : TIntegerArray;
BadColorTolerance: Integer;
End;
TMSObjectArray = Array of TMSObject;
{ Type TItem
Description: To be used for handling Items in all situations. }
TItem = Record
Name : String;
UpText : TStringArray;
ItemP : TPoint;
Stackable : Boolean;
Colors : TIntegerArray;
Tol : Integer;
DTM : Integer;
BMP : Integer;
End;
//Used in Banking.Scar
Type MSI_TItemArray = Array Of TItem;
{ Type TMMLocation
Description: Stores all needed colorwalking information. }
TMMLocation = Record
Symbol : String;
DTM : Integer;
W, H : Integer;
Colors : TIntegerArray;
Tolerances : TIntegerArray;
Counts : TIntegerArray;
End;
{ Type TPlayerSkillInfo
Description: Stores information for one player for one skill. }
TPlayerSkillInfo = record
TotalTime : integer;
TotalObj : integer;
TotalLoads : integer;
Level : integer;
TotalEXP : integer;
ObjQuants : array of integer;
end;
{ Type TProggy
Description: Stores information all progress related information for one
player. }
TProggy = record
PlayerName : string;
PlayerStatus: boolean;
FalseReason : string;
PlayerRandom: string;
PlayerCity : string;
PlayerLoc : integer;
PlayerTime : integer;
SkillInfo : array of TPlayerSkillInfo;
end;
var
//To be used to store information for Players individually
ProgressReportArray: Array of TProggy;
//Used like CurrentPlayer, but for the skills in the player array
CurrentSkill: Integer;
//For script user to choose how much to debug
Debug_LevelToDebug: integer;
//Used in the DeclarePlayers arrays for skills and objects
PlayerSkills: Array of TVariantArray;
PlayerObjects: Array of Array of TVariantArray;
//Used for script setup (assinged to constatns in RunMe.scar)
BreakAfter, BreakTime: Integer;
//Used when loading items for MSI
MSI_Item: Array[0..(MSI_ITEM_COUNT - 1)] Of TItem;
IsItemLoaded: Array[0..(MSI_ITEM_COUNT - 1)] of Boolean;
//Used for saving the debug box
ScriptStart: String;
SaveDebug: Boolean;
//Used to determine whether the reflection hooks are outdated
ReflectionBroken: Boolean;
//Used in the stats system
Stats_UserID, Stats_Password, Stats_ScriptID: string;
Stats_LastTime: Integer;
Stats_CustomVars: array [1..20] of Integer;
statsID, statsPass: String; //For compiling issues