Kain2030

Auto Carry Plugin - Teemo Edition - v1.03

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