Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- ViLoaded
- by Kevinkev
- <like matrix reloaded... no? ok..>
- Based on AutoVi by x7x
- Q fixed thanks to eXtragoZ.
- Thanks Manciuszz for showing me as well.
- Added item support thanks to Not2Legit
- ]]
- if myHero.charName ~= "Vi" then return end
- local items =
- {
- BRK = {id=3153, range = 500, reqTarget = true, slot = nil}, --Blade of the Ruined King
- BWC = {id=3144, range = 400, reqTarget = true, slot = nil}, --Bilgewater Cutlass
- DFG = {id=3128, range = 750, reqTarget = true, slot = nil}, --Deathfire Grasp
- HGB = {id=3146, range = 400, reqTarget = true, slot = nil}, --Hextech Gunblade
- RSH = {id=3074, range = 350, reqTarget = false, slot = nil}, --Ravenous Hydra
- STD = {id=3131, range = 350, reqTarget = false, slot = nil}, --Sword of the Divine
- TMT = {id=3077, range = 350, reqTarget = false, slot = nil}, --Tiamat
- YGB = {id=3142, range = 350, reqTarget = false, slot = nil} --Youmuu's Ghostblade
- }
- function OnLoad()
- --makeFile(path)
- --Hotkeys
- comboKey = 32
- nextTick = 0
- --Do not touch
- qTick = 0
- castQ = false
- TimeIsRight = false
- swingDelay = 0.24
- EMaxRange = 600
- EMinRange = 125
- ScanRange = 700
- RRange = 700
- RWidth = 200
- sexyahhahh = 0 --Copyright variable name by x7x
- iPressedQ = false
- buffer = 0 --So it doesn't undershoot Q
- debugTime = 0
- targetX,targetZ = 0,0
- lastBasicAttack = 0
- --600 is good on stationary targets (faster)
- --Decreasing increases charge time so you can actually reach enemies running away
- invisibleTime = 300 --Decrease this number to increase the charge duration
- ts = TargetSelector(TARGET_LOW_HP,700,DAMAGE_PHYSICAL,false)
- tQ = TargetPrediction(700, 1, 0)
- --Menu
- ViConfig = scriptConfig("Vi Combo", "ViCombo")
- ViConfig:addParam("active", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, comboKey)
- ViConfig:addParam("useult", "Use Ultimate", SCRIPT_PARAM_ONOFF, true)
- ViConfig:addParam("drawCircle", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
- ViConfig:addParam("Movement", "Move to Cursor", SCRIPT_PARAM_ONOFF, true)
- ViConfig:permaShow("active")
- ts.name = "Vi"
- ViConfig:addTS(ts)
- PrintChat(">> ViLoaded!")
- end
- function UseItems(target)
- if target == nil then return end
- for _,item in pairs(items) do
- item.slot = GetInventorySlotItem(item.id)
- if item.slot ~= nil then
- if item.reqTarget and GetDistance(target) < item.range then
- CastSpell(item.slot, target)
- elseif not item.reqTarget then
- if (GetDistance(target) - getHitBoxRadius(myHero) - getHitBoxRadius(target)) < 50 then
- CastSpell(item.slot)
- end
- end
- end
- end
- end
- function CastSpellQ() --Cast Vi's Q workaround since it's bugged. Ty eXtragoZ!
- if myHero:CanUseSpell(_Q) == READY then
- if not iPressedQ and GetTickCount() - qTick + invisibleTime > HoldForHowLong(targetX, targetZ) then
- CastSpell(_Q, targetX, targetZ)
- CastSpell(10)
- swing = 0
- qTick = GetTickCount()
- end
- if iPressedQ and GetTickCount() - qTick + invisibleTime > HoldForHowLong(targetX, targetZ) then
- CastSpell(_Q, targetX, targetZ)
- qTick = GetTickCount()
- end
- end
- end
- function OnProcessSpell(unit, spell)
- if unit.isMe and (spell.name:find("BasicAttack" or "CritAttack") ~= nil) then
- swing = 1
- lastBasicAttack = os.clock()
- end
- end
- function getHitBoxRadius(target)
- return GetDistance(target.minBBox, target.maxBBox)/2
- end
- function OnCreateObj(object)
- if object.name == "Vi_Q_Channel_L.troy" then iPressedQ = true end
- end
- function OnDeleteObj(object)
- if object.name == "Vi_Q_Channel_L.troy" then iPressedQ = false end
- end
- function HoldForHowLong(x,z)
- result = 0
- distance = pythag(myHero.x - x, myHero.z - z) + buffer
- if distance < 250 then
- return result
- elseif distance > 725 then
- return result + 1250
- else
- result = (distance-250)/0.38
- return result
- end
- end
- function pythag(x,y)
- return math.floor(math.sqrt((x)^2 + (y)^2))
- end
- function OnTick()
- ts:update()
- QReady = (myHero:CanUseSpell(_Q) == READY)
- EReady = (myHero:CanUseSpell(_E) == READY)
- RReady = (myHero:CanUseSpell(_R) == READY)
- if os.clock() > lastBasicAttack + 0.5 then
- swing = 0
- end
- --Combo's and such
- if ts.target ~= nil and ViConfig.active then
- myHero:Attack(ts.target)
- QPredict = tQ:GetPrediction(ts.target)
- if QPredict ~= nil then
- --ItemSupport
- UseItems(ts.target)
- --Vi's R
- if RReady and ViConfig.useult then CastSpell(_R, ts.target) end
- --Vi's Q
- if QReady then
- targetX, targetZ = QPredict.x,QPredict.z
- CastSpellQ()
- end
- myHero:Attack(ts.target)
- --Auto E after auto attack
- if EReady and QReady == false and os.clock() - lastBasicAttack > swingDelay and GetDistance(ts.target) <= EMinRange + 125 then
- CastSpell(_E)
- end
- end
- end
- if ViConfig.Movement and ViConfig.active and ts.target == nil then myHero:MoveTo(mousePos.x, mousePos.z)
- end
- end
- function OnUnload()
- PrintChat(">> Arrivederci")
- end
- function OnDraw()
- if ViConfig.drawCircle then
- DrawCircle(myHero.x, myHero.y, myHero.z, ScanRange, 0xFF0000)
- end
- end
- function OnWndMsg(msg,key)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement