-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMusinessBanagersource.lua
2138 lines (1846 loc) · 94.4 KB
/
MusinessBanagersource.lua
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
--[[ https://imgur.com/a/kchuhXW
Credits:
- https://www.unknowncheats.me/forum/3337151-post1560.html <3 boredom1234
Script created by ICYPhoenix#0727 and Ren#5219
]]
--util.require_natives(1651208000)
local IS_RELEASE_VERSION <const> = false
local IS_BETA_VERSION <const> = false
local IGNORE_VERSION_DIFFERENCE <const> = false
local THIS_RELEASE_VERSION <const> = "1.0.0"
local STAND_RESOURCE_DIR = filesystem.resources_dir()
local MB_RESOUCES_DIR = STAND_RESOURCE_DIR .. "Musiness Banager/"
local MB_TRANSLATIONS_DIR = MB_RESOUCES_DIR .. "Translations/"
local MBPrefix = "[MusinessBanager] "
local og_toast = util.toast
local og_log = util.log
local nullsub = function() --[[util.toast("nullsub")]] end
util.toast = function(str, flag) assert(str != nil, "No string given") if flag ~= nil then og_toast(MBPrefix .. tostring(str), flag) else og_toast(MBPrefix .. tostring(str)) end end
util.log = function(str) assert(str != nil, "No string given") og_log(MBPrefix .. tostring(str)) end
util.yield_x = function(int) for i = 1, int do util.yield_once() end end -- yields x amount of ticks
local menu, players, entities, directx, util, v3, lang, filesystem, async_http, memory = menu, players, entities, directx, util, v3, lang, filesystem, async_http, memory
--#region natives
-- regex for removing comments in the native arguments: --\[\[(?:(?:\w)|(?:\d)|\*)*(?: \((?:(?:\w)|(?:\d)|\*)*\))*\]\]
-- regex for finding natives in the script that have not yet been converted to local-natives: [A-Z][A-Z][A-Z]\.(?:_|[A-Z][A-Z][A-Z][A-Z][A-Z])
local nv = native_invoker
local ENTITY_SET_ENTITY_COORDS_NO_OFFSET = function(entity,xPos,yPos,zPos,xAxis,yAxis,zAxis)nv.begin_call();nv.push_arg_int(entity);nv.push_arg_float(xPos);nv.push_arg_float(yPos);nv.push_arg_float(zPos);nv.push_arg_bool(xAxis);nv.push_arg_bool(yAxis);nv.push_arg_bool(zAxis);nv.end_call("239A3351AC1DA385");end
local ENTITY_GET_ENTITY_COORDS = function(entity,alive)nv.begin_call();nv.push_arg_int(entity);nv.push_arg_bool(alive);nv.end_call("3FEF770D40960D5A");return nv.get_return_value_vector3();end
local ENTITY_FREEZE_ENTITY_POSITION = function(entity,toggle)nv.begin_call();nv.push_arg_int(entity);nv.push_arg_bool(toggle);nv.end_call("428CA6DBD1094446");end
local CAM_CREATE_CAM_WITH_PARAMS = function(camName,posX,posY,posZ,rotX,rotY,rotZ,fov,p8,p9)nv.begin_call();nv.push_arg_string(camName);nv.push_arg_float(posX);nv.push_arg_float(posY);nv.push_arg_float(posZ);nv.push_arg_float(rotX);nv.push_arg_float(rotY);nv.push_arg_float(rotZ);nv.push_arg_float(fov);nv.push_arg_bool(p8);nv.push_arg_int(p9);nv.end_call("B51194800B257161");return nv.get_return_value_int();end
local CAM_DESTROY_CAM = function(cam,bScriptHostCam)nv.begin_call();nv.push_arg_int(cam);nv.push_arg_bool(bScriptHostCam);nv.end_call("865908C81A2C22E9");end
local CAM_GET_FINAL_RENDERED_CAM_FOV = function()nv.begin_call();nv.end_call("80EC114669DAEFF4");return nv.get_return_value_float();end
local CAM_GET_FINAL_RENDERED_CAM_ROT = function(rotationOrder)nv.begin_call();nv.push_arg_int(rotationOrder);nv.end_call("5B4E4C817FCC2DFB");return nv.get_return_value_vector3();end
local CAM_SET_CAM_ACTIVE = function(cam,active)nv.begin_call();nv.push_arg_int(cam);nv.push_arg_bool(active);nv.end_call("026FB97D0A425F84");end
local CAM_RENDER_SCRIPT_CAMS = function(render,ease,easeTime,p3,p4,p5)nv.begin_call();nv.push_arg_bool(render);nv.push_arg_bool(ease);nv.push_arg_int(easeTime);nv.push_arg_bool(p3);nv.push_arg_bool(p4);nv.push_arg_int(p5);nv.end_call("07E5B515DB0636FC");end
local GRAPHICS_TOGGLE_PAUSED_RENDERPHASES = function(toggle)nv.begin_call();nv.push_arg_bool(toggle);nv.end_call("DFC252D8A3E15AB7");end
local GRAPHICS_DONT_RENDER_IN_GAME_UI = function(p0)nv.begin_call();nv.push_arg_bool(p0);nv.end_call("22A249A53034450A");end
local PAD_SET_CONTROL_VALUE_NEXT_FRAME = function(padIndex,control,amount)nv.begin_call();nv.push_arg_int(padIndex);nv.push_arg_int(control);nv.push_arg_float(amount);nv.end_call("E8A25867FBA3B05E");return nv.get_return_value_bool();end
local PAD_SET_CURSOR_POSITION = function(x,y)nv.begin_call();nv.push_arg_float(x);nv.push_arg_float(y);nv.end_call("FC695459D4D0E219");return nv.get_return_value_bool();end
local PLAYER_PLAYER_PED_ID = function()nv.begin_call();nv.end_call("D80958FC74E988A6");return nv.get_return_value_int();end
local SYSTEM_START_NEW_SCRIPT = function(scriptName,stackSize)nv.begin_call();nv.push_arg_string(scriptName);nv.push_arg_int(stackSize);nv.end_call("E81651AD79516E48");return nv.get_return_value_int();end
local SCRIPT_GET_NUMBER_OF_THREADS_RUNNING_THE_SCRIPT_WITH_THIS_HASH = function(scriptHash)nv.begin_call();nv.push_arg_int(scriptHash);nv.end_call("2C83A9DA6BFFC4F9");return nv.get_return_value_int();end
local SCRIPT_DOES_SCRIPT_EXIST = function(scriptName)nv.begin_call();nv.push_arg_string(scriptName);nv.end_call("FC04745FBE67C19A");return nv.get_return_value_bool();end
local SCRIPT_REQUEST_SCRIPT = function(scriptName)nv.begin_call();nv.push_arg_string(scriptName);nv.end_call("6EB5F71AA68F2E8E");end
local SCRIPT_HAS_SCRIPT_LOADED = function(scriptName)nv.begin_call();nv.push_arg_string(scriptName);nv.end_call("E6CC9F3BA0FB9EF1");return nv.get_return_value_bool();end
local SCRIPT_SET_SCRIPT_AS_NO_LONGER_NEEDED = function(scriptName)nv.begin_call();nv.push_arg_string(scriptName);nv.end_call("C90D2DCACD56184C");end
local STATS_STAT_GET_INT = function(statHash,outValue,p2)nv.begin_call();nv.push_arg_int(statHash);nv.push_arg_pointer(outValue);nv.push_arg_int(p2);nv.end_call("767FBC2AC802EF3D");return nv.get_return_value_bool();end
local STATS_STAT_SET_INT = function(statName,value,save)nv.begin_call();nv.push_arg_int(statName);nv.push_arg_int(value);nv.push_arg_bool(save);nv.end_call("B3271D7AB655B441");return nv.get_return_value_bool();end
local STATS_STAT_SET_BOOL = function(statName,value,save)native_invoker.begin_call();native_invoker.push_arg_int(statName);native_invoker.push_arg_bool(value);native_invoker.push_arg_bool(save);native_invoker.end_call("4B33C4243DE0C432");return native_invoker.get_return_value_bool();end
local STATS_STAT_GET_BOOL = function(statHash,outValue,p2)native_invoker.begin_call();native_invoker.push_arg_int(statHash);native_invoker.push_arg_pointer(outValue);native_invoker.push_arg_int(p2);native_invoker.end_call("11B5E6D2AE73F48E");return native_invoker.get_return_value_bool();end
local STATS_SET_PACKED_STAT_BOOL_CODE = function(index,value,characterSlot)native_invoker.begin_call();native_invoker.push_arg_int(index);native_invoker.push_arg_bool(value);native_invoker.push_arg_int(characterSlot);native_invoker.end_call("DB8A58AEAA67CD07");end
local STATS_GET_PACKED_STAT_BOOL_CODE = function(index,characterSlot)native_invoker.begin_call();native_invoker.push_arg_int(index);native_invoker.push_arg_int(characterSlot);native_invoker.end_call("DA7EBFC49AE3F1B0");return native_invoker.get_return_value_bool();end
local NETSHOPPING_NET_GAMESERVER_TRANSACTION_IN_PROGRESS = function()native_invoker.begin_call()native_invoker.end_call_2(0x613F125BA3BD2EB9)return native_invoker.get_return_value_bool();end
local TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME = function(scriptName)native_invoker.begin_call()native_invoker.push_arg_string(scriptName)native_invoker.end_call_2(0x9DC711BC69C548DF)end
--#endregion natives
local MenuLabels = {
BUNKER="Bunker",
BUSINESS="Business",
MCBUSINESS="MC Business",
WAREHOUSE="Warehouse",
NIGHTCLUB="Nightclub",
NIGHTCLUBSAFE="Nightclub Safe",
SPECIALCARGO="Special Cargo",
SELLMISSION="Sell Mission",
BUYMISSION="Buy Mission",
START="Start",
MONEY="Money",
STOCK="Stock",
SUPPLIES="Supplies",
CRATES="Crates",
PRODUCT="Product",
INFOOVERLAY="Info Overlay",
TERRORBYTE="Terrorbyte",
--! STOCK, SUPPLIES, PRODUCT should all be what the game calls it, or something equivalent
--! You might want to leave TERRORBYTE the same, unless the game calls it something different
HTTPGIVEUP="Failed to establish connection to remote.",
HTTPINVALID="Received an invalid response from remote! This may be due to Cloudflare or your antivirus blocking the connection. Please either establish a new VPN connection, and or switch networks.",
HTTPFAILSAFE="Activating Killswitches due to failsafe.",
SCRIPTOUTOFDATE="Script is out of date! Please restart the script to get the latest from the repository!",
KILLSWITCH_SAFELOOP="Killing Nightclub Safe AFK Money Loop due to killswitch",
KILLSWITCH_SPECIALCARGO="Killing Special Cargo due to killswitch",
KILLSWITCH_MAXSELLPRICE="Killing Max Sell Price due to killswitch",
KILLSWITCH_AUTOCOMPLETE="Killing Auto Complete due to killswitch",
TRANSACTIONSSTUCK_TOAST="It seems that your transactions are stuck. Please switch sessions or restart the game.",
BEALONE_TOAST="There are too many players in your lobby! Triggering bealone",
PREFIX_SAFELOOP="[Safe Loop] {1}",
PREFIX_SPECIALCARGO="[Special Cargo] {1}",
PREFIX_TOTALEARNED="Total Earned: {1}",
PREFIX_MOTD="MOTD: {1}",
--! {1} is a number, the amount of money earned in total.
PREFIX="{1} {2}",
--! This can be '[x1] x2' where x1 is the prefix, and x2 is the message. This might go unused though..
INFO_SCWAREHOUSE="SC Warehouse {1}: {2}/{3}",
--! {1} is slot {2} is amount {3} is capacity
INFO_HUBBUSINESS="Hub {1}: {2}/{3}",
--! {1} is name {2} is stock {3} is max capacity
INFO_NCSAFE="Nightclub Safe $: {1}",
--! {1} is value
INFO_MCBUSINESS="MC {1}: {2}% | {3}/{4}",
--! {1} is name {2} is supplies {3} is product {4} is capacity
INFO_BUNKER="Bunker: {1}% | {2}/{3}",
--! {1} is supplies {2} is product {3} is capacity
FINDSAFERWAYS="Find safer ways to make money",
FINDSAFERWAYS_DESC="Please at least read this before proceeding with the money options found below",
MAXSELLPRICE="Max Sell Price",
MAXSELLPRICE_DESC="Sell your {1} for the maximum possible price no matter how much {2} you have",
--! {1} and {2} are the same, and may be one of the following: [STOCK], [SUPPLIES], or [PRODUCT]
MONITOR="Monitor",
MONITOR_EXTRA="Monitor {1}",
MONITOR_DESC="Shows you the amount of {1} you have in your {2}, using the {3}",
--! {1} could be [STOCK], [SUPPLIES], [PRODUCT], or [MONEY] {2} could be [NIGHTCLUBSAFE], [BUSINESS], or [WAREHOUSE]. {3} is [INFOOVERLAY] for now, but could be changed in the future.
BYPASSCOOLDOWN="Bypass {1} Cooldown",
--! {1} may be one of the following: [SELLMISSION], [BUYMISSION]
BYPASSCOOLDOWN_DESC="Allows you to {1} another {2} without having to wait on a cooldown",
--! {1} is [START] for now, and {2} could be [SELLMISSION] or [BUYMISSION] for now.
SETPRODUCT="Set Product",
SETPRODUCT_DESC="Set how much product you have directly",
SETPRODUCT_TOAST="Product set.",
MAXPRODUCTALL="Max Product of All",
MAXPRODUCTALL_DESC="Sets all of your product amount to max",
MAXPRODUCTALL_TOAST="All product maxed.",
MAXPRODUCTIONSPEED="Max Production Speed",
MCMAXPRODUCTIONSPEED_DESC="Takes effect instantly",
NCMAXPRODUCTIONSPEED_DESC="Takes effect after a unit finishes producing",
MAXPRODUCTIONSPEED_TOAST="Production speed maxed.",
MAXPRODUCTIONSPEEDSLOW_TOAST="Production speed maxed. It will take effect once a good has been produced.",
MAXIMUMCAPACITY="Maximum Capacity",
MAXIMUMCAPACITY_DESC="Affects how much stock you can potentially hold",
MAXIMUMCAPACITY_TOAST="Capacity modified.",
SUPPLYPRODUCTRATIO="Supply->Product Ratio",
SUPPLYPRODUCTRATIO_DESC="Sets how much supply it takes to make one product. Lower values means better efficiency",
SUPPLYPRODUCTRATIO_TOAST="Ratio modified.",
RESUPPLY="Resupply",
RESUPPLY_DESC="Will instantly deliver supplies to your business, free of charge",
FORCERESUPPLY="Force Resupply",
FORCERESUPPLY_DESC="If automatic resupply stops working and you are *OUT* of supplies, press this once and hope that it kickstarts everything. Also try restarting your business.",
TRIGGERPRODUCTION="Trigger Production",
TRIGGERPRODUCTION_DESC="Puts production into effect immediately",
TRIGGERPRODUCTION_TOAST="Production Triggered.",
ENFORCEEASIESTMISSION="Enforce Easiest Sell Mission",
ENFORCEEASIESTMISSION_DESC="This will make sure you always get the quickest and easiest sell mission. Although, if you're too quick you may not get paid?",
SPECIALCARGOLIST_DESC="Note that sell values cap out at $6m.",
SPECIALCARGOWAREHOUSE_DESC="Select which warehouse to monitor and modify, since you can own five of them.",
SPECIALCARGOMONITOR_DESC="Displays how many special cargo crates you have in the selected warehouse",
SPECIALCARGONOWAREHOUSE="No Warehouse",
SPECIALCARGONOWAREHOUSE_DESC="You don't have a warehouse in this slot!",
SPECIALCARGOMAXSELLPRICE_DESC="Changes the sell price of your CEO's Special Cargo crates to $6m. Keep this enabled to ensure proper math on future sales",
OPENSCREEN="Open {1} Screen",
OPENSCREEN_DESC="Opens the {1} Screen",
--! {1} could be [TERRORBYTE] or [WAREHOUSE]
SELLACRATE="Press To Sell A Crate",
SELLACRATE_DESC="Automatically sells one Special Cargo Crate",
NOTINSELECTEDWAREHOUSE_TOAST="You are not at your currently selected warehouse!",
AUTOCOMPLETE="Autocomplete {1}",
AUTOCOMPLETE_DESC="Makes the {1} complete automatically",
--! {1} could be [SELLMISSION] or [BUYMISSION]
NCLIST_DESC="Note that sell values cap out at $4m.\nDO NOT attempt to 'sell all'",
NCREVENUE="Revenue",
NCREVENUE_DESC="Edits how much revenue your Nightclub gains, no matter how popular you are",
NCREVENUE_TOAST="Revenue set.",
NCMAXPOPULARITY="Max Nightclub Popularity",
NCMAXPOPULARITY_DESC="Sets your Nightclub popularity to 100%",
NCMAXPOPULARITY_TOAST="Maxed Nightclub popularity.",
NCSAFELOOP="AFK Money Loop",
NCSAFELOOP_DESC="Open your Nightclub safe before enabling this feature!\nWill allow you to passively gain $300k every ~4-5 seconds",
NCSAFELOOPDELAY="Loop Delay",
NCSAFELOOPDELAY_DESC="Will set how long the afk loop waits (in milliseconds) in between major steps",
NCSAFELOOPDELAY_TOAST="Delay modified.",
NCSAFELOOPTRANSACTIONTIMEOUT="Transaction Timeout",
NCSAFELOOPTRANSACTIONTIMEOUT_DESC="Sets how long to wait for a transaction to process before giving up",
NCSAFELOOPTIMEOUTMODIFIED_TOAST="Transaction Timeout modified.",
NCSAFELOOPSTOP="Stop Loop After $x Amount",
NCSAFELOOPSTOP_DESC="Will stop the AFK Money Loop after you earn the set amount",
NCSAFELOOPSTOP_TOAST="Limit set.",
NCRESETSAFEVALUE="Reset Safe Value",
--! Referenced in [NCSAFELOOPSAFEOVERLIMIT_TOAST]
NCRESETSAFEVALUE_DESC="If your Nightclub Safe is above $300k or below $0 then this should fix it.",
NCRESETSAFEVALUEWAIT_TOAST="Please wait while your Nightclub Safe is being reset.",
NCRESETSAFEVALUESUCCESS_TOAST="Your Nightclub Safe should be reset now.",
NCRESETSAFEVALUESKIP_TOAST="Your Nightclub Safe appears to be fine",
NCSAFELOOPMAXIMUMVALUEREACHED_TOAST="Maximum value has been reached!",
NCSAFELOOPNOTINNIGHTCLUB_TOAST="You don't appear to be in your Nightclub. Make sure you are in your Nightclub with the safe open before using this feature!",
NCSAFELOOPTIMEOUT_TOAST="Seems like you've hit transaction timeout.",
NCSAFELOOPSAFEOVERLIMIT_TOAST="Uh oh, it seems like the safe went over the limit. Use 'Reset Safe Value' then try again",
--! References [NCRESETSAFEVALUE]
NCSAFELOOPSOMETHINGWENTWRONG_TOAST="Something didn't go as it should... if you can reproduce this issue, please report it.",
MCLIST_DESC="Note that sell values cap out at $2.5m.",
BUNKERLIST_DESC="Note that sell values cap out at $2.7m.",
TELEPORTTO="Teleport to {1}",
TELEPORTTO_DESC="Teleports you to your {1}",
--! {1} may be one of the following: [PROPERTY], [WAREHOUSE], [NIGHTCLUB], or [NIGHTCLUBSAFE]
NOTINNIGHTCLUB_TOAST="You are not in your Nightclub!",
SHOWMOTDBLANK_TOAST="The MOTD is blank.",
WARNINGRISKY_TOAST="WARNING: All features in this script are considered risky! There is a chance you will get banned within an unknown number of days (bans are delayed randomly). You have been warned.",
--! Nightclub
ALREADYINPROPERTY="You are already in your {1}!",
--! {1} may be [NIGHTCLUB], [WAREHOUSE], [BUSINESS]
--! Nightclub categories
HUBCARGO="Cargo",
HUBWEED="Weed",
HUBWEAPONS="Weapons",
HUBMETH="Meth",
HUBCOCAINE="Cocaine",
HUBCASH="Cash",
HUBFORGERY="Forgery",
--! MC categories
MCFORGERY="Forgery",
MCWEED="Weed",
MCCASH="Cash",
MCMETH="Meth",
MCCOCAINE="Cocaine",
MCBUNKER="Bunker",
--! Special Cargo
SPECIALCARGONOMORECRATES="You have no more crates in your warehouse!",
SPECIALCARGONEEDCEO="You are in an MC! You need to be in a CEO.",
SPECIALCARGOMAXCRATESOURCE="Max Crate Sourcing Amount",
SPECIALCARGOMAXCRATESOURCE_DESC="Sets the amount of crates your staff will deliver",
SPECIALCARGOSETDELIVERTIME="Minimize Delivery Time",
SPECIALCARGOSETDELIVERTIME_DESC="Sets the amount of time to pass before you staff will deliver, to zero",
}
-- Register English labels now
for k, v in MenuLabels do
MenuLabels[k] = lang.register(v)
end
local MCBusinessPropertyInfo = {
[1] = {name = "Paleto Bay Meth Lab", coords = {x = 52.903, y = 6338.585, z = 31.35 }, type = 3}, -- "MP_BWH_METH_1",
[2] = {name = "Mount Chiliad Weed Farm", coords = {x = 416.7524, y = 6520.753, z = 27.7121}, type = 1}, -- "MP_BWH_WEED_1",
[3] = {name = "Paleto Bay Cocaine Lockup", coords = {x = 51.7653, y = 6486.163, z = 31.428 }, type = 4}, -- "MP_BWH_CRACK_1",
[4] = {name = "Paleto Bay Counterfeit Cash Factory", coords = {x = -413.6606, y = 6171.938, z = 31.4782}, type = 2}, -- "MP_BWH_CASH_1",
[5] = {name = "Paleto Bay Forgery Office", coords = {x = -163.6828, y = 6334.845, z = 31.5808}, type = 0}, -- "MP_BWH_FAKEID_1",
[6] = {name = "El Burro Heights Meth Lab", coords = {x = 1454.671, y = -1651.986, z = 67 }, type = 3}, -- "MP_BWH_METH_2",
[7] = {name = "Downtown Vinewood Weed Farm", coords = {x = 102.14, y = 175.26, z = 104.56 }, type = 1}, -- "MP_BWH_WEED_2",
[8] = {name = "Morningwood Cocaine Lockup", coords = {x = -1462.622, y = -381.826, z = 38.802 }, type = 4}, -- "MP_BWH_CRACK_2",
[9] = {name = "Vespucci Canals Counterfeit Cash Factory", coords = {x = -1171.005, y = -1380.922, z = 4.937 }, type = 2}, -- "MP_BWH_CASH_2",
[10] = {name = "Textile City Forgery Office", coords = {x = 299.071, y = -759.072, z = 29.333 }, type = 0}, -- "MP_BWH_FAKEID_2",
[11] = {name = "Senora Desert Meth Lab", coords = {x = 201.8909, y = 2461.782, z = 55.6885}, type = 3}, -- "MP_BWH_METH_3",
[12] = {name = "San Chianski Weed Farm", coords = {x = 2848.369, y = 4450.147, z = 48.5139}, type = 1}, -- "MP_BWH_WEED_3",
[13] = {name = "Zancudo River Cocaine Lockup", coords = {x = 387.5332, y = 3585.042, z = 33.2922}, type = 4}, -- "MP_BWH_CRACK_3",
[14] = {name = "Senora Desert Counterfeit Cash Factory", coords = {x = 636.6344, y = 2785.126, z = 42.0111}, type = 2}, -- "MP_BWH_CASH_3",
[15] = {name = "Grapeseed Forgery Office", coords = {x = 1657.066, y = 4851.732, z = 41.9882}, type = 0}, -- "MP_BWH_FAKEID_3",
[16] = {name = "Terminal Meth Lab", coords = {x = 1181.44, y = -3113.82, z = 6.03 }, type = 3}, -- "MP_BWH_METH_4",
[17] = {name = "Elysian Island Weed Farm", coords = {x = 136.973, y = -2472.795, z = 5.98 }, type = 1}, -- "MP_BWH_WEED_4",
[18] = {name = "Elysian Island Cocaine Lockup", coords = {x = -253.31, y = -2591.15, z = 5.97 }, type = 4}, -- "MP_BWH_CRACK_4",
[19] = {name = "Cypress Flats Counterfeit Cash Factory", coords = {x = 671.451, y = -2667.502, z = 6.0812 }, type = 2}, -- "MP_BWH_CASH_4",
[20] = {name = "Elysian Island Forgery Office", coords = {x = -331.52, y = -2778.97, z = 5.12 }, type = 0}, -- "MP_BWH_FAKEID_4",
[21] = {name = "Grand Senora Oilfields Bunker", coords = {x = 492.8395, y = 3014.057, z = 39.9793}, type = 5}, -- "MP_BUNKER_1",
[22] = {name = "Grand Senora Desert Bunker", coords = {x = 849.603, y = 3021.697, z = 40.3076}, type = 5}, -- "MP_BUNKER_2",
[23] = {name = "Route 68 Bunker", coords = {x = 39.5967, y = 2930.506, z = 54.8034}, type = 5}, -- "MP_BUNKER_3",
[24] = {name = "Farmhouse Bunker", coords = {x = 1572.078, y = 2226.001, z = 77.2829}, type = 5}, -- "MP_BUNKER_4",
[25] = {name = "Smoke Tree Road Bunker", coords = {x = 2110.019, y = 3326.12, z = 44.3526}, type = 5}, -- "MP_BUNKER_5",
[26] = {name = "Thomson Scrapyard Bunker", coords = {x = 2489.36, y = 3162.12, z = 48.0015}, type = 5}, -- "MP_BUNKER_6",
[27] = {name = "Grapeseed Bunker", coords = {x = 1801.273, y = 4705.483, z = 38.8253}, type = 5}, -- "MP_BUNKER_7",
[28] = {name = "Paleto Forest Bunker", coords = {x = -755.5687, y = 5943.835, z = 18.9008}, type = 5}, -- "MP_BUNKER_9",
[29] = {name = "Raton Canyon Bunker", coords = {x = -388.8392, y = 4340.109, z = 55.1741}, type = 5}, -- "MP_BUNKER_10",
[30] = {name = "Lago Zancudo Bunker", coords = {x = -3031.356, y = 3334.059, z = 9.1805 }, type = 5}, -- "MP_BUNKER_11",
[31] = {name = "Chumash Bunker", coords = {x = -3157.599, y = 1376.695, z = 15.866 }, type = 5}, -- "MP_BUNKER_12",
}
local WarehousePropertyInfo = {
[1] = {name = "Pacific Bait Storage", capacity = 16, coords = {x = 54.191, y = -2569.248, z = 6.0046 }}, -- "MP_WHOUSE_0",
[2] = {name = "White Widow Garage", capacity = 16, coords = {x = -1083.054, y = -1261.893, z = 5.534 }}, -- "MP_WHOUSE_1",
[3] = {name = "Celltowa Unit", capacity = 16, coords = {x = 896.3665, y = -1035.749, z = 35.1096}}, -- "MP_WHOUSE_2",
[4] = {name = "Convenience Store Lockup", capacity = 16, coords = {x = 247.473, y = -1956.943, z = 23.1908}}, -- "MP_WHOUSE_3",
[5] = {name = "Foreclosed Garage", capacity = 16, coords = {x = -424.828, y = 185.825, z = 80.775 }}, -- "MP_WHOUSE_4",
[6] = {name = "Xero Gas Factory", capacity = 111, coords = {x = -1042.482, y = -2023.516, z = 13.1616}}, -- "MP_WHOUSE_5",
[7] = {name = "Derriere Lingerie Backlot", capacity = 42, coords = {x = -1268.119, y = -812.2741, z = 17.1075}}, -- "MP_WHOUSE_6",
[8] = {name = "Bilgeco Warehouse", capacity = 111, coords = {x = -873.65, y = -2735.948, z = 13.9438}}, -- "MP_WHOUSE_7",
[9] = {name = "Pier 400 Utility Building", capacity = 16, coords = {x = 274.5224, y = -3015.413, z = 5.6993 }}, -- "MP_WHOUSE_8",
[10] = {name = "GEE Warehouse", capacity = 42, coords = {x = 1569.69, y = -2129.792, z = 78.3351}}, -- "MP_WHOUSE_9",
[11] = {name = "LS Marine Building 3", capacity = 42, coords = {x = -315.551, y = -2698.654, z = 7.5495 }}, -- "MP_WHOUSE_10",
[12] = {name = "Railyard Warehouse", capacity = 42, coords = {x = 499.81, y = -651.982, z = 24.909 }}, -- "MP_WHOUSE_11",
[13] = {name = "Fridgit Annexe", capacity = 42, coords = {x = -528.5296, y = -1784.573, z = 21.5853}}, -- "MP_WHOUSE_12",
[14] = {name = "Disused Factory Outlet", capacity = 42, coords = {x = -295.8596, y = -1353.238, z = 31.3138}}, -- "MP_WHOUSE_13",
[15] = {name = "Discount Retail Unit", capacity = 42, coords = {x = 349.839, y = 328.889, z = 104.272}}, -- "MP_WHOUSE_14",
[16] = {name = "Logistics Depot", capacity = 111, coords = {x = 926.2818, y = -1560.311, z = 30.7404}}, -- "MP_WHOUSE_15",
[17] = {name = "Darnell Bros Warehouse", capacity = 111, coords = {x = 759.566, y = -909.466, z = 25.244 }}, -- "MP_WHOUSE_16",
[18] = {name = "Wholesale Furniture", capacity = 111, coords = {x = 1037.813, y = -2173.062, z = 31.5334}}, -- "MP_WHOUSE_17",
[19] = {name = "Cypress Warehouses", capacity = 111, coords = {x = 1019.116, y = -2511.69, z = 28.302 }}, -- "MP_WHOUSE_18",
[20] = {name = "West Vinewood Backlot", capacity = 111, coords = {x = -245.3405, y = 203.3286, z = 83.818 }}, -- "MP_WHOUSE_19",
[21] = {name = "Old Power Station", capacity = 42, coords = {x = 539.346, y = -1945.682, z = 24.984 }}, -- "MP_WHOUSE_20",
[22] = {name = "Walker & Sons Warehouse", capacity = 111, coords = {x = 96.1538, y = -2216.4, z = 6.1712 }}, -- "MP_WHOUSE_21",
}
local NightclubPropertyInfo = {
[1] = {name = "La Mesa Nightclub", coords = {x = 757.009, y = -1332.32, z = 27.1802 }},
[2] = {name = "Mission Row Nightclub", coords = {x = 345.7519, y = -978.8848, z = 29.2681 }},
[3] = {name = "Strawberry Nightclub", coords = {x = -120.906, y = -1260.49, z = 29.2088 }},
[4] = {name = "West Vinewood Nightclub", coords = {x = 5.53709, y = 221.35, z = 107.6566}},
[5] = {name = "Cypress Flats Nightclub", coords = {x = 871.47, y = -2099.57, z = 30.3768 }},
[6] = {name = "LSIA Nightclub", coords = {x = -676.625, y = -2458.15, z = 13.8444 }},
[7] = {name = "Elysian Island Nightclub", coords = {x = 195.534, y = -3168.88, z = 5.7903 }},
[8] = {name = "Downtown Vinewood Nightclub", coords = {x = 373.05, y = 252.13, z = 102.9097}},
[9] = {name = "Del Perro Nightclub", coords = {x = -1283.38, y = -649.916, z = 26.5198 }},
[10] = {name = "Vespucci Canals Nightclub", coords = {x = -1174.85, y = -1152.3, z = 5.56128 }},
}
local HubTypesOrderedWithLabels = {
[0] = {name = "Cargo", label = MenuLabels.HUBCARGO},
[1] = {name = "Weapons", label = MenuLabels.HUBWEAPONS},
[2] = {name = "Cocaine", label = MenuLabels.HUBCOCAINE},
[3] = {name = "Meth", label = MenuLabels.HUBMETH},
[4] = {name = "Weed", label = MenuLabels.HUBWEED},
[5] = {name = "Forgery", label = MenuLabels.HUBFORGERY},
[6] = {name = "Cash", label = MenuLabels.HUBCASH},
}
local MCBusinessTypesOrderedWithLabels = {
[0] = {name = "Forgery", label = MenuLabels.MCFORGERY},
[1] = {name = "Weed", label = MenuLabels.MCWEED},
[2] = {name = "Cash", label = MenuLabels.MCCASH},
[3] = {name = "Meth", label = MenuLabels.MCMETH},
[4] = {name = "Cocaine", label = MenuLabels.MCCOCAINE},
[5] = {name = "Bunker", label = MenuLabels.MCBUNKER},
}
local MyBusinesses = {
[0] = {property = 0, type = "None"},
[1] = {property = 0, type = "None"},
[2] = {property = 0, type = "None"},
[3] = {property = 0, type = "None"},
[4] = {property = 0, type = "None"},
[5] = {property = 0, type = "None"},
["Forgery"] = {slot = 0, property = 0, product = 0, supplies = 0, upgraded = false},
["Weed"] = {slot = 0, property = 0, product = 0, supplies = 0, upgraded = false},
["Cash"] = {slot = 0, property = 0, product = 0, supplies = 0, upgraded = false},
["Meth"] = {slot = 0, property = 0, product = 0, supplies = 0, upgraded = false},
["Cocaine"] = {slot = 0, property = 0, product = 0, supplies = 0, upgraded = false},
["Bunker"] = {slot = 0, property = 0, product = 0, supplies = 0, upgraded = false, research = 0},
["Hub"] = {
["Cargo"] = 0, -- 0 -- CEO?
["Weapons"] = 0, -- 1
["Cocaine"] = 0, -- 2
["Meth"] = 0, -- 3
["Weed"] = 0, -- 4
["Forgery"] = 0, -- 5
["Cash"] = 0, -- 6
}
}
local MenuCurrentWarehouses = {
[0] = {"Name", {}, ""},
[1] = {"Name", {}, ""},
[2] = {"Name", {}, ""},
[3] = {"Name", {}, ""},
[4] = {"Name", {}, ""},
}
local Selected_Warehouse = 0
local NCSafePos = {x = -1615.6832, y = -3015.7546, z = -75.204994}
local tunables_global = 262145
local globals = {
Hub = {
MaxSellPrice = 4000000 - 2100000,
ProSpd = 1000,
SellCooldownActive = 1957639+7+1, -- appbusinesshub
Cargo = {
SellDefaultValue = 10000,
ProSpdDefaultValue = 8400000,
CapDefaultValue = 50,
},
Weapons = {
SellDefaultValue = 5000,
ProSpdDefaultValue = 4800000,
CapDefaultValue = 100,
},
Cocaine = {
SellDefaultValue = 27000,
ProSpdDefaultValue = 14400000,
CapDefaultValue = 10,
},
Meth = {
SellDefaultValue = 11475,
ProSpdDefaultValue = 7200000,
CapDefaultValue = 20,
},
Weed = {
SellDefaultValue = 2025,
ProSpdDefaultValue = 2400000,
CapDefaultValue = 80,
},
Forgery = {
SellDefaultValue = 1350,
ProSpdDefaultValue = 1800000,
CapDefaultValue = 60,
},
Cash = {
SellDefaultValue = 4725,
ProSpdDefaultValue = 3600000,
CapDefaultValue = 40,
},
},
MC = {
MaxSellPrice = 2000000,
Forgery = {
Sell1DefaultValue = 1350,
Sell2DefaultValue = 1.5,
ProSpd1DefaultValue = 300000,
ProSpd2DefaultValue = 300000,
Ratio1DefaultValue = 4,
Ratio2DefaultValue = 2,
CapDefaultValue = 60,
},
Cash = {
Sell1DefaultValue = 4725,
Sell2DefaultValue = 1.5,
ProSpd1DefaultValue = 720000,
ProSpd2DefaultValue = 720000,
Ratio1DefaultValue = 10,
Ratio2DefaultValue = 5,
CapDefaultValue = 40,
},
Cocaine = {
Sell1DefaultValue = 27000,
Sell2DefaultValue = 1.5,
ProSpd1DefaultValue = 3000000,
ProSpd2DefaultValue = 3000000,
Ratio1DefaultValue = 50,
Ratio2DefaultValue = 25,
CapDefaultValue = 10,
},
Meth = {
Sell1DefaultValue = 11475,
Sell2DefaultValue = 1.5,
ProSpd1DefaultValue = 1800000,
ProSpd2DefaultValue = 1800000,
Ratio1DefaultValue = 24,
Ratio2DefaultValue = 12,
CapDefaultValue = 20,
},
Weed = {
Sell1DefaultValue = 2025,
Sell2DefaultValue = 1.5,
ProSpd1DefaultValue = 360000,
ProSpd2DefaultValue = 360000,
Ratio1DefaultValue = 4,
Ratio2DefaultValue = 2,
CapDefaultValue = 80,
},
Bunker = {
Sell1DefaultValue = 5000,
Sell2DefaultValue = 1.5,
ProSpd1DefaultValue = 600000,
ProSpd2DefaultValue = 90000,
ProSpd3DefaultValue = 90000,
Ratio1DefaultValue = 10,
Ratio2DefaultValue = 5,
CapDefaultValue = 100,
},
},
SafeLimit = 300000,
SafeStatus1 = 1668129, -- freemode, bitset below "CLUB_PAY"
SafeStatus2 = 2707861, -- freemode
MCSupplyTime = 1667995+1, -- freemode, above "BPLJT_LOWW", if (!func_XXXXX(bVar1)), +1 because array
SpecialCargoMaxSellPriceValue = 6000000,
SpecialCargoSellFuncSomething = 1943763, -- gb_contraband_sell, PED::SET_PED_SHOOT_RATE(iParam0, == 1
SpecialCargoDeliveryCrates = 1882747+12, -- freemode, "SRC_CRG_TICKER_1", == 1
IsUsingComputerScreen = 76640, -- freemode
}
local locals = {
----------------
-- Special Cargo
----------------
--appsecuroserv
SpecialCargoSecuroString = "appsecuroserv",
SpecialCargoSecuroArgs = 4592, -- arg count needed to properly start the script, possibly outdated
SpecialCargoCurrentProperty = 755, -- warehouse property id (non-global-index based))
SpecialCargoScreenStatus = 578, -- status: 3011 = sold? 1 = error, 3012 = confirm?
SpecialCargoCratesToSell = 759, -- "MP_WH_SELL", "WH
SpecialCargoSellFromOption = 760, -- ^^^^^^^ (not current property id, but buttons [1-3])
SpecialCargoCurrentBitset = 579, -- ^^^^^^^ bit 13 controls if it is warehouse or securoserv
SpecialCargoStartingPosX = 776, -- struct<3> Local_ -- float (if distance to this from self is greater than 5f to this local, kill script)
SpecialCargoStartingPosY = 776+1, -- ^^^^^^^
SpecialCargoStartingPosZ = 776+2, -- ^^^^^^^
--gb_contraband_sell
SpecialCargoSellString = "gb_contraband_sell",
SpecialCargoSellType = 563+584,
SpecialCargoSellSubType = 563+7, -- return 5000;
SpecialCargoSellAmount = 563+57, -- ^ in function below
SpecialCargoSellStatus = 563+583,
--gb_contraband_buy
SpecialCargoBuyString = "gb_contraband_buy",
SpecialCargoBuyComplete = 621+192,
SpecialCargoBuyCollected = 621+186,
SpecialCargoBuyCollected2 = 496,
--appHackerTruck
SpecialCargoBuyScreenString = "appHackerTruck",
SpecialCargoBuyScreenArgs = 4592, -- arg count needed to properly start the script, possibly outdated
----------------
-- NightClub
----------------
NCSafeScriptString = "freemode",
NCSafeTransactionStatus = 20056+1, -- , 39, 0);
NCSafeAddMoneyAmount = 20056+2, -- same as above
NCHubScriptString = "appbusinesshub",
NCHubSellCooldown = 139, -- a local
NCHubSellCooldownBit = 27, -- a bitset bit
----EZNCMission = ,
----------------
-- MC
----------------
MCSellScriptString = "gb_biker_contraband_sell",
MCEZMissionStarted = 725+122, -- == 3 && (Local
MCEZMission = 725+17, -- ^ function below
MCLaptopString = "appbikerbusiness",
MCLaptopCurrentProperty = 544, -- (iVar2 > -1 && iVar2 < 7) &&
}
-- Also search for [[update]]
--#region Generated by internal tooling
globals.Hub.Cargo.Sell = tunables_global+23969
globals.Hub.Cargo.ProSpd = tunables_global+23954
globals.Hub.Cargo.Cap = tunables_global+23976
globals.Hub.Weapons.Sell = tunables_global+23963
globals.Hub.Weapons.ProSpd = tunables_global+23948
globals.Hub.Weapons.Cap = tunables_global+23970
globals.Hub.Cocaine.Sell = tunables_global+23964
globals.Hub.Cocaine.ProSpd = tunables_global+23949
globals.Hub.Cocaine.Cap = tunables_global+23971
globals.Hub.Meth.Sell = tunables_global+23965
globals.Hub.Meth.ProSpd = tunables_global+23950
globals.Hub.Meth.Cap = tunables_global+23972
globals.Hub.Weed.Sell = tunables_global+23966
globals.Hub.Weed.ProSpd = tunables_global+23951
globals.Hub.Weed.Cap = tunables_global+23973
globals.Hub.Forgery.Sell = tunables_global+23967
globals.Hub.Forgery.ProSpd = tunables_global+23952
globals.Hub.Forgery.Cap = tunables_global+23974
globals.Hub.Cash.Sell = tunables_global+23968
globals.Hub.Cash.ProSpd = tunables_global+23953
globals.Hub.Cash.Cap = tunables_global+23975
globals.MC.Forgery.Sell1 = tunables_global+17319
globals.MC.Forgery.Sell2 = tunables_global+18875
globals.MC.Forgery.ProSpd1 = tunables_global+17293
globals.MC.Forgery.Ratio1 = tunables_global+17307
globals.MC.Forgery.Ratio2 = tunables_global+17313
globals.MC.Forgery.Cap = tunables_global+18744
globals.MC.Cash.Sell1 = tunables_global+17320
globals.MC.Cash.Sell2 = tunables_global+18875
globals.MC.Cash.ProSpd1 = tunables_global+17294
globals.MC.Cash.Ratio1 = tunables_global+17308
globals.MC.Cash.Ratio2 = tunables_global+17314
globals.MC.Cash.Cap = tunables_global+18752
globals.MC.Cocaine.Sell1 = tunables_global+17321
globals.MC.Cocaine.Sell2 = tunables_global+18875
globals.MC.Cocaine.ProSpd1 = tunables_global+17292
globals.MC.Cocaine.Ratio1 = tunables_global+17309
globals.MC.Cocaine.Ratio2 = tunables_global+17315
globals.MC.Cocaine.Cap = tunables_global+18736
globals.MC.Meth.Sell1 = tunables_global+17322
globals.MC.Meth.Sell2 = tunables_global+18875
globals.MC.Meth.ProSpd1 = tunables_global+17291
globals.MC.Meth.Ratio1 = tunables_global+17310
globals.MC.Meth.Ratio2 = tunables_global+17316
globals.MC.Meth.Cap = tunables_global+18728
globals.MC.Weed.Sell1 = tunables_global+17323
globals.MC.Weed.Sell2 = tunables_global+18875
globals.MC.Weed.ProSpd1 = tunables_global+17290
globals.MC.Weed.Ratio1 = tunables_global+17311
globals.MC.Weed.Ratio2 = tunables_global+17317
globals.MC.Weed.Cap = tunables_global+18720
globals.MC.Bunker.Sell1 = tunables_global+21254
globals.MC.Bunker.Sell2 = tunables_global+21227
globals.MC.Bunker.ProSpd1 = tunables_global+21249
globals.MC.Bunker.ProSpd2 = tunables_global+21250
globals.MC.Bunker.ProSpd3 = tunables_global+21251
globals.MC.Bunker.Ratio1 = tunables_global+21006
globals.MC.Bunker.Ratio2 = tunables_global+21007
globals.MC.Bunker.Cap = tunables_global+21248
globals.SafeCap = tunables_global+23680
globals.SafeRevenue = tunables_global+23657
globals.MCSupplyDelay = tunables_global+18764
globals.BunkSupplyDelay = tunables_global+21274
globals.SpecialCargoBypassBuyCooldown = tunables_global+15499
globals.SpecialCargoBypassSellCooldown = tunables_global+15500
globals.SpecialCargoCrateMaxThreshold = tunables_global+15731
globals.SpecialCargoRewardPerCrate = tunables_global+15752
globals.SpecialCargoCrateMultiplier3 = tunables_global+16593
globals.SpecialCargoCrateMultiplier2 = tunables_global+16594
globals.SpecialCargoCrateMultiplier1 = tunables_global+16595
globals.SpecialCargoBonus = tunables_global+15524
globals.SpecialCargoDeliveryTime = tunables_global+31874
--#endregion Generated by internal tooling
local TotalEarnedTypes = {
--type = {prefix = label, amount = 0}
-- Do not use GetLabelText in here, these are prefixes and will be converted later
safeloop = {prefix = MenuLabels.PREFIX_SAFELOOP, amount = 0},
specialcargo = {prefix = MenuLabels.PREFIX_SPECIALCARGO, amount = 0},
}
local I32_MAX = 2147483647
-----------------------------------
-- String Functions
-----------------------------------
--#region String Functions
local function ReplacePlaceholder(str, rep, num)
local b, e = str:find("{"..num.."}")
if b and e then
return (str:sub(0, b-1) .. rep .. str:sub(e+1, -1))
else
util.log(string.format("Expected {%i} Placeholder in: %s", num, str))
return str
end
end
---@param label string
---@param ... string|integer
---@return string
local function GetLabelText(label, ...)
-- Usage: GetLabelText("Press {1} to interact.", "E") -- Returns "Press E to interact."
-- Usage: GetLabelText("Press {1} to open {2}.", "X", "the menu") -- Returns "Press X to open the menu."
-- Usage: GetLabelText("Press {2} to open {1}.", "in fullscreen", "F") -- Returns "Press F to open in fullscreen."
-- Note: NUMBER OF ARGS GIVEN TO FUNCTION AND ARGS IN LABEL MUST MATCH!
-- Note: EMPTY ARGS OR DUPLICATE ARGS IN LABEL IS UNDEFINED BEHAVIOUR!
local args = {...}
local str = lang.get_localised(label)
for i = 1, #args do
str = ReplacePlaceholder(str, lang.get_localised(args[i]), i)
end
return str
end
local function GetLabelTextLiteral(label, ...)
local args = {...}
local str = lang.get_localised(label)
for i = 1, #args do
str = ReplacePlaceholder(str, args[i], i)
end
return str
end
local function GetKeyValueFromLine(line, size)
local find = string.find(line, "=")
if not find then return end
size = size or 2
local key = string.sub(line, 0, find-size)
local value = string.sub(line, find+size, -1)
return key, value
end
local function GetCharacterFromString(str, charpos)
return str:sub(charpos, charpos)
--return str[charpos] -- pluto only
end
--#endregion String Functions
-----------------------------------
-- Version Functions
-----------------------------------
--#region Version Functions
local function VersionStringToTable(str)
local result = {}
local s = str .. "."
for match in string.gmatch(s, "(.-)%.") do
table.insert(result, match)
end
return result
end
---@param lversion string
---@param rversion string
---@param vtypes table?
---@return boolean
---@return string
-- returns true if up to date or above date, false if out of date
local function VersionCheck(lversion, rversion, vtypes)
local lvtable = VersionStringToTable(lversion)
local rvtable = VersionStringToTable(rversion)
for index in ipairs(lvtable) do
if lvtable[index] < rvtable[index] then
return false, "out of date by a " .. (vtypes and vtypes[index] or index) .. " version"
elseif lvtable[index] > rvtable[index] then
break
end
end
return true, "is not out of date"
end
--#endregion Version Functions
-----------------------------------
-- Translation Functions
-----------------------------------
--#region Translation Functions
---@return boolean
---@return table
local function GetTranslationFileMetadata(path)
local metadata = {}
local file, err = io.open(path, "r")
if file then
local line = file:read("l")
local iter = 0
while GetCharacterFromString(line, 1) == "@" do
local key, value = GetKeyValueFromLine(line:sub(2), 1)
if key then
metadata[key] = value
else
--util.log("Failure in getting key-value from line:\n"..line)
if not SCRIPT_SILENT_START then
util.toast("Failure in reading translation file!")
end
break
end
if iter >= 10 then
break
end
iter = iter + 1
line = file:read("l")
end
file:close()
else
--util.log("Failure in opening:\n"..path.."\nReason: "..(err or "unspecified"))
return false, metadata
end
return true, metadata
end
---@param language table|string
local function TranslateLabels(path)
local lvalue, rvalue
for line in io.lines(path) do
local first_char = GetCharacterFromString(line, 1)
if first_char == "!" or first_char == "#" or first_char == "@" then
else
lvalue, rvalue = GetKeyValueFromLine(line, 1)
if lvalue then
if MenuLabels[lvalue] ~= nil then
lang.translate(MenuLabels[lvalue], rvalue:gsub("\\n", "\n") or "ERROR")
else
util.toast("Error occurred while reading Translation file. Translation file may be corrupt or out of date.")
--util.log("Translation file attempted to assign a non-existant MenuLabel a value. $"..lvalue)
end
end
end
end
end
do
local l = lang.get_current()
local path = MB_TRANSLATIONS_DIR .. l .. ".txt"
if filesystem.exists(path) then
lang.set_translate(l)
TranslateLabels(path)
end
end
--#endregion Translation Functions
local menu_findsaferways = menu.hyperlink(menu.my_root(), MenuLabels.FINDSAFERWAYS, "https://stand.sh/help/money", MenuLabels.FINDSAFERWAYS_DESC)
if not SCRIPT_SILENT_START then
util.toast(lang.get_string(MenuLabels.WARNINGRISKY_TOAST, lang.get_current()))
end
-----------------------------------
-- HTTP Functions
-----------------------------------
--#region HTTP Functions
local MOTD = ""
local HTTPHosts = {
{HOST = "gist.githubusercontent.com", PATH = "/VSussyImpostor/8cf3bf39ae47218c4ee20a9ef96871ca/raw"},
{HOST = "pastebin.com", PATH = "/raw/yaMG2Vz1"},
}
--HTTP Contents below
--[[
motd = ""
version = "0.3.2"
killswitch_safeloop = false
killswitch_specialcargo = false
killswitch_maxsellprice = false
killswitch_autocomplete = false
]]
local HTTP = {
PENDING = false,
SUCCESS = false,
TRIES = 0,
HOST = HTTPHosts[1].HOST,
PATH = HTTPHosts[1].PATH,
HOST_NUMBER = 1,
SUCCESS_WAIT_TIME = (90 * 1000), -- 1 minute, 30 seconds
GIVEUP_TIME = (30 * 1000), -- 30 seconds
WAIT_TIME = (3 * 1000), -- 3 seconds
FAILSAFE = false,
}
local remote = {
motd = "",
version = "",
killswitches = {
["safeloop"] = false,
["specialcargo"] = false,
["maxsellprice"] = false,
["autocomplete"] = false,
},
}
local function StringToBoolean(str)
return str == "true"
end
local function LinesToTable(lines)
local result = {}
for s in lines:gmatch("[^\r\n]+") do
table.insert(result, s)
end
return result
end
local function IsKeyKillswitch(key)
return key:startswith("killswitch_")
end
local function GetKillswitchFromKey(key)
-- 12 is the length of "killswitch_"
return string.sub(key, 12, -1)
end
local function ActivateFailsafe()
if not HTTP.FAILSAFE then
util.toast(MenuLabels.HTTPFAILSAFE .. " (HTTP E3)")
for name, value in pairs(remote.killswitches) do
remote.killswitches[name] = true
end
HTTP.FAILSAFE = true -- in order to avoid this chunk of code running multiple times
end
end
local function HandleHTTPResponse(response)
for index, line in ipairs(LinesToTable(response)) do
local key, value = GetKeyValueFromLine(line)
if not key or not value then
util.toast(MenuLabels.HTTPINVALID .. " (HTTP E2)")
HTTP.SUCCESS = false -- don't immmediately trigger failsafe, treat this as a failed request
return -- jump out of handling, try again
end
if IsKeyKillswitch(key) then
remote.killswitches[GetKillswitchFromKey(key)] = StringToBoolean(value)
else
remote[key] = string.sub(value, 2, -2) -- drop the quotes
end
end
HTTP.FAILSAFE = false -- reset failsafe if it triggered before
if not IGNORE_VERSION_DIFFERENCE and IS_RELEASE_VERSION and not VersionCheck(THIS_RELEASE_VERSION, remote.version) then
util.toast(lang.get_localised(MenuLabels.SCRIPTOUTOFDATE), TOAST_ALL)
end
end
local function HTTPGiveUp()
util.toast(MenuLabels.HTTPGIVEUP .. " (HTTP E1)", TOAST_ALL)
ActivateFailsafe()
end
local function HTTPSwitchHost()
HTTP.HOST_NUMBER = HTTP.HOST_NUMBER == #HTTPHosts and 1 or HTTP.HOST_NUMBER + 1
HTTP.HOST = HTTPHosts[HTTP.HOST_NUMBER].HOST
HTTP.PATH = HTTPHosts[HTTP.HOST_NUMBER].PATH
end
local function HTTPFail()
-- if not IS_RELEASE_VERSION then
-- util.toast("HTTP Attempt Failed.", TOAST_ALL)
-- end
HTTP.PENDING = false
HTTP.SUCCESS = false
HTTP.TRIES = HTTP.TRIES + 1
end
local function HTTPSuccess(response)
-- if not IS_RELEASE_VERSION then
-- util.toast("HTTP Attempt Succeeded.", TOAST_ALL)
-- end
HTTP.PENDING = false
HTTP.SUCCESS = true
HandleHTTPResponse(response)
end
local function HTTPTry()
while HTTP.PENDING do -- prevent two http requests at once
util.yield()
end
HTTP.PENDING = true
async_http.init(HTTP.HOST, HTTP.PATH, HTTPSuccess, HTTPFail)
async_http.dispatch()
while HTTP.PENDING do
util.yield()
end
return HTTP.SUCCESS
end
local function HTTPHeartbeat()
HTTPTry()
if HTTP.SUCCESS then
util.yield(HTTP.SUCCESS_WAIT_TIME)
elseif HTTP.TRIES == 1 then
util.yield(HTTP.WAIT_TIME)
elseif HTTP.TRIES == 2 then
util.yield(HTTP.WAIT_TIME)
HTTPSwitchHost()
elseif HTTP.TRIES == 3 then
util.yield(HTTP.WAIT_TIME)
elseif HTTP.TRIES >= 4 then -- Forcing an HTTP connection by debug functions will increment the count, so we do >= to account for that case
-- Our connection is fucked, give up
HTTPGiveUp()
util.yield(HTTP.GIVEUP_TIME)
HTTP.TRIES = 0
end
end
--#endregion HTTP Functions
-----------------------------------
-- Custom Command Functions
-----------------------------------
--#region Custom Command Functions
local function RegisterUpdatingReadOnlyCommand(list, title, value_func)
local command = menu.readonly(list, title, value_func())