-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathEasyCait.lua
229 lines (191 loc) · 9.32 KB
/
EasyCait.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
--[[
EasyCait - Scripted by How I met Katarina.
Version: 0.05
Credits : Bilbao for maths and skill table, Honda7 for SOW and VPred
Hope I didn't forget somebody.
]]--
-- Hero check
if GetMyHero().charName ~= "Caitlyn" then
return
end
local version = 0.05
local pVersion = "0.05"
local AUTOUPDATE = true
local SCRIPT_NAME = "EasyCait"
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
local SOURCELIB_URL = "https://raw.github.com/TheRealSource/public/master/common/SourceLib.lua"
local SOURCELIB_PATH = LIB_PATH.."SourceLib.lua"
if FileExist(SOURCELIB_PATH) then
require("SourceLib")
else
DOWNLOADING_SOURCELIB = true
DownloadFile(SOURCELIB_URL, SOURCELIB_PATH, function() print("Required libraries downloaded successfully, please reload") end)
end
if DOWNLOADING_SOURCELIB then print("Downloading required libraries, please wait...") return end
if AUTOUPDATE then
SourceUpdater(SCRIPT_NAME, version, "raw.github.com", "/S4CHQQ/Scripting/master/"..SCRIPT_NAME..".lua", SCRIPT_PATH .. GetCurrentEnv().FILE_NAME, "/S4CHQQ/version/master/"..SCRIPT_NAME..".version"):CheckUpdate()
end
local RequireI = Require("SourceLib")
RequireI:Add("vPrediction", "https://raw.github.com/Hellsing/BoL/master/common/VPrediction.lua")
RequireI:Add("SOW", "https://raw.github.com/Hellsing/BoL/master/common/SOW.lua")
RequireI:Check()
if RequireI.downloadNeeded == true then return end
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Spell info's in order to get prediction
local Qrange, Qwidth, Qspeed, Qdelay = 1250, 90, 2200, 0.25
local Wrange, Wwidth, Wspeed, Wdelay = 800, 100, 1450, 0.5
local Erange, Ewidth, Espeed, Edelay = 950, 80, 2000, 0.65
local Rrange, Rwidth, Rspeed, Rdelay = 3000, 1, 1500, 0.5
--[[ Callback 1 ]]--
function OnLoad()
PrintChat("<font color=\"#eFF99CC\">You are using EasyCait ["..pVersion.."] by How I met Katarina.</font>")
_LoadLib()
end
-- Looks like drawing with OnDraw fix FPS drop
function OnDraw()
if CaitMenu.Drawing.DrawAA then
if CaitMenu.Drawing.lowfpscircle then
-- Lag free circle here
DrawCircle3D(myHero.x, myHero.y, myHero.z, SOWi:MyRange() + 100, 1, TARGB({255, 255, 0, 255}), 100)
DrawCircle3D(myHero.x, myHero.y, myHero.z, SOWi:MyRange() + 102, 1, TARGB({255, 255, 255, 255}), 100)
else
-- Draw AA hero range
DrawCircle(myHero.x, myHero.y, myHero.z, SOWi:MyRange() + 150, 0xFF80FF)
end
end
if CaitMenu.Drawing.DrawULT then
if myHero.level >= 6 and myHero.level < 11 then
DrawCircleMinimap(myHero.x, myHero.y, myHero.z, 2000, 1, TARGB({255, 255, 0, 255}), 100)
elseif myHero.level >= 11 and myHero.level < 16 then
DrawCircleMinimap(myHero.x, myHero.y, myHero.z, 2500, 1, TARGB({255, 255, 0, 255}), 100)
elseif myHero.level >= 16 then
DrawCircleMinimap(myHero.x, myHero.y, myHero.z, 3000, 1, TARGB({255, 255, 0, 255}), 100)
end
end
end
function OnTick()
-- if autolevel on then autolevel spell
if CaitMenu.Extra.AutoLev then
_AutoLevel()
end
-- if Space (32) pressed then combo
if CaitMenu.Combo.combokey then
_Combo()
end
-- if key C pressed then harass
if CaitMenu.Harass.harasskey then
_Harass()
end
if CaitMenu.Jump.jumpkey then
_Jump()
end
-- "Animation cancel found try it"
local target = STS:GetTarget(Qrange)
if target ~= nil and myHero:CanUseSpell(_E) == READY and myHero:CanUseSpell(_Q) == READY then
if CaitMenu.QE.qekey then
if myHero:CanUseSpell(_E) == READY then
-- Ty Bilbao, math to reverse spell
local ToMousePos = Vector(myHero) + (Vector(myHero) - Vector(mousePos.x, mousePos.y, mousePos.z))*(950/GetDistance(mousePos))
Packet('S_CAST', { spellId = _E, fromX = ToMousePos.x, fromY = ToMousePos.z}):send()
end
end
if CaitMenu.QE.qekey then
if myHero:CanUseSpell(_Q) == READY then
local CastPosition = VP:GetLineCastPosition(target, Qdelay, Qwidth, Qrange, Qspeed, myHero, true)
if GetDistance(target) <= Qrange - 150 and myHero:CanUseSpell(_Q) == READY then
Packet('S_CAST', { spellId = _Q, fromX = CastPosition.x, fromY = CastPosition.z}):send()
end
end
end
end
end
--[[ Personal Function ]]--
-- Load lib
function _LoadLib()
VP = VPrediction(true)
STS = SimpleTS(STS_LESS_CAST_PHYSICAL)
SOWi = SOW(VP, STS)
_LoadMenu()
end
-- Load my menu adding SOW Orbwalking..
function _LoadMenu()
CaitMenu = scriptConfig("EasyCait "..pVersion, "EasyCait "..pVersion)
CaitMenu:addSubMenu("Target selector", "STS")
STS:AddToMenu(CaitMenu.STS)
CaitMenu:addSubMenu("Drawing", "Drawing")
CaitMenu.Drawing:addParam("lowfpscircle", "Lag free draw", SCRIPT_PARAM_ONOFF, true)
CaitMenu.Drawing:addParam("DrawAA", "Draw AA Range", SCRIPT_PARAM_ONOFF, true)
CaitMenu.Drawing:addParam("DrawULT", "Draw ult minimap", SCRIPT_PARAM_ONOFF, true)
CaitMenu:addSubMenu("Orbwalker", "Orbwalker")
SOWi:LoadToMenu(CaitMenu.Orbwalker)
SOWi:RegisterAfterAttackCallback(AfterAttack)
CaitMenu:addSubMenu("Combo", "Combo")
CaitMenu.Combo:addParam("combokey", "Combo key", SCRIPT_PARAM_ONKEYDOWN, false, 32)
CaitMenu.Combo:addParam("comboQ", "Use Q", SCRIPT_PARAM_ONOFF, true)
CaitMenu.Combo:addParam("gapcloseE", "Use E anti gapcloser", SCRIPT_PARAM_ONOFF, true)
CaitMenu.Combo:addParam("gapcloseDist", "lower if u want it to antigaplose when the ennemy is farther", SCRIPT_PARAM_SLICE, 700, 50, 950)
CaitMenu:addSubMenu("Jump", "Jump")
CaitMenu.Jump:addParam("jumpkey", "Jump to mouse key", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("T"))
CaitMenu:addSubMenu("Harass", "Harass")
CaitMenu.Harass:addParam("harasskey", "Harass key", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("C"))
CaitMenu.Harass:addParam("harassQ", "Use Q", SCRIPT_PARAM_ONOFF, true)
CaitMenu.Harass:addParam("Manacheck", "Mana manager", SCRIPT_PARAM_SLICE, 50, 1, 100)
CaitMenu:addSubMenu("Q/E", "QE")
CaitMenu.QE:addParam("qekey", "Q/E key", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("X"))
CaitMenu:addSubMenu("Extra", "Extra")
CaitMenu.Extra:addParam("AutoLev", "Auto level skill", SCRIPT_PARAM_ONOFF, false)
CaitMenu.Extra:addParam("pCast", "Packet cast", SCRIPT_PARAM_ONOFF, false)
end
-- This will cast spell packet or normal depending if ON/OFF in menu and if u are VIP or not
function CastSpells(spell, posx, posz)
if CaitMenu.Extra.pCast and VIP_USER then
Packet('S_CAST', { spellId = spell, fromX = posx, fromY = posz}):send()
else
CastSpell(spell, posx, posz)
CaitMenu.Extra.pCast = false
end
end
-- Thats the combo function, declaring in range target, checking if key pressed, if spell ready, getting prediction using VPred, casting spell
function _Combo()
local target = STS:GetTarget(Qrange)
if CaitMenu.Combo.comboQ and myHero:CanUseSpell(_Q) == READY and target ~= nil then
local CastPosition = VP:GetLineCastPosition(target, Qdelay, Qwidth, Qrange, Qspeed, myHero, true)
if GetDistance(target) <= Qrange - 150 and myHero:CanUseSpell(_Q) == READY then
CastSpells(_Q, CastPosition.x, CastPosition.z)
end
end
local target = STS:GetTarget(Erange)
if CaitMenu.Combo.gapcloseE and myHero:CanUseSpell(_E) == READY and target ~= nil then
local CastPosition = VP:GetLineCastPosition(target, Edelay, Ewidth, Erange, Espeed, myHero, true)
if GetDistance(target) <= Erange - CaitMenu.Combo.gapcloseDist and myHero:CanUseSpell(_E) == READY then
CastSpells(_E, CastPosition.x, CastPosition.z)
end
end
end
-- That's the harass function hell yeahh
function _Harass()
local target = STS:GetTarget(Qrange)
if CaitMenu.Harass.harassQ and myHero:CanUseSpell(_Q) == READY and target ~= nil and (myHero.mana / myHero.maxMana * 100) >= CaitMenu.Harass.Manacheck then
local CastPosition = VP:GetLineCastPosition(target, Qdelay, Qwidth, Qrange, Qspeed, myHero, true)
if GetDistance(target) <= Qrange - 150 and myHero:CanUseSpell(_Q) == READY then
CastSpells(_Q, CastPosition.x, CastPosition.z)
end
end
end
-- Auto level spell function
function _AutoLevel()
Sequence = { 1,3,1,2,1,4,1,3,1,3,4,3,3,2,2,4,2,2 }
autoLevelSetSequence(Sequence)
end
-- Jump to mouse function
function _Jump()
if myHero:CanUseSpell(_E) == READY then
-- Ty Bilbao, math to reverse spell
local ToMousePos = Vector(myHero) + (Vector(myHero) - Vector(mousePos.x, mousePos.y, mousePos.z))*(950/GetDistance(mousePos))
CastSpells(_E, ToMousePos.x, ToMousePos.z)
end
end