Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.21 KB | None | 0 0
  1. -- ************************** LBC META *****************************
  2. -- * lbc_name = RengarIsKool.lua
  3. -- * lbc_version = 1.1
  4. -- * lbc_date = 09/23/2014 // use correct date format mm/dd/yyyy
  5. -- * lbc_status = 3 // 0 = unknowen; 1 = alpha/wip; 2 = beta; 3 = ready; 4 = required; 5 = outdated
  6. -- * lbc_type = 3 // 0 = others; 1 = binaries; 2 = libs; 3 = champion; 4 = hotkey; 5 = utility
  7. -- * lbc_creator = KoolKaracter
  8. -- * lbc_champion = Rengar // if this script is for a special champ
  9. -- * lbc_tags = Rengar, assassin, cat, AD, jungler, Kool, kool, iskool, koolkaracter
  10. -- * lbc_link = http://leaguebot.net/forum/Upload/showthread.php?tid=4444
  11. -- * lbc_source = https://raw.githubusercontent.com/koolkaracter/Scripts/AutoKool/Champs/RengarIsKool.lua
  12. -- * lbc_update = // only if you have a new version on a new source
  13. -- ************************** LBC META *****************************
  14.  
  15. local ScriptName = 'RengarIsKool'
  16. local Version = '1.1'
  17. local Author = 'Koolkaracter'
  18. --[[
  19. __________ .___ ____ __. .__
  20. \______ \ ____ ____ _________ _______ | | ______ | |/ _|____ ____ | |
  21. | _// __ \ / \ / ___\__ \\_ __ \ | |/ ___/ | < / _ \ / _ \| |
  22. | | \ ___/| | \/ /_/ > __ \| | \/ | |\___ \ | | ( <_> | <_> ) |__
  23. |____|_ /\___ >___| /\___ (____ /__| |___/____ > |____|__ \____/ \____/|____/
  24. \/ \/ \//_____/ \/ \/ \/
  25. ]]
  26.  
  27. require 'yprediction'
  28. require 'spell_damage'
  29. require 'winapi'
  30. require 'SKeys'
  31. require 'Utils'
  32. require 'vals_lib'
  33. local yayo = require 'yayo'
  34. local uiconfig = require 'uiconfig'
  35. local send = require 'SendInputScheduled'
  36. local YP = YPrediction()
  37. local target = nil
  38. local attempts = 0
  39. local lastAttempt = 0
  40. local Q,W,E,R = 'Q','W','E','R'
  41. local aaRange = 125 + 60--myHero.range+(GetDistance(GetMinBBox(myHero)))
  42. local qRange, wRange, eRange, rRange = aaRange, 470, 950, nil
  43. local qSpeed, wSpeed, eSpeed, rSpeed = nil, nil, 1500, nil
  44. local qDelay, wDelay, eDelay, rDelay = .5, .5, .5, .5
  45. local qWidth, wWidth, eWidth, rWidth = nil, nil, 70, nil
  46. local qCollision, wCollision, eCollision, rCollision = false, false, true, false
  47. local tsRange = 950
  48. local smitedamage = {390, 410, 430, 450, 480, 510, 540, 570, 600, 640, 680, 720, 760, 800, 850, 900, 950, 1000}
  49. local prefixes = { 'Worm', 'Dragon', 'AncientGolem', 'LizardElder' }
  50.  
  51.  
  52. ------------------------------------------------------------
  53. ---------------------------Menu-----------------------------
  54. ------------------------------------------------------------
  55. Cfg, menu = uiconfig.add_menu('Rengar Is Kool', 250)
  56. local submenu = menu.submenu('1. Skill Options', 150)
  57. submenu.label('lbS1', '--AutoCarry Mode--')
  58. submenu.checkbox('Q_AC_ON', 'Use Q', true)
  59. submenu.checkbox('W_AC_ON', 'Use W', true)
  60. submenu.checkbox('E_AC_ON', 'Use E', true)
  61. submenu.label('lbS2', '----Mixed Mode----')
  62. submenu.checkbox('Q_M_ON', 'Use Q', true)
  63. submenu.checkbox('W_M_ON', 'Use W', true)
  64. submenu.checkbox('E_M_ON', 'Use E', false)
  65. submenu.label('lbS3', '----Lane Clear----')
  66. submenu.checkbox('Q_LC_ON', 'Use Q', false)
  67. submenu.checkbox('W_LC_ON', 'Use W', false)
  68. submenu.checkbox('E_LC_ON', 'Use E', false)
  69. submenu.label('lbS4', '----5 Stack Opts----')
  70. submenu.checkbox('W_Stacks_Heal_ON', 'Use W Heal below %Hp', false)
  71. submenu.slider('W_Stacks_Heal_Value', 'Use W Heal at x% Health', 0, 100, 35)
  72. submenu.checkbox('W_Stacks_Heal_Auto_ON', 'Heal w/o Hotkey Pressed', false)
  73.  
  74. local submenu = menu.submenu('2. Target Selector', 300)
  75. submenu.slider('TS_Mode', 'Target Selector Mode', 1,2,1, {'TS Primary', 'Get Weakest'})
  76. submenu.checkbox('TS_Circles', 'Use Circles To ID Target(s)', true)
  77. submenu.keydown('TS', 'Target Selection Hotkey', 0x01)
  78.  
  79. local submenu = menu.submenu('3. Draw Range', 150)
  80. submenu.checkbox('qRange', 'Show Q Range ', true)
  81. submenu.slider('qRangeColor', 'Color of Q Indicator?', 1, 6, 1, {"Green","Red", "Aqua", "Light Purple", "Blue", "Dark Purple"})
  82. submenu.checkbox('wRange', 'Show W Range', false)
  83. submenu.slider('wRangeColor', 'Color of W Indicator?', 1, 6, 1, {"Green","Red", "Aqua", "Light Purple", "Blue", "Dark Purple"})
  84. submenu.checkbox('eRange', 'Show E Range', true)
  85. submenu.slider('eRangeColor', 'Color of E Indicator?', 1, 6, 1, {"Green","Red", "Aqua", "Light Purple", "Blue", "Dark Purple"})
  86. submenu.checkbox('smiteRange', 'Show Smite Range', false)
  87. submenu.slider('smiteRangeColor', 'Color of Smite Indicator?', 1, 6, 1, {"Green","Red", "Aqua", "Light Purple", "Blue", "Dark Purple"})
  88.  
  89. local submenu = menu.submenu('4. Item Options', 225)
  90. submenu.label('lbI1', '--Offensive Items--')
  91. submenu.checkbox('BC', '---Bilgewater Cutlass---', true)
  92. submenu.checkbox('BORK', '---Blade Of The Ruined King---', true)
  93. submenu.checkbox('RO', '---Randuin\'s Omen---', true)
  94. submenu.checkbox('RH', '---Ravenous Hydra---', true)
  95. submenu.checkbox('T', '---Tiamat---', true)
  96. submenu.checkbox('YG', '---Youmuu\'s Goshtblade---', true)
  97. submenu.checkbox('ACItem_ON', 'Use Items in A/C mode', true)
  98. submenu.checkbox('MItem_ON', 'Use Items in Mixed mode', true)
  99. submenu.checkbox('LCItem_ON', 'Use Hydra/Tiamat in L/C mode', true)
  100.  
  101. local submenu = menu.submenu('5. Summoner Spell Options', 300)
  102. submenu.checkbox('Auto_Ignite_ON', 'Ignite', true)
  103. submenu.checkbutton('Auto_Ignite_Self_ON', 'Ignite Self Cast (creates circle when killable)', false)
  104. submenu.checkbox('Auto_Exhaust_ON', 'Exhaust', true)
  105. submenu.slider('AutoExhaustValue', 'Auto Exhaust Value', 0, 100, 30)
  106. submenu.checkbox('Auto_Barrier_ON', 'Barrier', true)
  107. submenu.slider('AutoBarrierValue', 'Auto Barrier Value', 0, 100, 15)
  108. submenu.checkbox('Auto_Heal_ON', 'Heal', true)
  109. submenu.checkbox('Auto_HealAlly_ON', 'Use Heal To Protect Allies', true)
  110. submenu.slider('AutoHealValue', 'Auto Heal Value', 0, 100, 15)
  111. submenu.keytoggle('AutoSmite', 'Auto-Smite', Keys.N, true)
  112. submenu.permashow("AutoSmite")
  113.  
  114. local submenu = menu.submenu('6. Potion Options', 300)
  115. submenu.checkbox('Health_Potion_ON', 'Health Potions', true)
  116. submenu.slider('Health_Potion_Value', 'Health Potion Value', 0, 100, 75)
  117. submenu.checkbox('Biscuit_ON', 'Biscuit', true)
  118. submenu.slider('Biscuit_Value', 'Biscuit Value', 0, 100, 60)
  119. submenu.checkbox('Chrystalline_Flask_ON', 'Chrystalline Flask', true)
  120. submenu.slider('Chrystalline_Flask_Value', 'Chrystalline Flask Value', 0, 100, 75)
  121. submenu.checkbox('Elixir_of_Fortitude_ON', 'Elixir of Fortitude', true)
  122. submenu.slider('Elixir_of_Fortitude_Value', 'Elixir of Fortitude Value', 0, 100, 30)
  123. submenu.checkbox('Mana_Potion_ON', 'Mana Potions', true)
  124. submenu.slider('Mana_Potion_Value', 'Mana Potion Value', 0, 100, 75)
  125.  
  126. local submenu = menu.submenu('7. Kill Steal Options', 300)
  127. submenu.checkbutton('KillSteal_ON', 'Single Spell Kill Steal', true)
  128. submenu.checkbox('KSQ', 'KS with Q', true)
  129. submenu.checkbox('KSW', 'KS with W', true)
  130. submenu.checkbox('KSE', 'KS with E', true)
  131. submenu.checkbox('KSBC', 'KS w/ Cutlass', true)
  132. submenu.checkbox('KST', 'KS w/ Tiamat', true)
  133. submenu.checkbox('KSRH', 'KS w/ Hydra', true)
  134. submenu.checkbox('KSBORK', 'KS w/ BORK', true)
  135. submenu.checkbox('KSIGN', 'KS w/ Ignite', true)
  136.  
  137. local submenu = menu.submenu('8. Misc Options', 300)
  138. submenu.checkbox('ShowPHP', 'Show Your % of HP', true)
  139. submenu.label('lbM1', '--Auto Level--')
  140. submenu.checkbox('ALevel_ON', 'Use Auto Leveler', true)
  141. submenu.slider('lvlOrder', 'Skill Leveling Order', 1, 6 , 1, {'RQWE', 'RQEW', 'RWQE', 'RWEQ','REQW', 'REWQ'})
  142.  
  143. menu.label('lb01', ' ')
  144. menu.label('lb02', 'Rengar Is Kool Version '..tostring(Version) ..' by KoolKaracter')
  145. ------------------------------------------------------------
  146. ------------------------End Of Menu-------------------------
  147. ------------------------------------------------------------
  148.  
  149.  
  150. ------------------------------------------------------------
  151. ------------------------Main Function-----------------------
  152. ------------------------------------------------------------
  153. function Main()
  154. TargetSelector()
  155. RangeIndicators()
  156. AutoSummoners()
  157. AutoPots()
  158. onTick()
  159. if Cfg['7. Kill Steal Options'].KillSteal_ON then KillSteal() end
  160. if Cfg['8. Misc Options'].ShowPHP then ShowPercentHP() end
  161. if Cfg['8. Misc Options'].ALevel_ON then AutoLvl() end
  162. if Cfg['1. Skill Options'].W_Stacks_Heal_ON and Cfg['1. Skill Options'].W_Stacks_Heal_Auto_ON and myHero.health <= (myHero.maxHealth*(Cfg['1. Skill Options'].W_Stacks_Heal_Value / 100)) and myHero.mana == 5 then CastSpellTarget('W', myHero) end --health is below the slider % value
  163.  
  164. if yayo.Config.AutoCarry then
  165. if target ~= nil then
  166. if Cfg['4. Item Options'].ACItem_ON then UseOffensiveItems(target) end
  167. CheckStacks(target, 'AC')
  168. if Cfg['1. Skill Options'].Q_AC_ON then UseQ(target) end
  169. CheckStacks(target, 'AC')
  170. if Cfg['1. Skill Options'].W_AC_ON then UseW(target) end
  171. CheckStacks(target, 'AC')
  172. if Cfg['1. Skill Options'].E_AC_ON then UseE(target) end
  173. CheckStacks(target, 'AC')
  174. end
  175. end
  176.  
  177. if yayo.Config.Mixed then
  178. if target ~= nil then
  179. if Cfg['4. Item Options'].MItem_ON then UseOffensiveItems(target) end
  180. CheckStacks(target, 'M')
  181. if Cfg['1. Skill Options'].Q_M_ON then UseQ(target) end
  182. CheckStacks(target, 'M')
  183. if Cfg['1. Skill Options'].W_M_ON then UseW(target) end
  184. CheckStacks(target, 'M')
  185. if Cfg['1. Skill Options'].E_M_ON then UseE(target) end
  186. CheckStacks(target, 'M')
  187. end
  188. end
  189.  
  190. if yayo.Config.LaneClear then SpellClear() end
  191. end
  192. ------------------------------------------------------------
  193. --------------------End Of Main Function--------------------
  194. ------------------------------------------------------------
  195.  
  196.  
  197. ------------------------------------------------------------
  198. ---------------------------Skills---------------------------
  199. ------------------------------------------------------------
  200. function UseQ(targ)
  201. local QRANGE
  202. if IsBuffed(myHero, 'Rengar_Base_P_Buf_Ring.troy') then
  203. QRANGE = 590
  204. else
  205. QRANGE = aaRange
  206. end
  207. if GetDistance(targ, myHero) <= QRANGE and ValidTarget(targ) then
  208. CastSpellTarget('Q', targ)
  209. AttackTarget(targ)
  210. end
  211. end
  212.  
  213. function UseW(targ)
  214. if GetDistance(targ, myHero) <= wRange and ValidTarget(targ) then CastSpellTarget('W', myHero) end
  215. end
  216.  
  217. function UseE(targ)
  218. CastPosition, HitChance, Position = YP:GetLineCastPosition(targ, eDelay, eWidth, eRange, eSpeed, myHero, eCollision)
  219. if CastPosition and HitChance >= 2 then
  220. local x, y, z = CastPosition.x, CastPosition.y, CastPosition.z
  221. CastSpellXYZ('E', x, y, z)
  222. end
  223. end
  224.  
  225. function CheckStacks(targ, mode)
  226. if myHero.mana == 5 then
  227. if Cfg['1. Skill Options'].W_Stacks_Heal_ON and myHero.health <= (myHero.maxHealth*(Cfg['1. Skill Options'].W_Stacks_Heal_Value / 100)) and myHero.mana == 5 then
  228. CastSpellTarget('W', myHero)
  229. else
  230. if mode ~= nil and ((mode == 'AC' and Cfg['1. Skill Options'].Q_AC_ON) or (mode == 'M' and Cfg['1. Skill Options'].Q_M_ON) or (mode == 'LC' and Cfg['1. Skill Options'].Q_LC_ON)) then
  231. UseQ(targ)
  232. end
  233. end
  234. end
  235. end
  236.  
  237. function SpellClear()
  238. local minionTarget = GetLowestHealthEnemyMinion(900)
  239.  
  240. if Cfg['4. Item Options'].LCItem_ON and minionTarget ~= nil and GetDistance(minionTarget, myHero) < 400 then
  241. UseItemOnTarget(3074, myHero) -- Ravenous Hydra
  242. UseItemOnTarget(3077, myHero) -- Tiamat
  243. end
  244. CheckStacks(minionTarget, 'LC')
  245. --Q Farm
  246. if Cfg['1. Skill Options'].Q_LC_ON and minionTarget ~= nil then UseQ(minionTarget) end
  247. CheckStacks(minionTarget, 'LC')
  248. --W Farm
  249. if Cfg['1. Skill Options'].W_LC_ON and minionTarget ~= nil then UseW(minionTarget) end
  250. CheckStacks(minionTarget, 'LC')
  251. --E Farm
  252. if Cfg['1. Skill Options'].E_LC_ON and minionTarget ~= nil then UseE(minionTarget) end
  253. CheckStacks(minionTarget, 'LC')
  254. end
  255. ------------------------------------------------------------
  256. ------------------------End Of Skills-----------------------
  257. ------------------------------------------------------------
  258.  
  259.  
  260. ------------------------------------------------------------
  261. ------------------------Target Selector---------------------
  262. ------------------------------------------------------------
  263. function TargetSelector()
  264. --TS Mode 1 (TS Primary)
  265. if Cfg['2. Target Selector'].TS_Mode == 1 then
  266. if Cfg['2. Target Selector'].TS then
  267. for i = 1, objManager:GetMaxHeroes() do
  268. local enemy = objManager:GetHero(i)
  269. if enemy ~= nil and enemy.team ~= myHero.team and enemy.visible == 1 and GetDistance(enemy,mousePos) < 150 then
  270. targetPri = enemy
  271. end
  272. end
  273. end
  274. if target ~= nil and (GetDistance(target, myHero) > tsRange or target.visible ~= 1) then target = nil end
  275. if targetPri ~= nil and ValidTarget(targetPri, tsRange) then
  276. target = targetPri
  277. yayo.ForceTarget(target)
  278. elseif target == nil or (targetPri ~= nil and ValidTarget(targetPri, tsRange) ~= 1) then
  279. target = GetWeakEnemy('PHYS', tsRange)
  280. target = target
  281. yayo.ForceTarget(target)
  282. end
  283. if targetPri ~= nil and (targetPri.dead == 1 or myHero.dead == 1) then targetPri = nil end
  284. if target ~= nil and (target.dead==1 or myHero.dead==1) then
  285. target = nil
  286. end
  287. if Cfg['2. Target Selector'].TS_Circles then
  288. if targetPri ~= nil and targetPri ~= target then
  289. CustomCircle(100,10,9,targetPri) --yellow
  290. end
  291. if target ~= nil then
  292. CustomCircle(100,10,1,target) -- green
  293. end
  294. end
  295. -- TS Mode 2 (Get Weakest)
  296. elseif Cfg['2. Target Selector'].TS_Mode == 2 then
  297. target = GetWeakEnemy('PHYS', tsRange)
  298. yayo.ForceTarget(target)
  299. if target ~= nil and (GetDistance(target, myHero) > tsRange or target.visible ~= 1) then target = nil end
  300. if Cfg['2. Target Selector'].TS_Circles and target ~= nil then
  301. CustomCircle(100,10,1,target)
  302. end
  303. else
  304. --Do nothing
  305. end
  306. end
  307. ------------------------------------------------------------
  308. --------------------End Of Target Selector------------------
  309. ------------------------------------------------------------
  310.  
  311.  
  312. ------------------------------------------------------------
  313. -----------------------Range Indicators---------------------
  314. ------------------------------------------------------------
  315. function RangeIndicators()
  316. --local qColor, wColor, eColor, rColor = GetColors()
  317. if Cfg['3. Draw Range'].qRange then
  318. DrawCircleObject(myHero, qRange, Cfg['3. Draw Range'].qRangeColor)
  319. end
  320. if Cfg['3. Draw Range'].wRange then
  321. DrawCircleObject(myHero, wRange, Cfg['3. Draw Range'].wRangeColor)
  322. end
  323. if Cfg['3. Draw Range'].eRange then
  324. DrawCircleObject(myHero, eRange, Cfg['3. Draw Range'].eRangeColor)
  325. end
  326. if Cfg['3. Draw Range'].smiteRange then
  327. DrawCircleObject(myHero, 750, Cfg['3. Draw Range'].smiteRangeColor)
  328. end
  329. end
  330. ------------------------------------------------------------
  331. --------------------End Of Range Indicators-----------------
  332. ------------------------------------------------------------
  333.  
  334.  
  335. ------------------------------------------------------------
  336. --------------------------Use Items-------------------------
  337. ------------------------------------------------------------
  338. function UseOffensiveItems(target)
  339. AttackRange = myHero.range+(GetDistance(GetMinBBox(myHero)))
  340.  
  341. if target ~= nil then
  342. if Cfg['4. Item Options'].BC and (GetDistance(myHero, target) < 400) then -- IR
  343. UseItemOnTarget(3144, target) -- Bilgewater Cutlass
  344. end
  345. if Cfg['4. Item Options'].BORK and (GetDistance(myHero, target) < 500) then -- IR
  346. UseItemOnTarget(3153, target) -- Blade of the Ruined King
  347. end
  348. if Cfg['4. Item Options'].RO and (GetDistance(myHero, target) < 400) then -- IR
  349. UseItemOnTarget(3143, target) -- Randuin's Omen
  350. end
  351. if Cfg['4. Item Options'].RH and (GetDistance(myHero, target) < 400) then -- IR
  352. UseItemOnTarget(3074, target) -- Ravenous Hydra
  353. end
  354. if Cfg['4. Item Options'].T and (GetDistance(myHero, target) < 400) then -- IR
  355. UseItemOnTarget(3077, target) -- Tiamat
  356. end
  357. if Cfg['4. Item Options'].YG and (GetDistance(myHero, target) < AttackRange+10) then -- AR
  358. UseItemOnTarget(3142, target) -- Youmuu's Ghostblade
  359. end
  360. end
  361. end
  362. ------------------------------------------------------------
  363. -----------------------End Of Use Items---------------------
  364. ------------------------------------------------------------
  365.  
  366.  
  367. ------------------------------------------------------------
  368. ------------------------Summoner Spells---------------------
  369. ------------------------------------------------------------
  370. local Summoners =
  371. {
  372. Ignite = {Key = nil, Name = 'summonerdot'},
  373. Exhaust = {Key = nil, Name = 'summonerexhaust'},
  374. Heal = {Key = nil, Name = 'summonerheal'},
  375. Clarity = {Key = nil, Name = 'summonermana'},
  376. Barrier = {Key = nil, Name = 'summonerbarrier'},
  377. Smite = {Key = nil, Name = 'summonersmite'}
  378. }
  379.  
  380. if myHero ~= nil then
  381. for _, Summoner in pairs(Summoners) do
  382. if myHero.SummonerD == Summoner.Name then
  383. Summoner.Key = "D"
  384. elseif myHero.SummonerF == Summoner.Name then
  385. Summoner.Key = "F"
  386. end
  387. end
  388. end
  389.  
  390. function AutoSummoners()
  391. if Cfg['5. Summoner Spell Options'].Auto_Ignite_ON then SummonerIgnite() end
  392. if Cfg['5. Summoner Spell Options'].Auto_Barrier_ON then SummonerBarrier() end
  393. if Cfg['5. Summoner Spell Options'].Auto_Heal_ON then SummonerHeal() end
  394. if Cfg['5. Summoner Spell Options'].Auto_Exhaust_ON then SummonerExhaust() end
  395. end
  396.  
  397. function SummonerIgnite()
  398. if myHero.SummonerD == 'summonerdot' or myHero.SummonerF == 'summonerdot' then --Dont waist time/energy if you dont have ignite
  399. if myHero.SummonerD == 'summonerdot' then
  400. ignKey = Keys.D
  401. else
  402. ignKey = Keys.F
  403. end
  404.  
  405. for i = 1, objManager:GetMaxHeroes() do
  406. local targetIgnite = objManager:GetHero(i)
  407. if targetIgnite ~= nil and targetIgnite.team ~= myHero.team and targetIgnite.visible == 1 and GetDistance(myHero, targetIgnite) < 700 then
  408. local targetName = champdb[targetIgnite.name]
  409. local damage = (myHero.selflevel*20)+50
  410. local targetRegenPerSec = (targetName.healthRegenBase + (targetName.healthRegenLevel * targetIgnite.selflevel))
  411. local ignDamageAfterRegen = (damage-((targetRegenPerSec*5)/2))
  412. local targCircle = 0
  413.  
  414. if Cfg['5. Summoner Spell Options'].Auto_Ignite_Self_ON then
  415. if (ignKey == Keys.D and myHero.SpellTimeD > 1) or (ignKey == Keys.F and myHero.SpellTimeF > 1 )then
  416. if targetIgnite.health < ignDamageAfterRegen and GetDistance(myHero, targetIgnite) < 600 then
  417. CustomCircle(80,8,2,targetIgnite)--RED
  418. targCircle = 2 --Ready to Cast
  419. elseif targetIgnite.health < ignDamageAfterRegen and GetDistance(myHero, targetIgnite) > 599 and GetDistance(myHero, targetIgnite) < 700 then
  420. CustomCircle(80,8,8,targetIgnite) --ORANGE
  421. targCircle = 1 --Ready to cast but target is just out of range (100 away)
  422. else
  423. targCircle = 0
  424. end
  425.  
  426. if targCircle == 2 and IsKeyDown(ignKey) then CastSummonerIgn(targetIgnite) end --Cast ignite on killable target when ignite key is pressed
  427. end
  428. elseif Cfg['5. Summoner Spell Options'].Auto_Ignite_Self_ON == false then
  429. if targetIgnite.health < ignDamageAfterRegen and GetDistance(myHero, targetIgnite) < 600 then CastSummonerIgn(targetIgnite) end
  430.  
  431. end
  432. end
  433. end
  434. end
  435. end
  436.  
  437.  
  438. function SummonerBarrier()
  439. if myHero.SummonerD == 'summonerbarrier' or myHero.SummonerF == 'summonerbarrier' then
  440. if myHero.health < myHero.maxHealth*(Cfg['5. Summoner Spell Options'].AutoBarrierValue / 100) then
  441. CastSummonerBar()
  442. end
  443. end
  444. end
  445.  
  446. function SummonerHeal()
  447. if myHero.SummonerD == 'summonerheal' or myHero.SummonerF == 'summonerheal' then
  448. if Cfg['5. Summoner Spell Options'].Auto_HealAlly_ON then --will activate when alley within range is below X%
  449. for h = 1, objManager:GetMaxHeroes() do
  450. local allyH = objManager:GetHero(h)
  451. if (allyH ~= nil and allyH.team == myHero.team and allyH.visible == 1 and GetDistance(myHero, allyH) < 700) or allyH == myHero then
  452. if allyH.health <= (allyH.maxHealth*(Cfg['5. Summoner Spell Options'].AutoHealValue / 100)) then --If health is below the slider % value
  453. CastSummonerHea()
  454. end
  455. end
  456. end
  457. else --HealAlly not on, will just activate on self
  458. if myHero.health < myHero.maxHealth*(Cfg['5. Summoner Spell Options'].AutoHealValue / 100) then
  459. CastSummonerHea()
  460. end
  461. end
  462. end
  463. end
  464.  
  465. function SummonerExhaust()
  466. if target ~= nil then
  467. if myHero.SummonerD == 'summonerexhaust' or myHero.SummonerF == 'summonerexhaust' then
  468. if myHero.health < myHero.maxHealth*(Cfg['5. Summoner Spell Options'].AutoExhaustValue / 100) and GetDistance(myHero, target) < 650 then
  469. if myHero.health < target.health then
  470. CastSummonerExh(target)
  471. end
  472. end
  473. end
  474. end
  475. end
  476.  
  477. -----------Kool's Edited version of Smite from Code BK-201----------------
  478. local track = {}
  479. local default_button_value = true
  480.  
  481. function onTick()
  482. for key,t in pairs(track) do
  483. local o = t.object
  484. local still_valid = false
  485. if is_boss(o) and o.dead == 0 and o.health > 0 then
  486. local current_key = get_key(o)
  487. if key == current_key then
  488. still_valid = true
  489. end
  490. end
  491. if still_valid then
  492. if Summoners.Smite.Key ~= nil then
  493. if IsSpellReady(Summoners.Smite.Key) and Cfg['5. Summoner Spell Options'].AutoSmite then
  494. if o.health <= smitedamage[myHero.selflevel] and GetDistance(o, myHero) < 750 then
  495. CastSmite(o)
  496. end
  497. end
  498. end
  499. else
  500. track[key] = nil
  501. end
  502. end
  503. end
  504.  
  505. function is_boss(o)
  506. if o ~= nil and o.valid == 1 and o.name ~= nil and o.charName ~= nil then
  507. for i=1,#prefixes do
  508. local prefix = prefixes[i]
  509. if starts_with(o.name, prefix) then
  510. return true
  511. end
  512. end
  513. end
  514. return false
  515. end
  516.  
  517. function starts_with(s, sub)
  518. return s:sub(1,string.len(sub))==sub
  519. end
  520.  
  521. function get_key(o)
  522. return tostring(o.id)..','..o.name..','..o.charName
  523. end
  524.  
  525. function start_tracking(o)
  526. local key = get_key(o)
  527. track[key] = {object=o, button_value=default_button_value, started=os.clock()}
  528. end
  529.  
  530. function OnCreateObj(o)
  531. if is_boss(o) then
  532. start_tracking(o)
  533. end
  534. end
  535.  
  536. for i=1,objManager:GetMaxObjects() do OnCreateObj(objManager:GetObject(i)) end
  537. ------------ End of Smite-------
  538.  
  539. function CastSummonerIgn(targ)
  540. if ValidTarget(targ) and Summoners.Ignite.Key ~= nil then
  541. CastSpellTarget(Summoners.Ignite.Key, targ)
  542. end
  543. end
  544.  
  545. function CastSummonerExh(targ)
  546. if ValidTarget(targ) and Summoners.Exhaust.Key ~= nil then
  547. CastSpellTarget(Summoners.Exhaust.Key, targ)
  548. end
  549. end
  550.  
  551. function CastSummonerHea(x, y, z)
  552. local unit
  553. if x == nil then
  554. unit = myHero
  555. elseif type(x) ~= 'number' then
  556. unit = x
  557. end
  558. if unit then
  559. x, y, z = unit.x, unit.y, unit.z
  560. end
  561. if Summoners.Heal.Key ~= nil then
  562. CastSpellXYZ(Summoners.Heal.Key, x, y, z)
  563. end
  564. end
  565.  
  566. function CastSummonerBar()
  567. if Summoners.Barrier.Key ~= nil then
  568. CastSpellTarget(Summoners.Barrier.Key, myHero)
  569. end
  570. end
  571.  
  572. function CastSmite(targ)
  573. printtext('\nGets here\n')
  574. CastSpellTarget(Summoners.Smite.Key, targ)
  575. end
  576. ------------------------------------------------------------
  577. ---------------------End Of Summoner Spells-----------------
  578. ------------------------------------------------------------
  579.  
  580.  
  581. ------------------------------------------------------------
  582. --------------------------Use Potions-------------------------
  583. ------------------------------------------------------------
  584. function AutoPots()
  585. if IsBuffed(myHero, "FountainHeal") ~= true then
  586. if Cfg['6. Potion Options'].Health_Potion_ON and myHero.health < myHero.maxHealth * (Cfg['6. Potion Options'].Health_Potion_Value / 100) and IsBuffed(myHero, 'Global_Item_HealthPotion') ~= true and IsBuffed(myHero, 'GLOBAL_Item_HealthPotion') ~= true then
  587. usePotion()
  588. end
  589. if Cfg['6. Potion Options'].Biscuit_ON and myHero.health < myHero.maxHealth * (Cfg['6. Potion Options'].Biscuit_Value / 100) and IsBuffed(myHero, 'Global_Item_HealthPotion')~= true and IsBuffed(myHero, 'GLOBAL_Item_HealthPotion') ~= true then
  590. useBiscuit()
  591. end
  592. if Cfg['6. Potion Options'].Chrystalline_Flask_ON and myHero.health < myHero.maxHealth * (Cfg['6. Potion Options'].Chrystalline_Flask_Value / 100) and IsBuffed(myHero, 'Global_Item_HealthPotion') ~= true and IsBuffed(myHero, 'GLOBAL_Item_HealthPotion') ~= true then
  593. useFlask()
  594. end
  595. if Cfg['6. Potion Options'].Elixir_of_Fortitude_ON and myHero.health < myHero.maxHealth * (Cfg['6. Potion Options'].Elixir_of_Fortitude_Value / 100) and IsBuffed(myHero, 'PotionofGiantStrength_itm') ~= true then
  596. useElixir()
  597. end
  598. if Cfg['6. Potion Options'].Mana_Potion_ON and myHero.mana < myHero.maxMana * (Cfg['6. Potion Options'].Mana_Potion_Value / 100) and IsBuffed(myHero, 'Global_Item_ManaPotion') ~= true and IsBuffed(myHero, 'GLOBAL_Item_ManaPotion') ~= true then
  599. useManaPot()
  600. end
  601. end
  602. end
  603.  
  604.  
  605. function usePotion()
  606. UseItemOnTarget(2003,myHero)
  607. end
  608.  
  609. function useBiscuit()
  610. UseItemOnTarget(2010,myHero)
  611. end
  612.  
  613. function useFlask()
  614. UseItemOnTarget(2041,myHero)
  615. end
  616.  
  617. function useElixir()
  618. UseItemOnTarget(2037,myHero)
  619. end
  620.  
  621. function useManaPot()
  622. UseItemOnTarget(2004,myHero)
  623. end
  624. ------------------------------------------------------------
  625. -----------------------End Of Use Potions-------------------
  626. ------------------------------------------------------------
  627.  
  628.  
  629. ------------------------------------------------------------
  630. -----------------------Kill Steal Function------------------
  631. ------------------------------------------------------------
  632. function KillSteal()
  633.  
  634. for i = 1, objManager:GetMaxHeroes() do
  635. local ksTarg = objManager:GetHero(i)
  636. if myHero.mana == 5 then
  637. if Cfg['7. Kill Steal Options'].KSW and ksTarg ~= nil and ValidTarget(ksTarg) and ksTarg.team ~= myHero.team and GetDistance(myHero, ksTarg) < wRange and getDmg('W', ksTarg, myHero) >= ksTarg.health then UseW(ksTarg) end
  638. if Cfg['7. Kill Steal Options'].KSQ and ksTarg ~= nil and ValidTarget(ksTarg) and ksTarg.team ~= myHero.team and GetDistance(myHero, ksTarg) < qRange and getDmg('Q', ksTarg, myHero) >= ksTarg.health then UseQ(ksTarg) end
  639. if Cfg['7. Kill Steal Options'].KSE and ksTarg ~= nil and ValidTarget(ksTarg) and ksTarg.team ~= myHero.team and GetDistance(myHero, ksTarg) < eRange and getDmg('E', ksTarg, myHero) >= ksTarg.health then UseE(ksTarg) end
  640. if Cfg['7. Kill Steal Options'].KSBC and ksTarg ~= nil and ValidTarget(ksTarg) and ksTarg.team ~= myHero.team and GetDistance(myHero, ksTarg) < 400 and getDmg('BWC', ksTarg, myHero) >= ksTarg.health then UseItemOnTarget(3144, ksTarg) end
  641. if Cfg['7. Kill Steal Options'].KST and ksTarg ~= nil and ValidTarget(ksTarg) and ksTarg.team ~= myHero.team and GetDistance(myHero, ksTarg) < 400 and getDmg('TIAMAT', ksTarg, myHero) >= ksTarg.health then UseItemOnTarget(3077, ksTarg) end
  642. if Cfg['7. Kill Steal Options'].KSRH and ksTarg ~= nil and ValidTarget(ksTarg) and ksTarg.team ~= myHero.team and GetDistance(myHero, ksTarg) < 400 and getDmg('HYDRA', ksTarg, myHero) >= ksTarg.health then UseItemOnTarget(3074, ksTarg) end
  643. if Cfg['7. Kill Steal Options'].KSBORK and ksTarg ~= nil and ValidTarget(ksTarg) and ksTarg.team ~= myHero.team and GetDistance(myHero, ksTarg) < 500 and getDmg('RUINEDKING', ksTarg, myHero) >= ksTarg.health then UseItemOnTarget(3153, ksTarg) end
  644. if Cfg['7. Kill Steal Options'].KSIGN and ksTarg ~= nil and ValidTarget(ksTarg) and ksTarg.team ~= myHero.team and GetDistance(myHero, ksTarg) < 600 and getDmg('IGNITE', ksTarg, myHero) >= ksTarg.health and (Cfg['5. Summoner Spell Options'].Auto_Ignite_Self_ON ~= true) then CastSummonerIgn(ksTarg) end
  645. else
  646. if Cfg['7. Kill Steal Options'].KSQ and ksTarg ~= nil and ValidTarget(ksTarg) and ksTarg.team ~= myHero.team and GetDistance(myHero, ksTarg) < qRange and getDmg('Q', ksTarg, myHero) >= ksTarg.health then UseQ(ksTarg) end
  647. if Cfg['7. Kill Steal Options'].KSW and ksTarg ~= nil and ValidTarget(ksTarg) and ksTarg.team ~= myHero.team and GetDistance(myHero, ksTarg) < wRange and getDmg('W', ksTarg, myHero) >= ksTarg.health then UseW(ksTarg) end
  648. if Cfg['7. Kill Steal Options'].KSE and ksTarg ~= nil and ValidTarget(ksTarg) and ksTarg.team ~= myHero.team and GetDistance(myHero, ksTarg) < eRange and getDmg('E', ksTarg, myHero) >= ksTarg.health then UseE(ksTarg) end
  649. if Cfg['7. Kill Steal Options'].KSBC and ksTarg ~= nil and ValidTarget(ksTarg) and ksTarg.team ~= myHero.team and GetDistance(myHero, ksTarg) < 400 and getDmg('BWC', ksTarg, myHero) >= ksTarg.health then UseItemOnTarget(3144, ksTarg) end
  650. if Cfg['7. Kill Steal Options'].KST and ksTarg ~= nil and ValidTarget(ksTarg) and ksTarg.team ~= myHero.team and GetDistance(myHero, ksTarg) < 400 and getDmg('TIAMAT', ksTarg, myHero) >= ksTarg.health then UseItemOnTarget(3077, ksTarg) end
  651. if Cfg['7. Kill Steal Options'].KSRH and ksTarg ~= nil and ValidTarget(ksTarg) and ksTarg.team ~= myHero.team and GetDistance(myHero, ksTarg) < 400 and getDmg('HYDRA', ksTarg, myHero) >= ksTarg.health then UseItemOnTarget(3074, ksTarg) end
  652. if Cfg['7. Kill Steal Options'].KSBORK and ksTarg ~= nil and ValidTarget(ksTarg) and ksTarg.team ~= myHero.team and GetDistance(myHero, ksTarg) < 500 and getDmg('RUINEDKING', ksTarg, myHero) >= ksTarg.health then UseItemOnTarget(3153, ksTarg) end
  653. if Cfg['7. Kill Steal Options'].KSIGN and ksTarg ~= nil and ValidTarget(ksTarg) and ksTarg.team ~= myHero.team and GetDistance(myHero, ksTarg) < 600 and getDmg('IGNITE', ksTarg, myHero) >= ksTarg.health and (Cfg['5. Summoner Spell Options'].Auto_Ignite_Self_ON ~= true) then CastSummonerIgn(ksTarg) end
  654. end
  655. end
  656. end
  657.  
  658. ------------------------------------------------------------
  659. -------------------End Of Kill Steal Function---------------
  660. ------------------------------------------------------------
  661.  
  662.  
  663. ------------------------------------------------------------
  664. --------------------Miscellaneous Functions-----------------
  665. ------------------------------------------------------------
  666. function ShowPercentHP()
  667.  
  668. local myHP = ((myHero.health / myHero.maxHealth) * 100)
  669. myHP = string.format('%d%%', myHP)
  670. DrawTextObject(myHP,myHero,Color.White)
  671.  
  672. end
  673.  
  674. function Level_Spell(letter)
  675. if letter == Q then send.key_press(0x69)
  676. elseif letter == W then send.key_press(0x6a)
  677. elseif letter == E then send.key_press(0x6b)
  678. elseif letter == R then send.key_press(0x6c)
  679. end
  680. end
  681.  
  682. function GetSkillOrder()
  683. if Cfg['8. Misc Options'].lvlOrder == 1 then
  684. skillOrder = {Q,W,E,Q,Q,R,Q,W,Q,W,R,W,W,E,E,R,E,E}
  685. end
  686. if Cfg['8. Misc Options'].lvlOrder == 2 then
  687. skillOrder = {Q,E,W,Q,Q,R,Q,E,Q,E,R,E,E,W,W,R,W,W}
  688. end
  689. if Cfg['8. Misc Options'].lvlOrder == 3 then
  690. skillOrder = {W,Q,E,W,W,R,W,Q,W,Q,R,Q,Q,E,E,R,E,E}
  691. end
  692. if Cfg['8. Misc Options'].lvlOrder == 4 then
  693. skillOrder = {W,E,Q,W,W,R,W,E,W,E,R,E,E,Q,Q,R,Q,Q}
  694. end
  695. if Cfg['8. Misc Options'].lvlOrder == 5 then
  696. skillOrder = {E,Q,W,E,E,R,E,Q,E,Q,R,Q,Q,W,W,R,W,W}
  697. end
  698. if Cfg['8. Misc Options'].lvlOrder == 6 then
  699. skillOrder = {E,W,Q,E,E,R,E,W,E,W,R,W,W,Q,Q,R,Q,Q}
  700. end
  701. end
  702.  
  703. function AutoLvl()
  704. if IsChatOpen() == 0 then
  705. GetSkillOrder()
  706. spellLevelSum = GetSpellLevel(Q) + GetSpellLevel(W) + GetSpellLevel(E) + GetSpellLevel(R)
  707.  
  708. if attempts <= 10 or (attempts > 10 and GetTickCount() > lastAttempt+1500) then
  709. if spellLevelSum < myHero.selflevel then
  710. if lastSpellLevelSum ~= spellLevelSum then attempts = 0 end
  711. letter = skillOrder[spellLevelSum+1]
  712. Level_Spell(letter, spellLevelSum)
  713. attempts = attempts+1
  714. lastAttempt = GetTickCount()
  715. lastSpellLevelSum = spellLevelSum
  716. else
  717. attempts = 0
  718. end
  719. end
  720. end
  721. send.tick()
  722. end
  723. ------------------------------------------------------------
  724. ----------------End Of Miscellaneous Functions--------------
  725. ------------------------------------------------------------
  726.  
  727.  
  728. SetTimerCallback('Main')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement