Don't like ads? PRO users don't see any ads ;-)
Guest

Karthus Q Spammer

By: a guest on Sep 4th, 2012  |  syntax: Lua  |  size: 1.33 KB  |  hits: 27  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. --[[
  2. Karthus Q Spammer by eXtragoZ
  3. ]]--
  4. local player = GetMyHero()
  5. if player.charName == "Karthus" then
  6.  
  7. --[[            Config          ]]
  8. local HK = 32 -- Space key
  9. local timeLag = .75
  10. local range = 950
  11.  
  12. --[[            Code            ]]
  13. function altDoFile(name)
  14.     dofile(debug.getinfo(1).source:sub(debug.getinfo(1).source:find(".*\\")):sub(2)..name)
  15. end
  16.  
  17. altDoFile("libs/TimingLib.lua")
  18. altDoFile("libs/target_selector.lua")
  19.  
  20.  
  21. local active = false
  22. local timer
  23. local ts
  24. local targeti
  25.  
  26. function OnLoad()
  27.         timer = Timer:new()
  28.         ts = TargetSelector:new(TARGET_LOW_HP,range,DAMAGE_MAGIC)
  29. end
  30. function OnTick()
  31.         KQShotkeys()
  32.         ts:tick()
  33.         timer:tickHandler()
  34.         if active then
  35.                 if ts.target ~= nil and player:CanUseSpell(_Q) then
  36.                         for i=1, heroManager.iCount do
  37.                                 local enemy = heroManager:GetHero(i)
  38.                                 if enemy ~= nil and enemy.team ~= player.team and enemy.charName == ts.target.charName then
  39.                                         targeti = i
  40.                                 end
  41.                         end            
  42.                         local targetNextMove = timer:predictMovement(targeti, timeLag)
  43.                         CastSpell(_Q, targetNextMove.x, targetNextMove.z)
  44.                 end
  45.         end
  46. end
  47.  
  48. function KQShotkeys()
  49.         if IsKeyPressed(HK) or IsKeyDown(HK) then
  50.                 active = true
  51.         else
  52.                 active = false
  53.         end
  54. end
  55. function OnDraw()
  56.         if not player.dead then
  57.                 DrawCircle(player.x, player.y, player.z, range, 0x19A712)
  58.         end
  59. end
  60. PrintChat(" >> Karthus Q Spammer loaded!")
  61. end