forked from Pickonme/BoL_Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGrabbed.lua
More file actions
193 lines (167 loc) · 6.43 KB
/
Copy pathGrabbed.lua
File metadata and controls
193 lines (167 loc) · 6.43 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
if myHero.charName ~= "Blitzcrank" or not VIP_USER then return end
require 'Collision'
require 'Prodiction'
local RangeAD, RangeQ, RangeR = 175, 1000, 600
local QReady, WReady, EReady, RReady, IGNITEReady = nil, nil, nil, nil, nil
local QSpeed, QDelay, QWidth = 1800, 0.25, 90
local IGNITESlot = nil
local ts
local enemyHeroes
local pd, qp, QCol
local ToInterrupt = {}
local InterruptList = {
{ charName = "Caitlyn", spellName = "CaitlynAceintheHole"},
{ charName = "FiddleSticks", spellName = "Crowstorm"},
{ charName = "FiddleSticks", spellName = "DrainChannel"},
{ charName = "Galio", spellName = "GalioIdolOfDurand"},
{ charName = "Karthus", spellName = "FallenOne"},
{ charName = "Katarina", spellName = "KatarinaR"},
{ charName = "Malzahar", spellName = "AlZaharNetherGrasp"},
{ charName = "MissFortune", spellName = "MissFortuneBulletTime"},
{ charName = "Nunu", spellName = "AbsoluteZero"},
{ charName = "Pantheon", spellName = "Pantheon_GrandSkyfall_Jump"},
{ charName = "Shen", spellName = "ShenStandUnited"},
{ charName = "Urgot", spellName = "UrgotSwap2"},
{ charName = "Varus", spellName = "VarusQ"},
{ charName = "Warwick", spellName = "InfiniteDuress"}
}
local priorityTable = {
AP = {
"Annie", "Ahri", "Akali", "Anivia", "Annie", "Brand", "Cassiopeia", "Diana", "Evelynn", "FiddleSticks", "Fizz", "Gragas", "Heimerdinger", "Karthus",
"Kassadin", "Katarina", "Kayle", "Kennen", "Leblanc", "Lissandra", "Lux", "Malzahar", "Mordekaiser", "Morgana", "Nidalee", "Orianna",
"Rumble", "Ryze", "Sion", "Swain", "Syndra", "Teemo", "TwistedFate", "Veigar", "Viktor", "Vladimir", "Xerath", "Ziggs", "Zyra", "MasterYi", "Yasuo",
},
Support = {
"Alistar", "Blitzcrank", "Janna", "Karma", "Leona", "Lulu", "Nami", "Nunu", "Sona", "Soraka", "Taric", "Thresh", "Zilean",
},
Tank = {
"Amumu", "Chogath", "DrMundo", "Galio", "Hecarim", "Malphite", "Maokai", "Nasus", "Rammus", "Sejuani", "Shen", "Singed", "Skarner", "Volibear",
"Warwick", "Yorick", "Zac",
},
AD_Carry = {
"Ashe", "Caitlyn", "Corki", "Draven", "Ezreal", "Graves", "Jayce", "Jinx", "KogMaw", "Lucian", "MissFortune", "Pantheon", "Quinn", "Shaco", "Sivir",
"Talon", "Tristana", "Twitch", "Urgot", "Varus", "Vayne", "Zed",
},
Bruiser = {
"Aatrox", "Darius", "Elise", "Fiora", "Gangplank", "Garen", "Irelia", "JarvanIV", "Jax", "Khazix", "LeeSin", "Nautilus", "Nocturne", "Olaf", "Poppy",
"Renekton", "Rengar", "Riven", "Shyvana", "Trundle", "Tryndamere", "Udyr", "Vi", "MonkeyKing", "XinZhao",
},
}
function OnLoad()
Config = scriptConfig("Grabbed", "Grabbed")
Config:addParam("combo", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
Config:addParam("grabRnd", "Grab first enemy", SCRIPT_PARAM_ONKEYDOWN, false, GetKey("Y"))
Config:addParam("ksR", "KS with R", SCRIPT_PARAM_ONOFF, true)
Config:addParam("interrupt", "Interrupt with R", SCRIPT_PARAM_ONOFF, true)
Config:addParam("printInterrupt", "Print Interrupts", SCRIPT_PARAM_ONOFF, true)
Config:addParam("autoIGN", "Auto Ignite", SCRIPT_PARAM_ONOFF, true)
Config:addParam("useW", "Use W", SCRIPT_PARAM_ONOFF, true)
Config:addParam("useE", "Use E", SCRIPT_PARAM_ONOFF, true)
Config:addParam("drawCol", "Draw Collision", SCRIPT_PARAM_ONOFF, true)
Config:permaShow("combo")
ts = TargetSelector(TARGET_LOW_HP_PRIORITY, RangeQ, DAMAGE_MAGIC or DAMAGE_PHYSICAL)
ts.name = "Blitzcrank"
Config:addTS(ts)
IGNITESlot = ((myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") and SUMMONER_1) or (myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") and SUMMONER_2) or nil)
enemyHeroes = GetEnemyHeroes()
pd = ProdictManager.GetInstance()
QCol = Collision(RangeQ, QSpeed, QDelay, QWidth)
qp = pd:AddProdictionObject(_Q, RangeQ, QSpeed, QDelay, QWidth)
for _, enemy in pairs(enemyHeroes) do
for _, champ in pairs(InterruptList) do
if enemy.charName == champ.charName then
table.insert(ToInterrupt, champ.spellName)
end
end
end
if heroManager.iCount < 10 then -- borrowed from Sidas Auto Carry
PrintChat(" >> Too few champions to arrange priority")
else
arrangePrioritys()
end
end
function OnTick()
ts:update()
CDHandler()
if Config.autoIGN then AutoIgnite() end
if Config.ksR then KSR() end
if Config.combo then Combo() end
if Config.grabRnd then
for _, enemy in pairs(enemyHeroes) do
qp:GetPredictionCallBack(enemy, CastQ)
end
end
end
function OnDraw()
if ts.target and Config.drawCol then QCol:DrawCollision(myHero, ts.target) end
end
function OnProcessSpell(unit, spell)
if #ToInterrupt > 0 and Config.interrupt and RReady then
for _, ability in pairs(ToInterrupt) do
if spell.name == ability and unit.team ~= myHero.team then
if RangeR >= GetDistance(unit) then
CastSpell(_R)
if Config.printInterrupt then print("Tried to interrupt " .. spell.name) end
end
end
end
end
end
function CDHandler()
QReady = (myHero:CanUseSpell(_Q) == READY)
WReady = (myHero:CanUseSpell(_W) == READY)
EReady = (myHero:CanUseSpell(_E) == READY)
RReady = (myHero:CanUseSpell(_R) == READY)
IGNITEReady = (IGNITESlot ~= nil and myHero:CanUseSpell(IGNITESlot) == READY)
end
function AutoIgnite()
if not IGNITEReady then return end
for _, enemy in pairs(enemyHeroes) do
if ValidTarget(enemy, 600) then
if getDmg("IGNITE", enemy, myHero) >= enemy.health then
CastSpell(IGNITESlot, enemy)
end
end
end
end
function KSR()
if not RReady then return end
for _, enemy in pairs(enemyHeroes) do
if ValidTarget(enemy, RangeR) then
if getDmg("R", enemy, myHero) >= enemy.health then
CastSpell(_R)
end
end
end
end
function Combo()
if not ts.target then return end
qp:GetPredictionCallBack(ts.target, CastQ)
if RangeAD >= GetDistance(ts.target) then
if EReady and Config.useE then CastSpell(_E, ts.target) end
if WReady and Config.useW then CastSpell(_W) end
myHero:Attack(ts.target)
end
end
function CastQ(unit, pos, spell)
local MinionCol = QCol:GetMinionCollision(myHero, unit)
if not MinionCol and RangeQ >= GetDistance(pos) and QReady then
CastSpell(_Q, pos.x, pos.z)
end
end
function SetPriority(table, hero, priority)
for i=1, #table, 1 do
if hero.charName:find(table[i]) ~= nil then
TS_SetHeroPriority(priority, hero.charName)
end
end
end
function arrangePrioritys()
for i, enemy in ipairs(enemyHeroes) do
SetPriority(priorityTable.AD_Carry, enemy, 1)
SetPriority(priorityTable.AP, enemy, 2)
SetPriority(priorityTable.Support, enemy, 3)
SetPriority(priorityTable.Bruiser, enemy, 4)
SetPriority(priorityTable.Tank, enemy, 5)
end
end