Kain2030

Auto Carry Plugin - Teemo Edition - v1.04

Jul 24th, 2013
695
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 14.01 KB | None | 0 0
  1. --[[
  2.  
  3.         Auto Carry Plugin - Teemo Edition
  4.         Author: Kain
  5.         Version: 1.04
  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 - Teemo.lua" without the quotes.
  13.             Place the plugin in BoL/Scripts/Common folder.
  14.  
  15.         Features:
  16.             Shroom Bomb
  17.             Escape Wizard
  18.             Shroom Placement Helper for Summoner's Rift
  19.             Range Circle
  20.  
  21.         History:
  22.             Version: 1.04: http://pastebin.com/EjLX4Vrq
  23.                 Added support for more items.
  24.             Version: 1.03: http://pastebin.com/GGWEjni1
  25.                 Fixed shrooms snapping/magnetism. Added toggle for this.
  26.                 Added more ranges; changed colors.
  27.                 Added experimental flash during escape toggle option. Off by default.
  28.  
  29.             Version: 1.02: http://pastebin.com/uJ2p7aaQ
  30.                 Random Fixes
  31. --]]
  32.  
  33. if myHero.charName ~= "Teemo" then return end
  34.  
  35. local Target
  36. local EscapeHotkey = string.byte("T")
  37.  
  38. -- Prediction
  39. local QRange = 580
  40. local RRange = 230
  41.  
  42. local SkillQ = {spellKey = _Q, range = QRange, speed = 2, delay = 0, width = 200, configName = "blindingDart", displayName = "Q (Blinding Dart)", enabled = true, skillShot = false, minions = false, reset = false, reqTarget = true }
  43. local SkillW = {spellKey = _W, range = 0, speed = 2, delay = 0}
  44. local SkillR = {spellKey = _R, range = RRange, speed = 2, delay = 0}
  45.  
  46. local DFGSlot, HXGSlot, BWCSlot, BRKSlot, FlashSlot = nil, nil, nil, nil, nil
  47. local QReady, WReady, EReady, RReady, DFGReady, HXGReady, BWCReady, BRKReady, FlashReady = false, false, false, false, false, false, false, false, false
  48.  
  49. AutoCarry.PluginMenu:addParam("Combo", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  50. AutoCarry.PluginMenu:addParam("Harass", "Harass", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("A"))
  51. AutoCarry.PluginMenu:addParam("Escape", "Escape Artist", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("T"))
  52. AutoCarry.PluginMenu:addParam("EscapeFlash", "Escape: Flash to Mouse", SCRIPT_PARAM_ONOFF, false)
  53. AutoCarry.PluginMenu:addParam("Ultimate", "Use Shroom Bomb with combo", SCRIPT_PARAM_ONOFF, true)
  54. AutoCarry.PluginMenu:addParam("DrawShrooms", "Shroom Placement Helper", SCRIPT_PARAM_ONOFF, true)
  55. AutoCarry.PluginMenu:addParam("SnapShrooms", "Snap Shrooms into place", SCRIPT_PARAM_ONOFF, true)
  56. AutoCarry.PluginMenu:addParam("AutoShroomsHigh", "Auto-shroom high priority locations", SCRIPT_PARAM_ONOFF, true)
  57. AutoCarry.PluginMenu:addParam("Draw", "Draw range circles", SCRIPT_PARAM_ONOFF, true)
  58.  
  59. -- Shrooms Config
  60. local highEnabled     = AutoCarry.PluginMenu.DrawShrooms -- Enable High Priority Mushrooms
  61. local medEnabled      = AutoCarry.PluginMenu.DrawShrooms -- Enable Medium Priority Mushrooms
  62. local lowEnabled      = AutoCarry.PluginMenu.DrawShrooms -- Enable Low Priority Mushrooms
  63. local blueEnabled     = AutoCarry.PluginMenu.DrawShrooms -- Enable Blue Team Mushrooms (in and around blue jungle)
  64. local purpEnabled     = AutoCarry.PluginMenu.DrawShrooms -- Enable Purple Team Mushrooms (in and around purple jungle)
  65.  
  66. local showLocationsInRange = 3000 -- When you press R, locations in this range will be shown
  67. local showClose = true -- Show shroom locations that are close to you
  68. local showCloseRange = 800
  69.  
  70. local FlashSlot = nil
  71.  
  72. -- Main
  73. function PluginOnLoad()
  74.     InitializeShrooms()
  75. end
  76.  
  77. function PluginOnTick()
  78.  
  79.     Target = AutoCarry.GetTarget()
  80.  
  81.     SpellCheck()
  82.  
  83.     if AutoCarry.PluginMenu.Combo then
  84.         Combo()
  85.     end
  86.  
  87.     if AutoCarry.PluginMenu.Harass then
  88.         Harass()
  89.     end
  90.  
  91.     if AutoCarry.PluginMenu.Escape then
  92.         EscapeCombo()
  93.     end
  94.  
  95.     -- Shrooms
  96.     PlaceAutoShrooms()
  97. end
  98.  
  99. function Combo()
  100.     if Target ~= nil then
  101.         CastSlots()
  102.  
  103.         if QReady and GetDistance(Target) < QRange then
  104.             if not AutoCarry.GetCollision(SkillQ, myHero, Target) then
  105.                 AutoCarry.CastSkillshot(SkillQ, Target)
  106.             end
  107.         end
  108.  
  109.         -- Shroom under enemy
  110.         if AutoCarry.PluginMenu.Ultimate and EReady and GetDistance(Target) < RRange then
  111.             if not shroomExists(shroomSpot) then
  112.                 AutoCarry.CastSkillshot(SkillR, Target)
  113.             end
  114.         end
  115.     end
  116. end
  117.  
  118. function EscapeCombo()
  119.     if WReady then
  120.         AutoCarry.CastSpell(SkillW.spellKey)
  121.     end
  122.  
  123.     if RReady then
  124.         CastSpell(SkillR.spellKey, myHero.x, myHero.z)
  125.     end
  126.  
  127.     if AutoCarry.PluginMenu.EscapeFlash and FlashSlot ~= nil and FlashReady and GetDistance(mousePos) > 300 then
  128.         CastSpell(FlashSlot, mousePos.x, mousePos.z)
  129.     end
  130.  
  131.     if AutoCarry.PluginMenu.EscapeFlash then
  132.         myHero:MoveTo(mousePos.x, mousePos.z)
  133.     end
  134. end
  135.  
  136. function Harass()
  137.     if Target ~= nil then
  138.         if QReady and GetDistance(Target) < QRange then
  139.             AutoCarry.CastSkillshot(SkillQ.spellKey, Target)
  140.         end
  141.     end
  142. end
  143.  
  144. function SpellCheck()
  145.     DFGSlot, HXGSlot, BWCSlot, BRKSlot = GetInventorySlotItem(3128),
  146.     GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3153)
  147.  
  148.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerFlash") then
  149.         FlashSlot = SUMMONER_1
  150.     elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerFlash") then
  151.         FlashSlot = SUMMONER_2
  152.     end
  153.  
  154.     QReady = (myHero:CanUseSpell(SkillQ.spellKey) == READY)
  155.     WReady = (myHero:CanUseSpell(SkillW.spellKey) == READY)
  156.     EReady = (myHero:CanUseSpell(_E) == READY)
  157.     RReady = (myHero:CanUseSpell(SkillR.spellKey) == READY)
  158.  
  159.     DFGReady   = (DFGSlot   ~= nil and myHero:CanUseSpell(DFGSlot)   == READY)
  160.     HXGReady   = (HXGSlot   ~= nil and myHero:CanUseSpell(HXGSlot)   == READY)
  161.     BWCReady   = (BWCSlot   ~= nil and myHero:CanUseSpell(BWCSlot)   == READY)
  162.     BRKReady   = (BRKSlot   ~= nil and myHero:CanUseSpell(BRKSlot)   == READY)
  163.     FlashReady = (FlashSlot ~= nil and myHero:CanUseSpell(FlashSlot) == READY)
  164. end
  165.  
  166. function CastSlots()
  167.     if Target ~= nil then
  168.         if GetDistance(Target) <= QRange then
  169.             if DFGReady then CastSpell(DFGSlot, Target) end
  170.             if HXGReady then CastSpell(HXGSlot, Target) end
  171.             if BWCReady then CastSpell(BWCSlot, Target) end
  172.             if BRKReady then CastSpell(BRKSlot, Target) end
  173.         end
  174.     end
  175. end
  176.  
  177. function PlaceAutoShrooms()
  178.     for i,group in pairs(shroomSpots) do
  179.         for x, shroomSpot in pairs(group.Locations) do
  180.             if group.Enabled and group.Auto and GetDistance(shroomSpot) <= 250 and not shroomExists(shroomSpot) then
  181.                 CastSpell(SkillR.spellKey, shroomSpot.x, shroomSpot.z)
  182.             end
  183.         end
  184.     end
  185. end
  186.  
  187. function PluginOnDraw()
  188.     -- Draw Ranges
  189.     if AutoCarry.PluginMenu.Draw then
  190.         DrawCircle(myHero.x, myHero.y, myHero.z, AutoCarry.SkillsCrosshair.range, 0x808080) -- Gray
  191.  
  192.         if QReady then
  193.             DrawCircle(myHero.x, myHero.y, myHero.z, QRange, 0x0099CC) -- Blue
  194.         end
  195.  
  196.         if RReady then
  197.             DrawCircle(myHero.x, myHero.y, myHero.z, RRange, 0xFF0000) -- Red
  198.         end
  199.     end
  200.  
  201.     -- Draw Shrooms
  202.         if (AutoCarry.PluginMenu.DrawShrooms) then
  203.         for i,group in pairs(shroomSpots) do
  204.             if group.Enabled == true then
  205.                 if drawShroomSpots then
  206.                     for x, shroomSpot in pairs(group.Locations) do
  207.                         if GetDistance(shroomSpot) < showLocationsInRange then
  208.                             if GetDistance(shroomSpot, mousePos) <= 250 then
  209.                                 shroomColour = 0xFFFFFF
  210.                             else
  211.                                 shroomColour = group.Colour
  212.                             end
  213.                             drawShroomCircles(shroomSpot.x, shroomSpot.y, shroomSpot.z,shroomColour)
  214.                         end
  215.                     end
  216.                 elseif showClose then
  217.                     for x, shroomSpot in pairs(group.Locations) do
  218.                         if GetDistance(shroomSpot) <= showCloseRange then
  219.                             if GetDistance(shroomSpot, mousePos) <= 250 then
  220.                                 shroomColour = 0xFFFFFF
  221.                             else
  222.                                 shroomColour = group.Colour
  223.                             end
  224.                             drawShroomCircles(shroomSpot.x, shroomSpot.y, shroomSpot.z,shroomColour)
  225.                         end
  226.                     end
  227.                 end
  228.             end
  229.         end
  230.     end
  231. end
  232.  
  233. -- Shrooms Main
  234. function InitializeShrooms()
  235.     red, yellow, green, blue, purple = 0x990000, 0x993300, 0x00FF00, 0x000099, 0x660066
  236.  
  237.     shroomSpots = {
  238.         -- High priority for both sides
  239.         HighPriority =  {
  240.                             Locations = {
  241.                                             { x = 3316.20,  y = -74.06, z = 9334.85},
  242.                                             { x = 4288.76,  y = -71.71, z = 9902.76},
  243.                                             { x = 3981.86,  y = 39.54,  z = 11603.55},
  244.                                             { x = 6435.51,  y = 47.51,  z = 9076.02},
  245.                                             { x = 9577.91,  y = 45.97,  z = 6634.53},
  246.                                             { x = 7635.25,  y = 45.09,  z = 5126.81},
  247.                                             { x = 10731.51, y = -30.77, z = 5287.01},
  248.                                             { x = 9662.24,  y = -70.79, z = 4536.15},
  249.                                             { x = 10080.45, y = 44.48,  z = 2829.56}  
  250.                                         },
  251.                             Colour = red,
  252.                             Enabled = highEnabled,
  253.                             Auto = AutoCarry.PluginMenu.AutoShroomsHigh,
  254.                             Snap = false
  255.                         },
  256.     -- Medium priority for both sides
  257.         MediumPriority ={
  258.                             Locations = {
  259.                                             { x = 3283.18,  y = -69.64, z = 10975.15},
  260.                                             { x = 2595.85,  y = -74.00, z = 11044.66},
  261.                                             { x = 2524.10,  y = 23.36,  z = 11912.28},
  262.                                             { x = 4347.64,  y = 43.34,  z = 7796.28},
  263.                                             { x = 6093.20,  y = -67.90, z = 8067.45},
  264.                                             { x = 7960.99,  y = -73.41, z = 6233.09},
  265.                                             { x = 10652.57, y = -58.96, z = 3507.64},
  266.                                             { x = 11460.14, y = -63.94, z = 3544.83},
  267.                                             { x = 11401.81, y = -11.72, z = 2626.61}  
  268.                                         },
  269.                             Colour = yellow,
  270.                             Enabled = medEnabled,
  271.                             Auto = false,
  272.                             Snap = false
  273.                         },
  274.     -- Low priority/situational for both sides
  275.         LowPriority =   {
  276.                             Locations = {
  277.                                             { x = 1346.10,  y = 26.56,  z = 11064.81},
  278.                                             { x = 705.87,   y = 26.93,  z = 11359.88},
  279.                                             { x = 762.80,   y = 26.15,  z = 12210.61},
  280.                                             { x = 1355.53,  y = 24.13,  z = 12936.99},
  281.                                             { x = 1926.92,  y = 25.14,  z = 11567.44},
  282.                                             { x = 1752.22,  y = 24.02,  z = 13176.95},
  283.                                             { x = 2512.96,  y = 21.74,  z = 13524.44},
  284.                                             { x = 3577.42,  y = 25.27,  z = 12429.88},
  285.                                             { x = 5246.01,  y = 30.91,  z = 12508.33},
  286.                                             { x = 5549.60,  y = 42.94,  z = 10917.27},
  287.                                             { x = 6552.56,  y = 47.09,  z = 9688.99},
  288.                                             { x = 5806.41,  y = 46.01,  z = 9918.99},
  289.                                             { x = 7112.27,  y = 46.86,  z = 8443.55},
  290.                                             { x = 4896.10,  y = -72.08, z = 8964.81},
  291.                                             { x = 3096.10,  y = 45.41,  z = 8164.81},
  292.                                             { x = 2390.53,  y = 46.57,  z = 5232.34},
  293.                                             { x = 4358.81,  y = 45.83,  z = 5834.64},
  294.                                             { x = 5746.10,  y = 42.52,  z = 4864.81},
  295.                                             { x = 6307.66,  y = 46.07,  z = 7165.92},
  296.                                             { x = 5443.82,  y = 45.64,  z = 7110.85},
  297.                                             { x = 5153.75,  y = 45.41,  z = 3358.76},
  298.                                             { x = 6876.07,  y = 46.44,  z = 5897.48},
  299.                                             { x = 6881.30,  y = 46.08,  z = 6555.85},
  300.                                             { x = 8555.10,  y = 46.36,  z = 7267.04},
  301.                                             { x = 7946.10,  y = 44.19,  z = 7214.81},
  302.                                             { x = 9088.99,  y = -73.12, z = 5441.11},
  303.                                             { x = 7687.96,  y = 46.12,  z = 5203.08},
  304.                                             { x = 8559.97,  y = 47.97,  z = 3477.87},
  305.                                             { x = 8841.04,  y = 52.28,  z = 1944.09},
  306.                                             { x = 10582.93, y = 43.25,  z = 1707.35},
  307.                                             { x = 11046.10, y = 43.26,  z = 964.81},
  308.                                             { x = 11682.20, y = 43.40,  z = 1061.03},
  309.                                             { x = 12420.51, y = 46.87,  z = 1532.34},
  310.                                             { x = 12819.32, y = 45.74,  z = 1931.32},
  311.                                             { x = 13275.52, y = 45.38,  z = 2873.69},
  312.                                             { x = 11978.71, y = 45.49,  z = 2914.69},
  313.                                             { x = 13379.36, y = 45.37,  z = 3499.62},
  314.                                             { x = 12818.08, y = 45.38,  z = 3625.44},
  315.                                             { x = 10985.17, y = 45.69,  z = 6305.81},
  316.                                             { x = 11580.80, y = 41.26,  z = 9214.09},
  317.                                             { x = 9574.88,  y = 44.40,  z = 8679.65},
  318.                                             { x = 8359.96,  y = 44.37,  z = 9595.58},
  319.                                             { x = 8927.12,  y = 48.17,  z = 11175.70}  
  320.                                         },
  321.                             Colour = green,
  322.                             Enabled = lowEnabled,
  323.                             Auto = false,
  324.                             Snap = false
  325.                         },
  326.     -- blue team areas
  327.         BlueOnly = {
  328.                         Locations = {
  329.                                         { x = 2112.87, y = 43.81, z = 7047.48},
  330.                                         { x = 2646.25, y = 45.84, z = 7545.78},
  331.                                         { x = 1926.95, y = 44.83, z = 9515.71},
  332.                                         { x = 4239.97, y = 44.40, z = 7132.02},
  333.                                         { x = 6149.34, y = 42.51, z = 4481.88},
  334.                                         { x = 6630.28, y = 46.56, z = 2836.88},
  335.                                         { x = 7687.62, y = 45.54, z = 3210.98},
  336.                                         { x = 7050.22, y = 46.46, z = 2351.33}  
  337.                                     },
  338.                         Colour = blue,
  339.                         Enabled = blueEnabled,
  340.                         Auto = false,
  341.                         Snap = false
  342.                     },
  343.     -- purple team areas
  344.         PurpleOnly =    {
  345.                         Locations = {
  346.                                         { x = 7466.52, y = 41.54, z = 11720.22},
  347.                                         { x = 6945.85, y = 43.53, z = 11901.30},
  348.                                         { x = 6636.28, y = 45.03, z = 11079.65},
  349.                                         { x = 7878.53, y = 43.83, z = 10042.65},
  350.                                         { x = 9701.57, y = 45.72, z = 7298.22},
  351.                                         { x = 11358.86, y = 45.71, z = 6872.10},
  352.                                         { x = 11946.10, y = 45.80, z = 7414.81},
  353.                                         { x = 12169.52, y = 44.03, z = 4858.85}  
  354.                                     },
  355.                         Colour = purple,
  356.                         Enabled = purpEnabled,
  357.                         Auto = false,
  358.                         Snap = false
  359.                     }
  360.     }
  361. end
  362.  
  363. drawShroomSpots = false
  364.  
  365. function shroomExists(shroomSpot)
  366.     for i=1, objManager.maxObjects do
  367.     local obj = objManager:getObject(i)
  368.         if obj ~= nil and obj.name:find("Noxious Trap") then
  369.             if GetDistance(obj) <= 260 then
  370.                 return true
  371.             end
  372.         end
  373.     end
  374.     return false
  375. end
  376.  
  377. function PluginOnWndMsg(msg,key)
  378.     if msg == KEY_DOWN and key == string.byte("R") then
  379.         if player:CanUseSpell(SkillR.spellKey) == READY then
  380.             drawShroomSpots = true
  381.         end
  382.     elseif msg == WM_LBUTTONDOWN and drawShroomSpots then
  383.         for i,group in pairs(shroomSpots) do
  384.             for x, shroomSpot in pairs(group.Locations) do
  385.                 if group.Snap or AutoCarry.PluginMenu.SnapShrooms then
  386.                     if GetDistance(shroomSpot, mousePos) <= 250 then
  387.                         CastSpell(SkillR.spellKey, shroomSpot.x, shroomSpot.z)
  388.                     end
  389.                 end
  390.             end
  391.         end
  392.     elseif msg == WM_RBUTTONDOWN and drawShroomSpots then
  393.         drawShroomSpots = false
  394.     end
  395. end
  396.  
  397. function drawShroomCircles(x,y,z,colour)
  398.     DrawCircle(x, y, z, 28, colour)
  399.     DrawCircle(x, y, z, 29, colour)
  400.     DrawCircle(x, y, z, 30, colour)
  401.     DrawCircle(x, y, z, 31, colour)
  402.     DrawCircle(x, y, z, 32, colour)
  403.     DrawCircle(x, y, z, 250, colour)
  404.     if colour == red or colour == blue
  405.         or colour == purple or colour == yellow then
  406.         DrawCircle(x, y, z, 251, colour)
  407.         DrawCircle(x, y, z, 252, colour)
  408.         DrawCircle(x, y, z, 253, colour)
  409.         DrawCircle(x, y, z, 254, colour)
  410.     end
  411. end
Advertisement
Add Comment
Please, Sign In to add comment