-
Notifications
You must be signed in to change notification settings - Fork 0
/
FNaFSBAutoSplitter.asl
1757 lines (1571 loc) · 88.4 KB
/
FNaFSBAutoSplitter.asl
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
//Five Nights at Freddy's: Security Breach Autosplitter | v2.4.0
//Created by (Discord usernames) daltone_21 and nintendude_sr
//Original autosplitter created by patrogue
//Special thanks to CheatingMuppet, Cheat The Game, and the "Speedrun Tool Development" Discord server
/*(especially apple1417 and just_ero, you two are the fucking GOAT)*/
//for making tutorials, helping us understand how to use Cheat Engine, and assisting in development of this ASL
state("fnaf9-Win64-Shipping"){}
startup {
vars.stopwatch = new Stopwatch();
vars.CompletedSplits = new HashSet<string>();
settings.CurrentDefaultParent = null;
settings.Add("Split Settings", false);
settings.Add("In-Game Time Settings", true);
settings.CurrentDefaultParent = "Split Settings";
settings.Add("Arcade Splits", false);
settings.Add("Counting Splits", false);
settings.Add("Deload Splits", false);
settings.Add("Ending Splits", false);
settings.Add("Item Splits", false);
settings.Add("Positional Splits", false);
settings.Add("Time Splits", false);
settings.CurrentDefaultParent = "Arcade Splits";
settings.Add("BB Arcade", false);
settings.Add("Monty Golf", false);
settings.Add("Princess Quest", false);
settings.CurrentDefaultParent = "BB Arcade";
settings.Add("bb_start", false, "Start Arcade");
settings.Add("bb_end", false, "Finish Arcade");
settings.CurrentDefaultParent = "Monty Golf";
settings.Add("mg_start", false, "Start Arcade");
settings.Add("Finish Hole 1", false);
settings.Add("Finish Hole 2", false);
settings.Add("Finish Hole 3", false);
settings.Add("Finish Hole 4", false);
settings.Add("Finish Hole 5", false);
settings.Add("Finish Hole 6", false);
settings.Add("Finish Hole 7", false);
settings.Add("Finish Hole 8", false);
settings.Add("Finish Hole 9", false);
settings.Add("mg_end", false, "Finish Arcade");
settings.CurrentDefaultParent = "Princess Quest";
settings.Add("Princess Quest 1", false);
settings.Add("Princess Quest 2", false);
settings.Add("Princess Quest 3", false);
settings.CurrentDefaultParent = "Princess Quest 1";
settings.Add("pq1_start", false, "Start Arcade");
settings.Add("pq1_1", false, "Exit Starting Room");
settings.Add("pq1_2", false, "2nd Room");
settings.Add("pq1_3", false, "3rd Room");
settings.Add("pq1_4", false, "Key Door");
settings.Add("pq1_5", false, "Crossroads");
settings.Add("pq1_6", false, "Right Door");
settings.Add("pq1_7", false, "Enter Graveyard");
settings.Add("pq1_8", false, "Staircase");
settings.Add("pq1_9", false, "Final Room");
settings.Add("pq1_end", false, "Finish Arcade");
settings.CurrentDefaultParent = "Princess Quest 2";
settings.Add("pq2_start", false, "Start Arcade");
settings.Add("pq2_1", false, "Exit Starting Room");
settings.Add("pq2_2", false, "2nd Room");
settings.Add("pq2_3", false, "Balls Room");
settings.Add("pq2_4", false, "4th Room");
settings.Add("pq2_5", false, "Split Puzzle Room");
settings.Add("pq2_6", false, "Big Torch Room");
settings.Add("pq2_7", false, "Hallway");
settings.Add("pq2_8", false, "Big Split Puzzle Room");
settings.Add("pq2_9", false, "Bedroom");
settings.Add("pq2_10", false, "Enter Final Room");
settings.Add("pq2_end", false, "Finish Arcade");
settings.CurrentDefaultParent = "Princess Quest 3";
settings.Add("pq3_start", false, "Start Arcade");
settings.Add("pq3_1", false, "Hallway");
settings.Add("pq3_2", false, "Hub Room");
settings.Add("pq3_3", false, "Conveyor Room");
settings.Add("pq3_4", false, "Split Puzzle Room (Glitchtrap Plush)");
settings.Add("pq3_5", false, "Flamin' Hot Foxy");
settings.Add("pq3_6", false, "Prize Counter");
settings.Add("pq3_7", false, "Enter Final Area");
settings.Add("pq3_endArcade", false, "Use Key");
settings.CurrentDefaultParent = "Counting Splits";
settings.Add("Daycare Generators", false);
settings.Add("Fazerblast Flags", false);
settings.Add("Monty Bucket Count", false);
settings.Add("Sewer Generators", false);
settings.Add("West Arcade Generators", false);
settings.CurrentDefaultParent = "Daycare Generators";
settings.Add("D_Generator 1", false, "Generator 1");
settings.Add("D_Generator 2", false, "Generator 2");
settings.Add("D_Generator 3", false, "Generator 3");
settings.Add("D_Generator 4", false, "Generator 4");
settings.Add("D_Generator 5", false, "Generator 5");
settings.CurrentDefaultParent = "Fazerblast Flags";
settings.Add("Flag 1", false);
settings.Add("Flag 2", false);
settings.Add("Flag 3", false);
settings.CurrentDefaultParent = "Monty Bucket Count";
settings.Add("10 Balls", false);
settings.Add("20 Balls", false);
settings.Add("25 Balls", false);
settings.CurrentDefaultParent = "Sewer Generators";
settings.Add("S_Generator 1", false, "Generator 1");
settings.Add("S_Generator 2", false, "Generator 2");
settings.Add("S_Generator 3", false, "Generator 3");
settings.CurrentDefaultParent = "West Arcade Generators";
settings.Add("WA_Generator 1", false, "Generator 1");
settings.Add("WA_Generator 2", false, "Generator 2");
settings.Add("WA_Generator 3", false, "Generator 3");
settings.Add("WA_Generator 4", false, "Generator 4");
settings.Add("WA_Generator 5", false, "Generator 5");
settings.CurrentDefaultParent = "Deload Splits";
settings.Add("D_Backstage", false, "Backstage");
settings.Add("D_Daycare", false, "Daycare");
settings.Add("D_Kid's Cove Sublobby", false, "Kid's Cove Sublobby");
settings.Add("D_Monty Golf Sublobby", false, "Monty Golf Sublobby");
settings.Add("D_Prize Counter", false, "Prize Counter");
settings.Add("D_Rockstar Row", false, "Rockstar Row");
settings.Add("D_Roxy Raceway", false, "Roxy Raceway");
settings.Add("D_Roxy Raceway Sublobby", false, "Roxy Raceway Sublobby");
settings.Add("D_Roxy Salon", false, "Roxy Salon");
settings.CurrentDefaultParent = "D_Backstage";
settings.Add("Foxy Cutout Deload", false);
settings.CurrentDefaultParent = "D_Daycare";
settings.Add("Arcade Deload", false);
settings.Add("Theatre Deload", false);
settings.CurrentDefaultParent = "D_Kid's Cove Sublobby";
settings.Add("KCD_Fence Deload", false, "Fence Deload");
settings.CurrentDefaultParent = "D_Monty Golf Sublobby";
settings.Add("MGD_Fence Deload", false, "Fence Deload");
settings.CurrentDefaultParent = "D_Prize Counter";
settings.Add("Counter Deload", false);
settings.CurrentDefaultParent = "D_Rockstar Row";
settings.Add("Chica Greenroom Deload", false);
settings.Add("Curtain Deload", false);
settings.Add("Roxy Cutout Deload", false);
settings.Add("Tunnel Door Deload", false);
settings.CurrentDefaultParent = "D_Roxy Raceway";
settings.Add("Afton Rock Column Deload", false);
settings.Add("Garage Fence Jump", false);
settings.Add("Roxy's Eyes Deload", false);
settings.CurrentDefaultParent = "D_Roxy Raceway Sublobby";
settings.Add("Balloon Deload", false);
settings.CurrentDefaultParent = "D_Roxy Salon";
settings.Add("Plant Deload", false);
settings.CurrentDefaultParent = "Ending Splits";
settings.Add("Afton Ending", false);
settings.Add("V_B", false, "Vanny Ending");
settings.Add("CB_B", false, "Car Battery Ending");
settings.Add("E_B", false, "Escape Ending");
settings.Add("F_B", false, "Fire Escape Ending");
settings.Add("pq3_endEndings", false, "Princess Quest Ending");
settings.CurrentDefaultParent = "Afton Ending";
settings.Add("Button 1", false);
settings.Add("Button 2", false);
settings.Add("Button 3", false);
settings.Add("Button 4", false);
settings.Add("Button 5", false);
settings.Add("Button 6", false);
settings.Add("Button 7", false);
settings.Add("Button 8/End", false);
settings.CurrentDefaultParent = "Item Splits";
settings.Add("Item List", false);
settings.Add("Security Badges", false);
settings.CurrentDefaultParent = "Item List";
settings.Add("Collectables", false);
settings.Add("Equipment", false);
settings.Add("Message Bags", false);
settings.Add("Special Collectibles", false);
settings.Add("Retro CDs", false);
settings.CurrentDefaultParent = "Collectables";
settings.Add("C_Backstage", false, "Backstage");
settings.Add("C_Basement Kitchen", false, "Basement Kitchen");
settings.Add("C_Bonnie Bowl", false, "Bonnie Bowl");
settings.Add("C_Chica's Bakery", false, "Chica's Bakery");
settings.Add("C_Daycare", false, "Daycare");
settings.Add("C_El Chips", false, "El Chips");
settings.Add("C_Fazerblast", false, "Fazerblast");
settings.Add("C_Fazerblast Sublobby", false, "Fazerblast Sublobby");
settings.Add("C_Kid's Cove Sublobby", false, "Kid's Cove Sublobby");
settings.Add("C_Laundry", false, "Laundry");
settings.Add("C_Lobby", false, "Lobby");
settings.Add("C_Main Atrium", false, "Main Atrium");
settings.Add("C_Monty Golf", false, "Monty Golf");
settings.Add("C_Monty Golf Sublobby", false, "Monty Golf Sublobby");
settings.Add("C_Parts & Service", false, "Parts & Service");
settings.Add("C_Prize Counter", false, "Prize Counter");
settings.Add("C_Rockstar Row", false, "Rockstar Row");
settings.Add("C_Roxy Raceway", false, "Roxy Raceway");
settings.Add("C_Roxy Raceway Sublobby", false, "Roxy Raceway Sublobby");
settings.Add("C_Roxy Salon", false, "Roxy Salon");
settings.Add("C_Salads & Sides", false, "Salads & Sides");
settings.Add("C_Sewers", false, "Sewers");
settings.Add("C_Utility Tunnels", false, "Utility Tunnels");
settings.Add("C_Warehouse", false, "Warehouse");
settings.Add("C_West Arcade", false, "West Arcade");
settings.CurrentDefaultParent = "C_Backstage";
settings.Add("CommonCollectible_13", false, "El Chip Piñata");
settings.Add("c_shirt_freddyicon", false, "Freddy Icon Shirt");
settings.Add("UncommonCollectible_7", false, "Glam Chica Figure");
settings.CurrentDefaultParent = "C_Basement Kitchen";
settings.Add("c_magnet_freddy", false, "Freddy Magnet");
settings.Add("c_golden_chica", false, "Golden Chica");
settings.CurrentDefaultParent = "C_Bonnie Bowl";
settings.Add("c_plush_bonnie", false, "Bonnie Plush");
settings.Add("c_golden_monty", false, "Golden Monty");
settings.CurrentDefaultParent = "C_Chica's Bakery";
settings.Add("c_magnet_monty", false, "Monty Magnet");
settings.CurrentDefaultParent = "C_Daycare";
settings.Add("RareCollectible_1", false, "Freddy Mask");
settings.Add("CommonCollectible_4", false, "Frozen Chica Treat");
settings.Add("UncommonCollectible_6", false, "Glam Freddy Figure");
settings.Add("c_golden_moon", false, "Golden Moon");
settings.Add("c_poster1", false, "Old Poster");
settings.Add("c_plush_baby", false, "Plush Baby");
settings.CurrentDefaultParent = "C_El Chips";
settings.Add("CommonCollectible_14", false, "Chica Balloon");
settings.CurrentDefaultParent = "C_Fazerblast";
settings.Add("CommonCollectible_15", false, "Freddy Balloon");
settings.Add("c_poster4", false, "Old Poster");
settings.Add("c_key_spchica", false, "Space Chica Keychain");
settings.Add("c_key_sproxy", false, "Space Roxy Keychain");
settings.CurrentDefaultParent = "C_Fazerblast Sublobby";
settings.Add("CommonCollectible_10", false, "Freddy Piñata");
settings.Add("c_key_spfreddy", false, "Space Freddy Keychain");
settings.CurrentDefaultParent = "C_Kid's Cove Sublobby";
settings.Add("c_golden_sun", false, "Golden Sun");
settings.Add("UncommonCollectible_5", false, "Moon Plush");
settings.CurrentDefaultParent = "C_Laundry";
settings.Add("UncommonCollectible_1", false, "Glam Roxy Plush");
settings.Add("c_poster2", false, "Old Poster");
settings.Add("c_shirt_star", false, "Star Shirt");
settings.CurrentDefaultParent = "C_Lobby";
settings.Add("CommonCollectible_8", false, "Chica Name Shirt");
settings.Add("CommonCollectible_18", false, "Cupcake Piñata");
settings.Add("CommonCollectible_6", false, "Freddy Name Shirt");
settings.Add("UncommonCollectible_2", false, "Glam Chica Plush");
settings.Add("CommonCollectible_1", false, "Sun Plush");
settings.CurrentDefaultParent = "C_Main Atrium";
settings.Add("CommonCollectible_20", false, "Monty Piñata");
settings.Add("CommonCollectible_9", false, "Roxy Name Shirt");
settings.CurrentDefaultParent = "C_Monty Golf";
settings.Add("c_gokart", false, "Go Kart");
settings.Add("c_mask_tragedy", false, "Tragedy Mask");
settings.CurrentDefaultParent = "C_Monty Golf Sublobby";
settings.Add("CommonCollectible_2", false, "Frozen Monty Treat");
settings.Add("UncommonCollectible_8", false, "Glam Monty Figure");
settings.CurrentDefaultParent = "C_Parts & Service";
settings.Add("UncommonCollectible_9", false, "Glam Roxy Figure");
settings.CurrentDefaultParent = "C_Prize Counter";
settings.Add("CommonCollectible_3", false, "Frozen Freddy Treat");
settings.Add("RareCollectible_4", false, "Monty Mask");
settings.CurrentDefaultParent = "C_Rockstar Row";
settings.Add("RareCollectible_2", false, "Chica Mask");
settings.Add("c_shirt_four", false, "Four Block Shirt");
settings.Add("c_golden_freddy", false, "Golden Freddy");
settings.Add("CommonCollectible_12", false, "Monty Name Shirt");
settings.Add("CommonCollectible_7", false, "Pizzaplex Logo Shirt");
settings.CurrentDefaultParent = "C_Roxy Raceway";
settings.Add("CommonCollectible_16", false, "Monty Balloon");
settings.Add("c_key_spmonty", false, "Space Monty Keychain");
settings.CurrentDefaultParent = "C_Roxy Raceway Sublobby";
settings.Add("CommonCollectible_5", false, "Frozen Roxy Treat");
settings.Add("CommonCollectible_17", false, "Roxy Balloon");
settings.Add("RareCollectible_3", false, "Roxy Mask");
settings.CurrentDefaultParent = "C_Roxy Salon";
settings.Add("c_magnet_roxy", false, "Roxy Magnet");
settings.Add("CommonCollectible_11", false, "Roxy Piñata");
settings.CurrentDefaultParent = "C_Salads & Sides";
settings.Add("c_shirt_freddyface", false, "Freddy Face Shirt");
settings.Add("c_pinata_general", false, "Piñata");
settings.CurrentDefaultParent = "C_Sewers";
settings.Add("c_poster3", false, "Old Poster");
settings.CurrentDefaultParent = "C_Utility Tunnels";
settings.Add("CommonCollectible_19", false, "Chica Piñata");
settings.Add("c_mask_comedy", false, "Comedy Mask");
settings.Add("c_plush_foxy", false, "Foxy Plush");
settings.Add("UncommonCollectible_3", false, "Glam Freddy Plush");
settings.Add("c_golden_roxy", false, "Golden Roxy");
settings.Add("UncommonCollectible_11", false, "Moon Figure");
settings.Add("UncommonCollectible_10", false, "Sun Figure");
settings.CurrentDefaultParent = "C_Warehouse";
settings.Add("c_plush_night", false, "Nightmare Plush");
settings.CurrentDefaultParent = "C_West Arcade";
settings.Add("UncommonCollectible_4", false, "Glam Monty Plush");
settings.CurrentDefaultParent = "Equipment";
settings.Add("E_Backstage", false, "Backstage");
settings.Add("E_Basement Kitchen", false, "Basement Kitchen");
settings.Add("E_Bonnie Bowl", false, "Bonnie Bowl");
settings.Add("E_Chica's Bakery", false, "Chica's Bakery");
settings.Add("E_Daycare", false, "Daycare");
settings.Add("E_El Chips", false, "El Chips");
settings.Add("E_Fazerblast", false, "Fazerblast");
settings.Add("E_Lobby", false, "Lobby");
settings.Add("E_Main Atrium", false, "Main Atrium");
settings.Add("E_Monty Golf", false, "Monty Golf");
settings.Add("E_Rockstar Row", false, "Rockstar Row");
settings.Add("E_Roxy Raceway", false, "Roxy Raceway");
settings.Add("E_Roxy Salon", false, "Roxy Salon");
settings.Add("E_Sewers", false, "Sewers");
settings.Add("E_Utility Tunnels", false, "Utility Tunnels");
settings.Add("E_West Arcade", false, "West Arcade");
settings.CurrentDefaultParent = "E_Backstage";
settings.Add("BackstagePass", false, "Backstage Pass");
settings.Add("FlashlightUpgrade_3", false, "Flashlight Upgrade");
settings.CurrentDefaultParent = "E_Basement Kitchen";
settings.Add("GregoryUpgrade_Stamina_3", false, "Freddy Fizzy Faz");
settings.CurrentDefaultParent = "E_Bonnie Bowl";
settings.Add("MontyMysteryMix", false, "Monty Mystery Mix");
settings.CurrentDefaultParent = "E_Chica's Bakery";
settings.Add("GregoryUpgrade_Stealth", false, "Hoodie");
settings.CurrentDefaultParent = "E_Daycare";
settings.Add("Flashlight", false);
settings.Add("FlashlightUpgrade_2", false, "Flashlight Upgrade");
settings.Add("MazerciseControlKey", false, "Mazercise Control Key");
settings.CurrentDefaultParent = "E_El Chips";
settings.Add("GregoryUpgrade_Stamina_4", false, "Monty Fizzy Faz");
settings.CurrentDefaultParent = "E_Fazerblast";
settings.Add("BowlingTicket", false, "Bowling Pass");
settings.Add("Golden Fazerblaster", false);
settings.Add("Grey Fazerblaster", false);
settings.CurrentDefaultParent = "E_Lobby";
settings.Add("GregoryUpgrade_Stamina_2", false, "Chica Fizzy Faz");
settings.Add("Daycare Pass", false);
settings.Add("CompPass", false, "Entrance Pass");
settings.Add("MrHippoMagnet", false, "Mr. Hippo Magnet");
settings.Add("ScrewDriver", false, "Screwdriver");
settings.CurrentDefaultParent = "E_Main Atrium";
settings.Add("FreddyUpgrade_1", false, "Freddy Upgrade");
settings.Add("Map", false, "Mapbot's Map");
settings.CurrentDefaultParent = "E_Monty Golf";
settings.Add("FlashBeacon", false, "Fazcam");
settings.Add("FlashlightUpgrade_1", false, "Flashlight Upgrade");
settings.Add("MazerciseTicket", false, "Mazercise Pass");
settings.Add("MontyClaws_C", false, "Monty's Claws");
settings.CurrentDefaultParent = "E_Rockstar Row";
settings.Add("Fazwatch", false);
settings.Add("PartyPassChicaRoom", false, "Party Pass");
settings.Add("PhotoPass", false, "Photo Pass");
settings.CurrentDefaultParent = "E_Roxy Raceway";
settings.Add("DamagedHead", false,"Damaged Head");
settings.Add("DancePass", false, "Dance Pass");
settings.Add("FreddyUpgrade_2", false, "Freddy Upgrade");
settings.Add("GregoryUpgrade_Stamina_1", false, "Roxy Fizzy Faz");
settings.Add("RoxyEyes_C", false, "Roxy's Eyes");
settings.CurrentDefaultParent = "E_Roxy Salon";
settings.Add("GregoryUpgrade_Shoes", false, "Shoes");
settings.CurrentDefaultParent = "E_Sewers";
settings.Add("Chica's Voicebox", false);
settings.CurrentDefaultParent = "E_Utility Tunnels";
settings.Add("UtilityHallwayMap", false, "Mapbot's Map");
settings.Add("Pizzaplex Cameras", false);
settings.CurrentDefaultParent = "E_West Arcade";
settings.Add("Repaired Head", false);
settings.CurrentDefaultParent = "Message Bags";
settings.Add("LilMusicMan1", false, "AC Inspection");
settings.Add("StaffParty2", false, "All Staff Meeting");
settings.Add("ArcadeGlitches3", false, "AR-CADE MAINT LOG");
settings.Add("ArcadeGlitches8", false, "ARCADE CONSPIRACY");
settings.Add("ArcadeGlitches1", false, "BBW MAINT LOG");
settings.Add("MontyBoss2", false, "BEHIND THE MAZE");
settings.Add("RayMessage", false, "BETTER EMPLOYEES");
settings.Add("ArcadeGlitches2", false, "CFF MAINT LOG");
settings.Add("RoxyBoss1", false, "Chasing Cars");
settings.Add("ChicaBoss4", false, "CHICA REPORT");
settings.Add("ChicaVoiceBox_M", false, "CHICA UPGRADE");
settings.Add("RoxyEyes_M", false, "ROXY UPGRADE");
settings.Add("MontyClaws_M", false, "MONTY UPGRADE");
settings.Add("ChicaBoss3", false, "COMPACTOR INSTRUCTIONS");
settings.Add("StaminaBoosters", false, "Drink Fizzy Faz!!!");
settings.Add("UpgradeMachine1", false, "Easy Money");
settings.Add("911Call", false, "False Alarm");
settings.Add("KitchenStaffNote", false, "Food Storage");
settings.Add("Complaint2", false, "HI DAVE");
settings.Add("ChicaBoss1", false, "Hide the Mix");
settings.Add("Complaint3", false, "IT IS HAPPENING AGAIN");
settings.Add("MontyBoss3", false, "Job Security");
settings.Add("Vanessa2", false, "MARKED FOR DELETION");
settings.Add("BonnieMissing3", false, "MISSING");
settings.Add("MontyBoss4", false, "Monty Mischief");
settings.Add("NightShift", false, "NIGHT SHIFT");
settings.Add("NightTerrors", false, "Night Terrors");
settings.Add("FlashCam", false, "No Flash Photography");
settings.Add("Vanessa1", false, "NO QUESTIONS ASKED");
settings.Add("Sinkhole3", false, "OLD ELEVATOR");
settings.Add("ArcadeGlitches6", false, "OUT OF ORDER");
settings.Add("Freddy1", false, "Party Foul");
settings.Add("Staff1", false, "PINK SLIP");
settings.Add("Sinkhole2", false, "POWER DRAIN");
settings.Add("ArcadeGlitches4", false, "PQ1 MAINT LOG");
settings.Add("ArcadeGlitches5", false, "PQ2 MAINT LOG");
settings.Add("StaffParty1", false, "QUESTION");
settings.Add("BonnieMissing2", false, "Re-Theme");
settings.Add("Complaint1", false, "RECYCLED PIZZA?");
settings.Add("ArcadeGlitches7", false, "RED FLAG");
settings.Add("ChicaBoss2", false, "SAFETY CHECK");
settings.Add("Sinkhole1", false, "SINKHOLE");
settings.Add("RoxyBoss2", false, "SORE WINNER");
settings.Add("LilMusicMan2", false, "Stolen Property");
settings.Add("RoxyBoss3", false, "TEST DRIVERS WANTED");
settings.Add("MontyBoss1", false, "THE ANSWER");
settings.Add("TornPaper", false, "TORN PAPER");
settings.Add("DJMM", false, "ULTIMATE PARTY HOST");
settings.Add("BonnieMissing1", false, "Understudy");
settings.CurrentDefaultParent = "Special Collectibles";
settings.Add("c_magnet_chica", false, "Chica Magnet (West Arcade/Chica's Cakes)");
settings.CurrentDefaultParent = "Retro CDs";
settings.Add("RetroCDCollectible_9", false, "Backstage Podium");
settings.Add("RetroCDCollectible_8", false, "Bonnie Bowl");
settings.Add("RetroCDCollectible_3", false, "Chica's Bakery");
settings.Add("RetroCDCollectible_15", false, "West Atrium Stage");
settings.Add("RetroCDCollectible_7", false, "Fazerblast");
settings.Add("RetroCDCollectible_4", false, "Kid's Cove");
settings.Add("RetroCDCollectible_10", false, "Main Atrium");
settings.Add("RetroCDCollectible_14", false, "Mazercise");
settings.Add("RetroCDCollectible_13", false, "Monty Golf");
settings.Add("RetroCDCollectible_1", false, "Rockstar Row Foxy");
settings.Add("RetroCDCollectible_11", false, "Rockstar Row Helpy");
settings.Add("RetroCDCollectible_12", false, "Roxy Raceway");
settings.Add("RetroCDCollectible_5", false, "Roxy Salon");
settings.Add("RetroCDCollectible_2", false, "Utility Tunnels Couch");
settings.Add("RetroCDCollectible_6", false, "Utility Tunnels Foxy Plush");
settings.Add("RetroCDCollectible_16", false, "West Arcade");
settings.CurrentDefaultParent = "Security Badges";
settings.Add("Security Badge 1", false);
settings.Add("Security Badge 2", false);
settings.Add("Security Badge 3", false);
settings.Add("Security Badge 4", false);
settings.Add("Security Badge 5", false);
settings.Add("Security Badge 6", false);
settings.Add("Security Badge 7", false);
settings.Add("Security Badge 8", false);
settings.CurrentDefaultParent = "Positional Splits";
settings.Add("P_Bonnie Bowl", false, "Bonnie Bowl");
settings.Add("P_Daycare", false, "Daycare");
settings.Add("P_El Chips", false, "El Chips");
settings.Add("P_Fazerblast", false, "Fazerblast");
settings.Add("P_Fazerblast Sublobby", false, "Fazerblast Sublobby");
settings.Add("P_Underground Afton Cave", false, "Underground Afton Cave");
settings.Add("P_Utility Tunnels", false, "Utility Tunnels");
settings.Add("P_West Arcade", false, "West Arcade");
settings.CurrentDefaultParent = "P_Bonnie Bowl";
settings.Add("Enter Bonnie Bowl", false);
settings.CurrentDefaultParent = "P_Daycare";
settings.Add("Enter Daycare", false);
settings.CurrentDefaultParent = "P_El Chips";
settings.Add("Enter El Chips", false);
settings.CurrentDefaultParent = "P_Fazerblast";
settings.Add("Fazerblast Spiral Stairs", false);
settings.CurrentDefaultParent = "P_Fazerblast Sublobby";
settings.Add("Rail Outside Fazerblast", false);
settings.CurrentDefaultParent = "P_Underground Afton Cave";
settings.Add("Exit Afton Elevator", false);
settings.CurrentDefaultParent = "P_Utility Tunnels";
settings.Add("First Aid Vanessa Cutscene", false);
settings.Add("Freddy Rail Jump", false);
settings.Add("Monty Chase", false);
settings.Add("STR-ATR-W Stairs", false);
settings.Add("STR-LB Stairs", false);
settings.CurrentDefaultParent = "P_West Arcade";
settings.Add("Enter West Arcade", false);
settings.Add("Exit West Arcade", false);
settings.CurrentDefaultParent = "Time Splits";
settings.Add("Exit Vents (11:30PM)", false);
settings.Add("Freddy Recharge (11:45PM)", false);
settings.Add("Front Entrance Closure (12:00AM)", false);
settings.Add("Enter Daycare (12:30AM)", false);
settings.Add("Daycare Nighttime (12:55AM)", false);
settings.Add("Daycare Vanny Cutscene (1:00AM)", false);
settings.Add("Mini Music Man Chase (1:15AM)", false);
settings.Add("Pizzabot (1:30AM)", false);
settings.Add("White Woman Abduction (2:00AM)", false);
settings.Add("Dead Fred (2:15AM)", false);
settings.Add("Backstage Pass (2:30AM)", false);
settings.Add("Use Showtime Disk (2:45AM)", false);
settings.Add("Freddy Abduction Recharge (3:00AM)", false);
settings.Add("Vanessa Repair Cutscene (3:15AM)", false);
settings.Add("Freddy Power Upgrade (3:30AM)", false);
settings.Add("Party Pass Recharge (4:00AM)", false);
settings.Add("Golden Fazerblaster (4:15AM)", false);
settings.Add("Monty Mix / Mazercise Key (4:30AM)", false);
settings.Add("Leave Sewers (4:40AM)", false);
settings.Add("Freddy Upgrade Recharge (5:00AM)", false);
settings.Add("Damaged Head (5:15AM)", false);
settings.Add("Repaired Head (5:30AM)", false);
settings.Add("Finish Roxy Sequence (5:40AM)", false);
settings.Add("Freddy Eye Upgrade Nighttime (5:50AM)", false);
settings.Add("Reach Exit Door (6:00AM)", false);
settings.CurrentDefaultParent = "In-Game Time Settings";
settings.Add("Elevator Pauses", true);
settings.Add("Stop Timer On Menu", true);
settings.Add("Stop Timer When Loading", true);
settings.Add("Stop Timer When Paused", true);
settings.CurrentDefaultParent = null;
settings.Add("Reset Settings", false);
settings.CurrentDefaultParent = "Reset Settings";
settings.Add("Reset On New Game", false);
settings.CurrentDefaultParent = null;
settings.Add("Unsupported version warning", true);
}
init {
#region Set version (and a few variables)
//Sets the version of the game upon startup
int gameSize = modules.First().ModuleMemorySize;
refreshRate = 60;
switch (gameSize){
default: {
vars.version = 100; // Unsupported
if (!settings["Unsupported version warning"]) break;
MessageBox.Show("Sorry, it seems like the version of Security Breach that you're using isn't currently fully supported! Splits may not work with this version of Security Breach currently.\n\n"+
"If this seems like a mistake, or you would like to suggest an additional version to support, please go to https://forms.gle/jxidK6RFToEXzUDe7 or contact either daltone_21 or nintendude_sr on Discord.\n\n"+
"Below is the 'gameSize' variable. Please include this when contacting about the issue.\n"+
"gameSize = 0x"+gameSize.ToString("X")+"\n\n"+
"Sorry for the inconvenience.", "Warning: Version Not Supported", MessageBoxButtons.OK, MessageBoxIcon.Warning).ToString();
print(gameSize.ToString("X"));
break;
}
case 0x48AE000: vars.version = 1.04; break;
case 0x48AF000: vars.version = 1.05; break;
case 0x48B0000: vars.version = 1.07; break;
case 0x48B8000: vars.version = 1.11; break;
case 0x5435000: vars.version = 1.14; break;
}
print("Version = " + vars.version);
const int CLASS_OFFSET = 0x10;
const int CHILD_OFFSET = 0x50;
const int NEXT_OFFSET = 0x20;
const int NAME_OFFSET = 0x28;
const int INTERNAL_OFFSET = 0x4C;
const int SUPERFIELD_OFFSET = 0x40;
vars.offsets = new Dictionary<string, int>();
vars.fnames = new Dictionary<long, string>();
vars.interactibleName = "";
vars.cachedPos = new Vector3f();
vars.foundLeave = false;
vars.aftonButtons = 0;
#endregion
#region Declare functions
#region Sigscan adjacent/Unreal Engine introspection related funcs
//Credit to Micrologist and Meta for this func, found in the Stray autosplitter
vars.GetStaticPointerFromSig = (Func<string, int, IntPtr>) ( (signature, instructionOffset) => {
var scanner = new SignatureScanner(game, modules.First().BaseAddress, (int)modules.First().ModuleMemorySize);
var pattern = new SigScanTarget(signature);
var location = scanner.Scan(pattern);
if (location == IntPtr.Zero) return IntPtr.Zero;
int offset = game.ReadValue<int>((IntPtr)location + instructionOffset);
return (IntPtr)location + offset + instructionOffset + 0x4;
});
//Credit to Micrologist and Meta for this func, found in the Stray autosplitter
vars.GetNameFromFName = (Func<long, string>) ( longKey => {
if (vars.fnames.ContainsKey(longKey)) return vars.fnames[longKey];
int key = (int)(longKey & uint.MaxValue);
int partial = (int)(longKey >> 32);
int chunkOffset = key >> 16;
int nameOffset = (ushort)key;
IntPtr namePoolChunk = memory.ReadValue<IntPtr>((IntPtr)vars.FNamePool + (chunkOffset+2) * 0x8);
Int16 nameEntry = game.ReadValue<Int16>((IntPtr)namePoolChunk + 2 * nameOffset);
int nameLength = nameEntry >> 6;
string output = game.ReadString((IntPtr)namePoolChunk + 2 * nameOffset + 2, nameLength);
string outputParsed = (partial == 0) ? output : output + "_" + partial.ToString();
vars.fnames[longKey] = outputParsed;
return outputParsed;
});
//Credit to apple1417 for this function, not sure where else it was used but I found it in their Borderlands 3 ASL
vars.GetPropertyOffset = (Func<IntPtr, string, IntPtr>) ((address, name) => {
var _class = game.ReadPointer(address + CLASS_OFFSET);
for (
;
_class != IntPtr.Zero;
_class = game.ReadPointer(_class + SUPERFIELD_OFFSET)
){
for (IntPtr property = game.ReadPointer(_class + CHILD_OFFSET);
property != IntPtr.Zero;
property = game.ReadPointer(property + NEXT_OFFSET)
){
string propName = vars.GetNameFromFName(game.ReadValue<long>(property + NAME_OFFSET));
if (propName == name){
int offset = game.ReadValue<int>(property + INTERNAL_OFFSET);
print("Found property \""
+ name
+ "\" at offset 0x"
+ offset.ToString("X")
);
vars.offsets[name] = offset;
return property;
}
}
}
print("Couldn't find property \""+name+"\".");
return IntPtr.Zero;
});
#endregion
#region Player state related funcs
vars.checkSphereNoBool = (Func<Vector3f, bool>)((pos)
=> vars.watchers["pos"].Current.Distance(pos) < 300f);
vars.checkItem = (Func<string, Vector3f, bool>)((name, item)
=> settings[name] && vars.checkSphereNoBool(item));
vars.checkBoxNoBool = (Func<Vector3f, Vector3f, bool>)((point1, point2) => {
/* This first section is just to allow you to pick any two points directly opposite each other
on a cuboid and still allow for the rest of the code to work, it's really just for convenience's sake*/
// Calculate which X/Y/Z is the lower of the two points, and set the upper/lower bound point along that axis accordingly
Vector3f LB = new Vector3f(Math.Min(point1.X, point2.X), Math.Min(point1.Y, point2.Y), Math.Min(point1.Z, point2.Z));
Vector3f UB = new Vector3f(Math.Max(point1.X, point2.X), Math.Max(point1.Y, point2.Y), Math.Max(point1.Z, point2.Z));
// Actually calculate if you are in the bounds of the defined cuboid
// Includes a check to see if you've already completed this split (uses HashSet<string>, initialized in startup{})
if (LB.X <= vars.watchers["pos"].Current.X && vars.watchers["pos"].Current.X <= UB.X
&& LB.Y <= vars.watchers["pos"].Current.Y && vars.watchers["pos"].Current.Y <= UB.Y
&& LB.Z <= vars.watchers["pos"].Current.Z && vars.watchers["pos"].Current.Z <= UB.Z){
return true;
}
return false;
});
vars.checkBox = (Func<string, Vector3f, Vector3f, bool>)((name, point1, point2)
=> settings[name] && vars.checkBoxNoBool(point1, point2) && vars.CompletedSplits.Add(name));
vars.checkOldBoxNoBool = (Func<Vector3f, Vector3f, bool>)((point1, point2) => {
/* This first section is just to allow you to pick any two points directly opposite each other
on a cuboid and still allow for the rest of the code to work, it's really just for convenience's sake*/
// Calculate which X/Y/Z is the lower of the two points, and set the upper/lower bound point along that axis accordingly
Vector3f LB = new Vector3f(Math.Min(point1.X, point2.X), Math.Min(point1.Y, point2.Y), Math.Min(point1.Z, point2.Z));
Vector3f UB = new Vector3f(Math.Max(point1.X, point2.X), Math.Max(point1.Y, point2.Y), Math.Max(point1.Z, point2.Z));
//Checks to see if the old position is outside a cuboid
if (LB.X <= vars.watchers["pos"].Old.X && vars.watchers["pos"].Old.X <= UB.X
&& LB.Y <= vars.watchers["pos"].Old.Y && vars.watchers["pos"].Old.Y <= UB.Y
&& LB.Z <= vars.watchers["pos"].Old.Z && vars.watchers["pos"].Old.Z <= UB.Z){
return true;
}
return false;
});
vars.checkElevs = (Func<bool>)(()
=> vars.checkBoxNoBool(new Vector3f(24192, 49679, 360), new Vector3f(23814, 50161, 752)) //Afton
|| vars.checkBoxNoBool(new Vector3f(328, 27856, 1421),new Vector3f(759, 27381, 1819)) //Kitchen (atrium)
|| vars.checkBoxNoBool(new Vector3f(328, 27856, -10), new Vector3f(759, 27381, 408)) //Kitchen (kitchen)
|| vars.checkBoxNoBool(new Vector3f(-11670, 40159, 1461),new Vector3f(-12176, 40711, 1816)) //Monty Golf (atrium)
|| vars.checkBoxNoBool(new Vector3f(-14204, 42656, 1474),new Vector3f(-14759, 43240, 1847)) //Monty Golf (monty golf)
|| vars.checkBoxNoBool(new Vector3f(-2669, 28897, 2038),new Vector3f(-2108, 28359, 2408)) //Atrium/Lobby (left side from atrium pov)
|| vars.checkBoxNoBool(new Vector3f(-1295, 28903, 2038),new Vector3f(-738, 28369, 2408)) //Atrium/Lobby 2.0 (right side from atrium pov)
|| vars.checkBoxNoBool(new Vector3f(5446, 37421, 3212),new Vector3f(5975, 36909, 3598)) //Bonnie Bowl
|| vars.checkBoxNoBool(new Vector3f(7725, 34759, 1450),new Vector3f(8232, 34243, 1819)) //Fazerblast
|| vars.checkBoxNoBool(new Vector3f(4289, 29381, 3289),new Vector3f(5530, 30187, 3555)) //West Arcade (atrium)
|| vars.checkBoxNoBool(new Vector3f(5699, 28832, 2036),new Vector3f(4640, 28066, 2407)) //West Arcade (west arcade)
|| vars.checkBoxNoBool(new Vector3f(-5071, 52079, 1911),new Vector3f(-5584, 52281,-1160)) //Chica Room (both encompassed in big box, same for next 3)
|| vars.checkBoxNoBool(new Vector3f(-2812, 53483, 1683),new Vector3f(-1937, 52803,-1160)) //Monty Room
|| vars.checkBoxNoBool(new Vector3f(-370, 52814, 1920),new Vector3f(-1155, 53030,-1193)) //Roxy Room
|| vars.checkBoxNoBool(new Vector3f(2348, 52554, 1870),new Vector3f(2073, 52156,-1179)) //Freddy Room
);
vars.checkPQPositionNoBool = (Func<double, double, double, double, bool>)((xLB, xUB, yLB, yUB)
=> xLB <= vars.watchers["pos"].Current.Y && vars.watchers["pos"].Current.Y <= xUB
&& yLB <= vars.watchers["pos"].Current.X && vars.watchers["pos"].Current.X <= yUB);
vars.checkPQPosition = (Func<string, double, double, double, double, bool>)((name, xLB, xUB, yLB, yUB)
=> settings[name]
&& vars.checkPQPositionNoBool(xLB, xUB, yLB, yUB)
&& vars.CompletedSplits.Add(name));
//checks in a circle (radius 200), upper and lower Z bound used
vars.checkGen = (Func<string, float, float, float, float, bool>)((name, x, y, zLower, zUpper) => {
if (!settings[name]
|| zLower > vars.watchers["pos"].Current.Z || vars.watchers["pos"].Current.Z > zUpper) return false;
Vector3f oPos = vars.watchers["pos"].Old, cPos = vars.watchers["pos"].Current, target = new Vector3f(x, y, 0);
return ((oPos.DistanceXY(target) <= 200f && cPos.DistanceXY(target) > 200f) && vars.CompletedSplits.Add(name));
});
vars.checkTimeNoBool = (Func<int, int, bool>)((hour, minute)
=> vars.getHour() == hour && vars.getMinute() == minute);
vars.checkTime = (Func<string, int, int, bool>)((name, hour, minute)
=> settings[name]
&& vars.checkTimeNoBool(hour, minute)
&& vars.CompletedSplits.Add(name));
#endregion
#region Miscellaneous functions
vars.getHour = (Func<int>)(() => {
if (vars.watchers["clockTime"].Current < 0){
return -1;
}
return (int)vars.watchers["clockTime"].Current/3600;
});
vars.getOldHour = (Func<int>)(() => {
if (vars.watchers["clockTime"].Old < 0){
return -1;
}
return (int)vars.watchers["clockTime"].Old/3600;
});
vars.getMinute = (Func<int>)(() => {
if ((int)vars.watchers["clockTime"].Current%3600/60 < 0){
return 60+(int)vars.watchers["clockTime"].Current%3600/60;
}
return (int)vars.watchers["clockTime"].Current%3600/60;
});
vars.getOldMinute = (Func<int>)(() => {
if ((int)vars.watchers["clockTime"].Old%3600/60 < 0){
return 60+(int)vars.watchers["clockTime"].Old%3600/60;
}
return (int)vars.watchers["clockTime"].Old%3600/60;
});
vars.conditionalFindProperty = (Action<IntPtr, string>)((address, name) => {
if (!vars.offsets.ContainsKey(name)) vars.GetPropertyOffset(address, name);
});
vars.cacheCurrentPos = (Action)(()
=> vars.cachedPos = new Vector3f(vars.watchers["pos"].Current.X, vars.watchers["pos"].Current.Y, vars.watchers["pos"].Current.Z));
vars.findLeave = (Func<bool>)(() => {
if (!vars.foundLeave){
if (!vars.offsets.ContainsKey("FinalChoice")){
print("Finding 'FinalChoice;'");
if (vars.GetPropertyOffset(vars.watchers[2].Current, "FinalChoice") == IntPtr.Zero){
return false;
}
}
IntPtr finalChoice = game.ReadPointer((IntPtr)vars.watchers[2].Current + (int)vars.offsets["FinalChoice"]);
if (!vars.offsets.ContainsKey("Leave")){
print("Finding 'Leave';");
if (vars.GetPropertyOffset(finalChoice, "Leave") == IntPtr.Zero){
return false;
}
}
vars.foundLeave = true;
}
if (vars.watchers[3].Current.GetType() != typeof(int)){
vars.watchers[3] = new MemoryWatcher<int>(new DeepPointer(vars.watchers[2].Current + vars.offsets["FinalChoice"], vars.offsets["Leave"])){
Name = "leaveButton" , FailAction = MemoryWatcher.ReadFailAction.SetZeroOrNull
};
}
return true;
});
vars.checkLeave = (Func<bool>)(()
=> (int)vars.watchers["leaveButton"].Current == 0 && (int)vars.watchers["leaveButton"].Old != 0
&& vars.watchers["worldCheck"].Current != 0);
vars.resetVariables = (Action)(() => {
//These 2 watchers are addresses which change while the game is running, and which change depending on what the player is interacting with.
//Make sure they are not garbage data when reading.
vars.interactibleName = "";
vars.watchers[0] = new MemoryWatcher<bool>((IntPtr)null){ Name = "lastInteractible" , FailAction = MemoryWatcher.ReadFailAction.SetZeroOrNull };
vars.watchers[1] = new MemoryWatcher<bool>((IntPtr)null){ Name = "canCollect" , FailAction = MemoryWatcher.ReadFailAction.SetZeroOrNull };
vars.montyBalls = 0;
vars.fbFlags = 0;
vars.aftonButtons = 0;
//Used to keep certain splits from repeating (reset)
vars.CompletedSplits.Clear();
//Arcade Splits
vars.arcade = "N/A";
//monty golf
vars.nHole = 0;
//pq2
vars.pq2_8 = false;
vars.onMenu = false;
});
vars.printCompletedSplits = (Action)(() => {
foreach (string str in vars.CompletedSplits){
print(str);
}
});
//Credit to KunoDemetries for this func, originated from the Poppy Playtime: Chapter 2 ASL
vars.SetTextComponent = (Action<string, string>)((id, text) => {
var textSettings = timer.Layout.Components.Where(x => x.GetType().Name == "TextComponent").Select(x => x.GetType().GetProperty("Settings").GetValue(x, null));
var textSetting = textSettings.FirstOrDefault(x => (x.GetType().GetProperty("Text1").GetValue(x, null) as string) == id);
if (textSetting == null) {
var textComponentAssembly = Assembly.LoadFrom("Components\\LiveSplit.Text.dll");
var textComponent = Activator.CreateInstance(textComponentAssembly.GetType("LiveSplit.UI.Components.TextComponent"), timer);
timer.Layout.LayoutComponents.Add(new LiveSplit.UI.Components.LayoutComponent("LiveSplit.Text.dll", textComponent as LiveSplit.UI.Components.IComponent));
textSetting = textComponent.GetType().GetProperty("Settings", BindingFlags.Instance | BindingFlags.Public).GetValue(textComponent, null);
textSetting.GetType().GetProperty("Text1").SetValue(textSetting, id);
}
if (textSetting != null)
textSetting.GetType().GetProperty("Text2").SetValue(textSetting, text);
});
#endregion
#endregion
#region Sigscanning
// FNamePool's base address doesn't get accessed at all (for some reason) but it's base address + 8 does
// Because of this, you can just sigscan for the base address + 8 and then subtract the 8 to get the real pointer
vars.FNamePool = vars.GetStaticPointerFromSig("8B 05 ??????03" //mov eax, [badFNamePool]
+"FF C0" //inc eax
+"C1 E9 10" //shr ecx,10
+"3B C8" //cmp ecx,eax
+"0F92 C0" //setb al
+"C3 CC" //ret
, 2)
-8;
vars.UWorld = vars.GetStaticPointerFromSig("E8 ????????" //call ????????
+"48 8B 88 ??0?0000" //mov rcx,[rax+???]
+"48 89 0D ??????02" //mov [UWorld],rcx
, 15);
vars.GEngine = vars.GetStaticPointerFromSig("48 8B 05 ????????" //mov rax,[GEngine]
+"48 8B D1" //mov rdx,rcx
+"48 8B 88 F80A0000" //mov rcx,[rax+AF8]
+"48 85 C9" //test rcx,rcx
+"74 07" //je
+"48 8B 01" //mov rax,[rcx]
+"48 FF 60 40" //jmp qword ptr [rax+40]
, 3);
vars.isLoading = vars.GetStaticPointerFromSig("48 2B E1" //sub rsp,rcx
+"C7 45 ?? FFFFFFFF" //mov [rbp+??],FFFFFFFF
+"44 8B F7" //mov r14d,edi
+"0FB6 3D ??????0?" //movzx edi,byte ptr [isLoading]
, 16);
if (vars.UWorld == IntPtr.Zero || vars.GEngine == IntPtr.Zero || vars.FNamePool == IntPtr.Zero || vars.isLoading == IntPtr.Zero){
throw new Exception("UWorld/GameEngine/FNamePool not initialized - trying again");
}
vars.GetPropertyOffset(game.ReadPointer((IntPtr)vars.GEngine), "GameInstance");
vars.GetPropertyOffset(game.ReadPointer((IntPtr)vars.GEngine), "TransitionType");
vars.GetPropertyOffset(game.ReadPointer((IntPtr)vars.UWorld), "AuthorityGameMode");
if (vars.version < 1.11){
vars.freddyThing = new DeepPointer(vars.UWorld, 0x188, 0xE0, 0x38, 0xB8);
vars.clockTime = new DeepPointer(vars.GEngine, vars.offsets["GameInstance"], 0xE0, 0x80, 0xC4);
}
else if (vars.version == 1.11){
vars.freddyThing = new DeepPointer(vars.UWorld, vars.offsets["AuthorityGameMode"], 0x310, 0x120, 0x18C);
vars.clockTime = new DeepPointer(vars.GEngine, vars.offsets["GameInstance"], 0xE0, 0x80, 0xC4);
}
else {
vars.freddyThing = new DeepPointer(vars.UWorld, vars.offsets["AuthorityGameMode"], 0x310, 0x120, 0x18C);
vars.clockTime = new DeepPointer(vars.GEngine, vars.offsets["GameInstance"], 0xF0, 0x80, 0xC4);
}
#endregion
#region Declare MemoryWatcherList
vars.watchers = new MemoryWatcherList {
//These are at the top so they will always be index 0 or 1 in this list. DO NOT CHANGE UNLESS YOU KNOW THE RAMIFICATIONS.
new MemoryWatcher<bool>((IntPtr)null) { Name = "lastInteractible" , FailAction = MemoryWatcher.ReadFailAction.SetZeroOrNull },
new MemoryWatcher<int>((IntPtr)null) { Name = "canCollect" , FailAction = MemoryWatcher.ReadFailAction.SetZeroOrNull },
new MemoryWatcher<IntPtr>(new DeepPointer(vars.UWorld, vars.offsets["AuthorityGameMode"], 0x318, 0x4E0, 0xE8, 0x0)) { Name = "leaveThing" , FailAction = MemoryWatcher.ReadFailAction.SetZeroOrNull },
new MemoryWatcher<bool>((IntPtr)null) { Name = "leaveButton" , FailAction = MemoryWatcher.ReadFailAction.SetZeroOrNull },
//Freddy's Power OR Freddy Thingie (1.11+)
new MemoryWatcher<int>(vars.freddyThing) { Name = "freddyThing" , FailAction = MemoryWatcher.ReadFailAction.SetZeroOrNull },
//Player Info
//GEngine.GameInstance.LocalPlayers[0].PlayerController.Pawn.CollisionComponent.Position[0x1D0]
new MemoryWatcher<Vector3f>(new DeepPointer(vars.GEngine, vars.offsets["GameInstance"], 0x38, 0x0, 0x30, 0x258, 0x298, 0x1D0)) { Name = "pos" , FailAction = MemoryWatcher.ReadFailAction.SetZeroOrNull },
new MemoryWatcher<float>(new DeepPointer(vars.GEngine, vars.offsets["GameInstance"], 0x38, 0x0, 0x30, 0x268, 0x298, 0x1D4)) { Name = "worldCheck", FailAction = MemoryWatcher.ReadFailAction.SetZeroOrNull },
//Arcade pointers
new MemoryWatcher<int>(new DeepPointer(vars.UWorld, vars.offsets["AuthorityGameMode"], 0x378, 0x270, 0x230, 0x40)) { Name = "golfStrokeCount" , FailAction = MemoryWatcher.ReadFailAction.SetZeroOrNull },
new MemoryWatcher<bool>(new DeepPointer(vars.GEngine, vars.offsets["GameInstance"], 0x38, 0x0, 0x30, 0x258, 0x3F9)) { Name = "pq3Attack" , FailAction = MemoryWatcher.ReadFailAction.SetZeroOrNull },
//Counter pointers
new MemoryWatcher<int>(new DeepPointer(vars.UWorld, 0x98, 0x40, 0x128, 0xA8, 0x580, 0x290, 0x14)) { Name = "DGens" , FailAction = MemoryWatcher.ReadFailAction.SetZeroOrNull },
//Keeps track of items
new MemoryWatcher<int>(new DeepPointer(vars.UWorld, 0x188, 0xE0, 0x38, 0xC0)) { Name = "securityBadgeCount" },
new MemoryWatcher<int>(new DeepPointer(vars.UWorld, 0x188, 0xE0, 0x38, 0x138)) { Name = "itemCount" , FailAction = MemoryWatcher.ReadFailAction.SetZeroOrNull },
new MemoryWatcher<int>(new DeepPointer(vars.UWorld, 0x98, 0x8A0, 0x128, 0xB8, 0x128, 0x328, 0x3C8)) { Name = "splashScreen" , FailAction = MemoryWatcher.ReadFailAction.SetZeroOrNull },
//In-Game Clock (keeps track of time in seconds, you need to do math to figure out hour & minute)
new MemoryWatcher<float>(vars.clockTime) { Name = "clockTime" , FailAction = MemoryWatcher.ReadFailAction.SetZeroOrNull },
//Used to pause the timer
new MemoryWatcher<bool>(new DeepPointer(vars.GEngine, vars.offsets["TransitionType"])) { Name = "pause" , FailAction = MemoryWatcher.ReadFailAction.SetZeroOrNull },
new MemoryWatcher<int>(new DeepPointer(vars.UWorld, vars.offsets["AuthorityGameMode"], 0x1A8, 0x20, 0x100, 0xA0, 0x228)) { Name = "menu", FailAction = MemoryWatcher.ReadFailAction.SetZeroOrNull },
new MemoryWatcher<bool>(vars.isLoading) { Name = "isLoading" , FailAction = MemoryWatcher.ReadFailAction.SetZeroOrNull },
//Experimental elevator fix that only requires 3 pointers (instead of 12)
//UWorld.AuthorityGameMode.GregoryPawn.PlayerInteractComponent.ClosestInteractible
new MemoryWatcher<IntPtr>(new DeepPointer(vars.UWorld, vars.offsets["AuthorityGameMode"], 0x318, 0x4E0, 0xC8)) { Name = "closestInteractibleAddress" , FailAction = MemoryWatcher.ReadFailAction.SetZeroOrNull },
//UWorld.AuthorityGameMode.GregoryPawn.PlayerInteractComponent.ClosestInteractible.Name
new MemoryWatcher<long>(new DeepPointer(vars.UWorld, vars.offsets["AuthorityGameMode"], 0x318, 0x4E0, 0xC8, 0x18)) { Name = "closestInteractibleFName" , FailAction = MemoryWatcher.ReadFailAction.SetZeroOrNull },