Advertisement
Guest User

Kayle(self/ally-heal-xkjtx)v1.0.lua

a guest
Feb 7th, 2013
411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.82 KB | None | 0 0
  1. --[[
  2.  
  3. Press spacebar to cast Q, W, E (Only using W on self)
  4. Press X to Harass with Q
  5. Press S to smart cast W on self/ally
  6. Press Z to smart cast R on self/ally
  7.  
  8. Edited by DrMundo for Kayle -
  9. Taking parts from TRUS kassadin script. (From his dropbox)
  10. :: dabbled by xkjtx(added W and R cast on ally)
  11. :: HeX's (AA) code from his Kayle helper
  12. ]]--
  13.  
  14. if myHero.charName ~= "Kayle" then return end
  15.  
  16. ---------------------------
  17. ------ Configuration ------
  18. ---------------------------
  19. local hotkey = 32 --[[ Spacebar (Cast Q, W, E)(With auto Attacks!) ]]--
  20. local harasskey = 88 --[[ X (Only cast Q spell) ]]--
  21. local healkey = 83 --[[ S (Cast W on self/ally while holding your mouse over) ]]--
  22. local sheildkey = 90 --[[ Z (Cast Ult on self/ally while holding your mouse over) ]]--
  23.  
  24. --[[ ------------------------------------
  25. ---- Script Start [Do not change] ----
  26. -------------------------------------- ]]--
  27. -- Runtime variables
  28.  
  29. local scriptActive = false
  30. local harassActive = false
  31. local HealActive = false
  32. local RshieldActive = false
  33.  
  34. local lastBasicAttack = 0
  35. local startAttackSpeed = 0.625
  36. local swing = 0
  37. local nextTick = 0
  38. local waitDelay = 400
  39.  
  40. local _wBuffer = 400 --Wont use W unless they are this far away. 400 by default.
  41. local _Qrange = 650
  42. local _Erange = 625
  43.  
  44. local ts
  45.  
  46. function OnLoad()
  47. PrintChat("Kayle -SBTW-")
  48. -- put true if you want to be able to GetTarget()
  49. ts = TargetSelector(TARGET_LOW_HP,_Qrange+125,DAMAGE_MAGIC)
  50. lastBasicAttack = os.clock()
  51. end
  52. function OnWndMsg(msg, key)
  53. if key == hotkey then
  54. if msg == KEY_DOWN then
  55. scriptActive = true
  56. elseif msg == KEY_UP then
  57. scriptActive = false
  58. end
  59. end
  60. if key == harasskey then
  61. if msg == KEY_DOWN then
  62. harassActive = true
  63. elseif msg == KEY_UP then
  64. harassActive = false
  65. end
  66. end
  67. if key == healkey then
  68. if msg == KEY_DOWN then
  69. HealActive = true
  70. elseif msg == KEY_UP then
  71. HealActive = false
  72. end
  73. end
  74. if key == sheildkey then
  75. if msg == KEY_DOWN then
  76. RshieldActive = true
  77. elseif msg == KEY_UP then
  78. RshieldActive = false
  79. end
  80. end
  81. end
  82. function OnProcessSpell(unit, spell)
  83. if unit.isMe and (spell.name:find("Attack") ~= nil) then
  84. swing = 1
  85. lastBasicAttack = os.clock()
  86. end
  87. end
  88. function OnTick()
  89. if myHero.dead then return end
  90. ts:update()
  91. AttackDelay = (1000/(myHero.attackSpeed/(1/startAttackSpeed)))/1000
  92. if swing == 1 and os.clock() > lastBasicAttack + AttackDelay then
  93. swing = 0
  94. end
  95. if not player.dead and RshieldActive then
  96. -- added by xkjtx: given to by TRUS: this will cast R on self/ally while holding mouse over
  97. for i = 1, heroManager.iCount, 1 do
  98. local hero = heroManager:getHero(i)
  99. if hero.team == myHero.team and GetDistanceFromMouse(hero)<200 ---here is your value
  100. then
  101. CastSpell(_R,hero)
  102. end
  103. end
  104. end
  105. if not player.dead and HealActive then
  106. -- added by xkjtx: given to by TRUS: this will cast W on self/ally while holding mouse over
  107. for i = 1, heroManager.iCount, 1 do
  108. local hero = heroManager:getHero(i)
  109. if hero.team == myHero.team and GetDistanceFromMouse(hero)<200 ---here is your value
  110. then
  111. CastSpell(_W,hero)
  112. end
  113. end
  114. end
  115. if not player.dead and scriptActive and ts.target ~= nil then
  116. if GetInventoryHaveItem(3128) then
  117. CastItem(3128, ts.target)
  118. end
  119. if player:CanUseSpell(_Q) == READY and GetMyHero():GetDistance(ts.target) < _Qrange then
  120. CastSpell(_Q, ts.target)
  121. end
  122. if player:CanUseSpell(_W) == READY and GetMyHero():GetDistance(ts.target) < _wBuffer then
  123. CastSpell(_W, myHero)
  124. end
  125. if player:CanUseSpell(_E) == READY and GetMyHero():GetDistance(ts.target) < _Erange then
  126. CastSpell(_E, ts.target)
  127. end
  128. --[[ Auto Attacks ]]--
  129. local tick = GetTickCount()
  130. if swing == 0 then
  131. if GetDistance(ts.target) < _Qrange and GetTickCount() > nextTick then
  132. myHero:Attack(ts.target)
  133. nextTick = GetTickCount() + waitDelay
  134. end
  135. elseif swing == 1 and GetTickCount() > (nextTick + 100) then
  136. myHero:MoveTo(mousePos.x, mousePos.z)
  137. end
  138. end
  139. if not player.dead and harassActive and ts.target ~= nil then
  140. if player:CanUseSpell(_Q) == READY and GetMyHero():GetDistance(ts.target) < _Qrange then
  141. CastSpell(_Q, ts.target)
  142. end
  143. end
  144. end
  145. function OnDraw()
  146. if player.dead then return end
  147. --DrawCircle(player.x, player.y, player.z, _Qrange, 0xFF80FF00)
  148. if scriptActive then DrawText("Script Active",16,100,80,0xFF80FF00) end
  149. if HealActive then DrawText("Heal Active",16,100,80,0xFF80FF00) end
  150. if harassActive then DrawText("Harass Active",16,100,80,0xFF80FF00) end
  151. if RshieldActive then DrawText("Shield Active",16,100,80,0xFF80FF00) end
  152. if ts.target ~= nil then
  153. DrawText("Targetting: " .. ts.target.charName, 16, 100, 100, 0xFFFF0000)
  154. DrawCircle(ts.target.x, ts.target.y, ts.target.z, 100, 0xFF80FF00)
  155. end
  156. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement