Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require "Utils"
- require "spell_damage"
- p = printtext
- local target
- local target2
- local targetHero
- local startAttackSpeed
- local projSpeed = 1
- local lastAttack = GetTickCount()
- local shotFired = false
- local range = myHero.range + GetDistance(GetMinBBox(myHero))
- local attackDelayOffset = 415
- local isMoving = false
- local startAttackSpeed = 0.625
- local script_loaded=1
- local active = false
- DravenConfig = scriptConfig('Draven AutoCarry Config', 'dravenACconfig')
- DravenConfig:addParam('catchaxe', 'CatchAxe', SCRIPT_PARAM_ONKEYTOGGLE, false, string.byte("Z"))
- OrbConfig = scriptConfig("AutoCarry", "Orb")
- OrbConfig:addParam("AutoCarry", "OrbWalk", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("T"))
- OrbConfig:addParam("Hybrid", "Hybrid", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("X"))
- OrbConfig:addParam("Farm", "Farm", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("C"))
- OrbConfig:addParam("Kite", "Kite", SCRIPT_PARAM_ONOFF, true,string.byte("O"))
- OrbConfig:addParam("Draw", "Draw Circles", SCRIPT_PARAM_ONOFF, true,string.byte("P"))
- OrbConfig:permaShow("AutoCarry")
- OrbConfig:permaShow("Hybrid")
- OrbConfig:permaShow("Farm")
- DravenConfig:permaShow("catchaxe")
- function OnCreateObj(obj)
- if obj ~= nil and DravenConfig.catchaxe then
- if string.find(obj.charName, "Draven_Q_reticle") then
- if GetDistance(obj,myHero)<300 then
- MoveToXYZ(obj.x,obj.y,obj.z)
- end
- if GetDistance(obj,myHero)>300 and GetDistance(obj,myHero)<700 then
- CastSpellTarget('W',myHero)
- MoveToXYZ(obj.x,obj.y,obj.z)
- end
- if GetDistance(obj) < 5 then StopMove() end
- end
- if string.find(obj.charName, "Draven_Q_ReticleCatchSuccess") then
- target = GetWeakEnemy('PHYS',900,'NEARMOUSE')
- if (target~=nil) and GetDistance(target,myHero)<900 then
- CastSpellTarget('W',myHero)
- Action()
- else
- target = GetLowestHealthEnemyMinion(550)
- if target ~= nil then
- CastHotkey('AUTO 100,0 ATTACK:WEAKMINION RANGE=550 ONESPELLHIT=(((.35+(spellq_level*.1))*player_ad)+player_ad)')
- end
- end
- end
- end
- end
- function OnTick()
- targetReset()
- if target and target.dead == 1 then target = nil end
- if OrbConfig.AutoCarry and IsChatOpen() == 0 then
- CustomCircle(range,2,4,myHero)
- if target2 ~= nil then target = target2 else target = GetWeakEnemy("PHYS",range) end
- if target ~= nil then
- UseAllItems(target)
- Action()
- else
- moveToCursor()
- end
- end
- if OrbConfig.Hybrid and IsChatOpen() == 0 then
- CustomCircle(range,2,4,myHero)
- targetHero = GetWeakEnemy("PHYS",range)
- if targetHero ~= nil then
- target = targetHero
- Action()
- else target = GetLowestHealthEnemyMinion(range) end
- if target ~= nil then
- if getDmg("AD",target,myHero) >= target.health then
- Action()
- end
- else
- moveToCursor()
- end
- end
- if OrbConfig.Farm and IsChatOpen() == 0 then
- CustomCircle(range,2,4,myHero)
- if target2 ~= nil then target = target2 elseif GetLowestHealthEnemyMinion(range) ~= nil then target = GetLowestHealthEnemyMinion(range) end
- if target ~= nil then
- if getDmg("AD",target,myHero) >= target.health then
- Action()
- end
- else
- moveToCursor()
- end
- end
- if OrbConfig.AutoCarry or OrbConfig.Hybrid or OrbConfig.Farm then
- moveToCursor()
- end
- if OrbConfig.Draw then
- if myHero.dead ~= 1 then
- CustomCircle(trueRange(),2,5,myHero)
- end
- end
- end
- function OnLoad()
- if GetAAData()[myHero.name] ~= nil then
- if GetAAData()[myHero.name].projSpeed ~= nil then
- projSpeed = GetAAData()[myHero.name].projSpeed
- end
- end
- if GetAAData()[myHero.name] ~= nil then
- if GetAAData()[myHero.name].startAttackSpeed ~= nil then
- startAttackSpeed = GetAAData()[myHero.name].startAttackSpeed
- end
- end
- p("\nTrue Range: "..math.ceil(range).."\nTraditional Range: "..myHero.range)
- end
- function trueRange()
- local trueRangeValue
- if target ~= nil and GetDistance(target) < range then
- trueRangeValue = range -(range-GetDistance(target))
- else
- trueRangeValue = range
- end
- return trueRangeValue
- end
- function targetReset()
- if not target and not target2 and not targetHero then
- target = nil
- target2 = nil
- targetHero = nil
- end
- end
- function Action()
- if timeToShoot() and string.find(obj.charName, "Draven_Q_reticle") == nil then
- attackEnemy(target)
- CustomCircle(100,10,1,target)
- else
- CustomCircle(100,5,2,target)
- if heroCanMove() then moveToCursor() end
- end
- end
- function attackEnemy(target)
- if ValidTarget(target) then
- AttackTarget(target)
- shotFired = True
- end
- end
- function GetNextAttackTime()
- return lastAttack + attackDelayOffset / GetAttackSpeed()
- end
- function GetAttackSpeed()
- return myHero.attackspeed/(1/startAttackSpeed)
- end
- function timeToShoot()
- if GetTickCount() > GetNextAttackTime() then
- return true
- end
- return false
- end
- function heroCanMove()
- if string.find(obj.charName, "Draven_Q_reticle") == nil then
- if shotFired == false or timeToShoot() then
- return true
- end
- return false
- end
- end
- function moveToCursor() -- Removes derping when mouse is in one position instead of myHero:MoveTo mousePos
- if string.find(obj.charName, "Draven_Q_reticle") == nil then
- isMoving = true
- local moveSqr = math.sqrt((mousePos.x - myHero.x)^2+(mousePos.z - myHero.z)^2)
- local moveX = myHero.x + 300*((mousePos.x - myHero.x)/moveSqr)
- local moveZ = myHero.z + 300*((mousePos.z - myHero.z)/moveSqr)
- MoveToXYZ(moveX,0,moveZ)
- end
- end
- function OnCreateObj(object)
- if GetAAData()[myHero.name] ~= nil then
- for _, v in pairs(GetAAData()[myHero.name].aaParticles) do
- if string.find(object.charName,v)
- then
- shotFired = false
- lastAttack = GetTickCount()
- end
- end
- end
- end
- function OnProcessSpell(obj,spell)
- if obj ~= nil and obj.name == myHero.name then
- if string.find(spell.name,aaSpellName) then
- lastAttack = GetTickCount()
- end
- end
- end
- function GetAAData()
- return {
- Draven = { projSpeed = 1.4, aaParticles = {"Draven_BasicAttack_mis","Draven_Q_mis", "Draven_Q_mis_bloodless", "Draven_Q_mis_shadow", "Draven_Q_mis_shadow_bloodless", "Draven_Qcrit_mis", "Draven_Qcrit_mis_bloodless", "Draven_Qcrit_mis_shadow", "Draven_Qcrit_mis_shadow_bloodless", "Draven_BasicAttack_mis_shadow", "Draven_BasicAttack_mis_shadow_bloodless", "Draven_BasicAttack_mis_bloodless", "Draven_crit_mis", "Draven_crit_mis_shadow_bloodless", "Draven_crit_mis_bloodless", "Draven_crit_mis_shadow", "Draven_Q_mis", "Draven_Qcrit_mis", "Draven_BasicAttackAlt_mis", "Draven_Q_Alt_mis"}, aaSpellName = {"DravenBasicAttack", "DravenBasicAttack2", "dravenspinningattack"}, startAttackSpeed = "0.679" }
- }
- end
- OnLoad()
- if GetAAData()[myHero.name] ~= nil then p("\n\nAuto Carry Loaded: "..myHero.name.."\n") end
- SetTimerCallback("OnTick")
Advertisement
Add Comment
Please, Sign In to add comment