16HeX16

Varus Helper 1.1

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