Advertisement
Guest User

Untitled

a guest
Mar 1st, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.41 KB | None | 0 0
  1. if myHero.charName ~= "Rengar" then return end
  2. local VP
  3. require "VPrediction"
  4. require "SxOrbWalk"
  5. local qRange = 100
  6. local eRange = 1050
  7. local leapRange = 775
  8. local fury = myHero.mana
  9. local Visible = true
  10.  
  11. function OnLoad()
  12.     VP = VPrediction()
  13.     print("AutoRengar v1.50 loaded - Created by Fret13103 - thank you for using")
  14.    
  15.     Config = scriptConfig("AutoRengar v1.3", "Rengar")
  16.     Config:addSubMenu("Empowered Control", "empCont")
  17.     Config:addSubMenu("Orbwalker", "SxOrb")
  18.     Config:addSubMenu("Harass Settings", "SettingHarass")
  19.     Config:addSubMenu("Drawing Settings", "drawing")
  20.    
  21.     Config:addParam("delete", "Combo Key", SCRIPT_PARAM_ONKEYDOWN, false, string.byte(" "))
  22.     Config:addParam("tripleQ", "triple Q Key(dont change!)", SCRIPT_PARAM_ONKEYDOWN, false, string.byte(" "))
  23.     Config:addParam("harass", "Harass key", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("C"))
  24.     Config:addParam("autoCombo", "Combo as soon as you leap", SCRIPT_PARAM_ONOFF, true)
  25.    
  26.     Config.drawing:addParam("drawCircles", "Draw Circle", SCRIPT_PARAM_ONOFF, true)
  27.     Config.drawing:addParam("drawE", "Draw E range", SCRIPT_PARAM_ONOFF, true)
  28.     Config.drawing:addParam("drawW", "Draw W range", SCRIPT_PARAM_ONOFF, true)
  29.    
  30.     Config.empCont:addParam("dontEmpE", "Dont use E at 5 stacks", SCRIPT_PARAM_ONOFF, false)
  31.     Config.empCont:addParam("autoheal", "Auto Heal if low", SCRIPT_PARAM_SLICE, 25,0,100,0)
  32.     Config.empCont:addParam("autoEmpQ", "Auto Use 5 stacks of fury on Q if in range",SCRIPT_PARAM_ONOFF, true)
  33.    
  34.     SxOrb:LoadToMenu(Config.SxOrb)
  35.    
  36.     Config.SettingHarass:addParam("UseE", "Use E in harass", SCRIPT_PARAM_ONOFF, true)
  37.     Config.SettingHarass:addParam("UseW", "Use W in harass", SCRIPT_PARAM_ONOFF, true)
  38.  
  39.     ts = TargetSelector(TARGET_LOW_HP_PRIORITY,950, true)
  40. end
  41.  
  42. function castE()
  43.     if ts.target ~= nil and Config.delete and CanCast(_E) and Visible == true and ValidTarget(target) then
  44.         local CastPosition,  HitChance,  Position = VP:GetLineCastPosition(ts.target, 0, 75, eRange, 2.25, myHero, true)
  45.         if HitChance >= 2 and GetDistance(ts.target) <= eRange then
  46.             if myHero.mana == 5 then
  47.                 if Config.empCont.dontEmpE then
  48.                     --Do nothing--
  49.                 else
  50.                     if GetDistance(target) > myHero.range + 250 and target.ms > myHero.ms - 50 then
  51.                         CastSpell(_E,CastPosition.x,CastPosition.z)
  52.                     end
  53.                 end
  54.             else
  55.                 CastSpell(_E, CastPosition.x,CastPosition.z)
  56.             end
  57.         end
  58.     end
  59. end
  60.  
  61. function AutoQ() -- OMFG IT'S TABBED CODE HOLY SHIT IT'S A FUQIN MIRACLE!!!
  62.     if Config.delete and ValidTarget(target) then
  63.         if myHero.mana == 5 and GetDistance(target) < (myHero.range+75) then
  64.         if CanCast(_Q) then CastSpell(_Q) myHero:Attack(target) end
  65.         end
  66.     end
  67. end
  68.  
  69. function AutoHeal()
  70. if myHero.health <= myHero.maxHealth/100*Config.empCont.autoheal and myHero.mana == 5 and CanCast(_W)then
  71. CastSpell(_W) end
  72. end
  73.  
  74. function calcRange()
  75. if myHero.range > 150 and myHero.range < 700 then leapRange = myHero.range+175 end
  76. if myHero.range >150 and myHero.range >= 700 then leapRange = myHero.range+75 end
  77. if myHero.range < 150 then leapRange = 125 end
  78. end
  79.  
  80. function Visibility()
  81. if leapRange > 150 then Visible = false else Visible = true end
  82. end
  83.  
  84. function CanCast(Spell)
  85. return (myHero:CanUseSpell(Spell) == READY)
  86. end
  87.  
  88. function isEmpowered()
  89. if target ~= nil and ValidTarget(target) then
  90. if myHero.mana == 5 then
  91.     if Config.empCont.AutoEmpQ and myHero.health > ((myHero.maxHealth/100)*25) and ValidTarget(target) then
  92.     local Dist = GetDistance(target)
  93.         if Dist <= myHero.range then
  94.             CastSpell(_Q)
  95.         else
  96.             if Visible == false then
  97.             CastSpell(_Q)
  98.             end
  99.         end
  100.     end
  101. end
  102. end
  103. end
  104.  
  105. function CastW()
  106. if Config.delete and ValidTarget(target) then
  107. if GetDistance(target) < 500 and myHero.mana < 5 and Visible == true then
  108. if CanCast(_W) then CastSpell(_W) end
  109. end
  110. end
  111. end
  112.  
  113. function Harass()
  114. if Config.harass and Visible == true and ValidTarget(target) then
  115. if Config.SettingHarass.UseW and GetDistance(target)<500 and CanCast(_W) and myHero.mana < 5 then
  116. CastSpell(_W)
  117. end
  118. if Config.SettingHarass.UseW and CanCast(_E) then
  119. local CastPosition,  HitChance,  Position = VP:GetLineCastPosition(ts.target, 0, 80, eRange, 2.25, myHero, true)
  120.         if HitChance >= 2 and GetDistance(ts.target) <= eRange and myHero.mana < 5 then
  121.             CastSpell(_E, CastPosition.x,CastPosition.z)
  122.         end
  123. end
  124. end
  125. end
  126.  
  127. function OnTick()
  128. ts:update()
  129. target = ts.target
  130. SxOrb:ForceTarget(target)
  131. castE()
  132. calcRange()
  133. Visibility()
  134. AutoHeal()
  135. isEmpowered()
  136. calcRange()
  137. AutoQ()
  138. CastW()
  139. Harass()
  140. autoCombo()
  141. tripleQ()
  142. instantWE()
  143. getItemSlot()
  144. fHydra()
  145. --getItemName()
  146. end
  147.  
  148. function OnDraw()
  149. if Config.drawing.drawE and CanCast(_E) then
  150. DrawCircle(myHero.x, myHero.y, myHero.z, eRange, 0xFFFF0000)
  151. end
  152. if Config.drawing.drawW and CanCast(_W) then
  153. DrawCircle(myHero.x, myHero.y, myHero.z, 500, 0xFFFF0000)
  154. end
  155. end
  156.  
  157. function autoCombo()
  158.     if Config.autoCombo and ValidTarget(target) and myHero.y > 90 then
  159.     if GetDistance(target) < 600 then
  160.         if CanCast(_Q) then CastSpell(_Q) end
  161.         if CanCast(_W) and fury < 5 then CastSpell(_W) end
  162.         if CanCast(_E) and fury < 5 then CastSpell(_E, target.x, target.z) end
  163.         if Hydra and CanCast(_Hydra) then CastSpell(_Hydra) end
  164.         if Ghostblade and CanCast(_Ghostblade) then CastSpell(_Ghostblade) end
  165.     end
  166. end
  167. end
  168.  
  169. function tripleQ()
  170.     if Config.tripleQ and ValidTarget(target) then
  171.     if GetDistance(target) < (myHero.range + 100) then
  172.         if CanCast(_Q) then CastSpell(_Q) myHero:Attack(target) end
  173.     end
  174. end
  175. end
  176.  
  177. function instantWE()
  178.     if Config.delete and ValidTarget(target) then
  179.         if CanCast(_W) and GetDistance(target) <= 500 then CastSpell(_W) end
  180.             if CanCast(_E) then
  181.                 if GetDistance(target) <= 500 then CastSpell(_E, target.x, target.z) else
  182.                     local CastPosition,  HitChance,  Position = VP:GetLineCastPosition(ts.target, 0, 75, eRange, 2.25, myHero, true)
  183.                     if HitChance >= 2 and GetDistance(ts.target) <= eRange then CastSpell(_E, CastPosition.x,CastPosition.z)
  184.                 end
  185.             end
  186.         end
  187.     end
  188. end
  189. local Tiamat -- tiamat and Hydra share the same name
  190. local Hydra
  191. local Ghostblade
  192.  
  193. function getItemSlot()
  194. for slot = ITEM_1, ITEM_7 do
  195. local currentItemName = myHero:GetSpellData(slot).name
  196.  
  197. if currentItemName == "ItemTiamatCleave" then
  198. Hydra = slot
  199. end
  200. if currentItemName  == "YoumusBlade" then
  201. Ghostblade = slot
  202. end
  203. end
  204. end
  205.  
  206. function fHydra()
  207. if ValidTarget(target) then
  208. if GetDistance(target) < 200 then
  209. if Hydra then
  210. if CanCast(Hydra) then CastSpell(Hydra)
  211. end
  212. end
  213. end
  214. end
  215. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement