-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathAuto.lua
More file actions
5347 lines (4573 loc) · 190 KB
/
Auto.lua
File metadata and controls
5347 lines (4573 loc) · 190 KB
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
local NextSpellCast = Game.Timer()
local _allyHealthPercentage = {}
local _allyHealthUpdateRate = 1
local Heroes = {"Nami","Brand", "Zilean", "Soraka", "Lux", "Blitzcrank","Lulu", "MissFortune","Karthus", "Illaoi", "Taliyah", "Kalista", "Cassiopeia", "Azir", "Thresh", "AurelionSol", "Xerath", "TwistedFate"}
local _adcHeroes = { "Ashe", "Caitlyn", "Corki", "Draven", "Ezreal", "Graves", "Jhin", "Jinx", "Kalista", "KogMaw", "Lucian", "MissFortune", "Quinn", "Sivir", "Teemo", "Tristana", "Twitch", "Varus", "Vayne", "Xayah"}
if not table.contains(Heroes, myHero.charName) then print("Hero not supported: " .. myHero.charName) return end
local Scriptname,Version,Author,LVersion = "[Auto]","v2.0","Sikaka","0.01"
local _atan = math.atan2
local _pi = math.pi
local _min = math.min
local _abs = math.abs
local _sqrt = math.sqrt
local _huge = math.huge
local _insert = table.insert
local _sort = table.sort
local _find = string.find
local LocalDrawLine = Draw.Line;
local LocalDrawColor = Draw.Color;
local LocalDrawCircle = Draw.Circle;
local LocalDrawText = Draw.Text;
local LocalControlIsKeyDown = Control.IsKeyDown;
local LocalControlMouseEvent = Control.mouse_event;
local LocalControlSetCursorPos = Control.SetCursorPos;
local LocalControlKeyUp = Control.KeyUp;
local LocalControlKeyDown = Control.KeyDown;
local LocalGameCanUseSpell = Game.CanUseSpell;
local LocalGameLatency = Game.Latency;
local LocalGameTimer = Game.Timer;
local LocalGameHeroCount = Game.HeroCount;
local LocalGameHero = Game.Hero;
local LocalGameMinionCount = Game.MinionCount;
local LocalGameMinion = Game.Minion;
local LocalGameTurretCount = Game.TurretCount;
local LocalGameTurret = Game.Turret;
local LocalGameWardCount = Game.WardCount;
local LocalGameWard = Game.Ward;
local LocalGameObjectCount = Game.ObjectCount;
local LocalGameObject = Game.Object;
local LocalGameMissileCount = Game.MissileCount;
local LocalGameMissile = Game.Missile;
local LocalGameParticleCount = Game.ParticleCount;
local LocalGameParticle = Game.Particle;
local LocalGameIsChatOpen = Game.IsChatOpen;
local LocalGameIsOnTop = Game.IsOnTop;
local BotTick
local HPredTick
local CleanseTick
local _nextVectorCast = Game.Timer()
function VectorCast(startPos, endPos, hotkey)
if NextSpellCast > Game.Timer() then return end
if _nextVectorCast > Game.Timer() then return end
_nextVectorCast = Game.Timer() + 2
NextSpellCast = Game.Timer() + .25
local cPos = cursorPos
Control.SetCursorPos(startPos)
DelayAction(function()Control.KeyDown(hotkey) end,.05)
DelayAction(function()Control.SetCursorPos(endPos) end,.1)
DelayAction(function()Control.KeyUp(hotkey) end,.15)
end
Callback.Add("Tick", function()
if BotTick then
BotTick()
end
if HPredTick then
HPredTick()
end
if CleanseTick then
CleanseTick()
end
end)
Callback.Add("Load",
function()
AutoUtil()
--Set up the initial menu for drawing and reaction time
Menu = MenuElement({type = MENU, id = myHero.charName, name = "[Auto] "..myHero.charName})
Menu:MenuElement({id = "General", name = "General", type = MENU})
Menu.General:MenuElement({id = "DrawQ", name = "Draw Q Range", value = false})
Menu.General:MenuElement({id = "DrawW", name = "Draw W Range", value = false})
Menu.General:MenuElement({id = "DrawE", name = "Draw E Range", value = false})
Menu.General:MenuElement({id = "DrawR", name = "Draw R Range", value = false})
Menu.General:MenuElement({id = "AutoInTurret", name = "Auto Cast While In Enemy Turret Range", value = true})
Menu.General:MenuElement({id = "SkillFrequency", name = "Skill Frequency", value = .3, min = .1, max = 1, step = .1})
Menu.General:MenuElement({id = "ReactionTime", name = "Reaction Time", value = .5, min = .1, max = 1, step = .1})
Menu.General:MenuElement({id = "Delay", name = "Throttle Processing", value = false})
Menu:MenuElement({id = "Skills", name = "Skills", type = MENU})
if AutoUtil:GetCleanse() then
Menu.Skills:MenuElement({id = "Cleanse", name = "Cleanse", type = MENU})
Menu.Skills.Cleanse:MenuElement({id = "CC", name = "CC Settings", type = MENU})
Menu.Skills.Cleanse.CC:MenuElement({id = "Suppression", name = "Suppression", value = true, toggle = true})
Menu.Skills.Cleanse.CC:MenuElement({id = "Stun", name = "Stun", value = true, toggle = true})
Menu.Skills.Cleanse.CC:MenuElement({id = "Sleep", name = "Sleep", value = true, toggle = true})
Menu.Skills.Cleanse.CC:MenuElement({id = "Polymorph", name = "Polymorph", value = true, toggle = true})
Menu.Skills.Cleanse.CC:MenuElement({id = "Taunt", name = "Taunt", value = true, toggle = true})
Menu.Skills.Cleanse.CC:MenuElement({id = "Charm", name = "Charm", value = true, toggle = true})
Menu.Skills.Cleanse.CC:MenuElement({id = "Fear", name = "Fear", value = true, toggle = true})
Menu.Skills.Cleanse.CC:MenuElement({id = "Blind", name = "Blind", value = false, toggle = true})
Menu.Skills.Cleanse.CC:MenuElement({id = "Snare", name = "Snare", value = false, toggle = true})
Menu.Skills.Cleanse.CC:MenuElement({id = "Slow", name = "Slow", value = false, toggle = true})
Menu.Skills.Cleanse.CC:MenuElement({id = "Poison", name = "Poison", value = false, toggle = true})
Menu.Skills.Cleanse:MenuElement({id = "CleanseTime", name = "Cleanse CC If Duration Over X Seconds", value = .5, min = .1, max = 2, step = .1 })
Menu.Skills.Cleanse:MenuElement({id="Enabled", name="Enabled", value = true})
Menu.Skills.Cleanse:MenuElement({id="Combo", name="Require Combo", value = true})
CleanseTick = AutoUtil.AutoCleanse
end
Callback.Add("Draw", function() CoreDraw() end)
Callback.Add("WndMsg",function(Msg, Key) WndMsg(Msg, Key) end)
end)
function CurrentTarget(range, physicalDamage)
if forcedTarget and HPred:IsInRange(myHero.pos, forcedTarget.pos, range) then return forcedTarget end
if _G.SDK then
if physicalDamage then
return _G.SDK.TargetSelector:GetTarget(range, _G.SDK.DAMAGE_TYPE_PHYSICAL);
else
return _G.SDK.TargetSelector:GetTarget(range, _G.SDK.DAMAGE_TYPE_MAGICAL);
end
elseif _G.EOW then
return _G.EOW:GetTarget(range)
else
return _G.GOS:GetTarget(range,"AD")
end
end
function IsFarming()
if _G.SDK and _G.SDK.Orbwalker then
if _G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_LASTHIT] or _G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_LANECLEAR] then
return true
end
end
return false
end
function WndMsg(msg,key)
if msg == 513 then
local starget = nil
local dist = 10000
for i = 1,LocalGameHeroCount(i) do
local enemy = LocalGameHero(i)
if enemy and enemy.alive and enemy.isEnemy and HPred:GetDistanceSqr(mousePos, enemy.pos) < dist then
starget = enemy
dist = HPred:GetDistanceSqr(mousePos, enemy.pos)
end
end
if starget then
forcedTarget = starget
end
end
end
local isLoaded = false
function TryLoad()
if Game.Timer() < 30 then return end
isLoaded = true
_G[myHero.charName]()
--Can re-enable this later to turn on teleport/revive/blink tracking
HPredTick = HPred.Tick
end
--Global draw function to be called from scripts to handle drawing spells and dashes - reduces duplicate code
function CoreDraw()
if not isLoaded then
TryLoad()
return
end
--Disabled for now
if Menu.General.Delay:Value() then return end
if Q and Q.Range and KnowsSpell(_Q) and Menu.General.DrawQ:Value() then
LocalDrawCircle(myHero.pos, Q.Range, LocalDrawColor(150, 255, 0,0))
end
if W and W.Range and KnowsSpell(_W) and Menu.General.DrawW:Value() then
LocalDrawCircle(myHero.pos, W.Range, LocalDrawColor(150, 0, 255,0))
end
if E and E.Range and KnowsSpell(_E) and Menu.General.DrawE:Value() then
LocalDrawCircle(myHero.pos, E.Range, LocalDrawColor(150, 0, 0,255))
end
if R and R.Range and KnowsSpell(_R) and Menu.General.DrawR:Value() then
LocalDrawCircle(myHero.pos, R.Range, LocalDrawColor(150, 0, 255,255))
end
for i = 1, LocalGameHeroCount() do
local Hero = LocalGameHero(i)
if Hero.isEnemy and Hero.pathing.hasMovePath and Hero.pathing.isDashing and Hero.pathing.dashSpeed>500 then
LocalDrawCircle(Hero:GetPath(1), 40, 20, LocalDrawColor(255, 255, 255, 255))
end
end
end
function SetMovement(bool)
if _G.EOWLoaded then
EOW:SetMovements(bool)
elseif _G.SDK then
_G.SDK.Orbwalker:SetMovement(bool)
else
GOS.BlockMovement = not bool
end
end
function SetAttack(bool)
if _G.EOWLoaded then
EOW:SetAttacks(bool)
elseif _G.SDK then
_G.SDK.Orbwalker:SetAttack(bool)
else
GOS.BlockAttack = not bool
end
end
function IsEvading()
if ExtLibEvade and ExtLibEvade.Evading then return true end
return false
end
function IsAttacking()
if myHero.attackData and myHero.attackData.target and myHero.attackData.state == STATE_WINDUP then return true end
return false
end
local _nextTick = Game.Timer()
local _tickFrequency = .2
function IsDelaying()
if _nextTick > Game.Timer() then return true end
if Menu.General.Delay:Value() then
_nextTick = Game.Timer() + _tickFrequency
end
return false
end
function SpecialCast(key, pos, bypassTiming, isLine)
if not Menu.Skills.Combo:Value() and not Menu.General.AutoInTurret:Value() and InsideEnemyTurretRange() then return end
if not bypassTiming and NextSpellCast > Game.Timer() then return end
if not pos then
Control.CastSpell(key)
return
end
if type(pos) == "userdata" and pos.pos then
pos = pos.pos
end
if not pos:ToScreen().onScreen and isLine then
pos = myHero.pos + (pos - myHero.pos):Normalized() * 250
end
if not pos:ToScreen().onScreen then
return
end
if _G.SDK and _G.Control then
_G.Control.CastSpell(key, pos)
else
Control.CastSpell(key, pos)
end
if not bypassTiming then
NextSpellCast = Menu.General.SkillFrequency:Value() + Game.Timer()
end
end
--Full credit ofc to LazyXerath
local castSpell = {state = 0, tick = GetTickCount(), casting = GetTickCount() - 1000, mouse = mousePos}
local function CastSpellMM(spell,pos,range,delay)
local range = range or math.huge
local delay = delay or 250
local ticker = GetTickCount()
if castSpell.state == 0 and HPred:GetDistance(myHero.pos,pos) < range and ticker - castSpell.casting > delay + Game.Latency() then
castSpell.state = 1
castSpell.mouse = mousePos
castSpell.tick = ticker
end
if castSpell.state == 1 then
if ticker - castSpell.tick < Game.Latency() then
local castPosMM = pos:ToMM()
Control.SetCursorPos(castPosMM.x,castPosMM.y)
Control.KeyDown(spell)
Control.KeyUp(spell)
castSpell.casting = ticker + delay
DelayAction(function()
if castSpell.state == 1 then
Control.SetCursorPos(castSpell.mouse)
castSpell.state = 0
end
end,Game.Latency()/1000)
end
if ticker - castSpell.casting > Game.Latency() then
Control.SetCursorPos(castSpell.mouse)
castSpell.state = 0
end
end
end
local function ReleaseSpell(spell,pos,range,delay)
local delay = delay or 250
local ticker = GetTickCount()
if castSpell.state == 0 and HPred:GetDistance(myHero.pos,pos) < range and ticker - castSpell.casting > delay + Game.Latency() then
castSpell.state = 1
castSpell.mouse = mousePos
castSpell.tick = ticker
end
if castSpell.state == 1 then
if ticker - castSpell.tick < Game.Latency() then
if not pos:ToScreen().onScreen then
pos = myHero.pos + (pos - myHero.pos):Normalized() * 250
Control.SetCursorPos(pos)
Control.KeyUp(spell)
else
Control.SetCursorPos(pos)
Control.KeyUp(spell)
end
castSpell.casting = ticker + delay
DelayAction(function()
if castSpell.state == 1 then
Control.SetCursorPos(castSpell.mouse)
castSpell.state = 0
end
end,Game.Latency()/1000)
end
if ticker - castSpell.casting > Game.Latency() then
Control.SetCursorPos(castSpell.mouse)
castSpell.state = 0
end
end
end
function ImmediateCast(key, pos)
if _G.SDK and _G.Control then
_G.Control.CastSpell(key, pos)
else
Control.CastSpell(key, pos)
end
end
function KnowsSpell(spell)
local spellInfo = myHero:GetSpellData(spell)
if spellInfo and spellInfo.level > 0 then
return true
end
return false
end
function CurrentPctLife(entity)
local pctLife = entity.health/entity.maxHealth * 100
return pctLife
end
function CurrentPctMana(entity)
local pctMana = entity.mana/entity.maxMana * 100
return pctMana
end
function GetHeroByHandle(handle)
for ei = 1, LocalGameHeroCount() do
local Enemy = LocalGameHero(ei)
if Enemy.isEnemy and Enemy.handle == handle then
return Enemy
end
end
end
function Ready(spellSlot)
return Game.CanUseSpell(spellSlot) == 0
end
function IsRecalling()
for i = 1, myHero.buffCount do
local buff = myHero:GetBuff(i)
if buff.name == "recall" and buff.duration > 0 then
return true
end
end
return false
end
function InsideEnemyTurretRange()
for i = 1, LocalGameTurretCount() do
local turret = LocalGameTurret(i)
if turret then
local range = (turret.boundingRadius + 750 + myHero.boundingRadius / 2)
if turret.isEnemy and HPred:IsInRange(turret.pos, myHero.pos, range) then
return true
end
end
end
end
function UpdateAllyHealth()
local deltaTick = Game.Timer() - _allyHealthUpdateRate
if deltaTick >= 1 then
_allyHealthPercentage = {}
_allyHealthUpdateRate = Game.Timer()
for i = 1, LocalGameHeroCount() do
local hero = LocalGameHero(i)
if hero ~= nill and hero.isAlly and hero.alive then
_allyHealthPercentage[hero.networkID] = CurrentPctLife(hero)
end
end
end
end
class "AutoUtil"
function AutoUtil:FindEnemyWithBuff(buffName, range, stackCount)
for i = 1, LocalGameHeroCount() do
local hero = LocalGameHero(i)
if hero ~= nil and hero.isEnemy and HPred:IsInRange(myHero.pos, hero.pos, range) then
for bi = 1, hero.buffCount do
local Buff = hero:GetBuff(bi)
if Buff.name == buffName and Buff.duration > 0 and Buff.count >= stackCount then
return hero
end
end
end
end
end
function AutoUtil:__init()
itemKey = {}
_ccNames =
{
["Cripple"] = 3,
["Stun"] = 5,
["Silence"] = 7,
["Taunt"] = 8,
["Polymorph"] = 9,
["Slow"] = 10,
["Snare"] = 11,
["Sleep"] = 18,
["Nearsight"] = 19,
["Fear"] = 21,
["Charm"] = 22,
["Poison"] = 23,
["Suppression"] = 24,
["Blind"] = 25,
-- ["Shred"] = 27,
["Flee"] = 28,
-- ["Knockup"] = 29,
["Airborne"] = 30,
["Disarm"] = 31
}
end
function AutoUtil:SupportMenu(Menu)
---[ITEM SETTINGS]---
Menu:MenuElement({id = "Items", name = "Item Settings", type = MENU})
---[LOCKET SETTINGS]---
Menu.Items:MenuElement({id = "Locket", name = "Locket", type = MENU})
Menu.Items.Locket:MenuElement({id = "Threshold", tooltip = "How much damage allies received in last second", name = "Ally Damage Threshold", value = 15, min = 1, max = 80, step = 1 })
Menu.Items.Locket:MenuElement({id="Count", tooltip = "How many allies must have been injured in last second to cast", name = "Ally Count", value = 3, min = 1, max = 6, step = 1 })
Menu.Items.Locket:MenuElement({id="Enabled", name="Enabled", value = true})
---[CRUCIBLE SETTINGS]---
Menu.Items:MenuElement({id = "Crucible", name = "Crucible", type = MENU})
Menu.Items.Crucible:MenuElement({id = "Targets", name = "Targets", type = MENU})
for i = 1, LocalGameHeroCount() do
local hero = LocalGameHero(i)
if hero.isAlly and myHero ~= hero then
if table.contains(_adcHeroes, hero.charName) then
Menu.Items.Crucible.Targets:MenuElement({id = hero.charName, name = hero.charName, value = true })
else
Menu.Items.Crucible.Targets:MenuElement({id = hero.charName, name = hero.charName, value = false })
end
end
end
Menu.Items.Crucible:MenuElement({id = "CC", name = "CC Settings", type = MENU})
Menu.Items.Crucible.CC:MenuElement({id = "CleanseTime", name = "Cleanse CC If Duration Over (Seconds)", value = .5, min = .1, max = 2, step = .1 })
Menu.Items.Crucible.CC:MenuElement({id = "Suppression", name = "Suppression", value = true, toggle = true})
Menu.Items.Crucible.CC:MenuElement({id = "Stun", name = "Stun", value = true, toggle = true})
Menu.Items.Crucible.CC:MenuElement({id = "Sleep", name = "Sleep", value = true, toggle = true})
Menu.Items.Crucible.CC:MenuElement({id = "Polymorph", name = "Polymorph", value = true, toggle = true})
Menu.Items.Crucible.CC:MenuElement({id = "Taunt", name = "Taunt", value = true, toggle = true})
Menu.Items.Crucible.CC:MenuElement({id = "Charm", name = "Charm", value = true, toggle = true})
Menu.Items.Crucible.CC:MenuElement({id = "Fear", name = "Fear", value = true, toggle = true})
Menu.Items.Crucible.CC:MenuElement({id = "Blind", name = "Blind", value = false, toggle = true})
Menu.Items.Crucible.CC:MenuElement({id = "Snare", name = "Snare", value = false, toggle = true})
Menu.Items.Crucible.CC:MenuElement({id = "Slow", name = "Slow", value = false, toggle = true})
Menu.Items.Crucible.CC:MenuElement({id = "Poison", name = "Poison", value = false, toggle = true})
---[REDEMPTION SETTINGS]---
Menu.Items:MenuElement({id = "Redemption", name = "Redemption", type = MENU})
Menu.Items.Redemption:MenuElement({id = "Targets", name = "Targets", type = MENU})
for i = 1, LocalGameHeroCount() do
local hero = LocalGameHero(i)
if hero.isAlly then
Menu.Items.Redemption.Targets:MenuElement({id = hero.charName, name = hero.charName, tooltip = "How low must this target's HP be to cast redemption", value = 60, min = 10, max = 90, step = 10 })
end
end
Menu.Items.Redemption:MenuElement({id="Duration", name="Prediction Duration", tooltip = "allies must be immobile for at least this long for redemption to cast", value = .5, min = 0, max = 2, step = .25})
Menu.Items.Redemption:MenuElement({id="Count", name = "Target Count", tooltip = "The total number of allies+enemies that may be hit with redemption in order to cast it.", value = 3, min = 1, max = 10, step = 1})
end
function AutoUtil:CalculatePhysicalDamage(target, damage)
local targetArmor = target.armor * myHero.armorPenPercent - myHero.armorPen
local damageReduction = 100 / ( 100 + targetArmor)
if targetArmor < 0 then
damageReduction = 2 - (100 / (100 - targetArmor))
end
damage = damage * damageReduction
return damage
end
function AutoUtil:CalculateMagicDamage(target, damage)
local targetMR = target.magicResist * myHero.magicPenPercent - myHero.magicPen
local damageReduction = 100 / ( 100 + targetMR)
if targetMR < 0 then
damageReduction = 2 - (100 / (100 - targetMR))
end
damage = damage * damageReduction
return damage
end
function AutoUtil:GetNearestAlly(entity, range)
local ally = nil
local distance = _huge
for i = 1,LocalGameHeroCount() do
local hero = LocalGameHero(i)
if hero and hero ~= entity and hero.isAlly and HPred:CanTargetALL(hero) then
local d = HPred:GetDistanceSqr(entity.pos, hero.pos)
if d < distance and d < range * range then
distance = d
ally = hero
end
end
end
if distance < range then
return ally
end
end
function AutoUtil:NearestEnemy(entity)
local distance = 999999
local enemy = nil
for i = 1,LocalGameHeroCount() do
local hero = LocalGameHero(i)
if hero and HPred:CanTarget(hero) then
local d = HPred:GetDistanceSqr(entity.pos, hero.pos)
if d < distance then
distance = d
enemy = hero
end
end
end
return _sqrt(distance), enemy
end
function AutoUtil:CountEnemiesNear(origin, range)
local count = 0
for i = 1,LocalGameHeroCount(i) do
local enemy = LocalGameHero(i)
if enemy and HPred:CanTarget(enemy) and HPred:IsInRange(origin, enemy.pos, range) then
count = count + 1
end
end
return count
end
function AutoUtil:GetItemSlot(id)
for i = 6, 12 do
if myHero:GetItemData(i).itemID == id then
return i
end
end
return nil
end
function AutoUtil:IsItemReady(id, ward)
if not self.itemKey or #self.itemKey == 0 then
self.itemKey =
{
HK_ITEM_1,
HK_ITEM_2,
HK_ITEM_3,
HK_ITEM_4,
HK_ITEM_5,
HK_ITEM_6,
HK_ITEM_7
}
end
local slot = self:GetItemSlot(id)
if slot then
return myHero:GetSpellData(slot).currentCd == 0 and not (ward and myHero:GetSpellData(slot).ammo == 0)
end
end
function AutoUtil:CastItem(unit, id, range)
if unit == myHero or HPred:GetDistance(myHero.pos, unit.pos, range) then
local keyIndex = self:GetItemSlot(id) - 5
local key = self.itemKey[keyIndex]
if key then
if unit ~= myHero then
Control.CastSpell(key, unit.pos or unit)
else
Control.CastSpell(key)
end
end
end
end
function AutoUtil:CastItemMiniMap(pos, id)
local keyIndex = self:GetItemSlot(id) - 5
local key = self.itemKey[keyIndex]
if key then
CastSpellMM(key, pos)
end
end
function AutoUtil:HasBuffType(unit, buffType, duration)
for i = 1, unit.buffCount do
local Buff = unit:GetBuff(i)
if Buff.duration > duration and Buff.count > 0 and Buff.type == buffType then
return true
end
end
return false
end
function AutoUtil:UseSupportItems()
--Use crucible on carry if they are CCd
if AutoUtil:IsItemReady(3222) then
AutoUtil:AutoCrucible()
end
--Use Locket
if AutoUtil:IsItemReady(3190) then
AutoUtil:AutoLocket()
end
--Use Redemption
if AutoUtil:IsItemReady(3107) then
AutoUtil:AutoRedemption()
end
end
function AutoUtil:AutoCrucible()
for i = 1, LocalGameHeroCount() do
local hero = LocalGameHero(i)
if hero and hero.isAlly and hero.alive and hero ~= myHero then
if Menu.Items.Crucible.Targets[hero.charName] and Menu.Items.Crucible.Targets[hero.charName]:Value() then
for ccName, ccType in pairs(_ccNames) do
if Menu.Items.Crucible.CC[ccName] and Menu.Items.Crucible.CC[ccName]:Value() and self:HasBuffType(hero, ccType, Menu.Items.Crucible.CC.CleanseTime:Value()) then
AutoUtil:CastItem(hero, 3222, 650)
end
end
end
end
end
end
function AutoUtil:AutoLocket()
local injuredCount = 0
for i = 1, LocalGameHeroCount() do
local hero = LocalGameHero(i)
if hero and _allyHealthPercentage and _allyHealthPercentage[hero.networkID] and hero.isAlly and hero.alive and HPred:IsInRange(myHero.pos, hero.pos, 700) then
local deltaLifeLost = _allyHealthPercentage[hero.networkID] - CurrentPctLife(hero)
if deltaLifeLost >= Menu.Items.Locket.Threshold:Value() then
injuredCount = injuredCount + 1
end
end
end
if injuredCount >= Menu.Items.Locket.Count:Value() then
AutoUtil:CastItem(myHero, 3190, _huge)
end
end
function AutoUtil:AutoRedemption()
local targetCount = 0
local aimPos
for i = 1, LocalGameHeroCount() do
local hero = LocalGameHero(i)
if hero and hero.isAlly and HPred:CanTargetALL(hero) and HPred:IsInRange(myHero.pos, hero.pos, 5500) and Menu.Items.Redemption.Targets[hero.charName] and Menu.Items.Redemption.Targets[hero.charName]:Value() >= CurrentPctLife(hero) then
--Check if they are immobile for at least the duration we specified
if HPred:GetImmobileTime(hero) >= Menu.Items.Redemption.Duration:Value() then
targetCount = 0
aimPos = hero.pos
--we can start adding targets within range!!
for z = 1, LocalGameHeroCount() do
local target = LocalGameHero(z)
if target and HPred:CanTargetALL(target) and HPred:IsInRange(hero.pos, HPred:PredictUnitPosition(target, 2),525) then
targetCount = targetCount + 1
end
end
if targetCount >= Menu.Items.Redemption.Count:Value() then
break
end
end
end
end
if aimPos and targetCount >= Menu.Items.Redemption.Count:Value() then
AutoUtil:CastItemMiniMap(aimPos, 3107)
end
end
function AutoUtil:GetExhaust()
local exhaustHotkey
local exhaustData = myHero:GetSpellData(SUMMONER_1)
if exhaustData.name ~= "SummonerExhaust" then
exhaustData = myHero:GetSpellData(SUMMONER_2)
exhaustHotkey = HK_SUMMONER_2
else
exhaustHotkey = HK_SUMMONER_1
end
if exhaustData.name == "SummonerExhaust" and exhaustData.currentCd == 0 then
return exhaustHotkey
end
end
function AutoUtil:AutoExhaust()
local exhaustHotkey = AutoUtil:GetExhaust()
if not exhaustHotkey or not Menu.Skills.Exhaust then return end
for i = 1, LocalGameHeroCount() do
local enemy = LocalGameHero(i)
--It's an enemy who is within exhaust range and is toggled ON in ExhaustList
if enemy and enemy.isEnemy and HPred:IsInRange(myHero.pos, enemy.pos, 600 + enemy.boundingRadius) and HPred:CanTarget(enemy, 650) and Menu.Skills.Exhaust.Targets[enemy.charName] and Menu.Skills.Exhaust.Targets[enemy.charName]:Value() then
for allyIndex = 1, LocalGameHeroCount() do
local ally = LocalGameHero(allyIndex)
if ally and ally.isAlly and ally.alive and HPred:IsInRange(enemy.pos, ally.pos, 600 + Menu.Skills.Exhaust.Radius:Value()) and CurrentPctLife(ally) <= Menu.Skills.Exhaust.Health:Value() then
Control.CastSpell(exhaustHotkey, enemy)
return
end
end
end
end
end
function AutoUtil:GetCleanse()
local cleanseHotkey
local cleanseData = myHero:GetSpellData(SUMMONER_1)
if cleanseData.name ~= "SummonerBoost" then
cleanseData = myHero:GetSpellData(SUMMONER_2)
cleanseHotkey = HK_SUMMONER_2
else
cleanseHotkey = HK_SUMMONER_1
end
if cleanseData.name == "SummonerBoost" and cleanseData.currentCd < 2 then
return cleanseHotkey
end
end
function AutoUtil:AutoCleanse()
local cleanseHotkey = AutoUtil:GetCleanse()
if not cleanseHotkey or not Menu.Skills.Cleanse then return end
if not Menu.Skills.Combo then return end
if Menu.Skills.Cleanse.Enabled:Value() and (Menu.Skills.Combo:Value() or not Menu.Skills.Cleanse.Combo:Value()) then
for ccName, ccType in pairs(_ccNames) do
if Menu.Skills.Cleanse.CC[ccName] and Menu.Skills.Cleanse.CC[ccName]:Value() and AutoUtil:HasBuffType(myHero, ccType, Menu.Skills.Cleanse.CleanseTime:Value()) then
Control.CastSpell(cleanseHotkey)
return
end
end
end
end
class "Brand"
function Brand:__init()
print("Loaded [Auto] ".. myHero.charName)
self:LoadSpells()
self:CreateMenu()
BotTick = self.Tick;
Callback.Add("Draw", function() self:Draw() end)
end
function Brand:LoadSpells()
Q = {Range = 1050, Width = 80, Delay = 0.25, Speed = 1550, Collision = true}
W = {Range = 900, Width = 250, Delay = 0.625, Speed = _huge}
E = {Range = 600, Delay = 0.25, Speed = _huge}
R = {Range = 750, Delay = 0.25, Speed = 1700}
end
function Brand:CreateMenu()
Menu.Skills:MenuElement({id = "Q", name = "[Q] Sear", type = MENU})
Menu.Skills.Q:MenuElement({id = "AccuracyCombo", name = "Combo Accuracy", value = 3, min = 1, max = 6, step = 1 })
Menu.Skills.Q:MenuElement({id = "AccuracyAuto", name = "Auto Accuracy", value = 3, min = 1, max = 6, step = 1 })
Menu.Skills:MenuElement({id = "W", name = "[W] Pillar of Flame", type = MENU})
Menu.Skills.W:MenuElement({id = "AccuracyCombo", name = "Combo Accuracy", value = 3, min = 1, max = 6, step = 1 })
Menu.Skills.W:MenuElement({id = "AccuracyAuto", name = "Auto Cast Accuracy", value = 3, min = 1, max = 6, step = 1 })
Menu.Skills.W:MenuElement({id = "Mana", name = "Auto Cast Mana", value = 30, min = 1, max = 100, step = 5 })
Menu.Skills:MenuElement({id = "E", name = "[E] Conflagration", type = MENU})
Menu.Skills.E:MenuElement({id = "Mana", name = "Auto Cast Mana", value = 15, min = 1, max = 100, step = 5 })
Menu.Skills.E:MenuElement({id = "Targets", name = "Auto Harass Targets", type = MENU})
for i = 1, LocalGameHeroCount() do
local hero = LocalGameHero(i)
if hero and hero.isEnemy then
Menu.Skills.E.Targets:MenuElement({id = hero.charName, name = hero.charName, value = true, toggle = true})
end
end
Menu.Skills:MenuElement({id = "R", name = "[R] Pyroclasm", type = MENU})
Menu.Skills.R:MenuElement({id = "Count", name = "Auto Cast On Enemy Count", value = 3, min = 1, max = 6, step = 1 })
Menu.Skills:MenuElement({id = "Combo", name = "Combo Key",value = false, key = string.byte(" ") })
end
function Brand:Draw()
--Nothing special needs to be drawn for brand... Could add prediciton for Q/W but its prob not needed
end
local WCastPos, WCastTime
--Gets the time until our W will deal damage
function Brand:GetWHitTime()
local deltaHitTime = 99999999
if( WCastTime) then
deltaHitTime = WCastTime + W.Delay - Game.Timer()
end
return deltaHitTime
end
function Brand:Tick()
if myHero.dead or IsRecalling() or IsEvading() or IsAttacking() or IsDelaying() then return end
--UnCache the last W if its already hit
if WCastPos and Game.Timer() - WCastTime > 1.5 then
WCastPos = nil
end
--Reliable spells cast even if combo key is NOT pressed and are the most likely to hit.
if Ready(_W) then
Brand:ReliableW()
if CurrentPctMana(myHero) >= Menu.Skills.W.Mana:Value() then
Brand:UnreliableW(Menu.Skills.W.AccuracyAuto:Value())
end
end
if Ready(_Q) then
Brand:ReliableQ()
end
if Ready(_E) then
Brand:ReliableE()
end
if Ready(_R) then
Brand:AutoR()
end
--Unreliable spells are cast if the combo or harass key is pressed
if Menu.Skills.Combo:Value() then
if Ready(_W) then
Brand:UnreliableW(Menu.Skills.W.AccuracyCombo:Value())
end
if Ready(_Q) then
Brand:UnreliableQ(Menu.Skills.Q.AccuracyCombo:Value())
end
else
if Ready(_Q) then
Brand:UnreliableQ(Menu.Skills.Q.AccuracyAuto:Value())
end
end
end
function Brand:ReliableQ()
local target, aimPosition = HPred:GetReliableTarget(myHero.pos, Q.Range, Q.Delay, Q.Speed,Q.Width, Menu.General.ReactionTime:Value(), Q.Collision)
if target and HPred:IsInRange(myHero.pos, aimPosition, Q.Range) then
--Check if they are ablaze or will be hit by W before Q
local WInterceptTime = self:GetWHitTime()
local QInterceptTime = HPred:GetSpellInterceptTime(myHero.pos, aimPosition, Q.Delay, Q.Speed)
if HPred:HasBuff(target, "BrandAblaze", QInterceptTime) or (WCastPos and HPred:IsInRange(WCastPos, aimPosition, W.Width) and QInterceptTime > WInterceptTime) then
SpecialCast(HK_Q, aimPosition, false, true)
end
end
end
function Brand:UnreliableQ(minAccuracy)
for i = 1,LocalGameHeroCount(i) do
local enemy = LocalGameHero(i)
if enemy and HPred:CanTarget(enemy) then
local hitChance, aimPosition = HPred:GetHitchance(myHero.pos, enemy,Q.Range, Q.Delay, Q.Speed, Q.Width, Q.Collision, nil)
local WInterceptTime = self:GetWHitTime()
local QInterceptTime = HPred:GetSpellInterceptTime(myHero.pos, aimPosition, Q.Delay, Q.Speed)
if hitChance and hitChance >= minAccuracy and HPred:IsInRange(myHero.pos, aimPosition, Q.Range) and (HPred:HasBuff(enemy, "BrandAblaze",1) or (WCastPos and HPred:IsInRange(WCastPos, aimPosition, W.Width) and QInterceptTime > WInterceptTime)) then
SpecialCast(HK_Q, aimPosition, false, true)
end
end
end
end
function Brand:ReliableW()
local target, aimPosition = HPred:GetReliableTarget(myHero.pos, W.Range, W.Delay, W.Speed,W.Width, Menu.General.ReactionTime:Value(), W.Collision)
if target and HPred:IsInRange(myHero.pos, aimPosition, W.Range) then
SpecialCast(HK_W, aimPosition)
WCastPos = aimPosition
WCastTime = Game.Timer()
end
end
function Brand:UnreliableW(minAccuracy)
local hitRate, aimPosition = HPred:GetUnreliableTarget(myHero.pos, W.Range, W.Delay, W.Speed, W.Width, W.Collision, minAccuracy)
if hitRate and HPred:IsInRange(myHero.pos, aimPosition, W.Range) then
SpecialCast(HK_W, aimPosition)
WCastPos = aimPosition
WCastTime = Game.Timer()
end
end
function Brand:ReliableE()
for i = 1, LocalGameHeroCount() do
local hero = LocalGameHero(i)
if hero and HPred:CanTarget(hero) and HPred:IsInRange(myHero.pos, hero.pos, E.Range) and Menu.Skills.E.Targets[hero.charName] and Menu.Skills.E.Targets[hero.charName]:Value() then
--TODO: Sort targets by priority and health (KS then priority list)
SpecialCast(HK_E, hero.pos)
break
end
end
end
function Brand:AutoR()
for i = 1,LocalGameHeroCount(i) do
local enemy = LocalGameHero(i)
if enemy and HPred:CanTarget(enemy) and HPred:HasBuff(enemy, "BrandAblaze") and HPred:IsInRange(myHero.pos, enemy.pos, R.Range) then
local targetCount = AutoUtil:CountEnemiesNear(myHero.pos, 600)
if targetCount >= Menu.Skills.R.Count:Value() then
SpecialCast(HK_R, enemy.pos)
break
end
end
end
end
class "Soraka"
function Soraka:__init()
print("Loaded [Auto] ".. myHero.charName)
self:LoadSpells()
self:CreateMenu()
BotTick = self.Tick;
Callback.Add("Draw", function() self:Draw() end)
end
function Soraka:LoadSpells()
Q = {Range = 800, Width = 235,Delay = 0.25, Speed = 1150}
W = {Range = 550 }
E = {Range = 925, Width = 300, Delay = 1, Speed = _huge}
end
function Soraka:CreateMenu()
AutoUtil:SupportMenu(Menu)
if AutoUtil:GetExhaust() then
Menu.Skills:MenuElement({id = "Exhaust", name = "Exhaust", type = MENU})
Menu.Skills.Exhaust:MenuElement({id ="Targets", name ="Target List", type = MENU})
for i = 1, LocalGameHeroCount() do
local hero = LocalGameHero(i)
if hero and hero.isEnemy then
Menu.Skills.Exhaust.Targets:MenuElement({id = hero.charName, name = hero.charName, value = true })
end
end
Menu.Skills.Exhaust:MenuElement({id = "Health", tooltip ="How low health allies must be to use exhaust", name = "Ally Health", value = 40, min = 1, max = 100, step = 5 })
Menu.Skills.Exhaust:MenuElement({id = "Radius", tooltip ="How close targets must be to allies to use exhaust", name = "Peel Distance", value = 200, min = 100, max = 1000, step = 25 })
Menu.Skills.Exhaust:MenuElement({id="Enabled", name="Enabled", value = false})
end
Menu.Skills:MenuElement({id = "Q", name = "[Q] Starcall", type = MENU})
Menu.Skills.Q:MenuElement({id = "AccuracyCombo", name = "Combo Accuracy", value = 3, min = 1, max = 6, step = 1 })
Menu.Skills.Q:MenuElement({id = "AccuracyAuto", name = "Auto Accuracy", value = 3, min = 1, max = 6, step = 1 })
Menu.Skills.Q:MenuElement({id = "Mana", name = "Auto Cast Mana", value = 30, min = 1, max = 100, step = 5 })