forked from saladinaazir/gosext
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpussyvel.lua
1646 lines (1477 loc) · 61.8 KB
/
pussyvel.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
local heroes = false
local checkCount = 0
local menu = 1
local Orb
local _OnWaypoint = {}
local _OnVision = {}
local castSpell = {state = 0, tick = GetTickCount(), casting = GetTickCount() - 1000, mouse = mousePos}
local spellcast = {state = 1, mouse = mousePos}
local ItemHotKey = {[ITEM_1] = HK_ITEM_1, [ITEM_2] = HK_ITEM_2,[ITEM_3] = HK_ITEM_3, [ITEM_4] = HK_ITEM_4, [ITEM_5] = HK_ITEM_5, [ITEM_6] = HK_ITEM_6, [ITEM_7] = HK_ITEM_7,}
local barHeight, barWidth, barXOffset, barYOffset = 8, 103, 0, 0
local Allies, Enemies, Turrets, Units = {}, {}, {}, {}
local TEAM_ALLY = myHero.team
local TEAM_ENEMY = 300 - myHero.team
local TEAM_JUNGLE = 300
local charging = false
local wClock = 0
local clock = os.clock
local Latency = Game.Latency
local ping = Latency() * 0.001
local MyHeroRange = myHero.range + myHero.boundingRadius * 2
local DrawCircle = Draw.Circle
local DrawColor = Draw.Color
local DrawText = Draw.Text
local ControlCastSpell = Control.CastSpell
local GameCanUseSpell = Game.CanUseSpell
local GameTimer = Game.Timer
local GameHeroCount = Game.HeroCount
local GameHero = Game.Hero
local GameMinionCount = Game.MinionCount
local GameMinion = Game.Minion
local GameTurretCount = Game.TurretCount
local GameTurret = Game.Turret
local GameObjectCount = Game.ObjectCount
local GameObject = Game.Object
local GameParticleCount = Game.ParticleCount
local GameParticle = Game.Particle
local GameMissileCount = Game.MissileCount
local GameMissile = Game.Missile
local GameIsChatOpen = Game.IsChatOpen
local TEAM_ALLY = myHero.team
local TEAM_ENEMY = 300 - myHero.team
local TEAM_JUNGLE = 300
local MathSqrt = math.sqrt
local MathHuge = math.huge
local TableInsert = table.insert
local TableRemove = table.remove
_G.LATENCY = 0.05
require "DamageLib"
require "2DGeometry"
require "MapPositionGOS"
require "GGPrediction"
function LoadUnits()
for i = 1, GameHeroCount() do
local unit = GameHero(i); Units[i] = {unit = unit, spell = nil}
if unit.team ~= myHero.team then TableInsert(Enemies, unit)
elseif unit.team == myHero.team and unit ~= myHero then TableInsert(Allies, unit) end
end
for i = 1, GameTurretCount() do
local turret = GameTurret(i)
if turret and turret.isEnemy then TableInsert(Turrets, turret) end
end
end
local function CheckLoadedEnemyies()
local count = 0
for i, unit in ipairs(Enemies) do
if unit and unit.isEnemy then
count = count + 1
end
end
return count
end
local function ConvertToHitChance(menuValue, hitChance)
return menuValue == 1 and _G.PremiumPrediction.HitChance.High(hitChance)
or menuValue == 2 and _G.PremiumPrediction.HitChance.VeryHigh(hitChance)
or _G.PremiumPrediction.HitChance.Immobile(hitChance)
end
local function IsValid(unit)
if (unit and unit.valid and unit.isTargetable and unit.alive and unit.visible and unit.networkID and unit.pathing and unit.health > 0) then
return true;
end
return false;
end
local function Ready(spell)
return myHero:GetSpellData(spell).currentCd == 0 and myHero:GetSpellData(spell).level > 0 and myHero:GetSpellData(spell).mana <= myHero.mana and GameCanUseSpell(spell) == 0
end
function GetMode()
if Orb == 1 then
if combo == 1 then
return 'Combo'
elseif harass == 2 then
return 'Harass'
elseif lastHit == 3 then
return 'Lasthit'
elseif laneClear == 4 then
return 'Clear'
end
elseif Orb == 2 then
if _G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_COMBO] then
return "Combo"
elseif _G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_HARASS] then
return "Harass"
elseif _G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_LANECLEAR] or _G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_JUNGLECLEAR] then
return "Clear"
elseif _G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_LASTHIT] then
return "LastHit"
elseif _G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_FLEE] then
return "Flee"
end
elseif Orb == 3 then
return GOS:GetMode()
elseif Orb == 4 then
return _G.gsoSDK.Orbwalker:GetMode()
elseif Orb == 5 then
return _G.PremiumOrbwalker:GetMode()
end
if _G.SDK then
return
_G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_COMBO] and "Combo"
or
_G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_HARASS] and "Harass"
or
_G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_LANECLEAR] and "Clear"
or
_G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_JUNGLECLEAR] and "Clear"
or
_G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_LASTHIT] and "LastHit"
or
_G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_FLEE] and "Flee"
or nil
elseif _G.PremiumOrbwalker then
return _G.PremiumOrbwalker:GetMode()
end
return nil
end
function GetTarget(range)
if Orb == 1 then
if myHero.ap > myHero.totalDamage then
return EOW:GetTarget(range, EOW.ap_dec, myHero.pos)
else
return EOW:GetTarget(range, EOW.ad_dec, myHero.pos)
end
elseif Orb == 2 and TargetSelector then
if myHero.ap > myHero.totalDamage then
return TargetSelector:GetTarget(range, _G.SDK.DAMAGE_TYPE_MAGICAL)
else
return TargetSelector:GetTarget(range, _G.SDK.DAMAGE_TYPE_PHYSICAL)
end
elseif _G.GOS then
if myHero.ap > myHero.totalDamage then
return GOS:GetTarget(range, "AP")
else
return GOS:GetTarget(range, "AD")
end
elseif _G.gsoSDK then
return _G.gsoSDK.TS:GetTarget()
elseif _G.PremiumOrbwalker then
return _G.PremiumOrbwalker:GetTarget(range)
end
if _G.SDK then
if myHero.ap > myHero.totalDamage then
return _G.SDK.TargetSelector:GetTarget(range, _G.SDK.DAMAGE_TYPE_MAGICAL);
else
return _G.SDK.TargetSelector:GetTarget(range, _G.SDK.DAMAGE_TYPE_PHYSICAL);
end
elseif _G.PremiumOrbwalker then
return _G.PremiumOrbwalker:GetTarget(range)
end
end
local function SetAttack(bool)
if _G.EOWLoaded then
EOW:SetAttacks(bool)
elseif _G.SDK then
_G.SDK.Orbwalker:SetAttack(bool)
elseif _G.PremiumOrbwalker then
_G.PremiumOrbwalker:SetAttack(bool)
else
GOS.BlockAttack = not bool
end
end
local function SetMovement(bool)
if _G.EOWLoaded then
EOW:SetMovements(bool)
elseif _G.SDK then
_G.SDK.Orbwalker:SetMovement(bool)
elseif _G.PremiumOrbwalker then
_G.PremiumOrbwalker:SetMovement(bool)
else
GOS.BlockMovement = not bool
end
end
local function GetDistanceSqr(p1, p2)
if not p1 then return MathHuge end
p2 = p2 or myHero
local dx = p1.x - p2.x
local dz = (p1.z or p1.y) - (p2.z or p2.y)
return dx*dx + dz*dz
end
local function GetDistance(p1, p2)
p2 = p2 or myHero
return MathSqrt(GetDistanceSqr(p1, p2))
end
local function GetDistance2D(p1,p2)
return MathSqrt((p2.x - p1.x)*(p2.x - p1.x) + (p2.y - p1.y)*(p2.y - p1.y))
end
local function IsRecalling(unit)
for i = 1, 63 do
local buff = unit:GetBuff(i)
if buff.count > 0 and buff.name == "recall" and Game.Timer() < buff.expireTime then
return true
end
end
return false
end
local function MyHeroNotReady()
return myHero.dead or GameIsChatOpen() or (_G.JustEvade and _G.JustEvade:Evading()) or (_G.ExtLibEvade and _G.ExtLibEvade.Evading) or IsRecalling(myHero)
end
--[[
local currSpell = myHero.activeSpell
if currSpell and currSpell.valid and myHero.isChanneling then
print ("Width: "..myHero.activeSpell.width)
print ("Speed: "..myHero.activeSpell.speed)
print ("Delay: "..myHero.activeSpell.animation)
print ("range: "..myHero.activeSpell.range)
print ("Name: "..myHero.activeSpell.name)
end
]]
--[[
for i = 0, myHero.buffCount do
local buff = myHero:GetBuff(i)
if buff.name == "" then
--print(buff.name)
print("Typ: "..buff.type)
print("Name: "..buff.name)
print("Start: "..buff.startTime)
print("Expire: "..buff.expireTime)
print("Dura: "..buff.duration)
print("Stacks: "..buff.stacks)
print("Count: "..buff.count)
print("Id: "..buff.sourcenID)
print("SouceName: "..buff.sourceName)
end
end
]]
local IsLoaded = false
Callback.Add("Tick", function()
if heroes == false then
local EnemyCount = CheckLoadedEnemyies()
if EnemyCount < 1 then
LoadUnits()
else
heroes = true
end
else
if not IsLoaded then
LoadScript()
DelayAction(function()
if not Menu.Pred then return end
if Menu.Pred.Change:Value() == 1 then
require('GamsteronPrediction')
elseif Menu.Pred.Change:Value() == 2 then
require('PremiumPrediction')
else
require('GGPrediction')
end
end, 1)
IsLoaded = true
end
end
end)
local DrawTime = false
Callback.Add("Draw", function()
if heroes == false then
Draw.Text(myHero.charName.." is Loading !!", 24, myHero.pos2D.x - 50, myHero.pos2D.y + 195, Draw.Color(255, 255, 0, 0))
else
if not DrawTime then
Draw.Text(myHero.charName.." is Ready !!", 24, myHero.pos2D.x - 50, myHero.pos2D.y + 195, Draw.Color(255, 0, 255, 0))
DelayAction(function()
DrawTime = true
end, 4.0)
end
end
end)
local loaded = false
local forcedTarget
local qMissile
local qHitPoints
local lastSpellCast = Game.Timer()
local qPointsUpdatedAt = Game.Timer()
local qLastChecked = 1
enemyPaths = {}
local function GetEnemyHeroes()
local _EnemyHeroes = {}
for i = 1, GameHeroCount() do
local unit = GameHero(i)
if unit.isEnemy then
table.insert(_EnemyHeroes, unit)
end
end
return _EnemyHeroes
end
local function GetTargetMS(target)
local ms = target.pathing.isDashing and target.pathing.dashSpeed or target.ms
return ms
end
local function GetPathNodes(unit)
local nodes = {}
table.insert(nodes, unit.pos)
if unit.pathing.hasMovePath then
for i = unit.pathing.pathIndex, unit.pathing.pathCount do
path = unit:GetPath(i)
table.insert(nodes, path)
end
end
return nodes
end
local function PredictUnitPosition(unit, delay)
local predictedPosition = unit.pos
local timeRemaining = delay
local pathNodes = GetPathNodes(unit)
for i = 1, #pathNodes -1 do
local nodeDistance = GetDistance(pathNodes[i], pathNodes[i +1])
local nodeTraversalTime = nodeDistance / GetTargetMS(unit)
if timeRemaining > nodeTraversalTime then
timeRemaining = timeRemaining - nodeTraversalTime
predictedPosition = pathNodes[i + 1]
else
local directionVector = (pathNodes[i+1] - pathNodes[i]):Normalized()
predictedPosition = pathNodes[i] + directionVector * GetTargetMS(unit) * timeRemaining
break;
end
end
return predictedPosition
end
local function VectorPointProjectionOnLineSegment(v1, v2, v)
assert(v1 and v2 and v, "VectorPointProjectionOnLineSegment: wrong argument types (3 <Vector> expected)")
local cx, cy, ax, ay, bx, by = v.x, (v.z or v.y), v1.x, (v1.z or v1.y), v2.x, (v2.z or v2.y)
local rL = ((cx - ax) * (bx - ax) + (cy - ay) * (by - ay)) / ((bx - ax) ^ 2 + (by - ay) ^ 2)
local pointLine = { x = ax + rL * (bx - ax), y = ay + rL * (by - ay) }
local rS = rL < 0 and 0 or (rL > 1 and 1 or rL)
local isOnSegment = rS == rL
local pointSegment = isOnSegment and pointLine or { x = ax + rS * (bx - ax), y = ay + rS * (by - ay) }
return pointSegment, pointLine, isOnSegment
end
local function GetLineTargetCount(source, Pos, delay, speed, width)
local Count = 0
for i = 1, GameMinionCount() do
local minion = GameMinion(i)
if minion and minion.team == TEAM_ENEMY and myHero.pos:DistanceTo(minion.pos) <= 1050 and IsValid(minion) then
local predictedPos = PredictUnitPosition(minion, delay+ GetDistance(source, minion.pos) / speed)
local proj1, pointLine, isOnSegment = VectorPointProjectionOnLineSegment(source, Pos, predictedPos)
if proj1 and isOnSegment and (GetDistanceSqr(predictedPos, proj1) <= (minion.boundingRadius + width) * (minion.boundingRadius + width)) then
Count = Count + 1
end
end
end
return Count
end
local function CheckEnemyCollision(location, radius, delay, maxDistance)
if not maxDistance then
maxDistance = 1050
end
for i, hero in ipairs(GetEnemyHeroes()) do
if IsValid(hero) and GetDistance(hero.pos, location) < maxDistance then
local predictedPosition = PredictUnitPosition(hero, delay)
if GetDistance(location, predictedPosition) < radius + hero.boundingRadius then
return true, hero
end
end
end
return false
end
local function CheckMinionIntercection(location, radius, delay, maxDistance)
if not maxDistance then
maxDistance = 1200
end
for i = 1, GameMinionCount() do
local minion = GameMinion(i)
if minion.isEnemy and minion.isTargetable and minion.alive and GetDistance(minion.pos, location) < maxDistance then
local predictedPosition = PredictUnitPosition(minion, delay)
if GetDistance(location, predictedPosition) <= radius + minion.boundingRadius then
return true
end
end
end
return false
end
local function CalculateNode(missile, nodePos)
local result = {}
result["pos"] = nodePos
result["delay"] = 0.251 + GetDistance(missile.pos, nodePos) / Q.Speed
local isCollision = false
local hitEnemy
if not isCollision then
isCollision, hitEnemy = CheckEnemyCollision(nodePos, 35, result["delay"])
isCollision = CheckMinionIntercection(nodePos, 35, result["delay"])
end
result["playerHit"] = hitEnemy
result["collision"] = isCollision
return result
end
local function IsQActive()
return qMissile and qMissile.name and qMissile.name == "VelkozQMissile"
end
local function IsRActive()
if myHero.activeSpell and myHero.activeSpell.valid and myHero.activeSpell.name == "VelkozR" then
return true
else
return false
end
end
local function CheckCol(source, startPos, minion, endPos, delay, speed, range, radius)
if source.networkID == minion.networkID then
return false
end
if _G.SDK and _G.SDK.Orbwalker and startPos and minion and minion.pos and minion.type ~= myHero.type and _G.SDK.HealthPrediction:GetPrediction(minion, delay + GetDistance(startPos, minion.pos) / speed - Game.Latency()/1000) < 0 then
return false
end
local waypoints = GetPathNodes(minion)
local MPos, CastPosition = #waypoints == 1 and Vector(minion.pos) or PredictUnitPosition(minion, delay)
if startPos and MPos and GetDistanceSqr(startPos, MPos) <= (range)^2 and GetDistanceSqr(startPos, minion.pos) <= (range + 100)^2 then
local buffer = (#waypoints > 1) and 8 or 0
if minion.type == myHero.type then
buffer = buffer + minion.boundingRadius
end
if #waypoints > 1 then
local proj1, pointLine, isOnSegment = VectorPointProjectionOnLineSegment(startPos, endPos, Vector(MPos))
if proj1 and isOnSegment and (GetDistanceSqr(MPos, proj1) <= (minion.boundingRadius + radius + buffer) ^ 2) then
return true
end
end
local proj2, pointLine, isOnSegment = VectorPointProjectionOnLineSegment(startPos, endPos, Vector(minion.pos))
if proj2 and isOnSegment and (GetDistanceSqr(minion.pos, proj2) <= (minion.boundingRadius + radius + buffer) ^ 2) then
return true
end
end
end
local function CheckMinionCollision(source, endPos, delay, radius, speed, range, start)
if _G.SDK and _G.SDK.Orbwalker then
return CheckMinionCollisionGG(source, endPos, delay, radius, speed, range, start)
else
return CheckMinionCollision(source, endPos, delay, radius, speed, range, start)
end
end
local function CheckMinionCollision(source, endPos, delay, radius, speed, range, start)
local startPos = myHero.pos
if start then
startPos = start
end
for i = 1, GameMinionCount() do
local minion = GameMinion(i)
if minion.alive and minion.isEnemy and GetDistance(startPos, minion.pos) < range then
if CheckCol(source, startPos, minion, endPos, delay, speed, range, radius) then
return true
end
end
end
end
local function CheckMinionCollisionGG(source, endPos, delay, radius, speed, range, start)
local startPos = myHero.pos
if start then
startPos = start
end
for i, minion in ipairs(_G.SDK.ObjectManager:GetEnemyMinions(range)) do
if CheckCol(source, startPos, minion, endPos, delay, speed ,range, radius) then
return true
end
end
for i, minion in ipairs(_G.SDK.ObjectManager:GetMonsters(range)) do
if CheckCol(source, startPos, minion, endPos, delay, speed ,range, radius) then
return true
end
end
for i, minion in ipairs(_G.SDK.ObjectManager:GetOtherEnemyMinions(range)) do
if minion.team ~= myHero.team and CheckCol(source, startPos, minion, endPos, delay, speed ,range, radius) then
return true
end
end
return false
end
local function GetImmobileTime(unit)
local duration = 0
for i = 0, unit.buffCount do
local buff = unit:GetBuff(i);
if buff.count > 0 and buff.duration > duration and (buff.type == 5 or buff.type == 8 or buff.type == 12 or buff.type == 22 or buff.type == 23 or buff.type == 25 or buff.type == 30 or buff.type == 35 or buff.name == "recall") then
duration = buff.duration
end
end
return duration
end
local function UnitMovementBounds(unit, delay, reactionTime)
local startPosition = PredictUnitPosition(unit, delay)
local radius = 0
local deltaDelay = delay -reactionTime- GetImmobileTime(unit)
if (deltaDelay >0) then
radius = GetTargetMS(unit) * deltaDelay
end
return startPosition, radius
end
local function GetSlowedTime(unit)
local duration = 0
for i = 0, unit.buffCount do
local buff = unit:GetBuff(i);
if buff.count > 0 and buff.duration > duration and buff.type == 11 then
duration = buff.duration
return duration
end
end
return duration
end
local function GetPathLength(nodes)
local result = 0
for i = 1, #nodes -1 do
result = result + GetDistance(nodes[i], nodes[i + 1])
end
return result
end
local function GetSpellInterceptTime(startPos, endPos, delay, speed)
local interceptTime = delay + GetDistance(startPos, endPos) / speed
return interceptTime
end
local function TryGetBuff(unit, buffname)
for i = 1, unit.buffCount do
local Buff = unit:GetBuff(i)
if Buff.name == buffname and Buff.duration > 0 then
return Buff, true
end
end
return nil, false
end
local function GetStasisTarget(source, range, delay, speed, timingAccuracy)
local target
for i, t in ipairs(GetEnemyHeroes()) do
local buff, success = TryGetBuff(t, "zhonyasringshield")
if success and t.isEnemy and buff ~= nil then
local deltaInterceptTime = GetSpellInterceptTime(myHero.pos, t.pos, delay, speed) - buff.duration
if deltaInterceptTime > -Game.Latency() / 2000 and deltaInterceptTime < timingAccuracy then
target = t
return target, target.pos
end
end
end
for i = 1, Game.WardCount() do
local ward = Game.Ward(i);
if ward.isEnemy and GetDistance(source, ward.pos) <= range then
for i = 1, ward.buffCount do
local Buff = ward:GetBuff(i)
if Buff.duration > 0 and Buff.name == "teleport_target" then
local skillInterceptTime = GetSpellInterceptTime(myHero.pos, ward.pos, delay, speed)
if Buff.duration < skillInterceptTime and skillInterceptTime - Buff.duration < timingAccuracy then
return ward, ward.pos
end
end
end
end
end
for i = 1, Game.MinionCount() do
local minion = Game.Minion(i);
if minion.isEnemy and GetDistance(source, minion.pos) <= range then
for i = 1, minion.buffCount do
local Buff = minion:GetBuff(i)
if Buff.duration > 0 and Buff.name == "teleport_target" then
local skillInterceptTime = GetSpellInterceptTime(myHero.pos, minion.pos, delay, speed)
if Buff.duration < skillInterceptTime and skillInterceptTime - Buff.duration < timingAccuracy then
return minion, minion.pos
end
end
end
end
end
end
local function GetImmobileTarget(source, range, minimumCCTime)
local bestTarget
local bestCCTime = 0
for i, enemy in ipairs(GetEnemyHeroes()) do
if enemy and IsValid(enemy) and GetDistance(source, enemy.pos) <= range then
for i = 0, enemy.buffCount do
local buff = enemy:GetBuff(i)
if (buff.type == 5 or buff.type == 8 or buff.type == 12 or buff.type == 22 or buff.type == 23 or buff.type == 25 or buff.type == 30 or buff.type == 35 or buff.name == "recall") then
if (buff.duration > minimumCCTime and buff.duration > bestCCTime) then
bestTarget = enemy
bestCCTime = buff.duration
end
end
end
end
end
return bestTarget, bestCCTime
end
local function GetInteruptTarget(source, range, delay, speed, timingAccuracy)
local target
local aimPosition
for i, t in ipairs(GetEnemyHeroes()) do
if t.isEnemy and t.pathing.hasMovePath and t.pathing.isDashing and t.pathing.dashSpeed > 500 then
local dashEndPosition = t:GetPath(1)
if GetDistance(source, dashEndPosition) <= range then
local dashTimeRemaining = GetDistance(t.pos, dashEndPosition) / t.pathing.dashSpeed
local skillInterceptTime = GetSpellInterceptTime(myHero.pos, dashEndPosition, delay, speed)
local deltaInterceptTime = math.abs(skillInterceptTime - dashTimeRemaining)
if deltaInterceptTime < timingAccuracy then
target = t
aimPosition = t.pathing.endPos
return target, aimPosition
end
end
end
end
end
local function UpdateTargetPaths()
for i, enemy in ipairs(GetEnemyHeroes()) do
if enemy.isEnemy then
if not enemyPaths[enemy.charName] then
enemyPaths[enemy.charName] = {}
end
if enemy.pathing and enemy.pathing.hasMovePath and enemyPaths[enemy.charName] and GetDistance(enemy.pathing.endPos, Vector(enemyPaths[enemy.charName].endPos)) > 56 then
enemyPaths[enemy.charName]["time"] = Game.Timer()
enemyPaths[enemy.charName]["endPos"] = enemy.pathing.endPos
end
end
end
end
local function PreviousPathDetails(charName)
local deltaTime = 0
local pathEnd
if enemyPaths and enemyPaths[charName] and enemyPaths[charName]["time"] then
deltaTime = enemyPaths[charName]["time"]
pathEnd = enemyPaths[charName]["endPos"]
end
return deltaTime, pathEnd
end
local function CurrentPctLife(entity)
local pctLife = entity.health/entity.maxHealth * 100
return pctLife
end
local function CurrentPctMana(entity)
local pctMana = entity.mana/entity.maxMana * 100
return pctMana
end
local function GetEnemyCount(range, pos)
local pos = pos.pos
local count = 0
for i, hero in ipairs(GetEnemyHeroes()) do
local Range = range * range
if GetDistanceSqr(pos, hero.pos) < Range and IsValid(hero) then
count = count + 1
end
end
return count
end
local function Find2PassiveTarget()
local target
for i, enemy in ipairs(GetEnemyHeroes()) do
if enemy and IsValid(enemy) then
for i = 0, enemy.buffCount do
local buff = enemy:GetBuff(i)
if buff.name == "velkozresearchstack" and buff.count == 2 and buff.duration > 0 and GetDistance(myHero.pos, enemy.pos) < W.Range then
target = enemy
end
end
end
end
return target
end
local function Find1PassiveTarget()
local target
for i, enemy in ipairs(GetEnemyHeroes()) do
if enemy and IsValid(enemy) then
if (enemy==_G.SDK.TargetSelector:GetTarget(1000) and (not Ready(_Q)) and (not Ready(_E)) and Menu.Skills.W.UseWnostacks:Value())then
return enemy
end
if (enemy==_G.SDK.TargetSelector:GetTarget(Menu.Skills.W.Range:Value()) and Menu.Skills.W.UseWnostacks:Value())then
return enemy
end
for i = 0, enemy.buffCount do
local buff = enemy:GetBuff(i)
if buff.name == "velkozresearchstack" and buff.count >= 1 and buff.duration > 0 and GetDistance(myHero.pos, enemy.pos) < W.Range then
target = enemy
end
end
end
end
return target
end
function LoadScript()
Menu = MenuElement({type = MENU, id = "PussyAIO2".. myHero.charName, name = myHero.charName})
Menu:MenuElement({name = " ", drop = {"Version 0.06"}})
Menu:MenuElement({name = " ", drop = {"Full reworked Version from Sikaka, butchered edition"}})
Menu:MenuElement({id = "General", name = "General Settings", type = MENU})
Menu.General:MenuElement({id = "Drawing", name = "Drawing", type = MENU})
Menu.General.Drawing:MenuElement({id = "DrawAA", name = "Draw AA Range", value = false})
Menu.General.Drawing:MenuElement({id = "DrawQ", name = "Draw Q Range", value = false})
Menu.General.Drawing:MenuElement({id = "DrawW", name = "Draw W Range", value = false})
Menu.General.Drawing:MenuElement({id = "DrawE", name = "Draw E Range", value = false})
Menu.General.Drawing:MenuElement({id = "DrawEAim", name = "Draw E Aim", value = false})
Menu.General.Drawing:MenuElement({id = "DrawR", name = "Draw R Range", value = false})
Menu.General:MenuElement({id = "ReactionTime", name = "Enemy Reaction Time",tooltip = "How quickly (seconds) do you expect enemies to react to w/e. only used in custom pred, not ggpred", value = .25, min = .1, max = 1, step = .05 })
Menu.General:MenuElement({id = "DashTime", name = "Dash Time",tooltip = "How long must a dash be to auto cast on it, only used in customcast mode", value = .5, min = .1, max = 2, step = .1 })
Menu.General:MenuElement({id = "ImmobileTime", name = "Immobile Time",tooltip = "How long must a stun be to auto cast on them,, only used in customcast mode", value = .5, min = .1, max = 2, step = .1 })
Menu.General:MenuElement({id = "CastFrequency", name = "Cast Frequency Time",tooltip = "How quickly may spells be cast", value = .25, min = .1, max = 1, step = .1 })
Menu.General:MenuElement({id = "CheckInterval", name = "Collision Check Interval(in units, larger=faster performance, try 25)", value = 25, min = 15, max = 75, step = 5 })
Menu.General:MenuElement({id = "earlydist", name = "how many units early to detonate Q(try 70, depends on ping and if enemies are generally running towards you or away)", value = 70, min = -20, max = 200, step = 5 })
Menu.General:MenuElement({id = "disableaalvl", name = "level to disable AA in combo if q/w/e is ready", value = 10, min = 1, max = 19, step = 1 })
Menu.General:MenuElement({id = "disableaa", name = "level to disable AA in combo", value = 19, min = 1, max = 19, step = 1 })
----------------------------------------------------------------------
Menu:MenuElement({id = "Skills", name = "Skill Settings", type = MENU})
Menu.Skills:MenuElement({id = "Q", name = "Q", type = MENU})
Menu.Skills.Q:MenuElement({id = "Combo", name = "UseQ Combo (look for diagonal q1 manually)", value = true })
Menu.Skills.Q:MenuElement({id = "Combodiagonal", name = "UseQ1 diagonal in Combo", value = false })
Menu.Skills.Q:MenuElement({id = "Harass", name = "UseQ Harass (will q1 diagonally if collision)", value = true })
Menu.Skills.Q:MenuElement({name = " ", drop = {"///////////////////////////"}})
Menu.Skills.Q:MenuElement({name = " ", drop = {"///////////////////////////"}})
Menu.Skills.Q:MenuElement({id = "Targets", name = "Targets", type = MENU})
for i, hero in ipairs(GetEnemyHeroes()) do
if hero.isEnemy then
Menu.Skills.Q.Targets:MenuElement({id = hero.charName, name = hero.charName, value = true })
end
end
Menu.Skills.Q:MenuElement({id = "Detonate", name = "Auto Detonate", value = true })
Menu.Skills.Q:MenuElement({id = "TargetImmobile", name = "Q Immobile", value = true })
Menu.Skills.Q:MenuElement({id = "TargetDashes", name = "Q Dashes", value = true })
Menu.Skills.Q:MenuElement({id = "Range", name = "Max Q cast Range", value = 900, min = 100, max = 1050, step = 25 })
Menu.Skills.Q:MenuElement({id = "Mana", name = "Mana Limit", value = 0, min = 1, max = 100, step = 5 })
Menu.Skills:MenuElement({id = "W", name = "W", type = MENU})
Menu.Skills.W:MenuElement({id = "Combo", name = "UseW Combo ?", value = true })
Menu.Skills.W:MenuElement({id = "Harass", name = "UseW Harass ?", value = true })
Menu.Skills.W:MenuElement({name = " ", drop = {"///////////////////////////"}})
Menu.Skills.W:MenuElement({name = " ", drop = {"///////////////////////////"}})
Menu.Skills.W:MenuElement({id = "UseW", name = "only use script's custom Passive/Immo/Dash logic instead of ggpredict", tooltip="checking this causes prediction to be pussyaio's custom casts, i'd just uncheck and use ggprediction", value = false })
Menu.Skills.W:MenuElement({id = "UseWnostacks", name = "use w even if no stacks when q and e down", value = true })
Menu.Skills.W:MenuElement({id = "Detonate", name = "W Detonate Passive", value = true })
Menu.Skills.W:MenuElement({id = "TargetImmobile", name = "W Immobile", value = true,tooltip="setting only used in custom cast mode" })
Menu.Skills.W:MenuElement({id = "TargetDashes", name = "W Dashes", value = false,tooltip="setting only used in custom cast mode" })
Menu.Skills.W:MenuElement({id = "Mana", name = "Mana Limit", value = 0, min = 1, max = 100, step = 5 })
Menu.Skills.W:MenuElement({id = "Range", name = "range for casting w in combo with no stacks",tooltip="for ggpred", value = 800, min = 0, max = 1100, step = 25 })
Menu.Skills:MenuElement({id = "E", name = "E", type = MENU})
Menu.Skills.E:MenuElement({id = "Combo", name = "UseE Combo ?", value = true })
Menu.Skills.E:MenuElement({id = "Harass", name = "UseE Harass ?", value = true })
Menu.Skills.E:MenuElement({name = " ", drop = {"///////////////////////////"}})
Menu.Skills.E:MenuElement({name = " ", drop = {"///////////////////////////"}})
Menu.Skills.E:MenuElement({id = "Targets", name = "Slowed/Dash Targets", type = MENU})
for i, hero in ipairs(GetEnemyHeroes()) do
if hero.isEnemy then
Menu.Skills.E.Targets:MenuElement({id = hero.charName, name = hero.charName, value = true })
end
end
Menu.Skills.E:MenuElement({id = "UseE", name = "Only E on Immo/Dash/Slow, (means using custom casts instead of ggprediction)", value = false })
Menu.Skills.E:MenuElement({id = "TargetImmobile", name = "E Immobile", value = true })
Menu.Skills.E:MenuElement({id = "TargetSlows", name = "E Slows", value = true })
Menu.Skills.E:MenuElement({id = "TargetDashes", name = "E Dashes", value = true,tooltip="setting only used in custom cast mode" })
Menu.Skills.E:MenuElement({id = "TargetDashes2", name = "AutoE / Check Dashes everytime", value = true })
Menu.Skills.E:MenuElement({id = "Radius", name = "Radius", value = 190, min = 50, max = 210, step = 10, tooltip="will use regardless if ggpred off or on, e will cast if target probably slow enough they can't run out of radius, and the target in slowlist menu" })
Menu.Skills.E:MenuElement({id = "Mana", name = "Mana Limit", value = 0, min = 1, max = 100, step = 5 })
Menu.Skills.E:MenuElement({id = "Range", name = "Max E cast Range (for ggpred)", value = 500, min = 0, max = 800, step = 25, tooltip="e casts based on radius ignore this slider" })
Menu.Skills:MenuElement({id = "R", name = "R", type = MENU})
Menu.Skills.R:MenuElement({id = "R2", name = "Auto/Combo ?", value = 2, drop = {"AutoUlt", "Use Ult only in ComboMode"}})
Menu.Skills.R:MenuElement({id = "R1", name = "Ult function", value = 3, drop = {"Ult if killable", "Ult if Hp lower than Hp Slider", "never use Ult"}})
Menu.Skills.R:MenuElement({id = "Hp", name = "Hp Slider for Ult function 2", value = 50, min = 0, max = 100, identifier = "%"})
Menu.Skills.R:MenuElement({id = "Range", name = "Max R cast Range", value = 1200, min = 0, max = 1550, identifier = "range"})
Menu.Skills.R:MenuElement({id = "Stop", name = "Stop Ult if Enemy out of range", value = false })
Menu.Skills.R:MenuElement({id = "Active", name = "Semi. manual Key", key = string.byte("T")})
Menu:MenuElement({id = "Farm", name = "Farm Settings", type = MENU})
Menu.Farm:MenuElement({type = MENU, id = "Clear", name = "LaneClear"})
Menu.Farm.Clear:MenuElement({id = "UseW", name = "Use [W]", value = false})
Menu.Farm.Clear:MenuElement({id = "UseWM", name = "Use [W] min Minions", value = 3, min = 1, max = 6})
Menu.Farm.Clear:MenuElement({id = "Mana", name = "Min Mana to LaneClear", value = 40, min = 0, max = 100, identifier = "%"})
Menu.Farm:MenuElement({type = MENU, id = "JClear", name = "JungleClear"})
Menu.Farm.JClear:MenuElement({id = "UseQ", name = "Use [Q]", value = false})
Menu.Farm.JClear:MenuElement({id = "UseW", name = "Use [W]", value = false})
Menu.Farm.JClear:MenuElement({id = "Mana", name = "Min Mana to JungleClear", value = 40, min = 0, max = 100, identifier = "%"})
Menu:MenuElement({type = MENU, id = "Pred", name = "Prediction Settings"})
Menu.Pred:MenuElement({name = " ", drop = {"After change Pred.Typ reload 2x F6, some ggpred specific stuff coded here"}})
Menu.Pred:MenuElement({id = "Change", name = "Change Prediction Typ", value = 3, drop = {"Gamsteron Prediction", "Premium Prediction", "GGPrediction"}})
Menu.Pred:MenuElement({id = "PredQ", name = "Hitchance[Q1]", value = 2, drop = {"Normal", "High", "Immobile"}})
Menu.Pred:MenuElement({id = "PredW", name = "Hitchance[W]", value = 2, drop = {"Normal", "High", "Immobile"}})
Menu.Pred:MenuElement({id = "PredE", name = "Hitchance[E]", value = 2, drop = {"Normal", "High", "Immobile"}})
LoadSpells()
Callback.Add("Tick", function() Tick() end)
Callback.Add("WndMsg",function(Msg, Key) WndMsge(Msg, Key) end)
Callback.Add("Draw", function() DrawSpells() end)
QData = {Type = _G.SPELLTYPE_LINE, Delay = (0.25+ping), Radius = 35, Range = 1050, Speed = 1300, Collision = true, MaxCollision = 0, CollisionTypes = {_G.COLLISION_MINION}}
QspellData = {speed = 1300, range = 1050, delay = (0.25+ping), radius = 35, collision = {"minion"}, type = "linear"}
QNoColData = {Type = _G.SPELLTYPE_LINE, Delay = (0.25+ping), Radius = 35, Range = 1100, Speed = 2100, Collision = false}
QNoColspellData = {speed = 2100, range = 1050, delay = (0.25+ping), radius = 35, collision = {nil}, type = "linear"}
WData = {Type = _G.SPELLTYPE_LINE, Delay = (0.25+ping), Radius = 87, Range = 1050, Speed = 1700, Collision = false}
WspellData = {speed = 1700, range = 1050, delay = (0.25+ping), radius = 87, collision = {nil}, type = "linear"}
EData = {Type = _G.SPELLTYPE_CIRCLE, Delay = (0.25+ping), Radius = 185, Range = 800, Speed = MathHuge, Collision = false}
EspellData = {speed = MathHuge, range = 800, delay = (0.25+ping), radius = 185, collision = {nil}, type = "circular"}
end
function LoadSpells()
Q = {Range = 1050, Width = 35,Delay = 0.25, Speed = 1300}
Q2 = {Range = 1100, Width = 35,Delay = 0, Speed = 2100}
W = {Range = 1050, Width = 87,Delay = 0.25, Speed = 1700}
E = {Range = 800, Width = 185,Delay = 0.25, Speed = math.huge}
R = {Range = 1550,Width = 75, Delay = 0.25, Speed = math.huge}
end
function DrawSpells()
if Menu.General.Drawing.DrawAA:Value() then
Draw.Circle(myHero.pos, 525, Draw.Color(100, 255, 255,255))
end
if Ready(_Q) and Menu.General.Drawing.DrawQ:Value() then
Draw.Circle(myHero.pos, Q.Range, Draw.Color(150, 50, 50,50))
end
if Ready(_W) and Menu.General.Drawing.DrawW:Value() then
Draw.Circle(myHero.pos, W.Range, Draw.Color(100, 0, 0,255))
end
if Ready(_E) then
if Menu.General.Drawing.DrawE:Value() then
Draw.Circle(myHero.pos, E.Range, Draw.Color(100, 0, 255,0))
end
if forcedTarget ~= nil and IsValid(forcedTarget) and Menu.General.Drawing.DrawEAim:Value() then
local targetOrigin = PredictUnitPosition(forcedTarget, E.Delay)
local interceptTime = GetSpellInterceptTime(myHero.pos, targetOrigin, E.Delay, E.Speed)
local origin, radius = UnitMovementBounds(forcedTarget, interceptTime, Menu.General.ReactionTime:Value())
if radius < 25 then
radius = 25
end
Draw.Circle(origin, 25,10)
Draw.Circle(origin, radius,1, Draw.Color(50, 255, 255,255))
end
end
if Ready(_R) and Menu.General.Drawing.DrawR:Value() then
Draw.Circle(myHero.pos, R.Range, Draw.Color(100, 255, 0,0))
end
end
function DisableAAcheck()
if myHero.levelData.lvl >= Menu.General.disableaalvl:Value() then
if Ready(_Q) or Ready(_W) or Ready(_E) or (myHero.levelData.lvl >=Menu.General.disableaa:Value()) then
_G.SDK.Orbwalker:SetAttack(false)
else
_G.SDK.Orbwalker:SetAttack(true)
end
end
end
function Tick()
UpdateQInfo()
if IsRActive() then
SetMovement(false)
if Menu.Skills.R.Active:Value() then
ControlUlt()
end
else
SetMovement(true)
end
if PredPos and not Ready(_Q) then
PredPos = false
end
if Game.Timer() - lastSpellCast <= 0.1 then
SetMovement(false)
else
SetMovement(true)
end
SemiUlt()
if MyHeroNotReady() then return end
if Ready(_R) and not IsRActive() and Menu.Skills.R.R2:Value() == 1 then
StartUlt()
end
local Mode = GetMode()
if Mode == "Clear" or Mode == "Lasthit" then
_G.SDK.Orbwalker:SetAttack(true)
end
UpdateTargetPaths()
if Mode == "Combo" then
DisableAAcheck()
if Ready(_R) and not IsRActive() and Menu.Skills.R.R2:Value() == 2 then
StartUlt()
end
if Ready(_Q) and Menu.Skills.Q.Combo:Value() then
UpdateQInfo()
if Menu.Skills.Q.Detonate:Value() and IsQActive() then
DetonateQ()
elseif CurrentPctMana(myHero) >= Menu.Skills.Q.Mana:Value() and not IsQActive() then
AutoQ()
end
end
if Ready(_W) and CurrentPctMana(myHero) >= Menu.Skills.W.Mana:Value() and Menu.Skills.W.Combo:Value() then
AutoW()
end
-- if Game.Timer() - lastSpellCast < Menu.General.CastFrequency:Value() or IsRActive() then return end
if Ready(_E) and CurrentPctMana(myHero) >= Menu.Skills.E.Mana:Value() and Menu.Skills.E.Combo:Value() then
AutoE()
end
elseif Mode == "Harass" then