Advertisement
Guest User

Hecarim

a guest
Dec 7th, 2015
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.26 KB | None | 0 0
  1. if GetObjectName(GetMyHero()) ~= "Hecarim" then return end                                          -- Only run the script if playing Hecarim
  2.  
  3. require("Inspired")                                                                                 -- Requires useage of the Inspired library
  4. local hero = GetMyHero()                                                                            -- Stores a refrence to your champion                                                                               -- Stores the nearby Jungle Minion
  5.  
  6. local HecarimMenu = MenuConfig("Hecarim", "Hec_Menu")                                               -- Config menu for hecarim
  7.     HecarimMenu:Menu("Auto_Q", "Auto Q Options")                                                    -- Menu for Auto Q
  8.     local Auto_Q_Menu = HecarimMenu.Auto_Q
  9.         Auto_Q_Menu:KeyBinding("Champion", "Champions", string.byte("Z"), false)                    -- Auto Q champions
  10.         Auto_Q_Menu:KeyBinding("Jungle", "Jungle Minions", string.byte("X"), false)                 -- Auto Q jungle minions
  11.         Auto_Q_Menu:KeyBinding("Lane", "Lane Minions", string.byte("C"), false)                     -- Auto Q lane minions
  12.  
  13.     HecarimMenu:Menu("Auto_S", "Auto Smite Options")                                                -- Menu for Smite options
  14.     local Auto_S_Menu = HecarimMenu.Auto_S
  15.         Auto_S_Menu:Menu("Smite_Steal", "Steal Buff Options")                                       -- Smite to steal buff options
  16.         local Smite_Steal_Menu = Auto_S_Menu.Smite_Steal
  17.             Smite_Steal_Menu:Boolean("Steal_Enabled", "Enabled", false)                             -- Smite to steal Enabled
  18.             Smite_Steal_Menu:Boolean("Steal_Baron", "Baron", false)                                 -- Smite to steal Baron
  19.             Smite_Steal_Menu:Boolean("Steal_Dragon", "Dragon", false)                               -- Smite to steal Dragon
  20.             Smite_Steal_Menu:Boolean("Steal_Red", "Red", false)                                     -- Smite to steal Red
  21.             Smite_Steal_Menu:Boolean("Steal_Blue", "Blue", false)                                   -- Smite to steal Blue
  22.             Smite_Steal_Menu:Boolean("Steal_Gromp", "Gromp", false)                                 -- Smite to steal Gromp
  23.             Smite_Steal_Menu:Boolean("Steal_Wolf", "Wolves", false)                                 -- Smite to steal Wolves
  24.             Smite_Steal_Menu:Boolean("Steal_Raptor", "Raptors", false)                              -- Smite to steal Raptors
  25.             Smite_Steal_Menu:Boolean("Steal_Crug", "Krugs", false)                                  -- Smite to steal Crugs
  26.             Smite_Steal_Menu:Boolean("Steal_Skuttle", "Skuttle", false)                             -- Smite to steal Skuttle
  27.  
  28.         Auto_S_Menu:Menu("Smite_Buff", "Buff Self Options")                                         -- Smite to buff self menu TODO: normal buffs
  29.         local Smite_Buff_Menu = Auto_S_Menu.Smite_Buff
  30.             Smite_Buff_Menu:Info("Smite_Heal", "Smite to heal self")                                -- Title for smite to heal
  31.             Smite_Buff_Menu:Boolean("Heal_Enabled", "Enabled", false)                               -- Smite to heal Enabled
  32.             Smite_Buff_Menu:Slider("Smite_Heal_Threshold", "Health %", 25, 1, 100, 1)               -- Minimum HP before smiting to heal
  33.             Smite_Buff_Menu:Empty("Smite_Buff_Sep", 0.1)
  34.             Smite_Buff_Menu:Info("Smite_Mana", "Smite to restore mana")                             -- Smite to restore Mana
  35.             Smite_Buff_Menu:Boolean("Mana_Enabled", "Enabled", false)                               -- Smite for Mana Enabled
  36.             Smite_Buff_Menu:Slider("Smite_Mana_Threshold", "Mana %", 25, 1, 100, 1)                 -- Minimum Mana before smiting to restore
  37.  
  38. local smiteSlot = nil                                                                               -- Stores what summoner spell is smite
  39. if GetCastName(hero, SUMMONER_1):lower():find("summonersmite") then smiteSlot = SUMMONER_1        -- Summoner Spell 1
  40. else GetCastName(hero, SUMMONER_2):lower():find("summonersmite") smiteSlot = SUMMONER_2 end       -- Summoner Spell 2
  41.  
  42. local champ = {}
  43. local jungle = {}
  44. local minion = {}
  45. local champSize = 0
  46. local jungleSize = 0
  47. local minionSize = 0
  48. --OnObjectLoop(function(o) ListObj(o) end) -- works perfectly just chunks FPS
  49. OnObjectLoad(function(o) ListObj(o) end)
  50. OnCreateObj(function(o) ListObj(o) end)
  51.  
  52. function ListObj(o)
  53.     if(o) then
  54.         if (GetObjectType(o) == Obj_AI_Hero) then ListChamp(o)
  55.         elseif (GetObjectType(o) == Obj_AI_Minion) then
  56.             if(GetObjectName(o):find("Krug") or GetObjectBaseName(o):find("Krug")) or
  57.                 (GetObjectName(o):find("Razorbeak") or GetObjectBaseName(o):find("Razorbeak")) or
  58.                 (GetObjectName(o):find("Murkwolf") or GetObjectBaseName(o):find("Murkwolf")) or
  59.                 (GetObjectName(o):find("Gromp") or GetObjectBaseName(o):find("Gromp")) or
  60.                 (GetObjectName(o):find("Red") or GetObjectBaseName(o):find("Red")) or
  61.                 (GetObjectName(o):find("Blue") or GetObjectBaseName(o):find("Blue")) or
  62.                 (GetObjectName(o):find("Crab") or GetObjectBaseName(o):find("Crab")) or
  63.                 (GetObjectName(o):find("Baron") or GetObjectBaseName(o):find("Baron")) or
  64.                 (GetObjectName(o):find("Dragon") or GetObjectBaseName(o):find("Dragon")) then
  65.                 ListJungle(o)
  66.             else
  67.                 ListMinion(o)
  68.             end
  69.         end
  70.     end
  71. end
  72.  
  73. function ListChamp(o)
  74.     local function FindSpot()
  75.         for i = 1, champSize do
  76.             local o = champ[i]
  77.             if(not o or not IsObjectAlive(o)) then return i end
  78.         end
  79.         champSize = champSize + 1
  80.         return champSize
  81.     end
  82.     champ[FindSpot()] = o
  83. end
  84.  
  85. function ListJungle(o)
  86.     local function FindSpot()
  87.         for i = 1, jungleSize do
  88.             local o = jungle[i]
  89.             if(not o or not IsObjectAlive(o)) then return i end
  90.         end
  91.         jungleSize = jungleSize + 1
  92.         return jungleSize
  93.     end
  94.     jungle[FindSpot()] = o
  95. end
  96.  
  97. function ListMinion(o)
  98.     local function FindSpot()
  99.         for i = 1, minionSize do
  100.             local o = minion[i]
  101.             if(not o or not IsObjectAlive(o)) then return i end
  102.         end
  103.         minionSize = minionSize + 1
  104.         return minionSize
  105.     end
  106.     minion[FindSpot()] = o
  107. end
  108.  
  109. function anyTargetInRange(type, range)
  110.     local npcs = nil
  111.     if (type == "Hero") then npcs = champ
  112.     elseif (type == "Jungle") then npcs = jungle
  113.     elseif (type == "Minion") then npcs = minion end
  114.     if(npcs ~= nil) then
  115.         for i, target in pairs(npcs) do
  116.             if(ValidTarget(target, range)) then return true end
  117.         end
  118.     end
  119.     return false
  120. end
  121.  
  122. OnTick(function(hero)
  123.     if(not IsDead(hero)) then
  124.         -- Auto Q breaks take look at how nearestminon
  125.         if(Auto_Q_Menu.Champion:Value() and
  126.             anyTargetInRange("Hero", GetCastRange(hero, _Q))) then CastSpell(_Q) end-- Auto Q if enabled and nearby enemy of Enabled type
  127.         if(Auto_Q_Menu.Jungle:Value() and
  128.             anyTargetInRange("Jungle", GetCastRange(hero, _Q))) then CastSpell(_Q) end-- Auto Q if enabled and nearby enemy of Enabled type
  129.         if(Auto_Q_Menu.Lane:Value() and
  130.             anyTargetInRange("Minion", GetCastRange(hero, _Q))) then CastSpell(_Q) end-- Auto Q if enabled and nearby enemy of Enabled type
  131.     end
  132. end)
  133.  
  134. PrintChat("Hecarim Loaded!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement