-
Notifications
You must be signed in to change notification settings - Fork 1
/
JungHub_AF.lua
4642 lines (3365 loc) · 160 KB
/
JungHub_AF.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
if not game:IsLoaded() then game.Loaded:Wait() end
repeat task.wait() until game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name)
if game.PlaceId == 16474126979 then
end
if getgenv().JungHubExecuted then return end
getgenv().JungHubExecuted = true
-- SERVICES
local HttpService = game:GetService('HttpService')
local UIS = game:GetService('UserInputService')
local RunS = game:GetService('RunService')
local RS = game:GetService('ReplicatedStorage')
local TS = game:GetService('TweenService')
local PS = game:GetService('PhysicsService')
-- VARIABLES
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local Remotes = RS:WaitForChild('endpoints')
local Event = game:GetService("ReplicatedStorage").endpoints["client_to_server"]
-- SAVED STATS
local DifferentColorsPoints = {Color3.fromRGB(1, 81, 255), Color3.fromRGB(255,0,0), Color3.fromRGB(0,255,0), Color3.fromRGB(255,255,0), Color3.fromRGB(255,0,255), Color3.fromRGB(0,255,255)}
MacroUnitsTextBlocks = {}
local RecordingMacro = false
local FPS = 0
local StartTime = os.time()
local IsLobby = workspace:FindFirstChild('_MAP_CONFIG') if IsLobby and IsLobby:FindFirstChild('IsLobby') then IsLobby = IsLobby.IsLobby.Value end
local _DATA = workspace:FindFirstChild('_DATA')
local GameFinished
if _DATA then GameFinished = _DATA:FindFirstChild('GameFinished') end
local ResultUI = player.PlayerGui['ResultsUI']
--------------- Files
makefolder("Jung Hub")
makefolder('Jung Hub\\Anime Fantasy')
local DefaultFiles = {
['Jung Hub\\Settings_' .. player.Name] = {
['Ignored Capsules'] = {};
['Delete Skins'] = {};
['Selected Portal Difficulties Delete'] = {};
['Selected Tiers Delete'] = {};
['Selected Portals Delete'] = {};
['Ignore Worlds Delete'] = {};
['Ignore Bonus Delete'] = {};
['PortalUSE Portals'] = {};
['PortalUSE Tiers'] = {};
['PortalUSE Difficulties Ignore'] = {};
['PortalUSE Worlds Ignore'] = {};
['PortalUSE Bonus Ignore'] = {};
['PortalUSE Start After Time'] = 1;
['PortalUSE Star After Players'] = 1;
['Challenge_IgnoreWorlds'] = {};
['Challenge_IgnoreDifficulties'] = {};
['Challenge_IgnoreRewards'] = {};
['AutoPlacePositions'] = {};
['AutoPlacesCap'] = {['1'] = 4, ['2'] = 4, ['3'] = 4, ['4'] = 4, ['5'] = 4, ['6'] = 4};
['AutoUpgradesCap'] = {['1'] = 10, ['2'] = 10, ['3'] = 10, ['4'] = 10, ['5'] = 10, ['6'] = 10};
['Discord Url'] = '';
['Discord UserID'] = '';
['StoryInf_World'] = '';
['StoryInf_Level'] = '';
['AutoJoinCastleMaxRoom'] = 500;
['AutoLeaveOnWave'] = 1;
['AutoSkillWave'] = 1;
['AutoSkillUnits'] = {};
['AutoSellUnitsWave'] = 1;
['FPS_LIMIT'] = 60;
['AutoSellFarmsWave'] = 1;
['AutoPlaceUnitsWave'] = 1;
['AutoUpgradeWave'] = 1;
['Selected Macro'] = '';
['Step Delay'] = 0.4;
['Hide Key'] = 'U';
['Selected Macro Map'] = {Tower = {}, Main = {}, Raid = {}, Portal = {}, Other = {}}
};
}
function deepcopy(orig)
local orig_type = type(orig)
local copy
if orig_type == 'table' then
copy = {}
for orig_key, orig_value in next, orig, nil do
copy[deepcopy(orig_key)] = deepcopy(orig_value)
end
setmetatable(copy, deepcopy(getmetatable(orig)))
else -- number, string, boolean, etc
copy = orig
end
return copy
end
RunS.RenderStepped:Connect(function()
FPS += 1
end)
for name, value in pairs(DefaultFiles) do -- SET DEFAULT VALUES
if not pcall(function() readfile(name) end) then writefile(name, HttpService:JSONEncode(value)) end
end
local Settings = HttpService:JSONDecode(readfile('Jung Hub\\Settings_' .. player.Name))
local function Save (valueName, newValue)
Settings[valueName] = newValue
writefile('Jung Hub\\Settings_' .. player.Name, HttpService:JSONEncode(Settings))
end
local function GetSave (valueName)
local value = Settings[valueName]
if value == nil then
if DefaultFiles['Jung Hub\\Settings_' .. player.Name][valueName] ~= nil then
Save(valueName, DefaultFiles['Jung Hub\\Settings_' .. player.Name][valueName])
else
Save(valueName, false)
end
value = Settings[valueName]
end
if type(value) == 'table' then value = deepcopy(value) end
return value
end
---------------------------------------------------------
local RefreshedUniqueItems = {}
local RefreshedNormalItems = {}
local Loader = require(RS.src.Loader)
local ItemInventoryServiceClient = Loader.load_client_service(script, "ItemInventoryServiceClient")
local battlePassID = ""
function get_inventory_items_unique_items()
return ItemInventoryServiceClient["session"]['inventory']['inventory_profile_data']['unique_items']
end
function get_inventory_items()
return ItemInventoryServiceClient["session"]["inventory"]['inventory_profile_data']['normal_items']
end
function get_Units_Owner()
return ItemInventoryServiceClient["session"]["collection"]["collection_profile_data"]['owned_units']
end
bpOpenTime = 0
for _, BattlePassModule in ipairs(RS.src.Data.BattlePass:GetChildren()) do
if not BattlePassModule:IsA('ModuleScript') then continue end
local bpModule = require(BattlePassModule)
for bpID,aboutBP in pairs(bpModule) do
if not aboutBP.tiers then continue end
if not aboutBP.tiers['26'] or not aboutBP.tiers['26']._unlock_time then continue end
if aboutBP.tiers['26']._unlock_time < bpOpenTime then continue end
battlePassID = bpID
bpOpenTime = aboutBP.tiers['26']._unlock_time
end
end
task.spawn(function()
while true do
RefreshedUniqueItems = get_inventory_items_unique_items()
RefreshedNormalItems = get_inventory_items()
task.wait(0.1)
end
end)
local function getEquippedUnits ()
local newUnitsEquipped = {}
for _, unitInfo in pairs(get_Units_Owner()) do
if not unitInfo['equipped_slot'] then continue end
newUnitsEquipped[unitInfo['uuid']] = {id = unitInfo['unit_id'], equipped_slot = unitInfo['equipped_slot'] }
end
return newUnitsEquipped
end
local EquippedUnits = getEquippedUnits()
local EquippedUnitsAbout = {}
for uuid, aboutSlot in pairs(EquippedUnits) do
for _, moduleScript in ipairs(RS.src.Data.Units:GetDescendants()) do
if not moduleScript:IsA('ModuleScript') then continue end
for unitID, unitTable in pairs(require(moduleScript)) do
if unitID ~= aboutSlot.id then continue end
EquippedUnitsAbout[ tostring(aboutSlot.equipped_slot) ] = {
id = unitID,
uuid = uuid,
upgrades = unitTable['upgrade'],
cost = unitTable['cost'],
hill = unitTable['hill_unit'],
spawn_cap = unitTable['spawn_cap'] or 5,
unsellable = unitTable['unsellable'],
global_spawn_cap = unitTable['global_spawn_cap']
}
end
end
end
function getLevelData()
return game.Workspace._MAP_CONFIG:WaitForChild("GetLevelData"):InvokeServer()
end
local LevelData = nil
if not game.Workspace._MAP_CONFIG:WaitForChild('IsLobby').Value then LevelData = getLevelData() end
function StringToCFrame(String)
local Split = string.split(String, ",")
return CFrame.new(Split[1],Split[2],Split[3],Split[4],Split[5],Split[6],Split[7],Split[8],Split[9],Split[10],Split[11],Split[12])
end
local function TPLobby ()
game:GetService('TeleportService'):Teleport(16474126979, player)
end
function makeComma(p1)
local value = p1;
while true do
local value2, value3 = string.gsub(value, "^(-?%d+)(%d%d%d)", "%1,%2");
value = value2;
if value3 ~= 0 then else
break;
end;
end;
return value;
end
local function math_round( roundIn , roundDig )
local mul = math.pow( 10, roundDig )
return ( math.floor( ( roundIn * mul ) + 0.5 )/mul )
end
local vu = game:GetService("VirtualUser")
player.Idled:connect(function()
vu:Button2Down(Vector2.new(0,0),workspace.CurrentCamera.CFrame)
wait(1)
vu:Button2Up(Vector2.new(0,0),workspace.CurrentCamera.CFrame)
end)
local function getItemsData ()
local newItemsData = {}
local DataModules = RS.src.Data.Items:GetDescendants()
table.insert(DataModules, RS.src.Data.Units)
for _, itemDataModule in ipairs(DataModules) do
if not itemDataModule:IsA('ModuleScript') then continue end
for itemID, ItemTable in pairs( require(itemDataModule) ) do
newItemsData[itemID] = {
Rarity = ItemTable.rarity,
Name = ItemTable.name,
Amount = 0
}
end
end
for itemId, amount in pairs(get_inventory_items()) do
newItemsData[itemId]['Amount'] = amount
end
for _, itemTable in pairs(get_inventory_items_unique_items()) do
newItemsData[ itemTable.item_id ]['Amount'] = newItemsData[ itemTable.item_id ]['Amount'] + 1
end
for _, unitTable in pairs(get_Units_Owner()) do
newItemsData[ unitTable.unit_id ]['Amount'] = newItemsData[ unitTable.unit_id ]['Amount'] + 1
end
return newItemsData
end
local oldItemsData = getItemsData()
local _Maps_DATA = {}
for _, mapData in ipairs(RS.src.Data.Maps:GetDescendants()) do
if not mapData:IsA('ModuleScript') then continue end
for mapId, mapTable in pairs( require(mapData) ) do
_Maps_DATA[mapTable.id] = mapTable.name
end
end
local macroMapList = {
['Main'] = {
'Fabled Kingdom',
'Planet Namak',
'Shiganshinu District',
'Windhym',
'Hollow World',
'Clover Kingdom',
'Magic Town',
'Ant Kingdom',
'Cursed Academy',
'Cape Canaveral',
"Marine's Ford",
'Hero City',
'Hidden Sand Village',
'Alien Spaceship',
'Snowy Town',
'Virtual Dungeon',
'Ghoul City',
'Puppet Island',
'Undead Tomb'
};
['Tower'] = {'Thriller Park', 'Entertainment District', 'Karakora Town', 'Storm Hideout', 'Infinity Train',};
['Raid'] = {
'Fabled Kingdom (Commandments)',
'Karakora Town',
'Entertainment District',
'Clover Kingdom (Elf Invasion)',
'Cape Canaveral',
'Hero City (Midnight)',
'Infinity Train',
'Virtual Dungeon (Bosses)',
'Storm Hideout',
'Storm Hideout (Final)',
'West City',
'Bizzare Town',
'Hidden Sand Village',
'Shiganshinu District',
'Undead Tomb'
};
['Portal'] = {
'Puppet Island (Summer)',
'Shiganshinu District (Summer)',
'Fabled Kingdom (Summer)',
'Alien Spaceship (Underwater)',
'Planet Namak (Summer)',
'Ant Kingdom (Summer)',
'Cursed Academy (Summer)',
'Fabled Kingdom (Cube)',
'The Eclipse',
'Alien Spaceship (Final)',
'Puppet Island (Birdcage)'
};
['Other'] = {
'Cursed Womb'
}
}
for _, mapName in ipairs(macroMapList.Main) do
table.insert(macroMapList.Tower, mapName)
end
---------------------------------------------------------
local function MakeUICorner (scale, newParent)
local newCorner = Instance.new('UICorner')
newCorner.CornerRadius = UDim.new(scale, 0)
newCorner.Parent = newParent
end
local function MakeUIPadding (bottom, left, right, top, newParent)
local newPadding = Instance.new('UIPadding')
newPadding.PaddingBottom = UDim.new(bottom, 0)
newPadding.PaddingLeft = UDim.new(left, 0)
newPadding.PaddingRight = UDim.new(right, 0)
newPadding.PaddingTop = UDim.new(top, 0)
newPadding.Parent = newParent
end
local function makeUIList (padding, newParent, VA)
local va = VA or Enum.VerticalAlignment.Top
local newUIList = Instance.new('UIListLayout')
newUIList.Padding = UDim.new(padding, 0)
newUIList.FillDirection = Enum.FillDirection.Vertical
newUIList.HorizontalAlignment = Enum.HorizontalAlignment.Center
newUIList.VerticalAlignment = va
newUIList.SortOrder = Enum.SortOrder.LayoutOrder
newUIList.Parent = newParent
end
---------------------------------------------------------
PGUI = game.Players.LocalPlayer:WaitForChild('PlayerGui')
-- MAKING GUI
ScreenGui = Instance.new('ScreenGui', game.CoreGui)
ScreenGui.Name = 'Jung Hub'
ScreenGui.ResetOnSpawn = false
ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Global
ScreenGui.Enabled = true
MainFrame = Instance.new('Frame', ScreenGui)
MainFrame.BackgroundTransparency = 1
MainFrame.SizeConstraint = Enum.SizeConstraint.RelativeYY
MainFrame.Size = UDim2.new(0.525, 0, 0.525, 0)
MainFrame.Position = UDim2.new(0.614, 0, 0.284, 0)
MainFrame.Name = 'MainFrame'
MainContent = Instance.new('Frame', MainFrame)
MainContent.BackgroundColor3 = Color3.fromRGB(73, 73, 99)
MainContent.Size = UDim2.new(1, 0, 1, 0)
MakeUICorner(0.01, MainContent)
lowerTop = Instance.new('Frame', MainContent)
lowerTop.AnchorPoint = Vector2.new(0.5, 1)
lowerTop.BackgroundColor3 = Color3.fromRGB(26, 26, 26)
lowerTop.Size = UDim2.new(1, 0, 0.019, 0)
lowerTop.Position = UDim2.new(0.5, 0, 0.038, 0)
lowerTop.BorderSizePixel = 0
ShadowMainContent = Instance.new('Frame', MainContent)
ShadowMainContent.BackgroundColor3 = Color3.fromRGB(26, 26, 26)
ShadowMainContent.AnchorPoint = Vector2.new(0.5, 0.5)
ShadowMainContent.Size = UDim2.new(1.02, 0, 1.02, 0)
ShadowMainContent.Position = UDim2.new(0.5, 0, 0.5, 0)
ShadowMainContent.ZIndex = -1
MakeUICorner(0.015, ShadowMainContent)
additionalFrame = Instance.new('Frame', ScreenGui) additionalFrame.Name = 'Additional'
additionalFrame.BackgroundColor3 = Color3.fromRGB(73,73,99)
additionalFrame.Position = UDim2.new(0.15, 0, 0.005, 0)
additionalFrame.SizeConstraint = Enum.SizeConstraint.RelativeYY
additionalFrame.Size = UDim2.new(0.195, 0, 0.062, 0)
additionalFrame.ZIndex = 1000001
MakeUICorner(0.07, additionalFrame)
additionalFrameShadow = Instance.new('Frame', additionalFrame)
additionalFrameShadow.BackgroundColor3 = Color3.fromRGB(26,26,26)
additionalFrameShadow.AnchorPoint = Vector2.new(0.5, 0.5)
additionalFrameShadow.Size = UDim2.new(1.05, 0, 1.1, 0)
additionalFrameShadow.Position = UDim2.new(0.5, 0, 0.5, 0)
additionalFrameShadow.ZIndex = 1000000
MakeUICorner(0.07, additionalFrameShadow)
additionalFrameInner = Instance.new('Frame', additionalFrame)
additionalFrameInner.BackgroundTransparency = 1
additionalFrameInner.Size = UDim2.new(1,0,1,0)
makeUIList(0.02, additionalFrameInner, Enum.VerticalAlignment.Center)
TimerLabel = Instance.new('TextLabel', additionalFrameInner)
TimerLabel.BackgroundTransparency = 1
TimerLabel.Size = UDim2.new(0.95, 0, 0.3, 0)
TimerLabel.ZIndex = 1000002
TimerLabel.Font = Enum.Font.GothamBlack
TimerLabel.TextColor3 = Color3.fromRGB(255,255,255)
TimerLabel.TextScaled = true
TimerLabel.TextXAlignment = Enum.TextXAlignment.Left
TimerLabel.Text = "Timer: 00:00:00"
FPSLabel = Instance.new('TextLabel', additionalFrameInner)
FPSLabel.BackgroundTransparency = 1
FPSLabel.Size = UDim2.new(0.95, 0, 0.3, 0)
FPSLabel.ZIndex = 1000002
FPSLabel.Font = Enum.Font.GothamBlack
FPSLabel.TextColor3 = Color3.fromRGB(255,255,255)
FPSLabel.TextScaled = true
FPSLabel.TextXAlignment = Enum.TextXAlignment.Left
FPSLabel.Text = "FPS: 0"
DiscordLabel = Instance.new('TextLabel', additionalFrameInner)
DiscordLabel.BackgroundTransparency = 1
DiscordLabel.Size = UDim2.new(0.95, 0, 0.3, 0)
DiscordLabel.ZIndex = 1000002
DiscordLabel.Font = Enum.Font.GothamBlack
DiscordLabel.TextColor3 = Color3.fromRGB(255,255,255)
DiscordLabel.TextScaled = true
DiscordLabel.TextXAlignment = Enum.TextXAlignment.Left
DiscordLabel.Text = "Discord: zMc8bTmQXh"
task.spawn(function()
while true do
TimerLabel.Text = string.format("Timer: %02s:%02s:%02s", math.floor((os.time() - StartTime) / 3600), math.floor((os.time() - StartTime)%3600/60), (os.time() - StartTime) % 60 )
FPSLabel.Text = string.format("FPS: %s", FPS) FPS = 0
task.wait(1)
end
end)
Top = Instance.new('Frame', MainFrame)
Top.BackgroundColor3 = Color3.fromRGB(26, 26, 26)
Top.AnchorPoint = Vector2.new(1, 0.5)
Top.Size = UDim2.new(1, 0, 0.048, 0)
Top.Position = UDim2.new(1, 0, 0.014, 0)
Top.ZIndex = 10000
MakeUICorner(0.2, Top)
CloseButton = Instance.new('TextButton', Top)
CloseButton.AnchorPoint = Vector2.new(1, 0.5)
CloseButton.BackgroundColor3 = Color3.fromRGB(80, 80, 80)
CloseButton.Size = UDim2.new(0.065, 0, 0.694, 0)
CloseButton.Position = UDim2.new(0.984, 0, 0.5, 0)
CloseButton.ZIndex = 10001
CloseButton.Font = Enum.Font.GothamBlack
CloseButton.TextColor3 = Color3.fromRGB(255,255,255)
CloseButton.TextScaled = true
CloseButton.Text = '-'
MakeUICorner(0.3, CloseButton)
HubTitle = Instance.new('TextLabel', Top)
HubTitle.BackgroundTransparency = 1
HubTitle.AnchorPoint = Vector2.new(0.5, 0.5)
HubTitle.Size = UDim2.new(0.85, 0, 0.8, 0)
HubTitle.Position = UDim2.new(0.5, 0, 0.5, 0)
HubTitle.ZIndex = 10001
HubTitle.Font = Enum.Font.GothamBlack
HubTitle.TextColor3 = Color3.fromRGB(255,255,255)
HubTitle.TextScaled = true
HubTitle.Text = 'Jung Hub - BETA'
TopBarSizes = {
[false] = UDim2.new(0.5, 0,0.048, 0),
[true] = UDim2.new(1,0,0.048,0)
}
closeButtonSizes = {
[false] = UDim2.new(0.13, 0, 0.694, 0),
[true] = UDim2.new(0.065, 0, 0.694, 0)
}
HubTitlePoses = {
[false] = UDim2.new(0.45, 0, 0.5, 0),
[true] = UDim2.new(0.5, 0, 0.5, 0)
}
CloseButton.MouseButton1Click:Connect(function()
MainContent.Visible = not MainContent.Visible
HubTitle.Position = HubTitlePoses[MainContent.Visible]
CloseButton.Size = closeButtonSizes[MainContent.Visible]
Top.Size = TopBarSizes[MainContent.Visible]
end)
local function MakeDraggable (dragGui, dragwith)
local dragging
local dragInput
local dragStart
local startPos
local function updateDrag(input)
local delta = input.Position - dragStart
local dragTime = 0.04
local SmoothDrag = {}
SmoothDrag.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
local dragSmoothFunction = TS:Create(dragwith, TweenInfo.new(dragTime, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), SmoothDrag)
dragSmoothFunction:Play()
end
dragGui.InputBegan:Connect(function(input)
local usedMouse = input.UserInputType == Enum.UserInputType.MouseButton1
local usedTouch = input.UserInputType == Enum.UserInputType.Touch
if usedMouse or usedTouch then
dragging = true
dragStart = input.Position
startPos = dragwith.Position
local release
release = UIS.InputEnded:Connect(function(input)
if input.UserInputType ~= Enum.UserInputType.MouseButton1 and input.UserInputType ~= Enum.UserInputType.Touch then return end
dragging = false
release:Disconnect()
end)
end
end)
dragGui.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
dragInput = input
end
end)
UIS.InputChanged:Connect(function(input)
if input == dragInput and dragging then
updateDrag(input)
end
end)
end
MakeDraggable(additionalFrame, additionalFrame)
MakeDraggable(Top, MainFrame)
Pages = Instance.new('ScrollingFrame', MainContent)
Pages.BackgroundColor3 = Color3.fromRGB(94, 94, 127)
Pages.Size = UDim2.new(1, 0, 0.047, 0)
Pages.Position = UDim2.new(0, 0, 0.038, 0)
Pages.AutomaticCanvasSize = 'Y'
Pages.CanvasSize = UDim2.new(0, 0, 0, 0)
Pages.ScrollBarThickness = 0
Pages.ScrollingDirection = Enum.ScrollingDirection.X
Pages.BorderSizePixel = 0
Pages.ZIndex = 9500
ListPages = Instance.new('UIListLayout', Pages)
ListPages.FillDirection = Enum.FillDirection.Horizontal
ListPages.HorizontalAlignment = Enum.HorizontalAlignment.Left
ListPages.VerticalAlignment = Enum.VerticalAlignment.Center
ListPages.SortOrder = Enum.SortOrder.LayoutOrder
ScrollingContent = Instance.new('ScrollingFrame', MainContent)
ScrollingContent.BackgroundTransparency = 1
ScrollingContent.Size = UDim2.new(1, 0, 0.916, 0)
ScrollingContent.Position = UDim2.new(0, 0, 0.084, 0)
ScrollingContent.AutomaticCanvasSize = 'Y'
ScrollingContent.CanvasSize = UDim2.new(0, 0, 0, 0)
ScrollingContent.ScrollBarThickness = 4
ScrollingContent.ScrollingDirection = Enum.ScrollingDirection.Y
ScrollingContent.ScrollBarImageColor3 = Color3.fromRGB(255, 255, 255)
ScrollingContent.BorderSizePixel = 0
newPageButtonBCInfo = TweenInfo.new(0.15, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false)
pageOrder = 1
pageShown = nil
local function MakeNewPage (pageName, pageButtonX)
local newPageButton = Instance.new('TextButton', Pages)
newPageButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
newPageButton.Name = pageName
newPageButton.BackgroundTransparency = 1
newPageButton.Size = UDim2.new(pageButtonX, 0, 1, 0)
newPageButton.Text = ''
newPageButton.LayoutOrder = pageOrder pageOrder+=1
newPageButton.BorderSizePixel = 0
newPageButton.ZIndex = 9850
local newPageButtonTitle = Instance.new('TextLabel', newPageButton)
newPageButtonTitle.AnchorPoint = Vector2.new(0.5, 0.5)
newPageButtonTitle.BackgroundTransparency = 1
newPageButtonTitle.Size = UDim2.new(1, 0, 0.8, 0)
newPageButtonTitle.Position = UDim2.new(0.5, 0, 0.5, 0)
newPageButtonTitle.Font = Enum.Font.GothamBlack
newPageButtonTitle.TextScaled = true
newPageButtonTitle.TextColor3 = Color3.fromRGB(255, 255, 255)
newPageButtonTitle.Text = string.upper(pageName)
newPageButtonTitle.ZIndex = 9875
local newPageButtonBottomLine = Instance.new('Frame', newPageButton)
newPageButtonBottomLine.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
newPageButtonBottomLine.Name = 'BottomLine'
newPageButtonBottomLine.AnchorPoint = Vector2.new(0, 1)
newPageButtonBottomLine.Size = UDim2.new(1, 0, 0.05, 0)
newPageButtonBottomLine.Position = UDim2.new(0, 0, 1, 0)
newPageButtonBottomLine.Visible = false
newPageButtonBottomLine.BorderSizePixel = 0
newPageButtonBottomLine.ZIndex = 9800
local newPage = Instance.new('Frame', ScrollingContent)
newPage.Name = pageName
newPage.BackgroundTransparency = 1
newPage.Size = UDim2.new(1, 0, 1, 0)
newPage.Visible = false
local LeftPage = Instance.new('Frame', newPage)
LeftPage.Name = 'Left'
LeftPage.BackgroundTransparency = 1
LeftPage.Size = UDim2.new(0.5, 0, 1, 0)
makeUIList(0.02, LeftPage)
MakeUIPadding(0.01, 0, 0, 0.01, LeftPage)
local RightPage = Instance.new('Frame', newPage)
RightPage.Name = 'Right'
RightPage.BackgroundTransparency = 1
RightPage.AnchorPoint = Vector2.new(1, 0)
RightPage.Position = UDim2.new(1, 0, 0, 0)
RightPage.Size = UDim2.new(0.5, 0, 1, 0)
makeUIList(0.02, RightPage)
MakeUIPadding(0.01, 0, 0, 0.01, RightPage)
local PlaceHolder = Instance.new('Frame', RightPage)
PlaceHolder.BackgroundTransparency = 1
PlaceHolder.Size = UDim2.new(0, 0, 0.4, 0)
PlaceHolder.LayoutOrder = 999999
local PlaceHolder = Instance.new('Frame', LeftPage)
PlaceHolder.BackgroundTransparency = 1
PlaceHolder.Size = UDim2.new(0, 0, 0.4, 0)
PlaceHolder.LayoutOrder = 999999
newPageButton.MouseEnter:Connect(function()
local TweenButton = TS:Create(newPageButton, newPageButtonBCInfo, {BackgroundTransparency = 0.9})
TweenButton:Play()
end)
newPageButton.MouseLeave:Connect(function()
local TweenButton = TS:Create(newPageButton, newPageButtonBCInfo, {BackgroundTransparency = 1})
TweenButton:Play()
end)
newPageButton.MouseButton1Click:Connect(function()
if pageShown == newPage then return end
pageShown.Visible = false
Pages[pageShown.Name].BottomLine.Visible = false
pageShown = newPage
newPageButtonBottomLine.Visible = true
newPage.Visible = true
end)
return newPage
end
local Orders = {}
local function MakeNewSubPage (pageName, side, scaleY, cornerScale, UIPaddingTop, UIListLayout)
local page = ScrollingContent[pageName][side]
local newSubPage = Instance.new('Frame', page)
newSubPage.BackgroundColor3 = Color3.fromRGB(48, 48, 69)
newSubPage.BorderSizePixel = 0
newSubPage.Size = UDim2.new(0.95, 0, scaleY, 0)
MakeUICorner(cornerScale, newSubPage)
makeUIList(UIListLayout, newSubPage)
MakeUIPadding(0, 0.03, 0.03, UIPaddingTop, newSubPage)
Orders[newSubPage] = 1
return newSubPage
end
local function MakeTitle (subPage, TitleTXT, scaleY)
local newTitle = Instance.new('TextLabel')
newTitle.BackgroundTransparency = 1
newTitle.Size = UDim2.new(1, 0, scaleY, 0)
newTitle.Font = Enum.Font.GothamBlack
newTitle.Text = TitleTXT
newTitle.TextColor3 = Color3.fromRGB(255, 255, 255)
newTitle.TextScaled = true
newTitle.LayoutOrder = Orders[subPage]
newTitle.Parent = subPage
Orders[subPage] += 1
return newTitle
end
local checkBoxColors = {
[true] = Color3.fromRGB(175, 175, 255);
[false] = Color3.fromRGB(37, 37, 54)
}
local function MakeCheckbox (subPage, checkBoxTXT, scaleY)
local newCheckBoxFrame = Instance.new('Frame', subPage)
newCheckBoxFrame.BackgroundTransparency = 1
newCheckBoxFrame.Size = UDim2.new(1, 0, scaleY, 0)
newCheckBoxFrame.LayoutOrder = Orders[subPage]
Orders[subPage] += 1
local newCheckBox = Instance.new('Frame', newCheckBoxFrame)
newCheckBox.AnchorPoint = Vector2.new(0, 0.5)
newCheckBox.BackgroundColor3 = Color3.fromRGB(37, 37, 54)
newCheckBox.Size = UDim2.new(0.049, 0, 0.73, 0)
newCheckBox.Position = UDim2.new(0, 0, 0.5, 0)
newCheckBox.BorderSizePixel = 0
newCheckBox.BackgroundColor3 = checkBoxColors[GetSave(checkBoxTXT)]
local UIStroke = Instance.new('UIStroke', newCheckBox)
UIStroke.Color = Color3.fromRGB(255, 255, 255)
UIStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Contextual
UIStroke.LineJoinMode = Enum.LineJoinMode.Round
UIStroke.Thickness = 1
local newCheckBoxButton = Instance.new('TextButton', newCheckBox)
newCheckBoxButton.Name = checkBoxTXT
newCheckBoxButton.BackgroundTransparency = 1
newCheckBoxButton.Size = UDim2.new(1,0,1,0)
newCheckBoxButton.ZIndex = 10
newCheckBoxButton.Text = ''
local newCheckBoxTXT = Instance.new('TextLabel', newCheckBoxFrame)
newCheckBoxTXT.BackgroundTransparency = 1
newCheckBoxTXT.Size = UDim2.new(0.835, 0, 1, 0)
newCheckBoxTXT.Position = UDim2.new(0.08, 0, 0, 0)
newCheckBoxTXT.Font = Enum.Font.GothamBold
newCheckBoxTXT.TextColor3 = Color3.fromRGB(255, 255, 255)
newCheckBoxTXT.TextScaled = true
newCheckBoxTXT.TextXAlignment = Enum.TextXAlignment.Left
newCheckBoxTXT.Text = checkBoxTXT
return newCheckBoxButton
end
local function MakeLargeButton (subPage, buttonTXT, scaleY)
local newLargeButtonFrame = Instance.new('Frame', subPage)
newLargeButtonFrame.BackgroundTransparency = 1
newLargeButtonFrame.Size = UDim2.new(1, 0, scaleY, 0)
newLargeButtonFrame.LayoutOrder = Orders[subPage]
Orders[subPage] += 1
local newLargeButton = Instance.new('TextButton', newLargeButtonFrame)
newLargeButton.AnchorPoint = Vector2.new(0.5, 0.5)
newLargeButton.BackgroundColor3 = Color3.fromRGB(75, 75, 108)
newLargeButton.BorderSizePixel = 0
newLargeButton.Size = UDim2.new(1, 0, 0.67, 0)
newLargeButton.Position = UDim2.new(0.5, 0, 0.5, 0)
newLargeButton.Text = ''
newLargeButton.BorderSizePixel = 0
local newLargeButtonLabel = Instance.new('TextLabel', newLargeButton)
newLargeButtonLabel.AnchorPoint = Vector2.new(0.5, 0.5)
newLargeButtonLabel.BackgroundTransparency = 1
newLargeButtonLabel.Size = UDim2.new(1, 0, 0.8, 0)
newLargeButtonLabel.Position = UDim2.new(0.5, 0, 0.5, 0)
newLargeButtonLabel.Font = Enum.Font.GothamBlack
newLargeButtonLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
newLargeButtonLabel.TextScaled = true
newLargeButtonLabel.Text = buttonTXT
MakeUICorner(0.15, newLargeButton)
local UIStroke = Instance.new('UIStroke', newLargeButton)
UIStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
UIStroke.Color = Color3.fromRGB(189, 189, 255)
UIStroke.LineJoinMode = Enum.LineJoinMode.Round
UIStroke.Thickness = 1
return newLargeButton
end
function getMacroUnits(macroName, textBlocks)
local nameMacro = macroName
local unitsFromMacro = {}
local macroExist = isfile('Jung Hub\\Anime Adventures\\' .. nameMacro)
local macroExistjson = isfile('Jung Hub\\Anime Adventures\\' .. nameMacro .. '.json')
if macroExistjson then nameMacro = nameMacro .. '.json' end
if macroExist or macroExistjson then
local sucess, response = pcall(function()
local MacroAbout = HttpService:JSONDecode( readfile( 'Jung Hub\\Anime Adventures\\' .. nameMacro) )
for _, macroTabl in pairs(MacroAbout) do
if not macroTabl['type'] or macroTabl['type'] ~= 'spawn_unit' then continue end
if table.find(unitsFromMacro, macroTabl.unit) then continue end
table.insert(unitsFromMacro, macroTabl.unit)
end
end)
if not sucess then
for i=1,6 do
unitsFromMacro[i] = "error"
end
end
end
for textBlockNumb, TextBlock in ipairs(textBlocks) do
local unitName = unitsFromMacro[textBlockNumb] if oldItemsData[unitsFromMacro[textBlockNumb]] then unitName = oldItemsData[unitsFromMacro[textBlockNumb]].Name end
TextBlock.Text = string.format('Unit %s: %s', textBlockNumb, unitName or "")
end
end
local function MakeDDL (subPage, DDLTXT, scaleY)
local newDDLFrame = Instance.new('Frame', subPage)
newDDLFrame.BackgroundTransparency = 1
newDDLFrame.Size = UDim2.new(1, 0, scaleY, 0)
newDDLFrame.LayoutOrder = Orders[subPage]
Orders[subPage] += 1
local newDDLLabel = Instance.new('TextLabel', newDDLFrame)
newDDLLabel.BackgroundTransparency = 1
newDDLLabel.Size = UDim2.new(1, 0, 0.3, 0)
newDDLLabel.Position = UDim2.new(0, 0, 0.05, 0)
newDDLLabel.Font = Enum.Font.GothamBlack
newDDLLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
newDDLLabel.TextScaled = true
newDDLLabel.TextXAlignment = Enum.TextXAlignment.Left
newDDLLabel.Text = DDLTXT
local newDDLButton = Instance.new('TextButton', newDDLFrame)
newDDLButton.BackgroundColor3 = Color3.fromRGB(75, 75, 108)
newDDLButton.BorderSizePixel = 0
newDDLButton.Size = UDim2.new(1, 0, 0.408, 0)
newDDLButton.Position = UDim2.new(0, 0, 0.45, 0)
newDDLButton.Text = ''
MakeUICorner(0.15, newDDLButton)
local UIStroke = Instance.new('UIStroke', newDDLButton)
UIStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
UIStroke.Color = Color3.fromRGB(189, 189, 255)
UIStroke.LineJoinMode = Enum.LineJoinMode.Round
UIStroke.Thickness = 1
local newDDLList = Instance.new('TextLabel', newDDLButton)
newDDLList.BackgroundTransparency = 1
newDDLList.AnchorPoint = Vector2.new(0.5, 0.5)
newDDLList.Size = UDim2.new(0.95, 0, 0.8, 0)
newDDLList.Position = UDim2.new(0.5, 0, 0.5, 0)
newDDLList.Font = Enum.Font.GothamBlack
newDDLList.TextScaled = true
newDDLList.TextXAlignment = Enum.TextXAlignment.Left
newDDLList.TextColor3 = Color3.fromRGB(255, 255, 255)
newDDLList.RichText = true
newDDLList.Text = 'None'
return newDDLButton
end
local function DDLlabel (ddlButton, newValue)
if type(newValue) == 'table' then
local newTXT = "None"
if #newValue >=1 then
newTXT = ""
for _, addItem in ipairs(newValue) do
newTXT = string.format(newTXT .. "%s, ", addItem)
end
end
ddlButton.TextLabel.Text = newTXT
else
local newTXT = "None" if newValue ~= "" and newValue ~= nil then newTXT = newValue end
ddlButton.TextLabel.Text = newTXT
end
end
local DDLColors = {
[true] = Color3.fromRGB(0, 176, 109);
[false] = Color3.fromRGB(138, 138, 199)
}
local function GetDDL (ddlButton, items, multiple, keyName, secondKeyName, tabName)
local DDL = ddlButton.Parent:FindFirstChild('List')
if not DDL then
DDL = Instance.new('Frame', MainContent) DDL.Name = 'List' DDL.Visible = false