16HeX16

Varus Helper 1.0 - Toggle

Mar 30th, 2013
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.89 KB | None | 0 0
  1. --[[((Varus Helper by HeX 1.0))]]--
  2.  
  3. if myHero.charName ~= "Varus" then return end
  4.  
  5. --[[((Ranges))]]--
  6. local qRange = 0
  7. local eRange = 925
  8. local rRange = 1075
  9. --[[((Attacks))]]--
  10. local ProcReady = false
  11. --[[((Waits))]]--
  12. local nextTick = 0
  13. local waitDelay = 400
  14. local delayTime = 0
  15. --[[((Prediction))]]--
  16. local qp = TargetPrediction(850, 1.9, 100)
  17. local ep = TargetPrediction(925, 1.8, 150)
  18. local rp = TargetPrediction(1075, 2.0, 280)
  19. --[[((Q Stuff))]]--
  20. local buffer = 0
  21. local iPressedQ = false
  22. local qTick = 0
  23. --[[((Items))]]--
  24. local ignite = nil
  25. local QREADY, EREADY, RREADY = false, false, false
  26. local DFGREADY, BRKREADY, HXGREADY, BWCREADY, STDREADY = false, false, false, false, false
  27. local DFGSlot, BRKSlot, HXGSlot, BWCSlot, STDSlot = nil, nil, nil, nil, nil
  28.  
  29. function OnLoad()
  30.     PrintChat("<font color='#CCCCCC'> >> Varus Helper 1.0 loaded! <<</font>")
  31.     VHConfig = scriptConfig("Varus Helper", "VarusHelper")
  32.     VHConfig:addParam("scriptActive", "Auto Proc", SCRIPT_PARAM_ONKEYTOGGLE, true, 90)
  33.     VHConfig:addParam("useR", "Use Ultimate", SCRIPT_PARAM_ONKEYDOWN, false, 88)
  34.     VHConfig:addParam("eProc", "Auto E Proc", SCRIPT_PARAM_ONKEYTOGGLE, false, 67)
  35.     VHConfig:addParam("autoignite", "Ignite when Killable", SCRIPT_PARAM_ONOFF, true)
  36.     VHConfig:addParam("drawcirclesSelf", "Draw Circles - Self", SCRIPT_PARAM_ONOFF, false)
  37.     VHConfig:addParam("drawcirclesEnemy", "Draw Circles - Enemy", SCRIPT_PARAM_ONOFF, false)
  38.     VHConfig:addParam("waitDelay", "Delay before Q(ms)",SCRIPT_PARAM_SLICE, 250, 0, 2000, 2)
  39.     VHConfig:permaShow("scriptActive")
  40.     VHConfig:permaShow("useR")
  41.     VHConfig:permaShow("eProc")
  42.    
  43.     ts = TargetSelector(TARGET_LOW_HP, 1600, DAMAGE_MAGIC)
  44.     ts.name = "Varus"
  45.     VHConfig:addTS(ts)
  46.    
  47.     ProcReady = false
  48.     lastQ = os.clock()
  49.     qTick = 0
  50.    
  51.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
  52.         elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2
  53.     end
  54. end
  55.  
  56. function OnTick()
  57.     ts:update()
  58.     qRange = 925 + (0.3375*VHConfig.waitDelay)
  59.     --[[((Prediction))]]--
  60.     if ts.target ~= nil then
  61.         qPred = qp:GetPrediction(ts.target)
  62.         ePred = ep:GetPrediction(ts.target)
  63.         rPred = rp:GetPrediction(ts.target)
  64.     end
  65.    
  66.     --[[((Ready))]]--
  67.     DFGSlot, BRKSlot, HXGSlot, BWCSlot, STDSlot = GetInventorySlotItem(3153), GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3131)
  68.     DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  69.     BRKREADY = (BRKSlot ~= nil and myHero:CanUseSpell(BRKSlot) == READY)
  70.     HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
  71.     BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
  72.     STDREADY = (STDSlot ~= nil and myHero:CanUseSpell(STDSlot) == READY)
  73.     IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  74.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  75.     EREADY = (myHero:CanUseSpell(_E) == READY)
  76.     RREADY = (myHero:CanUseSpell(_R) == READY)
  77.    
  78.     --[[((Auto Ignite))]]--
  79.     if VHConfig.autoignite then    
  80.         if IREADY then
  81.             local ignitedmg = 0    
  82.             for i = 1, heroManager.iCount, 1 do
  83.                 local enemyhero = heroManager:getHero(i)
  84.                 if ValidTarget(enemyhero,600) then
  85.                     ignitedmg = 50 + 20 * myHero.level
  86.                     if enemyhero.health <= ignitedmg then
  87.                         CastSpell(ignite, enemyhero)
  88.                     end
  89.                 end
  90.             end
  91.         end
  92.     end
  93.    
  94.     --[[((EProc))]]--
  95.     if ts.target ~= nil and VHConfig.eProc and not VHConfig.scriptActive then
  96.         if ePred ~= nil then
  97.             if EREADY and GetDistance(ePred) < eRange and ProcReady == true then
  98.                 CastSpell(_E, ePred.x, ePred.z)
  99.             end
  100.         end
  101.     end
  102.    
  103.     --[[((Ultimate))]]--
  104.     if rPred ~= nil then
  105.         if RREADY and GetDistance(rPred) < rRange and VHConfig.useR then
  106.             CastSpell(_R, rPred.x, rPred.z)
  107.         end
  108.     end
  109.    
  110.     --[[((Auto Proc))]]--
  111.     if ts.target ~= nil and VHConfig.scriptActive then
  112.         --[[((Items))]]--
  113.         if GetDistance(ts.target) < 600 then
  114.             if DFGREADY then CastSpell(DFGSlot, ts.target) end
  115.             if BRKREADY then CastSpell(BRKSlot, ts.target) end
  116.             if HXGREADY then CastSpell(HXGSlot, ts.target) end
  117.             if BWCREADY then CastSpell(BWCSlot, ts.target) end
  118.             if STDREADY then CastSpell(STDSlot) end
  119.         end
  120.         --[[((Abilities))]]--
  121.         if qPred ~= nil then
  122.             if QREADY and ProcReady == true and GetDistance(qPred) < qRange then
  123.                 targetX, targetZ = qPred.x, qPred.z
  124.                 CastSpellQ()
  125.             end
  126.         end
  127.         if ePred ~= nil then
  128.             if EREADY and GetDistance(ePred) < eRange and ProcReady == true and not QREADY and GetTickCount() > qTick + (VHConfig.waitDelay+500) then
  129.                 CastSpell(_E, ePred.x, ePred.z)
  130.             end
  131.         end
  132.         if ts.target ~= nil and ProcReady == true and GetTickCount() < qTick + (VHConfig.waitDelay+500) then
  133.             myHero:Attack(ts.target)
  134.         end
  135.     end
  136. end
  137.  
  138. function OnDraw()  
  139.     if VHConfig.drawcirclesSelf and not myHero.dead then
  140.         DrawCircle(myHero.x, myHero.y, myHero.z, qRange, 0x00FF00)
  141.     end
  142.     if VHConfig.drawcirclesEnemy and ts.target ~= nil then
  143.         for j=0, 10 do
  144.             DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00)
  145.         end
  146.     end
  147. end
  148.  
  149. --[[((Functions))]]--
  150. function OnCreateObj(object)
  151.     if object ~= nil and object.name == "VarusW_counter_03.troy" and GetDistance(object, ts.target) <= 125 then
  152.         ProcReady = true
  153.     end
  154.     if object.name == "VarusQChannel.troy" then iPressedQ = true end
  155. end
  156.  
  157.  
  158. function OnDeleteObj(object)
  159.     if object ~= nil and object.name == "VarusW_counter_03.troy" then
  160.         ProcReady = false
  161.     end
  162.     if object.name == "VarusQChannel.troy" then iPressedQ = false end
  163. end
  164.  
  165. --[[((Work Around))]]--
  166. function CastSpellQ()
  167.     if myHero:CanUseSpell(_Q) == READY and GetTickCount() > qTick + VHConfig.waitDelay then
  168.         if not iPressedQ and ProcReady == true then
  169.             CastSpell(_Q, targetX, targetZ)
  170.             CastSpell(10)
  171.             qTick = GetTickCount()
  172.         end
  173.         if iPressedQ and ProcReady == true and GetTickCount() > qTick + VHConfig.waitDelay then
  174.             CastSpell(_Q, targetX, targetZ)
  175.             qTick = GetTickCount()
  176.         end
  177.     end
  178. end
Advertisement
Add Comment
Please, Sign In to add comment