-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
3828 lines (3660 loc) · 134 KB
/
index.js
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 BY YOUR MOM */
'use strict'
//Lancer Skills
const JOB_LANCER =1;
const S_P =11200;
const S_P2 =11201;
const S_P3 =11202;
const S_P_D =650;
const S_P2_D =1000;
const S_P3_D =1800;
const SKILL_BLOCK =20200;
const SKILL_BLOCK_D =350;
const S_OnSl = 30200; // shield bash / 25% speed glyph
const S_OnSl_D =940;
const S_OnSl_D2 =505;
const S_OnSl_D3 =510;
const S_OnSl_D4 =500;
const S_OnSl_D5 =390;
const S_OnSl_D6 =740;
const S_ChSh = 40900; // 25% speed glyph
const S_ChSh_D =2190;
const S_SBash =50101;
const S_SBash_2 =50102;
const S_SBash_D =825;
const S_GShout =70300;
const S_GShout_D =565;
const S_ShCo = 81100; //chains from block
const S_ShCo_D =1440;
const S_Leash =90300;
const S_Leash_D =720;
const S_Leash_D2 =850;
const S_Deb =100300;
const S_Deb_D =920;
const S_Retal =111000;
const S_Retal_D =1610;
const S_Infu =120100;
const S_Infu_D =2430;
const S_Spring = 131100; //deb, 4th combo, 2nd shield barrage, shield bash, shield counter
const S_Spring_D =2790;
const SKILL_CHARGING =151000;
const SKILL_CHARGING_DURATION = 1100; //no aspd scaling
const SKILL_CHARGING_DISTANCE =494;
const SKILL_CHARGING_2 =151001;
const SKILL_CHARGING_2_DURATION =930;
const S_Wind =160700;
const S_Wind_D = 690; //no aspd scaling
const S_ARush =170200;
const S_ARush_D = 690; //no aspd scaling
const S_ShBarrage =181100;
//const S_ShBarrage_D =600;
const S_ShBarrage2 =181101;
const S_ShBarrage2_D =790;
const S_Pledge =190100;
const S_Pledge_D = 980; //no aspd scaling
const S_Menace =200100;
const S_Menace_D = 680; //no aspd
const S_Menace_D2 = 800; //no aspd
const S_Lockdown =210401;
const S_Lockdown_2 =210402;
const S_Lockdown_D =1390;
const S_IronWill =220600;
const S_IronWill_D = 800; //no aspd
const S_MasLeash =230200;
const S_MasLeash_D =715;
const S_MasLeash_D2 =840;
const S_Giga =240100;
const S_Giga_D =720;
const S_Giga_D2 =840;
const S_Wallop = 251000; //spring, deb
const S_Wallop_D =2380;
const S_BStep =260100;
const S_BStep_D =730;
const S_RCry =270100;
const S_RCry_D =640;
const S_RightLeap = 280100; //65
const S_RightLeap_D =300;
const S_RightLeap_D2_1 =1095;
const S_RightLeap_D3_1 =3100;
const S_RightLeap_D2_2 =775;
const S_RightLeap_D3_2 =775;
const S_RightLeap_Dist =450;
const S_DivineAegis =300100;
const S_DivineAegis_D =1250;
const S_Bulwark =290100;
const S_Bulwark_D =800;
const BLACKLIST = [110100, 111110, 111111, 111112, 111113, 111114, 111115, 111116, 111117, 111118, 111119, 111120, 111121, 111122, 111124, 111125,
111126, 111127, 111128, 111129, 111130, 111131, 111134, 111135, 111139, 111140, 111143, 111144, 111145, 111190, 111191, 111193,
111194, 111195, 111197, 111199, 111202, 111203, 116001, 116002, 116003, 116004, 117002, 117003, 140100, 460100, 480100, 900001,
111136, 111137, 111138, 111141, 111142, 111147, 111149, 111150, 111151, 111152, 111153, 111154, 111155, 111156, 111157, 111158,
211141, 211150, 111123, 111132, 111133, 111146, 111148, 111192, 111196, 111198, 211145, 111159, 111160, 111161, 111162, 111163,
111164, 111165, 111166, 111168, 111169, 111170, 111171, 111172, 111173, 111174, 111175, 111176, 111177, 111178, 111179, 111180,
111204, 111205, 111206, 111207, 111208, 111209, 111210, 111211, 111212, 111214, 111215, 111216, 111217, 111218, 111219, 111220,
111221, 111222, 111223, 111224, 111225, 111226, 111227, 111228, 111229, 111230, 111231, 111232, 111233, 111234, 111235, 111236,
111237, 111238, 111239, 111241, 111242, 111243, 111244, 111245, 111246, 111247, 111248, 111249, 111250, 111251, 111252, 111253,
111254, 111255, 111256, 111257, 111258, 111259, 111260, 111261, 111262, 111263, 111264, 111265, 111266, 111267, 111268, 111269,
111270, 111271, 111272, 111273, 111274, 111275, 111276, 111277, 111278, 111279, 111280, 111281, 111282, 111283, 111284, 111285,
111286, 111287, 111288, 111289, 111290, 111291, 111292, 111293, 111294, 111295, 111296, 111297, 111298, 111299, 111301, 111302,
111303,111304,111305,111306,111307,111308,111309,111310,111311,111312,111313,111314,111315,111316,111317,111318,111319,111320,111321,111322,
111324,111325,111326,111327,111328,111329,111330,116001,116002,116003,116004,117002,117003,117004,117005,118000];
module.exports = function lancer(dispatch) {
let config = {};
let settingTimeout = null;
let settingLock = false;
const path = require('path');
const fs = require('fs');
try { config = require('./config.json'); }
catch (e) {
config = {};
settingUpdate();
}
function settingUpdate() {
clearTimeout(settingTimeout);
settingTimeout = setTimeout(settingSave,1000);
}
function settingSave() {
if (settingLock) {
settingUpdate();
return;
}
settingLock = false;
fs.writeFile(path.join(__dirname, 'config.json'), JSON.stringify(config, undefined, '\t'), err => {
settingLock = false;
});
}
config.AUTOBLOCKRESET = "h1 command in game toggles block to be dropped and immediately restarted whenever you block an attack. Auto block reset is disabled by default. Is this even useful outside HTL stacking?";
//settingUpdate();
//change GLOBAL_LATENCY to your lowest usual ping
let GLOBAL_LATENCY =0;
if ("GLOBAL_LATENCY" in config) {
GLOBAL_LATENCY = config.GLOBAL_LATENCY;
}
if (!("GLOBAL_LATENCY" in config)) {
config.GLOBAL_LATENCY =0;
config.GLOBAL_LATENCY_DESCRIPTION = "change GLOBAL_LATENCY to your lowest usual ping";
settingUpdate();
}
let BARRAGE_CANCEL_TIME =200;
if ("BARRAGE_CANCEL_TIME" in config) {
BARRAGE_CANCEL_TIME = config.BARRAGE_CANCEL_TIME;
}
if (!("BARRAGE_CANCEL_TIME" in config)) {
config.BARRAGE_CANCEL_TIME =200;
config.BARRAGE_CANCEL_TIME_DESCRIPTION = "Self explanatory. This can be toggled in chat with sbtoggle1 command.";
settingUpdate();
}
let SB_CANCEL_TOGGLE = false;
if ("SB_CANCEL_TOGGLE" in config) {
SB_CANCEL_TOGGLE = config.SB_CANCEL_TOGGLE;
}
if (!("SB_CANCEL_TOGGLE" in config)) {
config.SB_CANCEL_TOGGLE = false;
config.SB_CANCEL_TOGGLE_DESCRIPTION = "If BARRAGE_CANCEL_TIME is active (i.e. not0), setting this to true will disable barrage cancel when movement key is held down.";
settingUpdate();
}
let SPRING_ATTACK_CANCEL_TIME =900;
if ("SPRING_ATTACK_CANCEL_TIME" in config) {
SPRING_ATTACK_CANCEL_TIME = config.SPRING_ATTACK_CANCEL_TIME;
}
if (!("SPRING_ATTACK_CANCEL_TIME" in config)) {
config.SPRING_ATTACK_CANCEL_TIME =900;
config.SPRING_ATTACK_CANCEL_TIME_DESCRIPTION = "Self explanatory";
settingUpdate();
}
let SPRINGAUTOWALLOP_TIME =900;
if ("SPRINGAUTOWALLOP_TIME" in config) {
SPRINGAUTOWALLOP_TIME = config.SPRINGAUTOWALLOP_TIME;
}
if (!("SPRINGAUTOWALLOP_TIME" in config)) {
config.SPRINGAUTOWALLOP_TIME =900;
config.SPRINGAUTOWALLOP_TIME_DESCRIPTION = "NOTE MUST HAVE SPRING_ATTACK_CANCEL_TIME ACTIVE TO TAKE EFFECT.";
settingUpdate();
}
let SPRING_WALLOP_NO_CANCEL = false;
if ("SPRING_WALLOP_NO_CANCEL" in config) {
SPRING_WALLOP_NO_CANCEL = config.SPRING_WALLOP_NO_CANCEL;
}
if (!("SPRING_WALLOP_NO_CANCEL" in config)) {
config.SPRING_WALLOP_NO_CANCEL = false;
config.SPRING_WALLOP_NO_CANCEL_DESCRIPTION = "If this is set to true, spring attack will not auto cancel if wallop is off CD. This feature will disable auto spring -> wallop chain.";
settingUpdate();
}
let LOCKDOWN_CANCEL_TIME =710;
if ("LOCKDOWN_CANCEL_TIME" in config) {
LOCKDOWN_CANCEL_TIME = config.LOCKDOWN_CANCEL_TIME;
}
if (!("LOCKDOWN_CANCEL_TIME" in config)) {
config.LOCKDOWN_CANCEL_TIME =710;
config.LOCKDOWN_CANCEL_TIME_DESCRIPTION = "Self explanatory";
settingUpdate();
}
let WALLOP_CANCEL_TIME_UNCHAINED =1600;
if ("WALLOP_CANCEL_TIME_UNCHAINED" in config) {
WALLOP_CANCEL_TIME_UNCHAINED = config.WALLOP_CANCEL_TIME_UNCHAINED;
}
if (!("WALLOP_CANCEL_TIME_UNCHAINED" in config)) {
config.WALLOP_CANCEL_TIME_UNCHAINED =1600;
config.WALLOP_CANCEL_TIME_UNCHAINED_DESCRIPTION = "NOTE BOTH WALLOP TIME HAVE TO BE ACTIVE TO TAKE EFFECT.";
settingUpdate();
}
let WALLOP_CANCEL_TIME_CHAINED =1200;
if ("WALLOP_CANCEL_TIME_CHAINED" in config) {
WALLOP_CANCEL_TIME_CHAINED = config.WALLOP_CANCEL_TIME_CHAINED;
}
if (!("WALLOP_CANCEL_TIME_CHAINED" in config)) {
config.WALLOP_CANCEL_TIME_CHAINED =1200;
config.WALLOP_CANCEL_TIME_CHAINED_DESCRIPTION = "NOTE BOTH WALLOP TIME HAVE TO BE ACTIVE TO TAKE EFFECT.";
settingUpdate();
}
let DEB_CANCEL_TIME =720;
if (("DEB_CANCEL_TIME" in config)) {
DEB_CANCEL_TIME = config.DEB_CANCEL_TIME;
}
if (!("DEB_CANCEL_TIME" in config)) {
config.DEB_CANCEL_TIME =720;
config.DEB_CANCEL_TIME_DESCRIPTION = "Self explanatory";
settingUpdate();
}
let DEBAUTOSPRING_TIME =720;
if (("DEBAUTOSPRING_TIME" in config)) {
DEBAUTOSPRING_TIME = config.DEBAUTOSPRING_TIME;
}
if (!("DEBAUTOSPRING_TIME" in config)) {
config.DEBAUTOSPRING_TIME =720;
config.DEBAUTOSPRING_TIME_DESCRIPTION = "NOTE MUST HAVE DEB_CANCEL_TIME ACTIVE TO TAKE EFFECT.";
settingUpdate();
}
let S_COUNTER_CANCEL_TIME =750;
if (("S_COUNTER_CANCEL_TIME" in config)) {
S_COUNTER_CANCEL_TIME = config.S_COUNTER_CANCEL_TIME;
}
if (!("S_COUNTER_CANCEL_TIME" in config)) {
config.S_COUNTER_CANCEL_TIME =750;
config.S_COUNTER_CANCEL_TIME_DESCRIPTION = "Self explanatory";
settingUpdate();
}
let S_COUNTER_SPRING_NO_CANCEL = true;
if (("S_COUNTER_SPRING_NO_CANCEL" in config)) {
S_COUNTER_SPRING_NO_CANCEL = config.S_COUNTER_SPRING_NO_CANCEL;
}
if (!("S_COUNTER_SPRING_NO_CANCEL" in config)) {
config.S_COUNTER_SPRING_NO_CANCEL = true;
config.S_COUNTER_SPRING_NO_CANCEL_DESCRIPTION = "If spring attack is off CD, shield counter will not block cancel if this is enabled. This feature is used to stop ghosting if you try to manually override Shield counter block cancel with spring attack.";
settingUpdate();
}
let S_COUNTER_ARUSH_NO_CANCEL = false;
if (("S_COUNTER_ARUSH_NO_CANCEL" in config)) {
S_COUNTER_ARUSH_NO_CANCEL = config.S_COUNTER_ARUSH_NO_CANCEL;
}
if (!("S_COUNTER_ARUSH_NO_CANCEL" in config)) {
config.S_COUNTER_ARUSH_NO_CANCEL = false;
config.S_COUNTER_ARUSH_NO_CANCEL_DESCRIPTION = "If A rush is activated, shield counter will not block cancel if this is enabled.";
settingUpdate();
}
let INFURIATE_CANCEL_TIME =1600;
if (("INFURIATE_CANCEL_TIME" in config)) {
INFURIATE_CANCEL_TIME = config.INFURIATE_CANCEL_TIME;
}
if (!("INFURIATE_CANCEL_TIME" in config)) {
config.INFURIATE_CANCEL_TIME =1600;
config.INFURIATE_CANCEL_TIME_DESCRIPTION = "Self explanatory";
settingUpdate();
}
let BARRAGE_SPRINGLOCK =0;
if (("BARRAGE_SPRINGLOCK" in config)) {
BARRAGE_SPRINGLOCK = config.BARRAGE_SPRINGLOCK;
}
if (!("BARRAGE_SPRINGLOCK" in config)) {
config.BARRAGE_SPRINGLOCK =0;
config.BARRAGE_SPRINGLOCK_DESCRIPTION = "set to lock spring attack for x ms after barrage2. Use this only with barrage auto cancel if you have ghosting issues with spring, this scales with ASPD.";
settingUpdate();
}
let AUTOBLOCKDELAY =0;
if (("AUTOBLOCKDELAY" in config)) {
AUTOBLOCKDELAY = config.AUTOBLOCKDELAY;
}
if (!("AUTOBLOCKDELAY" in config)) {
config.AUTOBLOCKDELAY =0;
config.AUTOBLOCKDELAY_DESCRIPTION = "this is the auto block delay. If set under 30, it will not consume RE.";
config.AUTOBLOCKDELAY_DESCRIPTION_2 = "NOTE: USING AUTO CANCEL CAN POTENTIALLY BREAK YOUR CHAIN (OBVIOUSLY)";
config.AUTOBLOCKDELAY_DESCRIPTION_3 = "Set to 0 to disable any of the above auto cancel. This is cancel time in milliseconds and scales with aspd.";
settingUpdate();
}
let WALLOP_AUTO_COUNTER = true;
if ("WALLOP_AUTO_COUNTER" in config) {
WALLOP_AUTO_COUNTER = config.WALLOP_AUTO_COUNTER;
}
if (!("WALLOP_AUTO_COUNTER" in config)) {
config.WALLOP_AUTO_COUNTER = true;
config.WALLOP_AUTO_COUNTER_DESCRIPTION = "DO NOT USE THIS WITHOUT ROBOTJS. Auto shield counter if wallop blocks, this will delay until after the last hit if auto block cancel is also activated for wallop.";
settingUpdate();
}
let LEAP_AUTO_COUNTER = true;
if ("LEAP_AUTO_COUNTER" in config) {
LEAP_AUTO_COUNTER = config.LEAP_AUTO_COUNTER;
}
if (!("LEAP_AUTO_COUNTER" in config)) {
config.LEAP_AUTO_COUNTER = true;
config.LEAP_AUTO_COUNTER_DESCRIPTION = "DO NOT USE THIS WITHOUT ROBOTJS. Auto shield counter if righteous leap blocks.";
settingUpdate();
}
let DO_NOT_USE_IF_RIGHTEOUS_LEAP_OFF_CD = false;
if ("DO_NOT_USE_IF_RIGHTEOUS_LEAP_OFF_CD" in config) {
DO_NOT_USE_IF_RIGHTEOUS_LEAP_OFF_CD = config.DO_NOT_USE_IF_RIGHTEOUS_LEAP_OFF_CD;
}
if (!("DO_NOT_USE_IF_RIGHTEOUS_LEAP_OFF_CD" in config)) {
config.DO_NOT_USE_IF_RIGHTEOUS_LEAP_OFF_CD = false;
config.DO_NOT_USE_IF_RIGHTEOUS_LEAP_OFF_CD_DESCRIPTION = "Disables WALLOP_AUTO_COUNTER if righteous leap is off cooldown.";
settingUpdate();
}
let OS_AUTO_COUNTER = true;
if ("OS_AUTO_COUNTER" in config) {
OS_AUTO_COUNTER = config.OS_AUTO_COUNTER;
}
if (!("OS_AUTO_COUNTER" in config)) {
config.OS_AUTO_COUNTER = true;
config.OS_AUTO_COUNTER_DESCRIPTION = "DO NOT USE THIS WITHOUT ROBOTJS. Auto shield counter if onslaught blocks, this will delay until after the last hit if auto block cancel is also activated for OS.";
settingUpdate();
}
let SHIELD_COUNTER_KEY = "4";
if (("SHIELD_COUNTER_KEY" in config)) {
SHIELD_COUNTER_KEY = config.SHIELD_COUNTER_KEY;
}
if (!("SHIELD_COUNTER_KEY" in config)) {
config.SHIELD_COUNTER_KEY = "4";
config.SHIELD_COUNTER_KEY_DESCRIPTION = "Key for shield counter, find keyboard syntax list here http://robotjs.io/docs/syntax";
settingUpdate();
}
let SB_AUTO_ONSLAUGHT = true;
if ("SB_AUTO_ONSLAUGHT" in config) {
SB_AUTO_ONSLAUGHT = config.SB_AUTO_ONSLAUGHT;
}
if (!("SB_AUTO_ONSLAUGHT" in config)) {
config.SB_AUTO_ONSLAUGHT = true;
config.SB_AUTO_ONSLAUGHT_DESCRIPTION = "DO NOT USE THIS WITHOUT ROBOTJS. Auto onslaught if shield bash. Can be toggled on off with sbos1 command.";
settingUpdate();
}
let ONSLAUGHT_KEY = "5";
if (("ONSLAUGHT_KEY" in config)) {
ONSLAUGHT_KEY = config.ONSLAUGHT_KEY;
}
if (!("ONSLAUGHT_KEY" in config)) {
config.ONSLAUGHT_KEY = "5";
config.ONSLAUGHT_KEY_DESCRIPTION = "Key for onslaught, find keyboard syntax list here http://robotjs.io/docs/syntax";
settingUpdate();
}
let ONSLAUGHT_AUTO_CANCEL = true;
if ("ONSLAUGHT_AUTO_CANCEL" in config) {
ONSLAUGHT_AUTO_CANCEL = config.ONSLAUGHT_AUTO_CANCEL;
}
if (!("ONSLAUGHT_AUTO_CANCEL" in config)) {
config.ONSLAUGHT_AUTO_CANCEL = true;
config.ONSLAUGHT_AUTO_CANCEL_DESCRIPTION = "DO NOT USE THIS WITHOUT ROBOTJS. Auto block cancel onslaught";
settingUpdate();
}
let ONSLAUGHT_AUTO_CANCEL_DELAY = "2600";
if (("ONSLAUGHT_AUTO_CANCEL_DELAY" in config)) {
ONSLAUGHT_AUTO_CANCEL_DELAY = config.ONSLAUGHT_AUTO_CANCEL_DELAY;
}
if (!("ONSLAUGHT_AUTO_CANCEL_DELAY" in config)) {
config.ONSLAUGHT_AUTO_CANCEL_DELAY = "2600";
config.ONSLAUGHT_AUTO_CANCEL_DELAY_DESCRIPTION = "Onslaught block cancel delay at base aspd";
settingUpdate();
}
let BLOCK_KEY = "6";
if (("BLOCK_KEY" in config)) {
BLOCK_KEY = config.BLOCK_KEY;
}
if (!("BLOCK_KEY" in config)) {
config.BLOCK_KEY = "6";
config.BLOCK_KEY_DESCRIPTION = "Key for Stand Fast, find keyboard syntax list here http://robotjs.io/docs/syntax";
settingUpdate();
}
let SB_AUTO_SPRING = true;
if ("SB_AUTO_SPRING" in config) {
SB_AUTO_SPRING = config.SB_AUTO_SPRING;
}
if (!("SB_AUTO_SPRING" in config)) {
config.SB_AUTO_SPRING = true;
config.SB_AUTO_SPRING_DESCRIPTION = "DO NOT USE THIS WITHOUT ROBOTJS. Auto spring attack after SB, toggle on and off in game with sbspring1";
settingUpdate();
}
let COUNTER_AUTO_SPRING = true;
if ("COUNTER_AUTO_SPRING" in config) {
COUNTER_AUTO_SPRING = config.COUNTER_AUTO_SPRING;
}
if (!("COUNTER_AUTO_SPRING" in config)) {
config.COUNTER_AUTO_SPRING = true;
config.COUNTER_AUTO_SPRING_DESCRIPTION = "DO NOT USE THIS WITHOUT ROBOTJS. Auto spring attack after shield counter. May bug if S_COUNTER_SPRING_NO_CANCEL is set to false.";
settingUpdate();
}
let SPRING_KEY = "7";
if (("SPRING_KEY" in config)) {
SPRING_KEY = config.SPRING_KEY;
}
if (!("SPRING_KEY" in config)) {
config.SPRING_KEY = "7";
config.SPRING_KEY_DESCRIPTION = "Key for spring attack, find keyboard syntax list here http://robotjs.io/docs/syntax";
settingUpdate();
}
let SPRING_BUG_TIME =150;
if (("SPRING_BUG_TIME" in config)) {
SPRING_BUG_TIME = config.SPRING_BUG_TIME;
}
if (!("SPRING_BUG_TIME" in config)) {
config.SPRING_BUG_TIME =150; //KEY=197383777980577
config.SPRING_BUG_TIME_DESCRIPTION = "Some people have issues with robotjs being too inhumanly fast and missing a spring tick";
config.SPRING_BUG_TIME_DESCRIPTION_2 = "this will slow down the SB2 -> Spring timing by this many milliseconds (will scale off aspd).";
settingUpdate();
}
let LOCKDOWN_AUTO_SPRING = false;
if (("LOCKDOWN_AUTO_SPRING" in config)) {
LOCKDOWN_AUTO_SPRING = config.LOCKDOWN_AUTO_SPRING;
}
if (!("LOCKDOWN_AUTO_SPRING" in config)) {
config.LOCKDOWN_AUTO_SPRING = false;
config.LOCKDOWN_AUTO_SPRING_DESCRIPTION = "DO NOT USE THIS WITHOUT ROBOTJS. If lockdown auto block cancel is enabled, enabling this option will use spring attack instead if available.";
settingUpdate();
}
let AGGRO_SHOUT_AUTO_CANCEL = true;
if ("AGGRO_SHOUT_AUTO_CANCEL" in config) {
AGGRO_SHOUT_AUTO_CANCEL = config.AGGRO_SHOUT_AUTO_CANCEL;
}
if (!("AGGRO_SHOUT_AUTO_CANCEL" in config)) {
config.AGGRO_SHOUT_AUTO_CANCEL = true;
config.AGGRO_SHOUT_AUTO_CANCEL_DESCRIPTION = "DO NOT USE THIS WITHOUT ROBOTJS. Auto cancels challenging shout";
settingUpdate();
}
let AGGRO_SHOUT_AUTO_CANCEL_DELAY = "1400";
if (("AGGRO_SHOUT_AUTO_CANCEL_DELAY" in config)) {
AGGRO_SHOUT_AUTO_CANCEL_DELAY = config.AGGRO_SHOUT_AUTO_CANCEL_DELAY;
}
if (!("AGGRO_SHOUT_AUTO_CANCEL_DELAY" in config)) {
config.AGGRO_SHOUT_AUTO_CANCEL_DELAY = "1400";
config.AGGRO_SHOUT_AUTO_CANCEL_DELAY_DESCRIPTION = "Challenging shout auto cancel delay";
settingUpdate();
}
let WALLOP_AUTO_LEAP = true;
if ("WALLOP_AUTO_LEAP" in config) {
WALLOP_AUTO_LEAP = config.WALLOP_AUTO_LEAP;
}
if (!("WALLOP_AUTO_LEAP" in config)) {
config.WALLOP_AUTO_LEAP = true;
config.WALLOP_AUTO_LEAP_DESCRIPTION = "DO NOT USE THIS WITHOUT ROBOTJS. Auto super leap after wallop. Activating this macro will also (obviously) disable wallop auto block cancel when leap is off CD.";
settingUpdate();
}
let LEAP_ARUSH_NO_CANCEL = false;
if (("LEAP_ARUSH_NO_CANCEL" in config)) {
LEAP_ARUSH_NO_CANCEL = config.LEAP_ARUSH_NO_CANCEL;
}
if (!("LEAP_ARUSH_NO_CANCEL" in config)) {
config.LEAP_ARUSH_NO_CANCEL = false;
config.LEAP_ARUSH_NO_CANCEL_DESCRIPTION = "Disables wallop -> superleap if less than x sec left on Arush CD or Arush off CD.";
settingUpdate();
}
let LEAP_ARUSH_NO_CANCEL_TIMER =10000;
if (("LEAP_ARUSH_NO_CANCEL_TIMER" in config)) {
LEAP_ARUSH_NO_CANCEL_TIMER = config.LEAP_ARUSH_NO_CANCEL_TIMER;
}
if (!("LEAP_ARUSH_NO_CANCEL_TIMER" in config)) {
config.LEAP_ARUSH_NO_CANCEL_TIMER =10000;
config.LEAP_ARUSH_NO_CANCEL_TIMER_DESCRIPTION = "Timer for x for above features in milliseconds.";
settingUpdate();
}
let LEAP_KEY = "6";
if (("LEAP_KEY" in config)) {
LEAP_KEY = config.LEAP_KEY;
}
if (!("LEAP_KEY" in config)) {
config.LEAP_KEY = "6";
config.LEAP_KEY_DESCRIPTION = "Key for super leap, find keyboard syntax list here http://robotjs.io/docs/syntax";
settingUpdate();
}
let LEAP_AUTO_CANCEL = true;
if ("LEAP_AUTO_CANCEL" in config) {
LEAP_AUTO_CANCEL = config.LEAP_AUTO_CANCEL;
}
if (!("LEAP_AUTO_CANCEL" in config)) {
config.LEAP_AUTO_CANCEL = true;
config.LEAP_AUTO_CANCEL_DESCRIPTION = "DO NOT USE THIS WITHOUT ROBOTJS. Auto block cancel super leap.";
settingUpdate();
}
let LEAP_AUTO_CANCEL_DELAY = "370";
if (("LEAP_AUTO_CANCEL_DELAY" in config)) {
LEAP_AUTO_CANCEL_DELAY = config.LEAP_AUTO_CANCEL_DELAY;
}
if (!("LEAP_AUTO_CANCEL_DELAY" in config)) {
config.LEAP_AUTO_CANCEL_DELAY = "370";
config.LEAP_AUTO_CANCEL_DELAY_DESCRIPTION = "Leap auto cancel delay";
settingUpdate();
}
let AUTO_ATTACK_CANCEL = false;
if (("AUTO_ATTACK_CANCEL" in config)) {
AUTO_ATTACK_CANCEL = config.AUTO_ATTACK_CANCEL;
}
if (!("AUTO_ATTACK_CANCEL" in config)) {
config.AUTO_ATTACK_CANCEL = false;
config.AUTO_ATTACK_CANCEL_DESCRIPTION = "Auto block cancel auto attack, requires robotjs. This is for skating.";
settingUpdate();
}
let AUTO_ATTACK_CANCEL_DELAY =100;
if (("AUTO_ATTACK_CANCEL_DELAY" in config)) {
AUTO_ATTACK_CANCEL_DELAY = config.AUTO_ATTACK_CANCEL_DELAY;
}
if (!("AUTO_ATTACK_CANCEL_DELAY" in config)) {
config.AUTO_ATTACK_CANCEL_DELAY =100;
config.AUTO_ATTACK_CANCEL_DELAY_DESCRIPTION = "Auto block cancel auto attack delay in milliseconds, scales with aspd.";
settingUpdate();
}
let KR_ONSLAUGHT_TALENT = true;
let SKILL_BLOCK =20200;
let H1_EXPERIMENT = false;
let cid;
let job;
let model;
let enabled = true;
let aspd;
let atkid = [];
let atkid_base = 0xFEFEFFEE;
let S_ShBarrage_D =600;
let disabSkill = [];
let startTime = [];
let timer = [];
let finishcheck = [];
let finish = [];
let charging = false;
let myRE;
let Ignore1 = false;
let Ignore2;
let SBASHAUTOONSLAUGHT_TIME =0;
let SCHAX =1;
let SB_AUTO_ONSLAUGHTER = SB_AUTO_ONSLAUGHT;
let xloc;
let yloc;
let zloc;
let wloc;
let timeloc;
let cdCheck = [];
let permawallop = WALLOP_CANCEL_TIME_UNCHAINED;
let blockd;
let punchCounter =0;
let clearPunchCounter;
let dstance =0;
let sBashGlyph = true;
let onslaughtTimer1;
let onslaughtTimer2;
let onslaughtTimer3;
let onslaughtTimer4;
let onslaughtTimer5;
let msgSuppress;
let canLeash = true;
let barragelock = true;
let safetyX = true;
let WALLOPCANCEL;
let lastBlock;
let checkerr =0;
let lastBulk;
let lastSkill;
let lastLastSkill;
let lastEvent;
let lastEventTime;
let currentRe;
let GLOBAL_LOCK_DELAY =800;
let blockActive =0;
let lastSkillTime = [];
let lastSkillDelay;
let lastLastSkillDelay;
let lastSkillStart;
let lastSkillEvent;
let RecheckTimer;
let zzz =0;
let yyy =1;
let glyphState = [];
let failsafe =0;
let collisionLocX;
let collisionLocY;
let collisionLocZ;
let leapready = false;
let aRusha = false;
let darkness =0;
let yes11 =0;
let autoreblock = false;
let blockstate;
let zoKk;
let autoscarray = [];
let savebarrage = BARRAGE_CANCEL_TIME;
let backStepStart;
var atkArr;
let talentState = [];
dispatch.hook('S_LOAD_EP_INFO', 3, (event) => {
if (!enabled) { return };
talentState = [];
event.perks.forEach(function (element) {
talentState[element.id] = element.level;
});
});
dispatch.hook('S_LEARN_EP_PERK', 1, (event) => {
if (!enabled) { return };
talentState = [];
event.perks.forEach(function (element) {
talentState[element.id] = element.level;
});
});
dispatch.hook('C_CHAT', 1, (event) => {
if (event.message.includes("sbtoggle1")) {
if (BARRAGE_CANCEL_TIME ==0) {
BARRAGE_CANCEL_TIME = savebarrage;
}
else if (BARRAGE_CANCEL_TIME !=0) {
BARRAGE_CANCEL_TIME =0;
}
return false;
}
if (event.message.includes("h1")) {
autoreblock = !autoreblock;
console.log("Auto reblock is set to: " + autoreblock);
return false;
}
if (event.message.includes("sbos1")) {
SB_AUTO_ONSLAUGHTER = !SB_AUTO_ONSLAUGHTER;
console.log("Auto SB->Onslaught is set to: " + SB_AUTO_ONSLAUGHTER);
return false;
}
});
dispatch.hook('S_LOAD_TOPO', 3, (event) => {
if (event.zone ==118) {
enabled = false;
}
else {
enabled = [JOB_LANCER].includes(job);
}
});
dispatch.hook('S_LOGIN', 14, (event) => {
lastBulk = event;
cid = event.gameId;
model = event.templateId;
job = (model -10101) %100;
enabled = [JOB_LANCER].includes(job);
disabSkill[977] = true;
var race = Math.floor((model -10101) /100);
if (race ==2) {
S_ShBarrage_D =503;
}
if (WALLOP_AUTO_LEAP) {
WALLOP_CANCEL_TIME_UNCHAINED =0;
}
});
dispatch.hook('C_CHAT', 1, (event) => {
if (event.message.includes("disable1")) {
enabled = false;
console.log("Lancer script disabled");
return false;
}
if (event.message.includes("enable1")) {
enabled = [JOB_LANCER].includes(job);
console.log("Lancer script enabled if you are currently logged into lancer");
return false;
}
if (event.message.includes("sbspring1")) {
SB_AUTO_SPRING = !SB_AUTO_SPRING;
console.log("SB_AUTO_SPRING is: "+SB_AUTO_SPRING);
return false;
}
});
dispatch.hook('S_RP_SKILL_POLISHING_LIST', 1, (event) => {
if (!enabled) return;
SKILL_BLOCK =20200;
try{
event.optionEffects.forEach(function(element){
if(element.id == 17020201 && element.active){
SKILL_BLOCK =20230;
}
if(element.id == 17020202 && element.active){
SKILL_BLOCK =20240;
}
});
}
catch (e) { }
});
function fakeEnd_sorc(event, duration) {
collisionLocX = false;
collisionLocY = false;
collisionLocZ = false;
xloc = false;
yloc = false;
zloc = false;
zzz =0;
yyy =1;
if (timer[lastSkill]) {
clearTimeout(timer[lastSkill]);
}
var d = new Date();
lastSkillStart = d.getTime();
lastLastSkillDelay = lastSkillDelay;
if (finish[lastSkill] == false) {
force_end(lastEvent,4);
}
finish[SKILL_CHARGING] = true;
clearTimeout(finishcheck[event.skill.id]);
finish[event.skill.id] = false;
atkid[event.skill.id] = atkid_base;
atkid_base--;
dispatch.toClient('S_ACTION_STAGE', 9, {
gameId: cid,
loc: {
x: event.loc.x,
y: event.loc.y,
z: event.loc.z
},
w: event.w,
templateId: model,
skill: event.skill.id,
stage: 0,
speed: aspd,
...(dispatch.majorPatchVersion >= 110 ? { projectileSpeed: aspd } : 0n),
id: atkid[event.skill.id],
effectScale: 1.0,
moving: false,
dest: { x: 0, y: 0, Z: 0 },
target: 0n,
movement: [],
});
finishcheck[event.skill.id] = setTimeout(function (event) { finish[event.skill.id] = true; }, (duration / aspd), event);
lastSkillDelay = duration / aspd;
setTimeout(function (event) {
lastSkillEvent = {
gameId: cid,
loc: {
x: collisionLocX || event.loc.x,
y: collisionLocY || event.loc.y,
z: collisionLocZ || event.loc.z
},
w: event.w,
templateId: model,
skill: event.skill.id,
type: 0,
id: atkid[event.skill.id],
};
}, duration / aspd, event);
timer[event.skill.id] = setTimeout(
function (event) {
if (event.skill.id != S_ShCo && lastSkill == S_ShCo && finish[S_ShCo] == false) {
return;
}
if (lastSkill ==1) { return; }
if (lastSkill ==2) { return; }
dispatch.toClient('S_ACTION_END', 5, {
gameId: cid,
loc: {
x: collisionLocX || event.loc.x,
y: collisionLocY || event.loc.y,
z: collisionLocZ || event.loc.z
},
w: event.w,
templateId: model,
skill: event.skill.id,
type: 0,
id: atkid[event.skill.id],
});
}, duration / aspd, event);
}
function charge(event) {
collisionLocX = false;
collisionLocY = false;
collisionLocZ = false;
xloc = false;
yloc = false;
zloc = false;
zzz =0;
yyy =1;
finish[SKILL_CHARGING] = true;
var d = new Date();
lastSkillStart = d.getTime();
lastLastSkillDelay = lastSkillDelay;
if (timer[lastSkill]) {
clearTimeout(timer[lastSkill]);
}
clearTimeout(finishcheck[event.skill.id]);
finish[event.skill.id] = false;
atkid[event.skill.id] = atkid_base;
atkid_base--;
dispatch.toClient('S_ACTION_STAGE', 9, {
gameId: cid,
loc: {
x: event.loc.x,
y: event.loc.y,
z: event.loc.z
},
w: event.w,
templateId: model,
skill: event.skill.id,
stage: 0,
speed: 1,
...(dispatch.majorPatchVersion >= 75 ? { projectileSpeed: 1 } : 0n),
id: atkid[event.skill.id],
effectScale: 1.0,
moving: false,
dest: { x: 0, y: 0, Z: 0 },
target: 0n,
movement: [],
});
dispatch.toClient('S_INSTANT_DASH', 3, {
gameId: cid,
target: 0n,
unk: 0,
loc: {
x: event.dest.x,
y: event.dest.y,
z: event.dest.z
},
w: event.w,
});
var zzzz = Math.pow((Math.pow((event.loc.x - event.dest.x),2) + Math.pow((event.loc.y - event.dest.y),2)), 0.5) / SKILL_CHARGING_DISTANCE * SKILL_CHARGING_DURATION;
lastSkillDelay = zzzz;
setTimeout(function (event) {
lastSkillEvent = {
gameId: cid,
loc: {
x: event.dest.x,
y: event.dest.y,
z: event.dest.z
},
w: event.w,
templateId: model,
skill: event.skill.id,
type: 39,
id: atkid[event.skill.id],
};
}, zzzz, event);
timer[event.skill.id] = setTimeout(function (event) {
if (lastSkill == SKILL_CHARGING) {
dispatch.toClient('S_ACTION_END', 5, {
gameId: cid,
loc: {
x: event.dest.x,
y: event.dest.y,
z: event.dest.z
},
w: event.w,
templateId: model,
skill: event.skill.id,
type: 39,
id: atkid[event.skill.id],
});
finish[event.skill.id] = true;
}
}, zzzz, event);
}
function force_end(event, unkz) {
dispatch.toClient('S_ACTION_END', 5, {
gameId: cid,
loc: {
x: collisionLocX || event.loc.x,
y: collisionLocY || event.loc.y,
z: collisionLocZ || event.loc.z
},
w: event.w,
templateId: model,
skill: event.skill.id + zzz,
type: unkz, //0x02
id: atkid[event.skill.id + zzz],
});
clearTimeout(timer[event.skill.id]);
}
function force_end2(event, unkz, skillx) {
dispatch.toClient('S_ACTION_END', 5, {
gameId: cid,
loc: {
x: collisionLocX || event.loc.x,
y: collisionLocY || event.loc.y,
z: collisionLocZ || event.loc.z
},
w: event.w,
templateId: model,
skill: skillx + zzz,
type: unkz, //0x02
id: atkid[skillx + zzz],
});
clearTimeout(timer[event.skill.id]);
}
function stageskill(event, stagex) {
var dist =0;
if (stagex == 2 && event.skill.id == S_OnSl) {
dist = dist +100;
}
if (stagex == 3 && event.skill.id == S_OnSl) {
dist = dist +200;
}
if (stagex == 4 && event.skill.id == S_OnSl) {
dist = dist +300;
}
if (stagex == 5 && event.skill.id == S_OnSl) {
dist = dist +400;
}
var newX;
var newY;
var angle = parseFloat(event.w);
newX = Math.cos(angle) * dist;
newY = Math.sin(angle) * dist;
dispatch.toClient('S_ACTION_STAGE', 9, {
gameId: cid,
loc: {
x: (collisionLocX) || xloc || (event.loc.x + newX),
y: (collisionLocY) || yloc || (event.loc.y + newY),
z: (collisionLocZ) || zloc || (event.loc.z +2)
},
w: event.w,
templateId: model,
skill: event.skill.id + zzz,
stage: stagex,
speed: aspd * yyy,
...(dispatch.majorPatchVersion >= 75 ? { projectileSpeed: aspd * yyy } : 0n),
id: atkid[event.skill.id + zzz],
effectScale: 1.0,
moving: false,
dest: { x: 0, y: 0, Z: 0 },
target: 0n,
movement: [],
});
}