This repository has been archived by the owner on Dec 6, 2018. It is now read-only.
forked from SRL/MSI
-
Notifications
You must be signed in to change notification settings - Fork 1
/
RunMe.simba
310 lines (260 loc) · 8.35 KB
/
RunMe.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
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
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
(*
RunMe
=====
The RunMe file is the file that the user will actually run. It doesn't matter
whether they're using the form or not, they still have to run this file. If
not using the form, the user should only change the DeclareSettings and
DeclarePlayers procedures.
The source for can be found
`here <https://github.com/SRL/MSI/raw/master/RunMe.simba>`_, and a very detailed
guide on how to properly setup MSI can be found here
`here <http://villavu.com/forum/showthread.php?p=745942#post745942>`_ if you are
having trouble setting up.
*)
program MSI_Script;
// Define the extras you want to use
{$DEFINE EXTRA_CHARACTER_STATS} // Saves player stats in HTML format
// Define other settings
{$DEFINE SPS} // Comment to disable SPS (no walking scripts)
{$DEFINE SMART} // Comment to use MSI with a browser
{$DEFINE SRL_REMOTE} // Use SRL's player remote control
{ ============================================================================ }
{$i MSI/MSI/Core/Setup.simba}
const
USE_FORM = True;
(*
DeclareSettings
~~~~~~~~~~~~~~~
.. code-block:: pascal
procedure DeclareSettings();
Sets the global variable 'MSI_Settings.' Can be easily expandable to any type
of setting requested by any user.
*)
procedure DeclareSettings();
begin
MSI_Settings[SETUP_RANDOM_TOOL] := True; // Use SRL's Random Tool? It notifies you when a random is found.
MSI_Settings[SETUP_REPORT_GUI] := False; // Use a GUI to display the progress report (recommended)
MSI_Settings[SETUP_DEBUG_SMART] := True; // Debugs things onto SMART (may cause lag)
MSI_Settings[SETUP_SAVE_DEBUG] := True; // Save's the debug box text to a file
MSI_Settings[SETUP_SAVE_REPORT] := True; // Save's the progress report to a file
MSI_Settings[SETUP_HUMAN_BREAK] := True; // Take more human like breaks
MSI_Settings[SETUP_SWITCH_WORLDS] := True; // Switch worlds when switching players or after breaks
MSI_Settings[SETUP_PRINT_REPORT] := True; // Will only print the short report in the debug box (will still save long report to file)
MSI_Settings[SETUP_DEATH_WALK] := True; // Use MSI's death walking feature if the player gets lost?
MSI_Settings[SETUP_BREAK_TIME] := 15; // Single player only - how long to break for (in minutes)
MSI_Settings[SETUP_DEBUG_LEVEL] := 10; // The lower the number, the less the script will debug
MSI_Settings[SETUP_ANTIBAN_WAIT] := 15000; // Minimum time to wait between antibans (in milliseconds 1000ms = 1s)
MSI_Settings[SETUP_RANDOMS_WAIT] := 10000; // Minimum time to wait between randoms checks
MSI_Settings[SETUP_STATS_ID] := ''; // Stats ID
MSI_Settings[SETUP_STATS_PASS] := ''; // Stats password
MSI_Settings[SETUP_QC_LEVELUP] := True; // Quick chat when you level up, only available when your level is above 20
MSI_Settings[SETUP_MAX_PLAYERS] := 30; // How many players around you before switching worlds
MSI_Settings[SETUP_RANDOM_NP] := True; // Choose a random player when switching players?
end;
(*
DeclarePlayers
~~~~~~~~~~~~~~
.. code-block:: pascal
procedure DeclarePlayers();
When called, sets the global variable 'MSI_Players.' This is the procedure
the user needs to setup if they elect not to use the player form.
*)
procedure DeclarePlayers();
var
i: Integer;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
SetLength(MSI_Players, HowManyPlayers);
for i := 0 to High(MSI_Players) do
SetLength(MSI_Players[i].Scripts, 100);
CurrentPlayer := 0;
CurrentScript := 0;
with MSI_Players[0] do
begin
Name := ''; // Username
Pass := ''; // Password
Pin := ''; // Bank pin; leave as '' if player doesn't have one
Active := True; // Use this player?
Member := False; // Is this player a member?
BreakLoads := 0; // Amount of loads before breaking/switching players; leave 0 to not take breaks
BreakTime := 0; // Amount of time (in minutes) before breaking/witching; leave 0 to not take breaks
TotalLoads := 0; // Total loads for the player to do; leave 0 if using TotalTime or to go forever
TotalTime := 0; // How long for the player to run? (in minutes); leave 0 if using TotalLoads or go forever
with Scripts[0] do
begin
end;
end;
{
with MSI_Players[1] do
begin
Name := '';
Pass := '';
Pin := '';
Active := True;
Member := False;
BreakLoads := 0;
BreakTime := 0;
TotalLoads := 0;
TotalTime := 0;
with Scripts[0] do
begin
end;
end;
with MSI_Players[2] do
begin
Name := '';
Pass := '';
Pin := '';
Active := True;
Member := False;
BreakLoads := ;
BreakTime := ;
TotalLoads := ;
TotalTime := ;
with Scripts[0] do
begin
end;
end;
with MSI_Players[3] do
begin
Name := '';
Pass := '';
Pin := '';
Active := True;
Member := False;
BreakLoads := ;
BreakTime := ;
TotalLoads := ;
TotalTime := ;
with Scripts[0] do
begin
end;
end;
with MSI_Players[4] do
begin
Name := '';
Pass := '';
Pin := '';
Active := True;
Member := False;
BreakLoads := ;
BreakTime := ;
TotalLoads := ;
TotalTime := ;
with Scripts[0] do
begin
end;
end;
with MSI_Players[5] do
begin
Name := '';
Pass := '';
Pin := '';
Active := True;
Member := False;
BreakLoads := ;
BreakTime := ;
TotalLoads := ;
TotalTime := ;
with Scripts[0] do
begin
end;
end;
with MSI_Players[6] do
begin
Name := '';
Pass := '';
Pin := '';
Active := True;
Member := False;
BreakLoads := ;
BreakTime := ;
TotalLoads := ;
TotalTime := ;
with Scripts[0] do
begin
end;
end;
with MSI_Players[7] do
begin
Name := '';
Pass := '';
Pin := '';
Active := True;
Member := False;
BreakLoads := ;
BreakTime := ;
TotalLoads := ;
TotalTime := ;
with Scripts[0] do
begin
end;
end;
}
end;
var
i: integer;
begin
// set the script start date and time used to progress reports and logs
ScriptStart := TheDate(DATE_DAY) + ' at ' + TheTime;
ScriptStart := Replace(scriptStart, ':', ' ');
ClearDebug;
MSI_Setup;
// initilize form if selected, otherwise call player setup routines
if (USE_FORM) then
begin
try
try
ThreadSafeCallEx('ShowMSIForm');
finally
ThreadSafeCallEx('FreeMSIForm');
end;
except
Writeln(ExceptionToString(ExceptionType, ExceptionParam));
end;
HowManyPlayers := Length(MSI_Players);
NumberOfPlayers(HowManyPlayers);
for i := 0 to High(MSI_Players) do
SetLength(MSI_Players[i].Scripts, 100);
if (not ScriptReady) then
TerminateScript;
end else begin
DeclareSettings;
DeclarePlayers;
end;
// initialize SMART and clear it's canvas
{$IFDEF SMART}
{$IFNDEF SIMBAMAJOR990}
SMART_Server := 10;
SMART_Members := False;
SMART_Signed := True;
SMART_SuperDetail := False;
{$ENDIF}
{$ENDIF}
SetupSRL;
ActivateClient;
CurrDebugLevel := 1;
MSI_InitSRLPlayers();
SetScriptProp(SP_WriteTimeStamp, [True]);
AddOnTerminate('MSI_ScriptTerminate');
{$IFDEF SMART}
SMART_ClearCanvas();
{$ENDIF}
// create debug file
if (MSI_Settings[SETUP_SAVE_DEBUG]) then
DebugFile := CreateFile(PATH_DEBUG + ScriptStart + '.txt');
SetupSRLStats(21, MSI_Settings[SETUP_STATS_ID], MSI_Settings[SETUP_STATS_PASS]);
MSI_WalkingDefines();
// these settings aren't yet in the player form
if (USE_FORM) then
begin
MSI_Settings[SETUP_RANDOM_TOOL] := true;
MSI_Settings[SETUP_PRINT_REPORT] := true;
MSI_Settings[SETUP_REPORT_GUI] := false;
MSI_Settings[SETUP_DEATH_WALK] := true;
end;
if (MSI_Settings[SETUP_RANDOM_TOOL]) then
SetupRandomTool(15000, 5, appPath+'Includes/MSI/MSI/RandomSound.wav');
MSI_Mainloop;
end.