ak77now

SidasAutoCarryPlugin - Nidalee.lua

May 7th, 2014
1,670
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.69 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5. --[[    Variables   ]]--
  6. --[[    Ranges  ]]--
  7. local qRange = 1500
  8. local qWidth = 90 -- Increase if Q is hitting creep with collision ON.
  9. local wRange = 700
  10. local wWidth = 120
  11. local eRange = 1200
  12. local eWidth = 120
  13. local rRange = 375
  14.  
  15.  
  16. --[ [Q Prediction   ]]--
  17.  
  18. local qp = TargetPrediction(qRange, 1.3, 124)
  19. local wp = TargetPrediction(wRange, 1.72, 260)
  20. local ep = TargetPrediction(eRange, 1.469, 265)
  21.  
  22.  
  23. --[[    Ready   ]]--
  24. local ignite = nil
  25. local BRKSlot, DFGSlot, HXGSlot, BWCSlot, TMTSlot, RAHSlot, RNDSlot, YGBSlot = nil, nil, nil, nil, nil, nil, nil, nil
  26. local QREADY, WREADY, EREADY, RREADY, IREADY = false, false, false, false, false
  27.  
  28.  
  29. function PluginOnLoad()
  30. --ignite-- 
  31.     PrintChat("<font color='#CCCCCC'> >> Auto Ignite 1.1 loaded! <<</font>")
  32.     AIConfig = scriptConfig("Ignite Config     \xC2\x49\xBF\x55 ", "AutoIgnite")
  33.     AIConfig:addParam("useIgnite", "Ignite when killable", SCRIPT_PARAM_ONKEYTOGGLE, true, 73)
  34.     AIConfig:addParam("doubleI", "Dont Double Ignite", SCRIPT_PARAM_ONOFF, true)
  35.     AIConfig:permaShow("useIgnite")
  36.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then iSlot = SUMMONER_1
  37.         elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then iSlot = SUMMONER_2
  38.             else iSlot = nil
  39.     end
  40. --ignite-- 
  41.  
  42. --- POKE ---   
  43.     allyMinions = minionManager(MINION_ALLY, 1200, player, MINION_SORT_HEALTH_ASC)
  44.     mainMenu()
  45. end
  46.  
  47.  
  48. --[[    Base Functions  ]]--
  49. function mainMenu()
  50.     PrintChat("<font color='#CCCCCC'> >> SAC plugin loaded! <<</font>")
  51.     Menu = scriptConfig("SAC Plugin Menu", "LeeSincombo")
  52.     Menu:addParam("on", "Auto Combo", SCRIPT_PARAM_ONOFF, true)
  53.     Menu:permaShow("on")   
  54.        
  55.     ts = TargetSelector(TARGET_LOW_HP,1250,DAMAGE_PHYSICAL)
  56.     ts.name = "Target"
  57.     Menu:addTS(ts)
  58.    
  59.     enemyMinions = minionManager(MINION_ENEMY, 1200, player)
  60.     allyMinions = minionManager(MINION_ALLY, 1000, player)
  61.  
  62. end
  63.  
  64. --[[======================================Tick/Combo======================================]]--
  65. function PluginOnTick()
  66. --升級大絕--
  67. DodajUlti()
  68.  
  69.  
  70.     --- POKE ---
  71.     allyMinions:update()
  72.  
  73. --ignite--
  74.     if AIConfig.useIgnite then
  75.         local iDmg = 0     
  76.         if iSlot ~= nil and myHero:CanUseSpell(iSlot) == READY then
  77.             for i = 1, heroManager.iCount, 1 do
  78.                 local target = heroManager:getHero(i)
  79.                 if ValidTarget(target) then
  80.                     iDmg = 50 + 20 * myHero.level
  81.                     if target ~= nil and target.team ~= myHero.team and not target.dead and target.visible and GetDistance(target) < 600 and target.health < iDmg then
  82.                         if AIConfig.doubleI and not TargetHaveBuff("SummonerDot", target) then
  83.                             CastSpell(iSlot, target)
  84.                             elseif not AIConfig.doubleI then
  85.                                 CastSpell(iSlot, target)
  86.                         end
  87.                     end
  88.                 end
  89.             end
  90.         end
  91.     end
  92. --ignite--
  93.     ts:update()
  94.     allyMinions:update()
  95.     enemyMinions:update()
  96.     Checks()
  97.     if Menu.on and ts.target ~= nil then
  98.         --UseItems(ts.target)
  99.         AutoCombo(ts.target)
  100.     end
  101. end
  102.  
  103. --[[    Basic Combo ]]--
  104. function AutoCombo(target)
  105.  
  106.  
  107.  
  108. --- POKE ---       
  109.     for _, minion in pairs(allyMinions.objects) do
  110.         if  getDmg("AD", minion, myHero) > minion.health  then
  111.  
  112.     if myHero:GetSpellData(_Q).name == "JavelinToss" or myHero:GetSpellData(_W).name == "Bushwhack" or myHero:GetSpellData(_E).name == "PrimalSurge" then
  113.     if qpredic ~= nil and QREADY and GetDistance(qpredic) <= 1500 and GetDistance(qpredic) > 600 then
  114.         if not qminionCollision(qpredic, qWidth, qRange) then
  115.             CastSpell(_Q, qpredic.x, qpredic.z)
  116.         end
  117.     end
  118.     end
  119.             return
  120.         end
  121.     end
  122.  
  123.  
  124.  
  125. --[[ 會被小兵擋到技能的話 ]]--
  126.     if (AutoCarry.MainMenu.AutoCarry or AutoCarry.MainMenu.MixedMode) then
  127.     if myHero:GetSpellData(_Q).name == "JavelinToss" or myHero:GetSpellData(_W).name == "Bushwhack" or myHero:GetSpellData(_E).name == "PrimalSurge" then
  128.     if qpredic ~= nil and QREADY and GetDistance(qpredic) <= 1500 and GetDistance(qpredic) > 600 then
  129.         if not qminionCollision(qpredic, qWidth, qRange) then
  130.             CastSpell(_Q, qpredic.x, qpredic.z)
  131.         end
  132.     end
  133.     end
  134.     end
  135.    
  136.     --
  137.     if (AutoCarry.MainMenu.AutoCarry or AutoCarry.MainMenu.MixedMode) then
  138.     if myHero:GetSpellData(_Q).name == "JavelinToss" or myHero:GetSpellData(_W).name == "Bushwhack" or myHero:GetSpellData(_E).name == "PrimalSurge" then
  139.     if qpredic ~= nil and QREADY and GetDistance(qpredic) <= 1500 then
  140.     if myHero.mana > 240 then
  141.         if not qminionCollision(qpredic, qWidth, qRange) then
  142.             CastSpell(_Q, qpredic.x, qpredic.z)
  143.         end
  144.     end
  145.     end
  146.     end
  147.     end
  148.     --
  149.    
  150.     if myHero:GetSpellData(_Q).name == "JavelinToss" or myHero:GetSpellData(_W).name == "Bushwhack" or myHero:GetSpellData(_E).name == "PrimalSurge" then
  151.     if GetDistance(ts.target) < 400 then
  152.     CastSpell(_E)
  153.     CastSpell(_R)
  154.     end
  155.     end
  156.    
  157.     if myHero:GetSpellData(_Q).name == "Takedown" or myHero:GetSpellData(_W).name == "Pounce" or myHero:GetSpellData(_E).name == "Swipe" then
  158.     if GetDistance(ts.target) < 400 then
  159.                CastSpell(_E)
  160.                CastSpell(_Q)
  161.     end
  162.     end
  163.    
  164.     --[[
  165.     if myHero:GetSpellData(_Q).name == "Takedown" or myHero:GetSpellData(_W).name == "Pounce" or myHero:GetSpellData(_E).name == "Swipe" then
  166.     if GetDistance(ts.target) > 500 and GetDistance(ts.target) < 800 then
  167.                CastSpell(_R)
  168.                
  169.     end
  170.     end
  171.     ]]--
  172.  
  173.  
  174. end
  175.  
  176.  
  177. function PluginOnDraw()
  178.     --> Ranges
  179.  
  180.    
  181.     if myHero:GetSpellData(_Q).name == "JavelinToss" then
  182.     if myHero:CanUseSpell(_Q) == READY then
  183.     DrawCircle(myHero.x, myHero.y, myHero.z, 1500, 0x007AFA)
  184.     DrawCircle(myHero.x, myHero.y, myHero.z, 400, 0x992D3D)
  185.     end
  186.     end
  187.    
  188.    
  189.     if myHero:GetSpellData(_Q).name == "JavelinToss" then
  190.     if myHero:CanUseSpell(_Q) ~= READY then
  191.     DrawCircle(myHero.x, myHero.y, myHero.z, 1500, 0x992D3D)
  192.     DrawCircle(myHero.x, myHero.y, myHero.z, 400, 0x992D3D)
  193.     end
  194.     end
  195.    
  196.     if myHero:GetSpellData(_Q).name == "Takedown" then
  197.     DrawCircle(myHero.x, myHero.y, myHero.z, 1500, 0x992D3D)
  198.     DrawCircle(myHero.x, myHero.y, myHero.z, 400, 0x992D3D)
  199.     end
  200. end
  201.  
  202.  
  203. --[[    Ready and Items ]]--
  204. function Checks()
  205.     BRKSlot, DFGSlot, HXGSlot, BWCSlot, TMTSlot, RAHSlot, RNDSlot, YGBSlot = GetInventorySlotItem(3153), GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3077), GetInventorySlotItem(3074),  GetInventorySlotItem(3143), GetInventorySlotItem(3142)
  206.     QREADY = (myHero:CanUseSpell(_Q) == READY)
  207.     WREADY = (myHero:CanUseSpell(_W) == READY)
  208.     EREADY = (myHero:CanUseSpell(_E) == READY)
  209.     RREADY = (myHero:CanUseSpell(_R) == READY)
  210.     DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
  211.     HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
  212.     BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
  213.     BRKREADY = (BRKSlot ~= nil and myHero:CanUseSpell(BRKSlot) == READY)
  214.     TMTREADY = (TMTSlot ~= nil and myHero:CanUseSpell(TMTSlot) == READY)
  215.     RAHREADY = (RAHSlot ~= nil and myHero:CanUseSpell(RAHSlot) == READY)
  216.     RNDREADY = (RNDSlot ~= nil and myHero:CanUseSpell(RNDSlot) == READY)
  217.     YGBREADY = (YGBSlot ~= nil and myHero:CanUseSpell(YGBSlot) == READY)
  218.     IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  219.  
  220.     if ts.target ~= nil then
  221.         qpredic = qp:GetPrediction(ts.target)
  222.         wpredic = wp:GetPrediction(ts.target)
  223.         epredic = ep:GetPrediction(ts.target)
  224.     end
  225. end
  226.    
  227. function UseItems(target)
  228.     if GetDistance(target) < 550 then
  229.         if DFGREADY then CastSpell(DFGSlot, target) end
  230.         if HXGREADY then CastSpell(HXGSlot, target) end
  231.         if BWCREADY then CastSpell(BWCSlot, target) end
  232.         if BRKREADY then CastSpell(BRKSlot, target) end
  233.         if YGBREADY then CastSpell(YGBSlot, target) end
  234.         if TMTREADY and GetDistance(target) < 275 then CastSpell(TMTSlot) end
  235.         if RAHREADY and GetDistance(target) < 275 then CastSpell(RAHSlot) end
  236.         if RNDREADY and GetDistance(target) < 275 then CastSpell(RNDSlot) end
  237.     end
  238. end
  239.  
  240.  
  241.  
  242.  
  243. function qminionCollision(qpredic, width, range)
  244.     for _, minionObjectE in pairs(enemyMinions.objects) do
  245.         if qpredic ~= nil and player:GetDistance(minionObjectE) < range then
  246.             ex = player.x
  247.             ez = player.z
  248.             tx = qpredic.x
  249.             tz = qpredic.z
  250.             dx = ex - tx
  251.             dz = ez - tz
  252.             if dx ~= 0 then
  253.                 m = dz/dx
  254.                 c = ez - m*ex
  255.             end
  256.             mx = minionObjectE.x
  257.             mz = minionObjectE.z
  258.             distanc = (math.abs(mz - m*mx - c))/(math.sqrt(m*m+1))
  259.             if distanc < width and math.sqrt((tx - ex)*(tx - ex) + (tz - ez)*(tz - ez)) > math.sqrt((tx - mx)*(tx - mx) + (tz - mz)*(tz - mz)) then
  260.                 return true
  261.             end
  262.         end
  263.     end
  264. return false
  265. end
  266.  
  267. function wminionCollision(wpredic, width, range)
  268.     for _, minionObjectE in pairs(enemyMinions.objects) do
  269.         if wpredic ~= nil and player:GetDistance(minionObjectE) < range then
  270.             ex = player.x
  271.             ez = player.z
  272.             tx = wpredic.x
  273.             tz = wpredic.z
  274.             dx = ex - tx
  275.             dz = ez - tz
  276.             if dx ~= 0 then
  277.                 m = dz/dx
  278.                 c = ez - m*ex
  279.             end
  280.             mx = minionObjectE.x
  281.             mz = minionObjectE.z
  282.             distanc = (math.abs(mz - m*mx - c))/(math.sqrt(m*m+1))
  283.             if distanc < width and math.sqrt((tx - ex)*(tx - ex) + (tz - ez)*(tz - ez)) > math.sqrt((tx - mx)*(tx - mx) + (tz - mz)*(tz - mz)) then
  284.                 return true
  285.             end
  286.         end
  287.     end
  288. return false
  289. end
  290.  
  291. function eminionCollision(epredic, width, range)
  292.     for _, minionObjectE in pairs(enemyMinions.objects) do
  293.         if epredic ~= nil and player:GetDistance(minionObjectE) < range then
  294.             ex = player.x
  295.             ez = player.z
  296.             tx = epredic.x
  297.             tz = epredic.z
  298.             dx = ex - tx
  299.             dz = ez - tz
  300.             if dx ~= 0 then
  301.                 m = dz/dx
  302.                 c = ez - m*ex
  303.             end
  304.             mx = minionObjectE.x
  305.             mz = minionObjectE.z
  306.             distanc = (math.abs(mz - m*mx - c))/(math.sqrt(m*m+1))
  307.             if distanc < width and math.sqrt((tx - ex)*(tx - ex) + (tz - ez)*(tz - ez)) > math.sqrt((tx - mx)*(tx - mx) + (tz - mz)*(tz - mz)) then
  308.                 return true
  309.             end
  310.         end
  311.     end
  312. return false
  313. end
  314.  
  315. --升級大招--
  316. function DodajUlti()
  317.  
  318.  
  319.     if myHero.level == 6 or myHero.level == 11 or myHero.level == 16 then
  320.       LevelSpell(_R)
  321.     end
  322.  
  323. end
Advertisement
Add Comment
Please, Sign In to add comment