Advertisement
TallyHo

TallyHo's Tryndamere V1.2

Jan 24th, 2014
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.97 KB | None | 0 0
  1. -- Required Libraries
  2. require 'Utils'
  3. require 'uiconfig'
  4.  
  5. --Variables
  6. local target
  7. local FLEEING = 0
  8. local CHASING = 1
  9. local STATIONARY = 2
  10. local uiconfig = require 'uiconfig'
  11. local timer = 0
  12. local Minion
  13. local smitedamage
  14.  
  15. --Menu
  16. CfgTrynd, menu = uiconfig.add_menu('Tryndamere',200)
  17. menu.keydown('Combo','Combo', Keys.Space)
  18. menu.keydown('Farm','Farm', Keys.C)
  19. menu.keytoggle('Jungle','AutoSmite', 200, Keys.X, true)
  20. menu.keytoggle('Hydra','Auto Hydra/Tiamat', 200, Keys.Z, true)
  21. menu.slider('BotRK','Use Bilge/BotRK %', 0, 100, 25, nil, true)
  22. menu.slider('UltHP','Auto Ult %', 0, 100, 25, nil, true)
  23. menu.slider('HealHP','Auto Heal %', 0, 100, 50, nil, true)
  24. menu.slider('IgniteHP','Auto Ignite %', 0, 100, 25, nil, true)
  25. menu.slider('ExhaustHP','Auto Exhaust %', 0, 100, 25, nil, true)
  26. menu.slider('AutoPot','Auto HP Pot %', 0, 100, 75, nil, true)
  27. menu.slider('AutoElixir','Auto Elixir HP %', 0, 100, 75, nil, true)
  28.     menu.permashow('Jungle')
  29.     menu.permashow('Farm')
  30.    
  31. --Main Function
  32. function Main()
  33. Minion = GetLowestHealthEnemyMinion(500)
  34.     Smite()
  35. target = GetWeakEnemy('PHYS', 1500)
  36.     if target ~= nil then
  37.         if CfgTrynd.Combo then Combo() end
  38.         if CfgTrynd.Hydra then Hydra() BotRK() end
  39.     end
  40.     if CfgTrynd.Jungle then Jungle() end
  41.     if CfgTrynd.Farm then LastHit() end
  42.     Draw()
  43.     HealthPot()
  44.     RedElixir()
  45.     TryndQ()
  46.     TryndUlt()
  47.         if Minion ~= nil then
  48.             if GetDistance(myHero,Minion) <= 550 then
  49.                 CustomCircle(100,2,1,Minion)
  50.             end
  51.         end
  52.     CustomCircle(500,2,1,myHero)
  53. end
  54.  
  55. --Combo Func
  56. function Combo()
  57.     if target ~= nil then
  58.         TryndE()
  59.         TryndW()
  60.         Ignite()
  61.         Exhaust()
  62.         AttackTarget(target)
  63.         BotRK()
  64.         else MoveToMouse()
  65.     end
  66.     MoveToMouse()
  67. end
  68.        
  69. --LastHit BETA
  70. function LastHit()
  71.     if Minion ~= nil then
  72.         if Minion.health <= (myHero.addDamage + myHero.baseDamage) then
  73.             AttackTarget(Minion) else
  74.             MoveToMouse()
  75.         end
  76.     end
  77.     MoveToMouse()
  78. end
  79.  
  80.  
  81. --GetRange
  82. function GetRange(range)
  83.     if target ~= nil and GetDistance(myHero,target) <= range then
  84.         return true
  85.     end
  86. end
  87.  
  88. --Draw (Range Circles)
  89. function Draw()
  90.     if  target ~= nil and GetRange(660) then
  91.         CustomCircle(100,2,1,target)
  92.     end
  93. end
  94.  
  95. --Item Usage
  96. function BotRK()
  97.     if target ~= nil then
  98.         if target.health <= target.maxHealth*(CfgTrynd.BotRK / 100) and GetRange(450) then
  99.             UseItemOnTarget(3153, target)
  100.             UseItemOnTarget(3144, target)
  101.         end
  102.     end
  103. end
  104.  
  105. function Hydra()
  106.     if target ~= nil then
  107.         if GetRange(400) then
  108.             UseItemOnTarget(3074,myHero)
  109.             UseItemOnTarget(3077,myHero)
  110.         end
  111.     end
  112. end
  113.  
  114.  
  115. --Consumables
  116. function HealthPot()
  117.     if myHero.health <= myHero.maxHealth*(CfgTrynd.AutoPot / 100) and os.time() > timer + 15 then
  118.         UseItemOnTarget(2003, myHero)
  119.         UseItemOnTarget(2010, myHero)
  120.         timer = os.time()
  121.     end
  122. end
  123.  
  124. function RedElixir()
  125.     if myHero.health <= myHero.maxHealth*(CfgTrynd.AutoElixir / 100) then
  126.         UseItemOnTarget(2037, myHero)
  127.     end
  128. end
  129.  
  130. --Summoners
  131. function Ignite()
  132.     if target ~= nil then
  133.         if myHero.SummonerD == 'SummonerDot' then
  134.             if target.health <= target.maxHealth*(CfgTrynd.IgniteHP / 100) and myHero.SpellTimeD > 1.0 then
  135.                 CastSummonerIgnite(target)
  136.             end
  137.         end
  138.         if myHero.SummonerF == 'SummonerDot' then
  139.             if target.health <= target.maxHealth*(CfgTrynd.IgniteHP / 100) and myHero.SpellTimeF > 1.0 then
  140.                 CastSummonerIgnite(target)
  141.                 end
  142.         end
  143.     end
  144. end
  145.  
  146. function Exhaust()
  147.     if target ~= nil then
  148.         if myHero.SummonerD == 'SummonerExhaust' then
  149.             if target.health <= target.maxHealth*(CfgTrynd.ExhaustHP / 100) and myHero.SpellTimeD > 1.0 then
  150.                 CastSummonerExhaust(target)
  151.             end
  152.         end
  153.         if myHero.SummonerF == 'SummonerExhaust' then
  154.             if target.health <= target.maxHealth*(CfgTrynd.ExhaustHP / 100) and myHero.SpellTimeF > 1.0 then
  155.                 CastSummonerExhaust(target)
  156.             end
  157.         end
  158.     end
  159. end
  160.  
  161. --Q Heal
  162. function TryndQ()
  163.     if myHero.SpellTimeQ > 1.0 and myHero.health <= myHero.maxHealth*(CfgTrynd.HealHP / 100) then
  164.         CastSpellTarget('Q', myHero)
  165.     end
  166. end
  167.  
  168. --E Harass
  169. function TryndE()
  170. target = GetWeakEnemy('PHYS', 1500)
  171.         if target ~= nil then
  172.                 if myHero.SpellTimeE > 1.0 and GetDistance(myHero,target) <= 660 then
  173.                         CastSpellXYZ('E',GetFireahead(target,2,20))
  174.                 end
  175.         end
  176. end
  177.  
  178. --Facing Detection by CCONN81
  179. function GetTargetDirection()
  180.     local distanceTarget = GetDistance(target)
  181.     local x1, y1, z1 = GetFireahead(target,2,10)
  182.     local distancePredicted = GetDistance({x = x1, y = y1, z = z1})
  183.    
  184.     return (distanceTarget > distancePredicted and CHASING or (distanceTarget < distancePredicted and FLEEING or STATIONARY))
  185. end
  186.  
  187. --Slow
  188. function TryndW()
  189.     if target ~= nil then
  190.         if GetTargetDirection() == FLEEING and myHero.SpellTimeW > 1.0 and GetDistance(myHero,target) <= 400 then
  191.             CastSpellTarget('W',target)
  192.         end
  193.     end
  194. end
  195.  
  196. --AutoUlt
  197. function TryndUlt()
  198. target2 = GetWeakEnemy('PHYS', 2500)
  199.     if target2 ~= nil then
  200.         if myHero.health <= myHero.maxHealth*(CfgTrynd.UltHP / 100) then
  201.             CastSpellTarget('R', myHero)
  202.         end
  203.     end
  204. end
  205.  
  206. --Jungle SmiteSteal
  207. function Jungle()
  208.         for i = 1, objManager:GetMaxObjects(), 1 do  
  209.             obj = objManager:GetObject(i)
  210.             if obj ~= nil then
  211.                 if (obj.charName:find("AncientGolem")) or (obj.charName:find("LizardElder")) or (obj.charName:find("Dragon" )) or (obj.charName:find("Worm" ))then
  212.                     if GetDistance(myHero,obj) <= 750 and obj.health <= smitedamage then
  213.                         CastSpellTarget('F',obj)
  214.                 end
  215.             end
  216.         end
  217.     end
  218. end
  219.  
  220. --Smite
  221. function Smite()
  222.     if myHero.selflevel < 5 then
  223.         smitedamage = 370+(myHero.selflevel*20)
  224.     elseif myHero.selflevel > 4 and myHero.selflevel < 10 then
  225.         smitedamage = 330+(myHero.selflevel*30)
  226.     elseif myHero.selflevel > 9 and myHero.selflevel < 15 then
  227.         smitedamage = 240+(myHero.selflevel*40)
  228.     elseif myHero.selflevel > 14 then
  229.         smitedamage = 100+(myHero.selflevel*50)
  230.     end
  231. end
  232.  
  233. SetTimerCallback('Main')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement