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
- ]]
- if myHero.charName == "Vi" then
- function OnLoad()
- --Hotkeys
- comboKey = 32
- --Do not touch
- RRange = 700
- RWidth = 200
- ts = TargetSelector(TARGET_LOW_HP,700,DAMAGE_PHYSICAL,false)
- tr = TargetPrediction(700, 1, 0, 700, 50)
- DFGSSlot = nil
- DFGReady = false
- sexyahhahh = 0 --Copyright variable name by x7x
- iPressedQ = false
- invisibleTime = 500 --Probably the delay when it detects objects being created iono.
- buffer = 0 --So it doesn't undershoot Q
- debugTime =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:permaShow("active")
- ts.name = "Vi"
- ViConfig:addTS(ts)
- PrintChat(">> ViLoaded!")
- end
- function OnCreateObj(object)
- --PrintChat(object.name)
- if object.name == "Vi_Q_Channel_L.troy" then
- iPressedQ = true
- end
- end
- function OnDeleteObj(object)
- --PrintChat(object.name)
- if object.name == "Vi_Q_Channel_L.troy" then
- iPressedQ = false
- end
- end
- function HoldForHowLong(x,z)
- result = 0
- distance = mathStuff(myHero.x - x, myHero.z - z) + buffer
- if distance < 250 then
- PrintChat("type1")
- return result
- elseif distance > 725 then
- PrintChat("type2")
- return result + 1250
- else
- result = result + (distance-250)/0.38
- --PrintChat(tostring(result))
- return result --Distance needed/distance * seconds
- end
- end
- function mathStuff(x,y)
- return math.floor(math.sqrt((x)^2 + (y)^2))
- end
- function OnTick()
- ts:update()
- DFGSlot = GetInventorySlotItem(3128)
- DFGReady = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
- QReady = (myHero:CanUseSpell(_Q) == READY)
- EReady = (myHero:CanUseSpell(_E) == READY)
- RReady = (myHero:CanUseSpell(_R) == READY)
- TargetPrediction__OnTick()
- if ts.target ~= nil and ViConfig.active then
- rpred = tr:GetPrediction(ts.target)
- if rpred ~= nil then
- if RReady and ViConfig.useult then CastSpell(_R, ts.target) end
- myHero:Attack(ts.target)
- if QReady then
- if iPressedQ == false then
- CastSpell(_Q,ts.target.x,ts.target.z) --Needed a direction
- sexyahhahh = GetTickCount()
- end
- if GetTickCount() + invisibleTime >= HoldForHowLong(ts.target.x,ts.target.z) + sexyahhahh and iPressedQ == true then
- --PrintChat("now")
- CastSpell(_Q,ts.target.x,ts.target.z)
- myHero:Attack(ts.target)
- if EReady then CastSpell(_E) end
- end
- myHero:Attack(ts.target)
- end
- end
- end
- end
- function OnUnload()
- PrintChat(">> Arrivederci")
- end
- function OnDraw()
- SC__OnDraw()
- end
- function OnWndMsg(msg,key)
- SC__OnWndMsg(msg,key)
- end
- function OnSendChat(msg)
- TargetSelector__OnSendChat(msg)
- ts:OnSendChat(msg, "pri")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement