Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ Poppy Helper 1.2 by HeX ]]--
- if myHero.charName ~= "Poppy" then return end
- require "MapPosition"
- --[[ Code ]]--
- local stunDistance = 300
- local Erange = 525
- local Qrange = 250
- local Rrange = 600
- local WeakestEnemy = nil
- --[[ Attacks ]]--
- local lastBasicAttack = 0
- local swingDelay = 0.25
- local startAttackSpeed = 0.625
- local swing = 0
- --[[ Ready ]]--
- local ignite = nil
- local QREADY, WREADY, EREADY, RREADY = false, false, false, false
- local BRKSlot, DFGSlot, HXGSlot, BWCSlot, TMTSlot, RAHSlot, RNDSlot = nil, nil, nil, nil, nil, nil, nil
- local QREADY, WREADY, EREADY, RREADY, BRKREADY, DFGREADY, HXGREADY, BWCREADY, TMTREADY, RAHREADY, RNDREADY = false, false, false, false, false, false, false, false, false, false, false
- function OnLoad()
- PrintChat("<font color='#CCCCCC'> >> Poppy Helper 1.2 loaded! <<</font>")
- PSConfig = scriptConfig("Poppy Stun", "PoppyStun")
- PSConfig:addParam("Harass", "Harass", SCRIPT_PARAM_ONKEYDOWN, false, 32)
- PSConfig:addParam("scriptActive", "Burst Combo", SCRIPT_PARAM_ONKEYDOWN, false, 90)
- PSConfig:addParam("TeamFight", "Team Fight", SCRIPT_PARAM_ONKEYDOWN, false, 88)
- PSConfig:addParam("autoStun", "Auto-Stun", SCRIPT_PARAM_ONKEYTOGGLE, true, 67)
- PSConfig:addParam("autoignite", "Ignite when Killable", SCRIPT_PARAM_ONOFF, true)
- PSConfig:addParam("stunCircle", "Auto-Stun - Arrow", SCRIPT_PARAM_ONOFF, true)
- PSConfig:permaShow("Harass")
- PSConfig:permaShow("scriptActive")
- PSConfig:permaShow("TeamFight")
- PSConfig:permaShow("autoStun")
- mapPosition = MapPosition()
- ts = TargetSelector(TARGET_LOW_HP, Erange+50, DAMAGE_MAGIC)
- ts.name = "Poppy"
- PSConfig:addTS(ts)
- LastBasicAttack = os.clock()
- if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
- elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2
- end
- end
- function OnTick()
- ts:update()
- AttackDelay = (600/(myHero.attackSpeed/(1/startAttackSpeed)))/1000
- if swing == 1 and os.clock() > lastBasicAttack + AttackDelay then
- swing = 0
- end
- BRKSlot, DFGSlot, HXGSlot, BWCSlot, TMTSlot, RAHSlot, RNDSlot = GetInventorySlotItem(3153), GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3077), GetInventorySlotItem(3074), GetInventorySlotItem(3143)
- DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
- HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
- BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
- BRKREADY = (BRKSlot ~= nil and myHero:CanUseSpell(BRKSlot) == READY)
- TMTREADY = (TMTSlot ~= nil and myHero:CanUseSpell(TMTSlot) == READY)
- RAHREADY = (RAHSlot ~= nil and myHero:CanUseSpell(RAHSlot) == READY)
- RNDREADY = (RNDSlot ~= nil and myHero:CanUseSpell(RNDSlot) == READY)
- IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
- QREADY = (myHero:CanUseSpell(_Q) == READY)
- WREADY = (myHero:CanUseSpell(_W) == READY)
- EREADY = (myHero:CanUseSpell(_E) == READY)
- RREADY = (myHero:CanUseSpell(_R) == READY)
- --[[ Harass ]]--
- if PSConfig.Harass and ts.target ~= nil then
- local QDMG = getDmg("Q", ts.target, myHero)
- --[[ Attacks ]]--
- if swing == 0 then
- if GetDistance(ts.target) < 400 then
- myHero:Attack(ts.target)
- elseif QREADY and ts.target.health < QDMG and GetDistance(ts.target) < Erange then
- CastSpell(_Q)
- Attack(ts.target)
- swing = 0
- end
- elseif swing == 1 then
- if QREADY and os.clock() - lastBasicAttack > swingDelay and GetDistance(ts.target) < Qrange then
- CastSpell(_Q)
- myHero:Attack(ts.target)
- swing = 0
- end
- end
- end
- --[[ Burst Combo ]]--
- if PSConfig.scriptActive and ts.target ~= nil then
- if DFGREADY then CastSpell(DFGSlot, ts.target) end
- if HXGREADY then CastSpell(HXGSlot, ts.target) end
- if BWCREADY then CastSpell(BWCSlot, ts.target) end
- if BRKREADY then CastSpell(BRKSlot, ts.target) end
- if TMTREADY and GetDistance(ts.target) < 275 then CastSpell(TMTSlot) end
- if RAHREADY and GetDistance(ts.target) < 275 then CastSpell(RAHSlot) end
- if RNDREADY and GetDistance(ts.target) < 275 then CastSpell(RNDSlot) end
- if RREADY and GetDistance(ts.target) < Rrange then CastSpell(_R, ts.target) end
- if WREADY and GetDistance(ts.target) < Erange then CastSpell(_W) end
- local QDMG = getDmg("Q", ts.target, myHero)
- --[[ Attacks ]]--
- if swing == 0 then
- if GetDistance(ts.target) < Erange then
- myHero:Attack(ts.target)
- elseif QREADY and ts.target.health < QDMG then
- CastSpell(_Q)
- Attack(ts.target)
- swing = 0
- end
- elseif swing == 1 then
- if QREADY and os.clock() - lastBasicAttack > swingDelay and GetDistance(ts.target) < Qrange then
- CastSpell(_Q)
- myHero:Attack(ts.target)
- swing = 0
- end
- end
- end
- --[[ Team Fight ]]--
- if PSConfig.TeamFight and ts.target ~= nil then
- findWeakest()
- if DFGREADY then CastSpell(DFGSlot, ts.target) end
- if HXGREADY then CastSpell(HXGSlot, ts.target) end
- if BWCREADY then CastSpell(BWCSlot, ts.target) end
- if BRKREADY then CastSpell(BRKSlot, ts.target) end
- if TMTREADY and GetDistance(ts.target) < 275 then CastSpell(TMTSlot) end
- if RAHREADY and GetDistance(ts.target) < 275 then CastSpell(RAHSlot) end
- if RNDREADY and GetDistance(ts.target) < 275 then CastSpell(RNDSlot) end
- if WeakestEnemy ~= nil then
- if RREADY and GetDistance(WeakestEnemy) < Rrange then CastSpell(_R, WeakestEnemy) end
- end
- if WREADY and GetDistance(ts.target) < Erange then CastSpell(_W) end
- local QDMG = getDmg("Q", ts.target, myHero)
- --[[ Attacks ]]--
- if swing == 0 then
- if GetDistance(ts.target) < Erange then
- myHero:Attack(ts.target)
- elseif QREADY and ts.target.health < QDMG then
- CastSpell(_Q)
- Attack(ts.target)
- swing = 0
- end
- elseif swing == 1 then
- if QREADY and os.clock() - lastBasicAttack > swingDelay and GetDistance(ts.target) < Qrange then
- CastSpell(_Q)
- myHero:Attack(ts.target)
- swing = 0
- end
- end
- end
- --[[ Auto Stun ]]--
- if myHero:GetSpellData(_E).level > 0 then
- StunPos = nil
- for i=1, heroManager.iCount do
- Target = heroManager:getHero(i)
- if ValidCheck(Target) and GetDistance(Target) <= Erange then
- if (PSConfig.autoStun or PSConfig.scriptActive) and EREADY and AgainstWall(Target) then
- if GetDistance(Target) <= Erange then
- CastSpell(_E, Target)
- end
- end
- end
- end
- end
- --[[ Auto Ignite ]]--
- if PSConfig.autoignite then
- if IREADY then
- local ignitedmg = 0
- for i = 1, heroManager.iCount, 1 do
- local enemyhero = heroManager:getHero(i)
- if ValidTarget(enemyhero,600) then
- ignitedmg = 50 + 20 * myHero.level
- if enemyhero.health <= ignitedmg then
- CastSpell(ignite, enemyhero)
- end
- end
- end
- end
- end
- end
- function OnDraw()
- if not myHero.dead and PSConfig.stunCircle then
- if Target ~= nil and EREADY and StunPos ~= nil then
- DrawArrows(TargetPos, StunPos, 80, 0x00FFFF, 80)
- end
- end
- end
- function AgainstWall(Enemy)
- TargetPos = Vector(Enemy.x, Enemy.y, Enemy.z)
- MyPos = Vector(myHero.x, myHero.y, myHero.z)
- StunPos = TargetPos + (TargetPos - MyPos)*((stunDistance/GetDistance(Enemy)))
- if StunPos ~= nil and mapPosition:intersectsWall(Point(StunPos.x, StunPos.z)) then
- return true
- end
- end
- function ValidCheck(Unit)
- if Unit ~= nil and Unit.type == "obj_AI_Hero" and not Unit.dead and myHero.team ~= Unit.team and Unit.visible then
- return true
- end
- end
- function findWeakest()
- WeakestEnemy = nil
- for i = 1, heroManager.iCount, 1 do
- local enemyhero = heroManager:getHero(i)
- if enemyhero ~= nil and enemyhero.team ~= myHero.team and not enemyhero.invulnerable and GetDistance(enemyhero) <= 1000 then
- if WeakestEnemy == nil then
- WeakestEnemy = enemyhero
- elseif ((WeakestEnemy.addDamage+WeakestEnemy.ap)>(enemyhero.addDamage+enemyhero.ap)) then
- WeakestEnemy = enemyhero
- end
- end
- end
- end
- function OnProcessSpell(unit, spell)
- if unit.isMe and (spell.name:find("Attack") ~= nil) then
- swing = 1
- lastBasicAttack = os.clock()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment