roach_

[2.0a] SidasAutoCarryPlugin - Pantheon

Nov 29th, 2013
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2.  
  3.         Auto Carry Plugin - Pantheon Edition
  4.         Author: Roach_
  5.         Version: 2.0a
  6.         Copyright 2013
  7.  
  8.         Dependency: Sida's Auto Carry: Revamped
  9.  
  10.         How to install:
  11.             Make sure you already have AutoCarry installed.
  12.             Name the script EXACTLY "SidasAutoCarryPlugin - Pantheon.lua" without the quotes.
  13.             Place the plugin in BoL/Scripts/Common folder.
  14.  
  15.         Features:
  16.             Combo with Autocarry
  17.             Fully supports E with movement/attack disable
  18.             Harass with Mixed Mode
  19.             Killsteal with Q/W or W+Q
  20.             Draw Combo Range
  21.             Draw Critical Hit on Target
  22.             Escape Artist(with Flash)
  23.  
  24.         History:
  25.             Version: 2.0a
  26.                 Added a Toggle for for Core Combo
  27.                 Added an Extra Menu
  28.                 Added Customizable Chase Combo
  29.                 Added Farm with Q
  30.                 Added Lane Clear with E
  31.                 Added Auto Pots/Items
  32.                 Added Minimum Mana to Harass/Farm - Check
  33.                 Modified Menu - More customizable
  34.                 Modified KS only with Q
  35.                 Modified Harass - Working with Mixed Mode
  36.                 Optimised Chase Combo
  37.                 Rewrited some Functions
  38.                 -- Fully Optimised the Script
  39.                
  40.             Version: 1.1c
  41.                 Added Chase Combo
  42.                 Fixed a bug where E was not casting
  43.                 Changed Plugin Menu
  44.                 Added a Mini-Menu
  45.                 Fixed "Draw Crit Text"
  46.        
  47.             Version: 1.1b
  48.                 Auto combo after Ultimate. (With a check!)
  49.                 Toggle for Auto Q Harass when in enemy range , with a mana check. (You will harass them until you'll have Mana for one last Combo)
  50.        
  51.             Version: 1.1a
  52.                 Optimised Escape Artist
  53.                 Optimised Killsteal(You can KS with Q+W)
  54.                 Fixed Ultimate Bugsplat(TESTED)
  55.                 Fixed Mixed Mode Harass
  56.                 Re-wrote majority of the Functions
  57.                 Hopefully fixed DCT(Draw Critical Text)
  58.                 Changed Circle's Color(Range Circle)
  59.                 Speeded-Up the Script(Some FPS Drops on Escape Artist and Ultimate)
  60.                
  61.             Version: 1.0d
  62.                 Fixed Escape Artist
  63.                 Fixed a problem with Flash, it was flashing before Stunning the enemy
  64.                 Optimised Escape Artist
  65.                 Fully removed Auto-Ignite
  66.                 Fixed all the Bugsplats (TESTED)
  67.                 Hopefully fixed Mixed Mode Harass
  68.                
  69.             Version: 1.0c
  70.                 Real fix for E.
  71.                 Fixed Killsteal.
  72.                 Hopefully fixed OnTick bugsplat.
  73.                 Removed Auto-Ignite, because it exists in SAC too.
  74.            
  75.             Version: 1.0b
  76.                 Temporarily fix for E.
  77.                 Fixed some bugsplats on draw.
  78.            
  79.             Version: 1.0a
  80.                 First release
  81. --]]
  82. if myHero.charName ~= "Pantheon" then return end
  83.  
  84. local Target
  85. local pEscapeHotkey = string.byte("T")
  86. local pChaseComboHotkey = string.byte("N")
  87.  
  88. -- Prediction
  89. local qwRange, eRange = 600, 300
  90.  
  91. local FlashSlot = nil
  92.  
  93. local SkillQ = {spellKey = _Q, range = cRange, speed = 2, delay = 0, width = 200, configName = "spearShot", displayName = "Q (Spear Shot)", enabled = true, skillShot = false, minions = false, reset = false, reqTarget = true }
  94. local SkillW = {spellKey = _W, range = cRange, speed = 2, delay = 0, width = 200, configName = "AoZ", displayName = "W (Aegis of Zeonia)", enabled = true, skillShot = false, minions = false, reset = false, reqTarget = true }
  95. local SkillE = {spellKey = _E, range = eRange, speed = 2, delay = 0, width = 200, configName = "heartseekerStrike", displayName = "E (Heartseeker Strike)", enabled = true, skillShot = true, minions = false, reset = false, reqTarget = true }
  96.  
  97. local QReady, WReady, EReady, RReady, FlashReady = false, false, false, false, false
  98.  
  99. -- Regeneration
  100. local UsingHPot, UsingMPot, UsingFlask = false, false, false
  101.  
  102. -- Our lovely script
  103. function PluginOnLoadMenu()
  104.         Menu = AutoCarry.PluginMenu
  105.         Menu2 = AutoCarry.MainMenu
  106.         Menu:addParam("pPlugin", "[Cast Options]", SCRIPT_PARAM_INFO, "")
  107.         Menu:addParam("pCombo", "[Combo Options]", SCRIPT_PARAM_INFO, "")
  108.         Menu:addParam("pAutoQ", "Auto Cast Q", SCRIPT_PARAM_ONOFF, true)
  109.         Menu:addParam("pAutoW", "Auto Cast W", SCRIPT_PARAM_ONOFF, true)
  110.         Menu:addParam("pAutoE", "Auto Cast E", SCRIPT_PARAM_ONOFF, true)
  111.         Menu:permaShow("pPlugin")
  112.        
  113.         Menu:addParam("pGap", "", SCRIPT_PARAM_INFO, "")
  114.        
  115.         Menu:addParam("pChase", "[Chase Combo Options]", SCRIPT_PARAM_INFO, "")
  116.         Menu:addParam("pChaseCombo", "Use Chase Combo", SCRIPT_PARAM_ONKEYDOWN, false, pChaseComboHotkey)
  117.         Menu:addParam("pAutoCW", "Auto Cast W - Chase", SCRIPT_PARAM_ONOFF, true)
  118.         Menu:addParam("pAutoCE", "Auto Cast E - Chase", SCRIPT_PARAM_ONOFF, true)
  119.         Menu:addParam("pAutoCQ", "Auto Cast Q - Chase", SCRIPT_PARAM_ONOFF, true)
  120.         Menu:permaShow("pChase")
  121.         Menu:permaShow("pChaseCombo")
  122.        
  123.         Menu:addParam("pGap", "", SCRIPT_PARAM_INFO, "")
  124.        
  125.         Menu:addParam("pKS", "[Kill Steal Options]", SCRIPT_PARAM_INFO, "")
  126.         Menu:addParam("pKillsteal", "Auto Kill Steal with Q", SCRIPT_PARAM_ONOFF, true)
  127.         Menu:permaShow("pKS")
  128.         Menu:permaShow("pKillsteal")
  129.        
  130.         Menu:addParam("pGap", "", SCRIPT_PARAM_INFO, "")
  131.        
  132.         Menu:addParam("pMisc", "[Misc Options]", SCRIPT_PARAM_INFO, "")
  133.         Menu:addParam("pAutoLVL", "Auto Level Spells", SCRIPT_PARAM_ONOFF, false)
  134.         Menu:addParam("pMinMana", "Minimum Mana to Farm/Harass", SCRIPT_PARAM_SLICE, 0.4, 0.1, 0.9, 1)
  135.         Menu:addParam("pEscape", "Escape Artist", SCRIPT_PARAM_ONKEYDOWN, false, pEscapeHotkey)
  136.         Menu:addParam("pEscapeFlash", "Escape: Flash to Mouse", SCRIPT_PARAM_ONOFF, false)
  137.         Menu:permaShow("pMisc")
  138.         Menu:permaShow("pEscape")
  139.        
  140.         Menu:addParam("pGap", "", SCRIPT_PARAM_INFO, "")
  141.        
  142.         Menu:addParam("pH", "[Harass Options]", SCRIPT_PARAM_INFO, "")
  143.         Menu:addParam("pHarass", "Auto Harass with Q", SCRIPT_PARAM_ONOFF, true)
  144.        
  145.         Menu:addParam("pGap", "", SCRIPT_PARAM_INFO, "")
  146.        
  147.         Menu:addParam("pFarm", "[Farm Options]", SCRIPT_PARAM_INFO, "")
  148.         Menu:addParam("pFarmQ", "Auto Farm with Q", SCRIPT_PARAM_ONOFF, false)
  149.         Menu:addParam("pFarmE", "Auto Clear Lane with E", SCRIPT_PARAM_ONOFF, false)
  150.        
  151.         Extras = scriptConfig("Sida's Auto Carry Plugin: "..myHero.charName..": Extras", myHero.charName)
  152.         Extras:addParam("pDraw", "[Draw Options]", SCRIPT_PARAM_INFO, "")
  153.         Extras:addParam("pDCR", "Draw Combo Range", SCRIPT_PARAM_ONOFF, true)
  154.         Extras:addParam("pDCT", "Draw Crit Text", SCRIPT_PARAM_ONOFF, true)
  155.        
  156.         Extras:addParam("pGap", "", SCRIPT_PARAM_INFO, "")
  157.        
  158.         Extras:addParam("pHPMana", "[Auto Pots/Items Options]", SCRIPT_PARAM_INFO, "")
  159.         Extras:addParam("pWItem", "Auto Wooglets", SCRIPT_PARAM_ONOFF, true)
  160.         Extras:addParam("pWHealth", "Min Health % for Wooglets", SCRIPT_PARAM_SLICE, 15, 0, 100, -1)
  161.         Extras:addParam("pHP", "Auto Health Pots", SCRIPT_PARAM_ONOFF, true)
  162.         Extras:addParam("pMP", "Auto Auto Mana Pots", SCRIPT_PARAM_ONOFF, true)
  163.         Extras:addParam("pHPHealth", "Min % for Health Pots", SCRIPT_PARAM_SLICE, 50, 0, 100, -1)
  164. end
  165.  
  166. function PluginOnLoad()
  167.     -- Params/PluginMenu
  168.     PluginOnLoadMenu()
  169.    
  170.     -- Range
  171.     AutoCarry.SkillsCrosshair.range = qwRange
  172.    
  173.     lastAnimation = nil
  174. end
  175.  
  176.  
  177. function PluginOnTick()
  178.     -- Get Attack Target
  179.     Target = AutoCarry.GetAttackTarget()
  180.  
  181.     -- Check Spells
  182.     pSpellCheck()
  183.  
  184.     -- Check if myHero is using _E
  185.     if isChanneling("Spell3") then
  186.         AutoCarry.CanAttack = false
  187.         AutoCarry.CanMove = false
  188.     else
  189.         AutoCarry.CanAttack = true
  190.         AutoCarry.CanMove = true
  191.     end
  192.  
  193.     -- Combo, Harass, Killsteal, Escape Combo, Farm - Checks
  194.     pCombo()
  195.     pChaseCombo()
  196.     pHarass()
  197.     pKillsteal()
  198.     pEscapeCombo()
  199.     pFarm()
  200.    
  201.     -- Draw Critical Text
  202.     pDrawCritText()
  203.    
  204.     -- Auto Regeneration
  205.     if Extras.WItem and IsMyHealthLow() and Target and WGTReady then CastSpell(wgtSlot) end
  206.     if Extras.pHP and NeedHP() and not (UsingHPot or UsingFlask) and (HPReady or FSKReady) then CastSpell((hpSlot or fskSlot)) end
  207.     if Extras.pMP and IsMyManaLow() and not (UsingMPot or UsingFlask) and(MPReady or FSKReady) then CastSpell((mpSlot or fskSlot)) end
  208. end
  209.  
  210. function PluginOnDraw()
  211.     -- Draw Panth's Range = 600
  212.     if not myHero.dead and Extras.pDCR then
  213.         DrawCircle(myHero.x, myHero.y, myHero.z, qwRange, 0x00FF00)
  214.     end
  215. end
  216.  
  217. -- Animation Detection
  218. function PluginOnAnimation(unit, animationName)
  219.     -- Set lastAnimation = Last Animation used
  220.     if unit.isMe and lastAnimation ~= animationName then lastAnimation = animationName end
  221. end
  222.  
  223. -- Object Detection
  224. function PluginOnCreateObj(obj)
  225.     if obj.name:find("TeleportHome.troy") then
  226.         if GetDistance(obj, myHero) <= 70 then
  227.             Recall = true
  228.         end
  229.     end
  230.     if obj.name:find("Regenerationpotion_itm.troy") then
  231.         if GetDistance(obj, myHero) <= 70 then
  232.             UsingHPot = true
  233.         end
  234.     end
  235.     if obj.name:find("Global_Item_HealthPotion.troy") then
  236.         if GetDistance(obj, myHero) <= 70 then
  237.             UsingHPot = true
  238.             UsingFlask = true
  239.         end
  240.     end
  241.     if obj.name:find("Global_Item_ManaPotion.troy") then
  242.         if GetDistance(obj, myHero) <= 70 then
  243.             UsingFlask = true
  244.             UsingMPot = true
  245.         end
  246.     end
  247. end
  248.  
  249. -- Custom Functions
  250. function pCombo()
  251.     if Menu.pCombo and Menu2.AutoCarry then
  252.         if ValidTarget(Target) then
  253.             if QReady and Menu.pAutoQ and GetDistance(Target) < qwRange then
  254.                 CastSpell(SkillQ.spellKey, Target)
  255.             end
  256.            
  257.             if WReady and Menu.pAutoW and GetDistance(Target) < qwRange then
  258.                 CastSpell(SkillW.spellKey, Target)
  259.             end
  260.            
  261.             if EReady and Menu.pAutoE and GetDistance(Target) < eRange then
  262.                 AutoCarry.CastSkillshot(SkillE, Target)
  263.             end
  264.         end
  265.     end
  266. end
  267.  
  268. function pHarass()
  269.     if Menu.pHarass and Menu2.MixedMode then
  270.         if ValidTarget(Target) then
  271.             if QReady and GetDistance(Target) < qwRange and (myHero.mana / myHero.maxMana) > Menu.pMinMana then
  272.                 CastSpell(SkillQ.spellKey, Target)
  273.                 myHero:Attack(Target)
  274.             end
  275.         end
  276.     end
  277. end
  278.  
  279. function pFarm()
  280.     if Menu.pFarmQ and (Menu2.LastHit) and (myHero.mana / myHero.maxMana) > Menu.pMinMana then
  281.         for _, minion in pairs(AutoCarry.EnemyMinions().objects) do
  282.             if ValidTarget(minion) and QReady and GetDistance(minion) <= qwRange then
  283.                 if minion.health < getDmg("Q", minion, myHero) then
  284.                     CastSpell(_Q, minion)
  285.                 end
  286.             end
  287.         end
  288.     end
  289.     if Menu.pFarmE and (Menu2.LaneClear) and (myHero.mana / myHero.maxMana) > Menu.pMinMana then
  290.         for _, minion in pairs(AutoCarry.EnemyMinions().objects) do
  291.             if ValidTarget(minion) and EReady and GetDistance(minion) <= eRange then
  292.                 if minion.health < getDmg("E", minion, myHero) then
  293.                     CastSpell(_E, minion)
  294.                 end
  295.             end
  296.         end
  297.     end
  298. end
  299.  
  300. function pChaseCombo()
  301.     if Menu.pChaseCombo then
  302.         if ValidTarget(Target) then
  303.             if WReady and Menu.pAutoCW  and GetDistance(Target) < qwRange then
  304.                 CastSpell(SkillW.spellKey, Target)
  305.             end
  306.            
  307.             if EReady and Menu.pAutoCE and GetDistance(Target) < eRange then
  308.                 AutoCarry.CastSkillshot(SkillE, Target)
  309.             end
  310.            
  311.             if QReady and Menu.pAutoCQ and GetDistance(Target) < qwRange and isChanneling("Spell3") then
  312.                 CastSpell(SkillQ.spellKey, Target)
  313.             end
  314.         end
  315.         if not isChanneling("Spell3") then
  316.             myHero:MoveTo(mousePos.x, mousePos.z)
  317.         end
  318.        
  319.     end
  320. end
  321.  
  322. function pKillsteal()
  323.     if Menu.pKillsteal then
  324.         for _, enemy in pairs(AutoCarry.EnemyTable) do
  325.             if QReady then
  326.                 if ValidTarget(enemy) and GetDistance(enemy) < qwRange and enemy.health < getDmg("Q", enemy, myHero) then
  327.                     CastSpell(SkillQ.spellKey, enemy)
  328.                 end
  329.             end
  330.         end
  331.     end
  332. end
  333.  
  334. function pEscapeCombo()
  335.     if Menu.pEscape then
  336.         if WReady and GetDistance(Target) < qwRange then
  337.             CastSpell(SkillW.spellKey, Target)
  338.             if Menu.pEscapeFlash and FlashReady and GetDistance(mousePos) > 300 and isChanneling("Spell2") then
  339.                 CastSpell(FlashSlot, mousePos.x, mousePos.z)
  340.             end
  341.         end
  342.        
  343.         if Menu.pEscapeFlash then
  344.             myHero:MoveTo(mousePos.x, mousePos.z)
  345.         end
  346.     end
  347. end
  348.  
  349. function isChanneling(animationName)
  350.     if lastAnimation == animationName then
  351.         return true
  352.     else
  353.         return false
  354.     end
  355. end
  356.  
  357. function pSpellCheck()
  358.     wgtSlot = GetInventorySlotItem(3090)
  359.     hpSlot, mpSlot, fskSlot = GetInventorySlotItem(2003),GetInventorySlotItem(2004),GetInventorySlotItem(2041)
  360.  
  361.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerFlash") then
  362.         FlashSlot = SUMMONER_1
  363.     elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerFlash") then
  364.         FlashSlot = SUMMONER_2
  365.     end
  366.  
  367.     QReady = (myHero:CanUseSpell(SkillQ.spellKey) == READY)
  368.     WReady = (myHero:CanUseSpell(SkillW.spellKey) == READY)
  369.     EReady = (myHero:CanUseSpell(SkillE.spellKey) == READY)
  370.     RReady = (myHero:CanUseSpell(_R) == READY)
  371.     WGTReady = (wgtSlot ~= nil and myHero:CanUseSpell(wgtSlot) == READY)
  372.     HPReady = (hpSlot ~= nil and myHero:CanUseSpell(hpSlot) == READY)
  373.     MPReady = (mpSlot ~= nil and myHero:CanUseSpell(mpSlot) == READY)
  374.     FSKReady = (fskSlot ~= nil and myHero:CanUseSpell(fskSlot) == READY)
  375.  
  376.     FlashReady = (FlashSlot ~= nil and myHero:CanUseSpell(FlashSlot) == READY)
  377. end
  378.  
  379. function pDrawCritText()
  380.     if not myHero.dead and Extras.pDCT then
  381.         for _, enemy in pairs(AutoCarry.EnemyTable) do
  382.             if ValidTarget(enemy) then
  383.                 if enemy.health <= enemy.maxHealth*0.15 then
  384.                     PrintFloatText(enemy, 10, "Critical Hit!")
  385.                 end
  386.             end
  387.         end
  388.     end
  389. end
  390.  
  391. -- Auto Regeneration
  392. function IsMyManaLow()
  393.     if (myHero.mana / myHero.maxMana) < Menu.pMinMana then
  394.         return true
  395.     else
  396.         return false
  397.     end
  398. end
  399.  
  400. function IsMyHealthLow()
  401.     if myHero.health < (myHero.maxHealth * (Extras.WHealth / 100)) then
  402.         return true
  403.     else
  404.         return false
  405.     end
  406. end
  407.  
  408. function NeedHP()
  409.     if myHero.health < (myHero.maxHealth * (Extras.pHPHealth / 100)) then
  410.         return true
  411.     else
  412.         return false
  413.     end
  414. end
  415.  
  416. --UPDATEURL=https://raw.github.com/RoachxD/BoL_Scripts/master/Common/SidasAutoCarryPlugin%20-%20Pantheon.lua
  417. --HASH=D2A4E405F4D438CE222C0762EFC64C5E
Advertisement
Add Comment
Please, Sign In to add comment