-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFast Fighter [SRL5].simba
1181 lines (1091 loc) · 36.5 KB
/
Fast Fighter [SRL5].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
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{------------------------------Script Info-------------------------------------|
| ScriptName = Fast Fighter |
| Author = Narcle |
| Description = Fights any monster, food eating and HP regen. |
|==============================================================================|
| Instructions |
|==============================================================================|
| |
| Setup with Form: (Reccommended) |
| 1a. Read FAQ on first post of Fast Fighter thread. |
| 1b. OR Hit play now the form is pretty easy to use. |
| Click 'Help' in Form if you don't know how to grab/set colors. |
| |
| Setup with Declare Players: |
| 1. Make sure you use the Color picker and select 3 colors |
| from monster, and place them accordingly in DeclarePlayers. |
| 2. Setup players in DeclarePlayers |
| 3. Setup RuneScape (unless your using SMART) |
| 4. Push play! |
| |
| |
|______________________________________________________________________________}
{$i SRL/SRL/misc/smart.simba}
{$i SRL/SRL.simba}
{$i SRL/SRL/skill/fighting.simba}
{$i SRL/SRL/skill/ranging.simba}
{$i SRL/SRL/misc/Reports.simba}
{$i srl/srl/misc/paintsmart.simba}
{------------------------------------------------------------------------------}
{===============================Player Setup===================================}
{------------------------------------------------------------------------------}
Const
LogoutIn = 29; //Logout every ?? Minutes; +/- 3 minutes for randomness
LogToFile = False; //File logging (helps me debug your problem) stores in /Scripts
DebugMode = False; //Debug mode
DisableSMARTPaint = False;//Might use less CPU if True
{ ATTENTION!!!
To use Forms just push play do NOT put anything in DeclarePlayers.
If you want to use DeclarePlayers fill it in (Forms should NOT come up then) }
procedure DeclarePlayers;
begin
With Players[0] do
begin
Name := ''; //Character Name
Pass := ''; //Character Pass
Active := True; //True if you want this player to be ran in the script, false if not
Strings[0] := '';//monster name
Strings[1] := '';//Fight style (str, att, def, crush etc. anything in your weapon info}
Integers[0] := 0;//1st color of monster
Integers[1] := 0;//2nd color of monster
Integers[2] := 0;//3rd color of monster
Arrays[0] := [3, false, false];
//[NPC Color Tolerance, Left click only, Right click only]
end;
{
With Players[1] do //copy and change number accordingly to add players
begin
Name :='';
Pass :='';
Active := True;
Strings[0] := '';//monster name
Strings[1] := '';//Fight Style
Integers[0] := 0;//1st color of monster
Integers[1] := 0;//2nd color of monster
Integers[2] := 0;//3rd color of monster
Arrays[0] := [3, false, false];
//[NPC Color Tolerance, Left click only, Right click only]
end;
}
end;
{------------------------------------------------------------------------------}
{===========Don't edit below this unless you know what your doing!=============}
{------------------------------------------------------------------------------}
Type
FUsers = Record
Range, Melee, Setup, OutOfFood, TPAFight: Boolean;
MobName: string;
NPCTol, Clicktype, AvgWeapTime, AvgAniChange, MaxAniTime, InvAmt, LastWeaptime: integer;
Colors, WeaponTimes, AniTimes, AniChanges: TIntegerArray;
Weapon: array of TStringArray;
end;
Const
Version = '4.10';
ScriptName = 'Fast Fighter';
WeaponTime = 4000;
PLAYERSET = 3;
TOTALNPCKILLS = 10;
FOODATE = 11;
NPCKILLS = 12;
KILLSperHour = 13;
XPGained = 14;
XPperHour = 15;
REPORTXP = 16;
CURRENTXP = 17;
LOGOUTIME = 19;
ATTACKTIME = 20;
STARTXP = 21;
DRAWXP = 22;
var
Playas: array [0..99] of FUsers;
TOTALKILLS, TOTALXP: integer;//Counters
LeftClickFail: boolean;
DebugFile: integer;
DebugModeOn: Boolean;
ReportTime: integer;
PlayerBox, AniBox: TBox;
const
FilePath = AppPath + 'FastFighter4Chars.ini';
var
frmDesign: TForm;
PButtons: Array [0..3] of TButton;
SButtons: Array of TButton;
frmLabels: Array of TLABEL;
frmEdits: Array of TEDIT;
CheckBoxs: Array [0..2] of TCHECKBOX;
CurPlayer: integer;
AKpf_SavePlayers, AKpf_Terminate: boolean;
Memo: TMemo;
procedure Debug(S: String);
begin
if LogToFile then
try
if (DebugFile <> -1) then
if (not WriteFileString(DebugFile, TheTime+' - '+S + #13+#10)) then
Writeln('Debug: Failed to write to file');
except
Writeln(ExceptionToString(ExceptionType, ExceptionParam));
end;
if DebugModeOn then
Writeln(S)
else
DebugLn(s);
end;
Procedure FormNotify(S: string);
begin
Writeln(S);
Memo.LINES.Add(s);
end;
Procedure SavePlayers(tofile: boolean);
var
i, ii: integer;
begin
try
With Players[CurPlayer] do
begin
Name := frmEdits[0].Caption;
Pass := frmEdits[1].Caption;
Active := CheckBoxs[0].CHECKED;
Strings[0] := frmEdits[6].Caption;//npc name
Strings[1] := frmEdits[11].Caption;//fight style
for ii := 0 to 2 do
Integers[ii] := StrToInt( ReplaceWrap( (frmEdits[ii+7].Caption), ' ', '', [rfReplaceAll]));
Arrays[0] := [frmEdits[10].Caption, CheckBoxs[1].CHECKED, CheckBoxs[2].CHECKED];
end;
except
Writeln('Failed to save Player '+ToStr(CurPlayer)+'.');
end;
if tofile then
begin
WriteINI('General', 'NumOfPlayers', IntToStr(HowManyPlayers), FilePath);
WriteINI('General', 'statsUser', frmEdits[4].Caption, FilePath);
WriteINI('General', 'statsPass', frmEdits[5].Caption, FilePath);
end;
if tofile then
for i := 0 to HowManyPlayers - 1 do
with Players[i] do
begin
WriteINI('Player['+IntToStr(i)+']', 'Name', Name, FilePath);
WriteINI('Player['+IntToStr(i)+']', 'Pass', Pass, FilePath);
WriteINI('Player['+IntToStr(i)+']', 'Active', BoolToStr(Active), FilePath);
WriteINI('Player['+IntToStr(i)+']', 'Strings[0]', Strings[0], FilePath);
WriteINI('Player['+IntToStr(i)+']', 'Strings[1]', Strings[1], FilePath);
for ii := 0 to 2 do
WriteINI('Player['+IntToStr(i)+']', 'Integers['+IntToStr(ii)+']', IntToStr(Integers[ii]), FilePath);
WriteINI('Player['+IntToStr(i)+']', 'Arrays[0][0]', IntToStr(Arrays[0][0]), FilePath);
WriteINI('Player['+IntToStr(i)+']', 'Arrays[0][1]', BoolToStr(Arrays[0][1]), FilePath);
WriteINI('Player['+IntToStr(i)+']', 'Arrays[0][2]', BoolToStr(Arrays[0][2]), FilePath);
end;
end;
Procedure NewPlayer(index: integer);
var
ii:integer;
begin
with Players[Index] do
begin
Name := '';
Pass := '';
Active := true;
Strings[0] := '';
Strings[1] := '';
for ii := 0 to 2 do
Integers[ii] := 0;
Arrays[0] := [9, false, false];//Color Tolerance, right click, left click
end;
end;
Procedure ShowPlayer(index: integer);
var
ii: integer;
begin
if Players[index].Name = '' then
NewPlayer(Index);
With Players[index] do
begin
frmEdits[0].Caption := Name;
frmEdits[1].Caption := Pass;
CheckBoxs[0].CHECKED := Active;
frmEdits[6].Caption := Strings[0];
frmEdits[11].Caption := Strings[1];
for ii := 0 to 2 do
frmEdits[ii+7].Caption := IntToStr(Integers[ii]);
frmEdits[10].Caption := IntToStr(Arrays[0][0]);//npc tol
CheckBoxs[1].Checked := Arrays[0][1];//Right click
CheckBoxs[2].Checked := Arrays[0][2];//Left click
end;
CurPlayer := index;
frmEdits[4].Caption := stats_Username;
frmEdits[5].Caption := stats_UserPass;
frmEdits[2].Caption := IntToStr(CurPlayer);
frmEdits[3].Caption := IntToStr(HowManyPlayers);
end;
Procedure LoadPlayers;
var
i,ii: integer;
begin
HowManyPlayers := StrToIntDef(ReadINI('General', 'NumOfPlayers', FilePath), 1);
stats_Username := ReadINI('General', 'statsUser', FilePath);
stats_UserPass := ReadINI('General', 'statsPass', FilePath);
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
CurPlayer := CurrentPlayer;
for i := 0 to HowManyPlayers - 1 do
with Players[i] do
begin
Name := ReadINI('Player['+IntToStr(i)+']', 'Name', FilePath);
Pass := ReadINI('Player['+IntToStr(i)+']', 'Pass', FilePath);
Active := StrToBool(ReadINI('Player['+IntToStr(i)+']', 'Active', FilePath));
Strings[0] := ReadINI('Player['+IntToStr(i)+']', 'Strings[0]', FilePath);
Strings[1] := ReadINI('Player['+IntToStr(i)+']', 'Strings[1]', FilePath);
for ii := 0 to 2 do
Integers[ii] := StrToInt(ReadINI('Player['+IntToStr(i)+']', 'Integers['+IntToStr(ii)+']', FilePath));
try
Arrays[0] := [StrToInt(ReadINI('Player['+IntToStr(i)+']', 'Arrays[0][0]', FilePath)),
StrToBool(ReadINI('Player['+IntToStr(i)+']', 'Arrays[0][1]', FilePath)),
StrToBool(ReadINI('Player['+IntToStr(i)+']', 'Arrays[0][2]', FilePath))];
except
Arrays[0] := [3, false, false];
end;
end;
end;
procedure OnLeftClick(Sender: TObject);
begin
Case Sender of
SButtons[0]: begin//Start
frmDesign.ModalResult := mrOk;
AKpf_SavePlayers := False;
AKpf_Terminate := False;
Writeln('Start.');
end;
SButtons[1]: begin//Save and start
frmDesign.ModalResult := mrOk;
AKpf_SavePlayers := True;
AKpf_Terminate := False;
Writeln('Save and Start.');
end;
SButtons[2]: begin//Save and Exit
frmDesign.MODALRESULT:= mrOk;
AKpf_SavePlayers := True;
AKpf_Terminate := True;
Writeln('Save and Exit.');
end;
SButtons[3]: begin//Exit
frmDesign.MODALRESULT:= mrOk;
AKpf_SavePlayers := False;
AKpf_Terminate := True;
Writeln('Exit.');
end;
SButtons[4]: Memo.LINES.Clear;
SButtons[5]: Memo.LINES.Add(GetClipBoard);
SButtons[6]: OpenWebPage('http://villavu.com/forum/showthread.php?t=67793');
PButtons[0]: begin//Previous player
SavePlayers(false);
if CurPlayer = 0 then
ShowPlayer(HowManyPlayers - 1)
else
ShowPlayer(CurPlayer - 1);
end;
PButtons[1]: begin//New player
Debugln('Trying to add new player.');
Inc(HowManyPlayers);
NumberOfPlayers(HowManyPlayers);
CurPlayer := HowManyPlayers-1;
ShowPlayer(CurPlayer);
FormNotify('Player '+IntToStr(CurPlayer)+' added.');
end;
PButtons[2]: begin//Next player
SavePlayers(false);
if CurPlayer = HowManyPlayers - 1 then
ShowPlayer(0)
else
ShowPlayer(CurPlayer + 1);
end;
PButtons[3]: begin//Delete player
if (HowManyPlayers > 1) and (CurPlayer = 0) then
FormNotify('Can''t delete player 0.')
else
if (HowManyPlayers = 1) then
begin
if not (MessageDlg('Delete?', 'Do you want to reset Player '+ToStr(CurPlayer)+'?', mtConfirmation, [mbYes,mbNo]) = mrYes) then
Exit;
NewPlayer(CurPlayer);
FormNotify('Player '+ToStr(CurPlayer)+' reset.');
end
else
if (MessageDlg('Delete?', 'Do you want to delete Player '+ToStr(CurPlayer)+'?', mtConfirmation, [mbYes,mbNo]) = mrYes) then
begin
FormNotify('Player '+ToStr(CurPlayer)+' deleted.');
Swap(Players[CurPlayer], Players[HowManyPlayers - 1]);
IncEx(HowManyPlayers, -1);
ShowPlayer(Max(CurPlayer - 1, 0));
SavePlayers(true);
end;
end;
CheckBoxs[1]: begin
if CheckBoxs[2].CHECKED then
CheckBoxs[2].CHECKED := false;
end;
CheckBoxs[2]: begin
if CheckBoxs[1].CHECKED then
CheckBoxs[1].CHECKED := false;
end;
end;
end;
procedure InitForm;
var
i: integer;
PCaps, Labels, Hints: TStringArray;
Ws, Ls, Ts: TIntegerArray;
begin
frmDesign := Tform.Create(nil);
With frmDesign do
begin
setBounds(100, 100, 600, 330);
Caption := ScriptName+' v'+Version+' by Narcle';
Color := ClWhite;
Font.Color := ClBlack;
end;
PCaps := ['Previous Player', 'New Player', 'Next Player', 'Delete Player'];
for i := 0 to 3 do
begin
PButtons[i] := TBUTTON.Create(frmDesign);
with PButtons[i] do
begin
Parent := frmDesign;
Height := 22;
if i = 3 then
Width := 80//Delete Player
else
Width := 120;
Left := 10+i*125;
Top := 8;
CAPTION := PCaps[i];
ONCLICK := @OnLeftClick;
if i = 3 then
begin
Left := 135;
Top := 34;
end;
end;
end;
PCaps := ['Start', 'Save and Start', 'Save and Exit', 'Exit', 'Clear', 'Paste', 'Help!'];
Hints := ['Clear the memo','Paste from clip board','Open help in default web browser.'];
SetArrayLength(SButtons, Length(PCaps));
for i := 0 to High(SButtons) do
begin
SButtons[i] := TBUTTON.Create(frmDesign);
with SButtons[i] do
begin
Parent := frmDesign;
Height := 22;
Width := 90;
Left := 6+i*96;
Top := 300;
FONT.Size := 8;
CAPTION := PCaps[i];
OnClick := @OnLeftClick;
if InIntArray([4,5,6],i) then
begin
Width := 50;
Left := 430+(i-4)*55;
ShowHint := true;
Hint := Hints[i-4];
end;
end;
end;
Labels := ['Username:', 'Password:', 'Active', 'Right click only', 'Left click only',
'SRL Stats User:', 'SRL Stats Password:', 'Player:', 'Total Players:',
'NPC Color 1:', 'NPC Color 2:', 'NPC Color 3:', 'NPC Name:','NPC Color Tolerance:', 'Fight Style:'];
Hints := ['Login name for the character you are using.','Login password','Will you be using this character?',
'Left click attack only', 'Right click attack only', 'SRL Stats goto stats.villavu.com to sign up!',
'SRL Stats goto stats.villavu.com to sign up!','','','Color of the NPC/Monster you''ll be fighting, use the color picker',
'Color of the NPC/Monster you''ll be fighting, use the color picker',
'Color of the NPC/Monster you''ll be fighting, use the color picker', 'Name of the NPC your fighting, check forums for details',
'Lower this number if the mouse hovers over other objects.', 'Read instructions on thread for more info'];
SetArrayLength(frmLabels, Length(Labels));
Ts := [62, 108, 186, 208, 230, 280, 280, 38, 38, 126, 156, 186, 62, 216, 160];
Ls := [10, 10, 30, 30, 30, 34, 198, 20, 260, 182, 182, 182, 200, 182, 10];
for i := 0 to High(Labels) do
begin
frmLabels[i] := TLABEL.Create(frmDesign);
with frmLabels[i] do
begin
Parent := frmDesign;
Height := 20;
Width := 50;
Top := Ts[i];
Left := Ls[i];
Font.Size := 8;
Caption := Labels[i];
if (Hints[i] <> '') then
Hint := Hints[i];
ShowHint := true;
end;
end;
Ws := [150, 150, 28, 28, 76, 76, 150, 100, 100, 100, 40, 80];
Ts := [ 80, 126, 34, 34, 274, 274, 80, 120, 150, 180, 210, 154];
Ls := [ 10, 10, 60, 330, 112, 300, 200, 250, 250, 250, 290, 80];
SetArrayLength(frmEdits, Length(Ws));
for i := 0 to High(frmEdits) do
begin
frmEdits[i] := TEDIT.Create(frmDesign);
with frmEdits[i] do
begin
Parent := frmDesign;
Height := 21;
Width := Ws[i];
top := Ts[i];
Left := Ls[i];
Font.Size := 8;
end;
end;
for i := 0 to High(CheckBoxs) do
begin
CheckBoxs[i] := TCHECKBOX.Create(frmDesign);
with CheckBoxs[i] do
begin
Parent := frmDesign;
Top := 184+i*22;
Left := 10;
ShowHint := true;
ONCLICK := @OnLeftClick;
end;
end;
Memo := TMemo.Create(frmDesign);
with Memo do
begin
Parent := frmDesign
Left := 390;
Top := 10;
Width := 200;
Height := 280;
end;
Memo.Lines.Add(ScriptName+' v'+Version+' by Narcle');
if FileExists(FilePath) then
begin
LoadPlayers;
ShowPlayer(0);
end
else
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
CurPlayer := 0;
ShowPlayer(CurPlayer);
end;
frmDesign.ShowModal;
end;
procedure SafeInitForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('InitForm', v);
end;
procedure AntiBan;
begin
if not LoggedIn then Exit;
case Random(99) of
0: wait(500+random(3000));
1: begin
RandomMovement;
SetAngle(SRL_ANGLE_HIGH);
end;
3: PickUpMouse;
end;
end;
Function HpCheck: boolean;
var
c, T, i:Integer;
RunDir: String;
begin
if (HPPercent < 50) and LoggedIn then
begin
Result := True;
Debug('HP low doing HP checks...');
if not InvEmpty then
for c := 0 to 1 do
begin
if (c > 0) then//in case uptext fails
MakeCompass(rs_GetCompassAngleDegrees+60+random(50));
for i := 1 to 28 do //Begin food eating proc
if ExistsItem(i) then
begin
MMouseItem(i);
if WaitUpTextMulti(['Eat', 'obster', 'onkfish', 'hark'], 400) then
begin
ClickMouse2(False);
if WaitOption('Eat', 400) then
begin
Debug('Eating food...');
t := GetSystemTime;
while ExistsItem(i) and ((GetSystemTime-t) < 2000) do
wait(20);
if not ExistsItem(i) then
Inc(Players[CurrentPlayer].Integers[FOODATE]);
if (HPPercent > 60) then
Exit;
end;
end;
end;//End food eating
end;
if (not LoggedIn) or (HPPercent > 50) then
Exit;
if (HPPercent < 50) then
begin
if (HPPercent < 25) then
if (InFight) then
begin
RunDir := 'nsewns';
Debug('Running away HP% < 25...');
RunAway(RunDir[random(6)+1], true, 1, 10000 + random(2000));
end;
T := GetSystemTime;
repeat
if not IsResting then
SetRest;
Wait(200+random(200));
FindNormalRandoms;
If ((GetSystemTime - T) > (50000+random(50000)) ) then
begin
case random(2) of
0: BoredHuman;
1: RandomMovement;
end;
T := GetSystemTime;
end;
if not LoggedIn then
Exit;
until (HPPercent > 60);
SetAngle(SRL_ANGLE_HIGH);
end;
end;
end;
procedure Report;
var
xp,i: integer;
begin
if not LoggedIn then
Exit;
with Players[CurrentPlayer] do
begin
IncEx(TOTALKILLS, Integers[NPCKILLS]);//Total Kills
stats_IncVariable('Monsters Killed', Integers[NPCKILLS]);
for i := 0 to 3 do
xp := Max(xp, GetXPBarTotal);
if (xp > Integers[REPORTXP]) then
Integers[CURRENTXP] := xp;
stats_IncVariable('Total EXP Gained', Integers[CURRENTXP]-Integers[REPORTXP]);
IncEx(Integers[XPGained], Integers[CURRENTXP]-Integers[REPORTXP]);
IncEx(TOTALXP, Integers[CURRENTXP]-Integers[REPORTXP]);
Integers[REPORTXP] := Integers[CURRENTXP];
if ((PlayerWorked(CurrentPlayer)/60000.0) > 0) then
Integers[KILLSperHour] := round( (Integers[TOTALNPCKILLS]*60.0)/(PlayerWorked(CurrentPlayer)/60000.0))//XP Per hour
else
Integers[KILLSperHour] := -1;
if ((PlayerWorked(CurrentPlayer)/60000.0) > 0) then
Integers[XPperHour] := round( (Integers[XPGained]*60.0)/(PlayerWorked(CurrentPlayer)/60000.0))//XP Per hour
else
Integers[XPperHour] := -1;
SRLProgressReport(ResultDebugBox, ScriptName, 'Narcle', Version,
['Time Ran','Killed', 'XP'],
[MsToTime(GetTimeRunning, Time_Abbrev), TOTALKILLS, TOTALXP]);
SRLPlayerReport(ResultDebugBox, 0, False,
[True, false, false, false, false, false],
['Kills', 'Kills/H', 'XP Gained', 'XP/H'],
[], [TOTALNPCKILLS, KILLSperHour, XPGained, XPperHour], [], []);
Integers[NPCKILLS] := 0;
end;
ReportTime := GetSystemTime + 5*61000;
stats_Commit;
end;
procedure LogoutSeq(reason:string);
begin
while InFight and LoggedIn do
begin
HpCheck;
wait(100);
end;
Debug('Logout sequence...');
if (reason = '') then
begin
if HowManyPlayers = 1 then
begin
LogOut;
Wait(RandomRange(1*60000, 3*60000));
NextPlayer(true);
end
else
NextPlayer(true);
end
else
begin
Writeln(reason+' '+Players[Currentplayer].Name+' is now inactive.');
NextPlayer(false);
end;
end;
procedure SitAndWait;//Super advance I know :P
var
T: integer;
begin
T := GetSystemTime + 30000;
Debug('No NPCs detected on screen, waiting...');
repeat
if not LoggedIn then
Exit;
Wait(50+random(50));
FindNormalRandoms;
AntiBan;
HpCheck;
until (GetSystemTime > T) or (Length(GetMMDotsOnMS('npc')) > 0);
end;
function ChangeCamera: boolean;
var
i, II, PosNeg:integer;
begin
Case random(2) of
0: PosNeg := 1;
1: PosNeg := -1;
end;
i := Round(rs_GetCompassAngleDegrees/45 - 1);
if i < 0 then i := 0;
if i > 7 then i := 7;
For II := 0 to 4+Random(4) do
begin
if (Length(GetMMDotsOnMS('npc')) > 0) then
begin
Result := true;
exit;
end;
i := i+PosNeg;
if i > 7 then i := 0;
if i < 0 then i := 7;
MakeCompass(inttostr(i*(40+random(6))));
end;
end;
procedure WaitFight;
Var
T, C, s, x, i, Time, L, Remove, H, Pixs, LastXP: integer;
P: TIntegerArray;
WeapTime, TimeOut: integer;
begin
//if DebugMode then
//SMART_DrawBoxEx(False, AniBox, clPurple);
if Length(Playas[CurrentPlayer].WeaponTimes) > 49 then
Playas[CurrentPlayer].AvgWeapTime := AverageTIA(Playas[CurrentPlayer].WeaponTimes);
if Length(Playas[CurrentPlayer].AniChanges) > 199 then
Begin
Playas[CurrentPlayer].AvgAniChange := Round(AverageTIA(Playas[CurrentPlayer].AniChanges)*0.9);
Debug('Pixs changed to: '+ToStr(Playas[CurrentPlayer].AvgAniChange));
end;
with Playas[CurrentPlayer] do
if AvgWeapTime > 0 then
begin
H := High(WeaponTimes);
for i := 0 to H do
if not InRange(WeaponTimes[i], AvgWeapTime-400, AvgWeapTime+400) then
begin
Swap(WeaponTimes[i], WeaponTimes[H-Remove]);
Inc(Remove);
end;
SetLength(WeaponTimes, Length(WeaponTimes)-Remove);
AvgWeapTime := AverageTIA(Playas[CurrentPlayer].WeaponTimes);
WeapTime := Round(AvgWeapTime+0.0*1.15);
if LastWeaptime <> WeapTime then
Debug('Weapon time switched too: '+ToStr(WeapTime));
LastWeaptime := WeapTime;
end;
if (WeapTime = 0) then
WeapTime := WeaponTime;
for i := 0 to 2 do
With Players[CurrentPlayer] do
Integers[CURRENTXP] := Max(Integers[CURRENTXP], GetXPBarTotal);
s := Players[CurrentPlayer].Integers[CURRENTXP];
x := s;
C := GetSystemTime;
T := C;
TimeOut := C + 8000+random(3000);
Repeat
P := PixelShiftMulti([AniBox], 200);
if Playas[CurrentPlayer].AvgAniChange > 0 then
Pixs := Playas[CurrentPlayer].AvgAniChange-20
else
Pixs := 300;
if (P[0] > Pixs) then
begin
//Debugln('Ani Time: '+Padl(ToStr(GetSystemTime-(T-WeapTime)), 5)+' Ani Change: '+ToStr(P[0]));
Time := GetSystemTime-T;
if (Playas[CurrentPlayer].AvgAniChange < 1) then
begin
L := Length(Playas[CurrentPlayer].AniChanges);
SetArrayLength(Playas[CurrentPlayer].AniChanges, L+1);
Playas[CurrentPlayer].AniChanges[L] := P[0];
end;
T := GetSystemTime;
TimeOut := T + WeapTime;
end;
With Players[CurrentPlayer] do
Integers[CURRENTXP] := Max(Integers[CURRENTXP], GetXPBarTotal);
if (Players[CurrentPlayer].Integers[CURRENTXP] > x) then
begin
LastXP := Players[CurrentPlayer].Integers[CURRENTXP] - x;
Time := GetSystemTime - C;
x := Players[CurrentPlayer].Integers[CURRENTXP];
if InRange(Time, 1000, 5000) then
begin
L := Length(Playas[CurrentPlayer].WeaponTimes);
SetArrayLength(Playas[CurrentPlayer].WeaponTimes, L+1);
Playas[CurrentPlayer].WeaponTimes[L] := Time;
end;
C := GetSystemTime;
Debugln('| Hit~ '+ToStr(Round(LastXP*1.9))+' Speed: '+Tostr(Time));
end;
FindNormalRandoms;
if HpCheck then
TimeOut := GetSystemTime + 4000;
until (GetSystemTime > TimeOut) or (not LoggedIn);
Debugln('Ani Time: '+Padl(ToStr(GetSystemTime-T), 5));
Debug('Fighting Done.');
if ((Players[CurrentPlayer].Integers[CURRENTXP]-s) > 12) then
begin
Inc(Players[CurrentPlayer].Integers[TOTALNPCKILLS]);
Inc(Players[CurrentPlayer].Integers[NPCKILLS]);
end;
end;
Procedure SetupBackGround;
var
TPA: TPointArray;
B: TBox;
begin
if DisableSMARTPaint then
Exit;
B := IntToBox(8, 345, 497, 379);
TPA := TPAFromBox(B);
SMART_DrawDotsEx(True, TPA, 725267);
B := IntToBox(8, 378, 497, 378);
TPA := TPAFromBox(B);
SMART_DrawDotsEx(false, TPA, 2570567);
//SMART_DrawTextEx(False, 378, 346, UpChars, ScriptName, 2570567);
SMART_DrawTextEx(False, 344, 345, BigChars, 'by Narcle', 2570567);
SMART_DrawTextEx(False, 282, 345, UpCharsEx, ' Fast', 2570567);
SMART_DrawTextEx(False, 280, 344+17, UpCharsEx, 'Fighter', 2570567);
SMART_DrawTextEx(False, 9, 347, UpChars, ' Kills: ', clYellow);
SMART_DrawTextEx(False, 154, 347, UpChars, ' K/H: ', clYellow);
SMART_DrawTextEx(False, 8, 347+17, UpChars, ' XP: ', clYellow);
SMART_DrawTextEx(False, 153, 347+17, UpChars, 'XP/H: ', clYellow);
end;
procedure PrintOnSmart(Str: String; Placement: TPoint); //y1 345, y2 377
var
TPA: TPointArray;
B: TBox;
begin
B := IntToBox(Placement.x, Placement.y, Placement.x+Length(Str)*8 , Placement.y+15);
TPA := TPAFromBox(B);
SMART_DrawDotsEx(False, TPA, 725267);
SMART_DrawTextEx(False, Placement.x, Placement.y, UpChars, Str, clYellow);
end;
Procedure SMARTDrawDisplay;
var
xp, x: integer;
begin
if DisableSMARTPaint then
Exit;
SMART_ClearCanvasArea(IntToBox(0, 0, MSX2, MSY2));
With Players[CurrentPlayer] do
begin
x := GetXPBarTotal;
if InRange(x, Integers[CURRENTXP], Integers[CURRENTXP]+1000) then
Integers[CURRENTXP] := x;
if Integers[DRAWXP] = Integers[CURRENTXP] then
Exit;
xp := (Integers[CURRENTXP]-Integers[STARTXP]);
if ((PlayerWorked(CurrentPlayer)/60000.0) > 0) then
Integers[KILLSperHour] := round( (Integers[TOTALNPCKILLS]*60.0)/(PlayerWorked(CurrentPlayer)/60000.0))//XP Per hour
else
Integers[KILLSperHour] := -1;
if ((PlayerWorked(CurrentPlayer)/60000.0) > 0) then
Integers[XPperHour] := round( (xp*60.0)/(PlayerWorked(CurrentPlayer)/60000.0))//XP Per hour
else
Integers[XPperHour] := -1;
Integers[DRAWXP] := Integers[CURRENTXP];
PrintOnSmart(ToStr(Integers[TOTALNPCKILLS]), Point(40, 347));
PrintOnSmart(ToStr(Integers[KILLSperHour]), Point(188, 347));
PrintOnSmart(ToStr(XP), Point(40, 347+17));
PrintOnSmart(ToStr(Integers[XPperHour]), Point(188, 347+17));
end;
end;
Function FightIt: Boolean;
var
i, ii, r, L, P: integer;
T: TPoint;
NPCs, TPA: TPointArray;
ATPA: T2DPointArray;
BoxArr: TBoxArray;
begin
P := GetSystemTime;
NPCs := GetMMDotsOnMS('npc');
L := Length(NPCs);
if L < 1 then
Exit;
SetLength(BoxArr, L);
for i := 0 to L-1 do
begin
T := MMtoMS(NPCs[i]);
BoxArr[i] := IntToBox(Max(T.x-40, MSX1), Max(T.y-40, MSY1), Min(T.x+40, MSX2), Min(T.y+40, MSY2));
end;
With Playas[CurrentPlayer] do
for i := 0 to L-1 do
with BoxArr[i] do
begin
SetLength(ATPA, Length(Colors));
For ii := 0 to High(Colors) do //Color array
FindColorsTolerance(ATPA[ii], Colors[ii], X1, Y1, X2, Y2, NPCTol);
TPA := MergeATPA(ATPA);
if Length(TPA) > 0 then
begin
ATPA := SplitTPA(TPA, 6);
SortATPASize(ATPA, True);
T := MiddleTPA(ATPA[0]);
if IsFightAt(T.x, T.y) then
Continue;
if not DisableSMARTPaint then
begin
SMARTDrawDisplay;
SMART_DrawBoxEx(False, BoxArr[i], clBlue);
SMART_DrawDotsEx(False, ATPA[0], clRed);
end;
MMouse(T.x, T.y, 3, 3);
if WaitUpTextMulti([MobName], 150+random(100)) then//Text array
begin
Case ClickType of
0: r := Random(3);
1: r := 1;
2: r := 2;
end;
if (ClickType = 0) then
if LeftClickFail then
r := 2;
case r of
0..1: begin
ClickMouse2(True);
Result := DidClick(True, 100);
end;
2: begin
ClickMouse2(False);
Result := ChooseOption('ttack');
end;
end;
LeftClickFail := not result;
if Result then
begin
Debug('Attacked '+Inttostr(GetsystemTime - P)+'ms');
MarkTime(Players[CurrentPlayer].Integers[ATTACKTIME]);
FFlag(0);
Exit;
end Else Continue;
end;
end;
end;
end;
procedure SetupPlayer;
var
ammo, i, N: integer;
begin
if not LoggedIn then
Exit;
MouseSpeed := RandomRange(15, 17);
SetupBackGround;
ToggleXPBar(True);
with Players[CurrentPlayer] do
begin
if not Booleans[PLAYERSET] then
begin
Debug('Setting Angle');
SetAngle(SRL_ANGLE_HIGH);
SetAngle(SRL_ANGLE_HIGH);//just in case of lag
Debug('Setting Retaliate');
Retaliate(True);
Debug('Getting Weapon Info');
GetWeaponData(Playas[CurrentPlayer].Weapon);
if (Players[CurrentPlayer].Strings[1] <> '') then
if SetWeaponMode(Players[CurrentPlayer].Strings[1], Playas[CurrentPlayer].Weapon, True) then
Debug('Weapon set');
N := StrToIntDef(Players[CurrentPlayer].Strings[1], 0);
if InRange(N, 1, 4) then
SetFightMode(N);
Playas[CurrentPlayer].Range := SetWeaponMode('ange', Playas[CurrentPlayer].Weapon, false);
Playas[CurrentPlayer].Melee := SetWeaponMode('ttack', Playas[CurrentPlayer].Weapon, false);
Debug('Getting Levels');
GetAllLevels;
If Playas[CurrentPlayer].Range then
Writeln(Capitalize(Players[CurrentPlayer].Name)+ ' is Ranging.');
if Playas[CurrentPlayer].Melee then
Writeln(Capitalize(Players[CurrentPlayer].Name)+ ' is Meleeing.');
if not (Playas[CurrentPlayer].Range or Playas[CurrentPlayer].Melee) then
Writeln('[WARNING] Failed to get weapon data. Can''t detect if ranging or meleeing.');
for i := 0 to 9 do
Integers[STARTXP] := Max(GetXPBarTotal, Integers[STARTXP]);