roach_

[2.0d] SidasAutoCarryPlugin - Pantheon

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