roach_

[1.0a] SidasAutoCarryPlugin - Wukong

Dec 5th, 2013
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.33 KB | None | 0 0
  1. --[[
  2.  
  3.         Auto Carry Plugin - Wukong/Monkey King Edition
  4.         Author: Roach_
  5.         Version: 1.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 - MonkeyKing.lua" without the quotes.
  13.             Place the plugin in BoL/Scripts/Common folder.
  14.  
  15.         Features:
  16.             Combo with Autocarry
  17.             Harass with Mixed Mode
  18.             Killsteal with Q / E
  19.             Farm with Q / E
  20.             Draw Combo Ranges (With Cooldown Check)
  21.             Escape Artist(with Flash)
  22.             Auto Pots/Items
  23.  
  24.         History:
  25.             Version: 1.0a
  26.                 First release
  27.  
  28. --]]
  29. if myHero.charName ~= "MonkeyKing" then return end
  30.  
  31. local Target
  32. local wEscapeHotkey = string.byte("T")
  33.  
  34. -- Prediction
  35. local qRange, eRange, rRange = 300, 625, 162
  36.  
  37. local FlashSlot = nil
  38.  
  39. local SkillQ = {spellKey = _Q, range = qRange, speed = 2, delay = 0, width = 200, configName = "crushingBlow", displayName = "Q (Crushing Blow)", enabled = true, skillShot = false, minions = false, reset = false, reqTarget = true }
  40. local SkillE = {spellKey = _E, range = eRange, speed = 2, delay = 0, width = 200, configName = "nimbusStrike", displayName = "E (Nimbus Strike)", enabled = true, skillShot = false, minions = false, reset = false, reqTarget = true }
  41.  
  42. local QReady, WReady, EReady, RReady, FlashReady = false, false, false, false, false
  43.  
  44. -- Regeneration
  45. local UsingHPot, UsingMPot, UsingFlask, Recall = false, false, false, false
  46.  
  47. -- Our lovely script
  48. function PluginOnLoadMenu()
  49.     Menu = AutoCarry.PluginMenu
  50.     Menu2 = AutoCarry.MainMenu
  51.     Menu:addParam("wPlugin", "[Cast Options]", SCRIPT_PARAM_INFO, "")
  52.     Menu:addParam("wCombo", "[Combo Options]", SCRIPT_PARAM_INFO, "")
  53.     Menu:addParam("wAutoQ", "Auto Cast Q", SCRIPT_PARAM_ONOFF, true)
  54.     Menu:addParam("wAutoE", "Auto Cast E", SCRIPT_PARAM_ONOFF, true)
  55.     Menu:addParam("wAutoR", "Auto Cast R(When Killable)", SCRIPT_PARAM_ONOFF, false)
  56.     Menu:permaShow("wPlugin")
  57.    
  58.     Menu:addParam("wGap", "", SCRIPT_PARAM_INFO, "")
  59.    
  60.     Menu:addParam("wKS", "[Kill Steal Options]", SCRIPT_PARAM_INFO, "")
  61.     Menu:addParam("wKillsteal", "Auto Kill Steal with E / Q", SCRIPT_PARAM_ONOFF, true)
  62.     Menu:permaShow("wKS")
  63.     Menu:permaShow("wKillsteal")
  64.    
  65.     Menu:addParam("wGap", "", SCRIPT_PARAM_INFO, "")
  66.    
  67.     Menu:addParam("wMisc", "[Misc Options]", SCRIPT_PARAM_INFO, "")
  68.     -- Menu:addParam("pAutoLVL", "Auto Level Spells", SCRIPT_PARAM_ONOFF, false)
  69.     Menu:addParam("wMinMana", "Minimum Mana to Farm/Harass", SCRIPT_PARAM_SLICE, 40, 0, 100, -1)
  70.     Menu:addParam("wEscape", "Escape Artist", SCRIPT_PARAM_ONKEYDOWN, false, wEscapeHotkey)
  71.     Menu:addParam("wEscapeFlash", "Escape: Flash to Mouse", SCRIPT_PARAM_ONOFF, false)
  72.     Menu:permaShow("wMisc")
  73.     Menu:permaShow("wEscape")
  74.    
  75.     Menu:addParam("wGap", "", SCRIPT_PARAM_INFO, "")
  76.    
  77.     Menu:addParam("wH", "[Harass Options]", SCRIPT_PARAM_INFO, "")
  78.     Menu:addParam("wHarass", "Auto Harass with E", SCRIPT_PARAM_ONOFF, true)
  79.     Menu:addParam("wHarassEscape", "Auto use W after Harass", SCRIPT_PARAM_ONOFF, false)
  80.    
  81.     Menu:addParam("wGap", "", SCRIPT_PARAM_INFO, "")
  82.    
  83.     Menu:addParam("wFarm", "[Farm Options]", SCRIPT_PARAM_INFO, "")
  84.     Menu:addParam("wFarmQ", "Auto Farm with Q", SCRIPT_PARAM_ONOFF, false)
  85.     Menu:addParam("wFarmE", "Auto Clear Lane with E", SCRIPT_PARAM_ONOFF, false)
  86.    
  87.     Extras = scriptConfig("Sida's Auto Carry Plugin: "..myHero.charName..": Extras", myHero.charName)
  88.     Extras:addParam("wDraw", "[Draw Options]", SCRIPT_PARAM_INFO, "")
  89.     Extras:addParam("wDQ", "Draw Q Range", SCRIPT_PARAM_ONOFF, false)
  90.     Extras:addParam("wDW", "Draw W Range(Check Cooldowns)", SCRIPT_PARAM_ONOFF, false)
  91.     Extras:addParam("wDE", "Draw E Range", SCRIPT_PARAM_ONOFF, false)
  92.    
  93.     Extras:addParam("wGap", "", SCRIPT_PARAM_INFO, "")
  94.    
  95.     Extras:addParam("wHPMana", "[Auto Pots/Items Options]", SCRIPT_PARAM_INFO, "")
  96.     Extras:addParam("wWItem", "Auto Wooglets", SCRIPT_PARAM_ONOFF, true)
  97.     Extras:addParam("wWHealth", "Minimum Health for Wooglets", SCRIPT_PARAM_SLICE, 15, 0, 100, -1)
  98.     Extras:addParam("wHP", "Auto Health Pots", SCRIPT_PARAM_ONOFF, true)
  99.     Extras:addParam("wMP", "Auto Auto Mana Pots", SCRIPT_PARAM_ONOFF, true)
  100.     Extras:addParam("wHPHealth", "Minimum Health for Pots", SCRIPT_PARAM_SLICE, 50, 0, 100, -1)
  101. end
  102. function PluginOnLoad()
  103.     -- Params/PluginMenu
  104.     PluginOnLoadMenu()
  105.    
  106.     -- Range
  107.     AutoCarry.SkillsCrosshair.range = eRange-25
  108. end
  109.  
  110. function PluginOnTick()
  111.     if Recall then return end
  112.  
  113.     -- Get Attack Target
  114.     Target = AutoCarry.GetAttackTarget()
  115.  
  116.     -- Check Spells
  117.     wSpellCheck()
  118.  
  119.     -- Combo, Harass, Killsteal, Escape Combo, Farm - Checks
  120.     wCombo()
  121.     wHarass()
  122.     wKillsteal()
  123.     wEscapeCombo()
  124.     wFarm()
  125.    
  126.     -- Auto Regeneration
  127.     if Extras.wWItem and IsMyHealthLow() and Target and WGTReady then CastSpell(wgtSlot) end
  128.     if Extras.wHP and NeedHP() and not (UsingHPot or UsingFlask) and (HPReady or FSKReady) then CastSpell((hpSlot or fskSlot)) end
  129.     if Extras.wMP and IsMyManaLow() and not (UsingMPot or UsingFlask) and(MPReady or FSKReady) then CastSpell((mpSlot or fskSlot)) end
  130. end
  131.  
  132. function PluginOnDraw()
  133.     -- Draw Wukong's Range = 625 - 25
  134.     local tempColor = { 0xFF0000, 0xFF0000, 0xFF0000 }
  135.    
  136.     if not myHero.dead then
  137.         if Extras.wDQ then
  138.             if QReady then tempColor[1] = 0x00FF00 end
  139.             DrawCircle(myHero.x, myHero.y, myHero.z, qRange, tempColor[1])
  140.         end
  141.         if Extras.wDW then
  142.             if WReady then tempColor[2] = 0x00FF00 end
  143.             DrawCircle(myHero.x, myHero.y, myHero.z, myHero.range-50, tempColor[2])
  144.         end
  145.         if Extras.wDE then
  146.             if EReady then tempColor[3] = 0x00FF00 end
  147.             DrawCircle(myHero.x, myHero.y, myHero.z, eRange, tempColor[3])
  148.         end
  149.     end
  150. end
  151.  
  152. -- Object Detection
  153. function PluginOnCreateObj(obj)
  154.     if obj.name:find("TeleportHome.troy") then
  155.         if GetDistance(obj, myHero) <= 70 then
  156.             Recall = true
  157.         end
  158.     end
  159.     if obj.name:find("Regenerationpotion_itm.troy") then
  160.         if GetDistance(obj, myHero) <= 70 then
  161.             UsingHPot = true
  162.         end
  163.     end
  164.     if obj.name:find("Global_Item_HealthPotion.troy") then
  165.         if GetDistance(obj, myHero) <= 70 then
  166.             UsingHPot = true
  167.             UsingFlask = true
  168.         end
  169.     end
  170.     if obj.name:find("Global_Item_ManaPotion.troy") then
  171.         if GetDistance(obj, myHero) <= 70 then
  172.             UsingFlask = true
  173.             UsingMPot = true
  174.         end
  175.     end
  176. end
  177.  
  178. function PluginOnDeleteObj(obj)
  179.     if obj.name:find("TeleportHome.troy") then
  180.         Recall = false
  181.     end
  182.     if obj.name:find("Regenerationpotion_itm.troy") then
  183.         UsingHPot = false
  184.     end
  185.     if obj.name:find("Global_Item_HealthPotion.troy") then
  186.         UsingHPot = false
  187.         UsingFlask = false
  188.     end
  189.     if obj.name:find("Global_Item_ManaPotion.troy") then
  190.         UsingMPot = false
  191.         UsingFlask = false
  192.     end
  193. end
  194.  
  195. -- Primary Functions
  196. function wCombo()
  197.     if Menu.wCombo and Menu2.AutoCarry then
  198.         if ValidTarget(Target) then
  199.             if QReady and Menu.wAutoQ and GetDistance(Target) < qRange then
  200.                 CastSpell(SkillQ.spellKey, Target)
  201.             end
  202.            
  203.             if EReady and Menu.wAutoE and GetDistance(Target) < eRange then
  204.                 CastSpell(SkillE.spellKey, Target)
  205.             end
  206.            
  207.             if RReady and Menu.wAutoR and (getDmg("R", Target, myHero) * 4) > Target.health and GetDistance(Target) < (rRange - 12) then
  208.                 CastSpell(_R)
  209.             end
  210.         end
  211.     end
  212. end
  213.  
  214. function wHarass()
  215.     if Menu.wHarass and Menu2.MixedMode then
  216.         if ValidTarget(Target) then
  217.             if EReady and GetDistance(Target) < eRange and (myHero.mana / myHero.maxMana) > Menu.wMinMana then
  218.                 CastSpell(SkillE.spellKey, Target)
  219.                 myHero:Attack(Target)
  220.             end
  221.             if WReady and Menu.wHarassEscape then
  222.                 CastSpell(_W)
  223.             end
  224.         end
  225.     end
  226. end
  227.  
  228. function wFarm()
  229.     if Menu.wFarmQ and (Menu2.LastHit) and (myHero.mana / myHero.maxMana) > Menu.wMinMana then
  230.         for _, minion in pairs(AutoCarry.EnemyMinions().objects) do
  231.             if ValidTarget(minion) and QReady and GetDistance(minion) <= qRange then
  232.                 if minion.health < getDmg("Q", minion, myHero) then
  233.                     CastSpell(SkillQ.spellKey, minion)
  234.                 end
  235.             end
  236.         end
  237.     end
  238.     if Menu.wFarmE and (Menu2.LaneClear) and (myHero.mana / myHero.maxMana) > Menu.wMinMana then
  239.         for _, minion in pairs(AutoCarry.EnemyMinions().objects) do
  240.             if ValidTarget(minion) and EReady and GetDistance(minion) <= eRange then
  241.                 if minion.health < getDmg("E", minion, myHero) then
  242.                     CastSpell(SkillE.spellKey, minion)
  243.                 end
  244.             end
  245.         end
  246.     end
  247. end
  248.  
  249. function wKillsteal()
  250.     if Menu.wKillsteal then
  251.         for _, enemy in pairs(AutoCarry.EnemyTable) do
  252.             if ValidTarget(enemy) then
  253.                 if QReady and GetDistance(enemy) < qRange and enemy.health < getDmg("Q", enemy, myHero) then
  254.                         CastSpell(SkillQ.spellKey, enemy)
  255.                 end
  256.                 if EReady and GetDistance(enemy) > qRange and GetDistance(enemy) < eRange and enemy.health < getDmg("E", enemy, myHero) then
  257.                     CastSpell(SkillE.spellKey, enemy)
  258.                 end
  259.             end
  260.         end
  261.     end
  262. end
  263.  
  264. function wEscapeCombo()
  265.     if Menu.wEscape then
  266.         if WReady then
  267.             CastSpell(_W)
  268.             if Menu.wEscapeFlash and FlashReady and GetDistance(mousePos) > 300 then
  269.                 CastSpell(FlashSlot, mousePos.x, mousePos.z)
  270.             end
  271.         end
  272.        
  273.         if Menu.wEscapeFlash then
  274.             myHero:MoveTo(mousePos.x, mousePos.z)
  275.         end
  276.     end
  277. end
  278.  
  279. -- Scondary Functions
  280. function wSpellCheck()
  281.     wgtSlot = GetInventorySlotItem(3090)
  282.     hpSlot, mpSlot, fskSlot = GetInventorySlotItem(2003),GetInventorySlotItem(2004),GetInventorySlotItem(2041)
  283.  
  284.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerFlash") then
  285.         FlashSlot = SUMMONER_1
  286.     elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerFlash") then
  287.         FlashSlot = SUMMONER_2
  288.     end
  289.  
  290.     QReady = (myHero:CanUseSpell(SkillQ.spellKey) == READY)
  291.     WReady = (myHero:CanUseSpell(_W) == READY)
  292.     EReady = (myHero:CanUseSpell(SkillE.spellKey) == READY)
  293.     RReady = (myHero:CanUseSpell(_R) == READY)
  294.     WGTReady = (wgtSlot ~= nil and myHero:CanUseSpell(wgtSlot) == READY)
  295.     HPReady = (hpSlot ~= nil and myHero:CanUseSpell(hpSlot) == READY)
  296.     MPReady = (mpSlot ~= nil and myHero:CanUseSpell(mpSlot) == READY)
  297.     FSKReady = (fskSlot ~= nil and myHero:CanUseSpell(fskSlot) == READY)
  298.  
  299.     FlashReady = (FlashSlot ~= nil and myHero:CanUseSpell(FlashSlot) == READY)
  300. end
  301.  
  302. -- Auto Potions
  303. function IsMyManaLow()
  304.     if (myHero.mana / myHero.maxMana) <= (Menu.wMinMana / 100) then
  305.         return true
  306.     else
  307.         return false
  308.     end
  309. end
  310.  
  311. function IsMyHealthLow()
  312.     if (myHero.health / myHero.maxHealth) <= (Extras.wWHealth / 100) then
  313.         return true
  314.     else
  315.         return false
  316.     end
  317. end
  318.  
  319. function NeedHP()
  320.     if (myHero.health / myHero.maxHealth) <= (Extras.wHPHealth / 100) then
  321.         return true
  322.     else
  323.         return false
  324.     end
  325. end
Advertisement
Add Comment
Please, Sign In to add comment