16HeX16

Kayle Helper 1.2.3

Mar 30th, 2013
6,363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.64 KB | None | 0 0
  1. --[[    Kayle Helper by HeX 1.2.3  ]]--
  2.  
  3. if myHero.charName ~= "Kayle" then return end
  4. local range = 650
  5. local wBuffer = 400 --Wont use W unless they are this far away. 400 by default.
  6. local aRange = 525
  7. local ignite = nil
  8. local lastBasicAttack = 0
  9. local swing = 0
  10. local startAttackSpeed = 0.625
  11. local nextTick = 0
  12. local QREADY, WREADY, EREADY, RREADY  = false, false, false, false
  13. local DFGREADY, BRKREADY, HXGREADY, BWCREADY, STDREADY = false, false, false, false, false
  14. local DFGSlot, BRKSlot, HXGSlot, BWCSlot, STDSlot = nil, nil, nil, nil, nil
  15.  
  16. function OnLoad()
  17.     PrintChat("<font color='#CCCCCC'> >> Kayle Helper 1.2.3 loaded! <<</font>")
  18.     KHConfig = scriptConfig("Kayle Helper", "KayleHelper")
  19.     KHConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  20.     KHConfig:addParam("Harass", "Harass", SCRIPT_PARAM_ONKEYDOWN, false, 65)
  21.     KHConfig:addParam("autoignite", "Ignite when Killable", SCRIPT_PARAM_ONOFF, true)
  22.     KHConfig:addParam("attacks", "Use auto attacks", SCRIPT_PARAM_ONOFF, true)
  23.     KHConfig:addParam("movement", "Basic Orb Walking", SCRIPT_PARAM_ONOFF, true)
  24.     KHConfig:addParam("drawcirclesSelf", "Draw Circles - Self", SCRIPT_PARAM_ONOFF, false)
  25.     KHConfig:addParam("drawcirclesEnemy", "Draw Circles - Enemy", SCRIPT_PARAM_ONOFF, false)
  26.     KHConfig:permaShow("scriptActive")
  27.     KHConfig:permaShow("Harass")
  28.     ts = TargetSelector(TARGET_LOW_HP, range+50, DAMAGE_MAGIC)
  29.     ts.name = "Kayle"
  30.     KHConfig:addTS(ts)
  31.    
  32.     lastBasicAttack = os.clock()
  33.    
  34.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
  35.         elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2
  36.     end
  37. end
  38.  
  39. function OnProcessSpell(unit, spell)
  40.     if unit.isMe and (spell.name:find("Attack") ~= nil) then
  41.         swing = 1
  42.         lastBasicAttack = os.clock()
  43.     end
  44. end
  45.  
  46. function OnTick()
  47.     ts:update()
  48.     AttackDelay = 1/(myHero.attackSpeed*startAttackSpeed)
  49.     if swing == 1 and os.clock() > lastBasicAttack + AttackDelay then
  50.         swing = 0
  51.     end
  52.    
  53.     DFGSlot, BRKSlot, HXGSlot, BWCSlot, STDSlot = GetInventorySlotItem(3153), GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3131)
  54.     DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  55.     BRKREADY = (BRKSlot ~= nil and myHero:CanUseSpell(BRKSlot) == READY)
  56.     HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
  57.     BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
  58.     STDREADY = (STDSlot ~= nil and myHero:CanUseSpell(STDSlot) == READY)
  59.     IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  60.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  61.     WREADY = (myHero:CanUseSpell(_W) == READY)
  62.     EREADY = (myHero:CanUseSpell(_E) == READY)
  63.     RREADY = (myHero:CanUseSpell(_R) == READY)
  64.    
  65.     --[[    Auto Ignite ]]--
  66.     if KHConfig.autoignite then    
  67.         if IREADY then
  68.             local ignitedmg = 0    
  69.             for i = 1, heroManager.iCount, 1 do
  70.                 local enemyhero = heroManager:getHero(i)
  71.                 if ValidTarget(enemyhero,600) then
  72.                     ignitedmg = 50 + 20 * myHero.level
  73.                     if enemyhero.health <= ignitedmg then
  74.                         CastSpell(ignite, enemyhero)
  75.                     end
  76.                 end
  77.             end
  78.         end
  79.     end
  80.    
  81.     --[[    Harass  ]]--
  82.     if ts.target ~= nil and KHConfig.Harass  then
  83.         if QREADY and GetDistance(ts.target) < range then
  84.             CastSpell(_Q, ts.target)
  85.         end
  86.     end  
  87.  
  88.     --[[    Basic Combo ]]--
  89.     if ts.target ~= nil and KHConfig.scriptActive then
  90.         --[[    Items   ]]--
  91.         if GetDistance(ts.target) < 600 then
  92.             if DFGREADY then CastSpell(DFGSlot, ts.target) end
  93.             if BRKREADY then CastSpell(BRKSlot, ts.target) end
  94.             if HXGREADY then CastSpell(HXGSlot, ts.target) end
  95.             if BWCREADY then CastSpell(BWCSlot, ts.target) end
  96.             if STDREADY then CastSpell(STDSlot) end
  97.         end
  98.         --[[    Abilities   ]]--
  99.         if QREADY and GetDistance(ts.target) < range then
  100.             CastSpell(_Q, ts.target)
  101.         end
  102.         if EREADY and GetDistance(ts.target) < aRange then
  103.             CastSpell(_E)
  104.         end
  105.         if WREADY and GetDistance(ts.target) > wBuffer then
  106.             CastSpell(_W, myHero)
  107.         end
  108.         --[[    Attacks ]]--
  109.         if swing == 0 and KHConfig.attacks then
  110.             if GetDistance(ts.target) < range and GetTickCount() > nextTick then
  111.                 myHero:Attack(ts.target)
  112.                 nextTick = GetTickCount()
  113.             end
  114.             elseif swing == 1 and KHConfig.movement and KHConfig.attacks and GetTickCount() > (nextTick + 250) then
  115.                 myHero:MoveTo(mousePos.x, mousePos.z)
  116.         end
  117.     end
  118. end
  119.  
  120. function OnDraw()  
  121.     if KHConfig.drawcirclesSelf and not myHero.dead then
  122.         DrawCircle(myHero.x, myHero.y, myHero.z, 650, 0xFF80FF00)
  123.     end
  124.     if KHConfig.drawcirclesEnemy and ts.target ~= nil then
  125.         for j=0, 10 do
  126.             DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00)
  127.         end
  128.     end
  129. end
Advertisement
Add Comment
Please, Sign In to add comment