Kain2030

Auto Carry Plugin - Teemo Edition - v1.1i Unencrypted

Aug 20th, 2013
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 18.15 KB | None | 0 0
  1. --[[
  2.  
  3.         Auto Carry Plugin - Teemo Edition
  4.         Author: Kain
  5.         Version: 1.1i
  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.1i: http://pastebin.com/GbBiCDYY
  23.                 Added Shroom Hack.
  24.                 Code cleanup.
  25.                 Changed method for displaying text on screen.
  26.                 Shroom settings changes now auto refresh without an F9.
  27.             Version: 1.05e: http://pastebin.com/nFXpw9tX
  28.                 Fixed "Blinding Dart" range to 680.
  29.                 Fixed "Shroom Bomb" not firing.
  30.                 Added on screen text to indicate when "Shroom Bomb" occurs.
  31.                 Made improvements to target detection. Will not shoot at Kog'maw passive, Karthus, etc.
  32.                 Fixed issue with Q not working sometimes.
  33.             Version: 1.04: http://pastebin.com/EjLX4Vrq
  34.                 Added support for more items.
  35.             Version: 1.03: http://pastebin.com/GGWEjni1
  36.                 Fixed shrooms snapping/magnetism. Added toggle for this.
  37.                 Added more ranges; changed colors.
  38.                 Added experimental flash during escape toggle option. Off by default.
  39.  
  40.             Version: 1.02: http://pastebin.com/uJ2p7aaQ
  41.                 Random Fixes
  42. --]]
  43.  
  44. if myHero.charName ~= "Teemo" then return end
  45.  
  46. local Target
  47. local EscapeHotkey = string.byte("T")
  48.  
  49. -- Prediction
  50. local QRange = 680
  51. local RRange = 230
  52.  
  53. 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 }
  54. local SkillW = {spellKey = _W, range = 0, speed = 2, delay = 0}
  55. local SkillR = {spellKey = _R, range = RRange, speed = 2, delay = 0}
  56.  
  57. local DFGSlot, HXGSlot, BWCSlot, BRKSlot, FlashSlot = nil, nil, nil, nil, nil
  58. local QReady, WReady, EReady, RReady, DFGReady, HXGReady, BWCReady, BRKReady, FlashReady = false, false, false, false, false, false, false, false, false
  59.  
  60. -- Shrooms Config
  61. local highEnabled     = nil -- Enable High Priority Mushrooms
  62. local medEnabled      = nil -- Enable Medium Priority Mushrooms
  63. local lowEnabled      = nil -- Enable Low Priority Mushrooms
  64. local blueEnabled     = nil -- Enable Blue Team Mushrooms (in and around blue jungle)
  65. local purpEnabled     = nil -- Enable Purple Team Mushrooms (in and around purple jungle)
  66.  
  67. local shroomSpots     = nil
  68.  
  69. local showLocationsInRange = 3000 -- When you press R, locations in this range will be shown
  70. local showClose = true -- Show shroom locations that are close to you
  71. local showCloseRange = 800
  72.  
  73. local FlashSlot = nil
  74.  
  75. -- Keep track of settings changes
  76. local snapShrooms = nil
  77. local autoShroomsHigh = nil
  78. local autoShroomsMedium = nil
  79.  
  80. -- Main
  81.  
  82. function Menu()
  83.     AutoCarry.PluginMenu:addParam("Combo", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  84.     AutoCarry.PluginMenu:addParam("Harass", "Harass", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("A"))
  85.     AutoCarry.PluginMenu:addParam("Escape", "Escape Artist", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("T"))
  86.     AutoCarry.PluginMenu:addParam("EscapeFlash", "Escape: Flash to Mouse", SCRIPT_PARAM_ONOFF, false)
  87.     AutoCarry.PluginMenu:addParam("Ultimate", "Use Shroom Bomb with combo", SCRIPT_PARAM_ONOFF, true)
  88.     AutoCarry.PluginMenu:addParam("DrawShrooms", "Shroom Placement Helper", SCRIPT_PARAM_ONOFF, true)
  89.     AutoCarry.PluginMenu:addParam("SnapShrooms", "Snap Shrooms into place", SCRIPT_PARAM_ONOFF, true)
  90.     if VIP_USER then
  91.         AutoCarry.PluginMenu:addParam("ShroomHack", "Extra Shrooms Hack", SCRIPT_PARAM_ONOFF, true)
  92.     end
  93.     AutoCarry.PluginMenu:addParam("AutoShroomsHigh", "Auto-shroom high priority locations", SCRIPT_PARAM_ONOFF, true)
  94.     AutoCarry.PluginMenu:addParam("AutoShroomsMedium", "Auto-shroom medium priority locations", SCRIPT_PARAM_ONOFF, false)
  95.     AutoCarry.PluginMenu:addParam("Draw", "Draw range circles", SCRIPT_PARAM_ONOFF, true)
  96. end
  97.  
  98. function ShroomConfig()
  99.     highEnabled = AutoCarry.PluginMenu.DrawShrooms
  100.     medEnabled  = AutoCarry.PluginMenu.DrawShrooms
  101.     lowEnabled  = AutoCarry.PluginMenu.DrawShrooms
  102.     blueEnabled = AutoCarry.PluginMenu.DrawShrooms
  103.     purpEnabled = AutoCarry.PluginMenu.DrawShrooms
  104. end
  105.  
  106. function PluginOnLoad()
  107.     Menu()
  108.     ShroomConfig()
  109.     InitializeShrooms()
  110. end
  111.  
  112. function PluginOnTick()
  113.     Target = AutoCarry.GetAttackTarget()
  114.  
  115.     CheckSettingsChange()
  116.  
  117.     if VIP_USER then ShroomHackOnTick() end
  118.  
  119.     SpellCheck()
  120.  
  121.     if AutoCarry.PluginMenu.Combo then
  122.         Combo()
  123.     end
  124.  
  125.     if AutoCarry.PluginMenu.Harass then
  126.         Harass()
  127.     end
  128.  
  129.     if AutoCarry.PluginMenu.Escape then
  130.         EscapeCombo()
  131.     end
  132.  
  133.     -- Shrooms
  134.     PlaceAutoShrooms()
  135. end
  136.  
  137. function CheckSettingsChange()
  138.     -- Re-Initalize Shrooms settings if user changes them.
  139.     if snapShrooms == nil or snapShrooms ~= AutoCarry.PluginMenu.SnapShrooms
  140.         or autoShroomsHigh == nil or autoShroomsHigh ~= AutoCarry.PluginMenu.AutoShroomsHigh
  141.         or autoShroomsMedium == nil or autoShroomsMedium ~= AutoCarry.PluginMenu.AutoShroomsMedium then
  142.         snapShrooms = AutoCarry.PluginMenu.SnapShrooms
  143.         autoShroomsHigh = AutoCarry.PluginMenu.AutoShroomsHigh
  144.         autoShroomsMedium = AutoCarry.PluginMenu.AutoShroomsMedium
  145.         InitializeShrooms()
  146.     end
  147. end
  148.  
  149. function PluginOnProcessSpell(unit, spell)
  150.     if VIP_USER then ShroomHackOnProcessSpell(unit, spell) end
  151. end
  152.  
  153. function Combo()
  154.     if Target ~= nil and not Target.dead then
  155.         CastSlots()
  156.  
  157.         if QReady and GetDistance(Target) < QRange then
  158.             if not AutoCarry.GetCollision(SkillQ, myHero, Target) then
  159.                 CastSpell(SkillQ.spellKey, Target)
  160.             end
  161.         end
  162.  
  163.         -- Shroom under enemy
  164.         ShroomUnderEnemy()
  165.     end
  166. end
  167.  
  168. function EscapeCombo()
  169.     if WReady then
  170.         AutoCarry.CastSpell(SkillW.spellKey)
  171.     end
  172.  
  173.     if RReady then
  174.         CastSpell(SkillR.spellKey, myHero.x, myHero.z)
  175.     end
  176.  
  177.     if AutoCarry.PluginMenu.EscapeFlash and FlashSlot ~= nil and FlashReady and GetDistance(mousePos) > 300 then
  178.         CastSpell(FlashSlot, mousePos.x, mousePos.z)
  179.     end
  180.  
  181.     if AutoCarry.PluginMenu.EscapeFlash then
  182.         myHero:MoveTo(mousePos.x, mousePos.z)
  183.     end
  184. end
  185.  
  186. function Harass()
  187.     if Target ~= nil and not Target.dead then
  188.         if QReady and GetDistance(Target) < QRange then
  189.             CastSpell(SkillQ.spellKey, Target)
  190.             myHero:Attack(Target)
  191.         end
  192.     end
  193. end
  194.  
  195. function SpellCheck()
  196.     DFGSlot, HXGSlot, BWCSlot, BRKSlot = GetInventorySlotItem(3128),
  197.     GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3153)
  198.  
  199.     if myHero:GetSpellData(SUMMONER_1).name:find("SummonerFlash") then
  200.         FlashSlot = SUMMONER_1
  201.     elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerFlash") then
  202.         FlashSlot = SUMMONER_2
  203.     end
  204.  
  205.     QReady = (myHero:CanUseSpell(SkillQ.spellKey) == READY)
  206.     WReady = (myHero:CanUseSpell(SkillW.spellKey) == READY)
  207.     EReady = (myHero:CanUseSpell(_E) == READY)
  208.     RReady = (myHero:CanUseSpell(SkillR.spellKey) == READY)
  209.  
  210.     DFGReady   = (DFGSlot   ~= nil and myHero:CanUseSpell(DFGSlot)   == READY)
  211.     HXGReady   = (HXGSlot   ~= nil and myHero:CanUseSpell(HXGSlot)   == READY)
  212.     BWCReady   = (BWCSlot   ~= nil and myHero:CanUseSpell(BWCSlot)   == READY)
  213.     BRKReady   = (BRKSlot   ~= nil and myHero:CanUseSpell(BRKSlot)   == READY)
  214.     FlashReady = (FlashSlot ~= nil and myHero:CanUseSpell(FlashSlot) == READY)
  215. end
  216.  
  217. function CastSlots()
  218.     if Target ~= nil and not Target.dead then
  219.         if GetDistance(Target) <= QRange then
  220.             if DFGReady then CastSpell(DFGSlot, Target) end
  221.             if HXGReady then CastSpell(HXGSlot, Target) end
  222.             if BWCReady then CastSpell(BWCSlot, Target) end
  223.             if BRKReady then CastSpell(BRKSlot, Target) end
  224.         end
  225.     end
  226. end
  227.  
  228. function ShroomUnderEnemy()
  229.     if AutoCarry.PluginMenu.Ultimate and RReady and Target ~= nil and GetDistance(Target) < RRange then
  230.         if not shroomExists(shroomSpot) then
  231.             -- Message.AddMessage("Shroom Bomb!", ColorARGB.Green, myHero)
  232.             PrintFloatText(myHero, 10, "Shroom Bomb!")
  233.             AutoCarry.CastSkillshot(SkillR, Target)
  234.             return true
  235.         end
  236.     end
  237.  
  238.     return false
  239. end
  240.  
  241. function PlaceAutoShrooms()
  242.     if not shroomSpots then return end
  243.  
  244.     for i,group in pairs(shroomSpots) do
  245.         for x, shroomSpot in pairs(group.Locations) do
  246.             if group.Enabled and group.Auto and GetDistance(shroomSpot) <= 250 and not shroomExists(shroomSpot) then
  247.                 CastSpell(SkillR.spellKey, shroomSpot.x, shroomSpot.z)
  248.             end
  249.         end
  250.     end
  251. end
  252.  
  253. function PluginOnDraw()
  254.     -- Draw Ranges
  255.     if AutoCarry.PluginMenu.Draw then
  256.         DrawCircle(myHero.x, myHero.y, myHero.z, AutoCarry.SkillsCrosshair.range, 0x808080) -- Gray
  257.  
  258.         if QReady then
  259.             DrawCircle(myHero.x, myHero.y, myHero.z, QRange, 0x0099CC) -- Blue
  260.         end
  261.  
  262.         if RReady then
  263.             DrawCircle(myHero.x, myHero.y, myHero.z, RRange, 0xFF0000) -- Red
  264.         end
  265.     end
  266.  
  267.     -- Draw Shrooms
  268.     if AutoCarry.PluginMenu.DrawShrooms and shroomSpots then
  269.         for i,group in pairs(shroomSpots) do
  270.             if group.Enabled == true then
  271.                 if drawShroomSpots then
  272.                     for x, shroomSpot in pairs(group.Locations) do
  273.                         if GetDistance(shroomSpot) < showLocationsInRange then
  274.                             if GetDistance(shroomSpot, mousePos) <= 250 then
  275.                                 shroomColour = 0xFFFFFF
  276.                             else
  277.                                 shroomColour = group.Colour
  278.                             end
  279.                             drawShroomCircles(shroomSpot.x, shroomSpot.y, shroomSpot.z,shroomColour)
  280.                         end
  281.                     end
  282.                 elseif showClose then
  283.                     for x, shroomSpot in pairs(group.Locations) do
  284.                         if GetDistance(shroomSpot) <= showCloseRange then
  285.                             if GetDistance(shroomSpot, mousePos) <= 250 then
  286.                                 shroomColour = 0xFFFFFF
  287.                             else
  288.                                 shroomColour = group.Colour
  289.                             end
  290.                             drawShroomCircles(shroomSpot.x, shroomSpot.y, shroomSpot.z,shroomColour)
  291.                         end
  292.                     end
  293.                 end
  294.             end
  295.         end
  296.     end
  297. end
  298.  
  299. -- Shrooms Main
  300. function InitializeShrooms()
  301.     red, yellow, green, blue, purple = 0x990000, 0x993300, 0x00FF00, 0x000099, 0x660066
  302.  
  303.     shroomSpots = {
  304.         -- High priority for both sides
  305.         HighPriority =  {
  306.                             Locations = {
  307.                                             { x = 3316.20,  y = -74.06, z = 9334.85},
  308.                                             { x = 4288.76,  y = -71.71, z = 9902.76},
  309.                                             { x = 3981.86,  y = 39.54,  z = 11603.55},
  310.                                             { x = 6435.51,  y = 47.51,  z = 9076.02},
  311.                                             { x = 9577.91,  y = 45.97,  z = 6634.53},
  312.                                             { x = 7635.25,  y = 45.09,  z = 5126.81},
  313.                                             { x = 10731.51, y = -30.77, z = 5287.01},
  314.                                             { x = 9662.24,  y = -70.79, z = 4536.15},
  315.                                             { x = 10080.45, y = 44.48,  z = 2829.56}  
  316.                                         },
  317.                             Colour = red,
  318.                             Enabled = highEnabled,
  319.                             Auto = AutoCarry.PluginMenu.AutoShroomsHigh,
  320.                             Snap = false
  321.                         },
  322.     -- Medium priority for both sides
  323.         MediumPriority ={
  324.                             Locations = {
  325.                                             { x = 3283.18,  y = -69.64, z = 10975.15},
  326.                                             { x = 2595.85,  y = -74.00, z = 11044.66},
  327.                                             { x = 2524.10,  y = 23.36,  z = 11912.28},
  328.                                             { x = 4347.64,  y = 43.34,  z = 7796.28},
  329.                                             { x = 6093.20,  y = -67.90, z = 8067.45},
  330.                                             { x = 7960.99,  y = -73.41, z = 6233.09},
  331.                                             { x = 10652.57, y = -58.96, z = 3507.64},
  332.                                             { x = 11460.14, y = -63.94, z = 3544.83},
  333.                                             { x = 11401.81, y = -11.72, z = 2626.61}  
  334.                                         },
  335.                             Colour = yellow,
  336.                             Enabled = medEnabled,
  337.                             Auto = AutoCarry.PluginMenu.AutoShroomsMedium,
  338.                             Snap = false
  339.                         },
  340.     -- Low priority/situational for both sides
  341.         LowPriority =   {
  342.                             Locations = {
  343.                                             { x = 1346.10,  y = 26.56,  z = 11064.81},
  344.                                             { x = 705.87,   y = 26.93,  z = 11359.88},
  345.                                             { x = 762.80,   y = 26.15,  z = 12210.61},
  346.                                             { x = 1355.53,  y = 24.13,  z = 12936.99},
  347.                                             { x = 1926.92,  y = 25.14,  z = 11567.44},
  348.                                             { x = 1752.22,  y = 24.02,  z = 13176.95},
  349.                                             { x = 2512.96,  y = 21.74,  z = 13524.44},
  350.                                             { x = 3577.42,  y = 25.27,  z = 12429.88},
  351.                                             { x = 5246.01,  y = 30.91,  z = 12508.33},
  352.                                             { x = 5549.60,  y = 42.94,  z = 10917.27},
  353.                                             { x = 6552.56,  y = 47.09,  z = 9688.99},
  354.                                             { x = 5806.41,  y = 46.01,  z = 9918.99},
  355.                                             { x = 7112.27,  y = 46.86,  z = 8443.55},
  356.                                             { x = 4896.10,  y = -72.08, z = 8964.81},
  357.                                             { x = 3096.10,  y = 45.41,  z = 8164.81},
  358.                                             { x = 2390.53,  y = 46.57,  z = 5232.34},
  359.                                             { x = 4358.81,  y = 45.83,  z = 5834.64},
  360.                                             { x = 5746.10,  y = 42.52,  z = 4864.81},
  361.                                             { x = 6307.66,  y = 46.07,  z = 7165.92},
  362.                                             { x = 5443.82,  y = 45.64,  z = 7110.85},
  363.                                             { x = 5153.75,  y = 45.41,  z = 3358.76},
  364.                                             { x = 6876.07,  y = 46.44,  z = 5897.48},
  365.                                             { x = 6881.30,  y = 46.08,  z = 6555.85},
  366.                                             { x = 8555.10,  y = 46.36,  z = 7267.04},
  367.                                             { x = 7946.10,  y = 44.19,  z = 7214.81},
  368.                                             { x = 9088.99,  y = -73.12, z = 5441.11},
  369.                                             { x = 7687.96,  y = 46.12,  z = 5203.08},
  370.                                             { x = 8559.97,  y = 47.97,  z = 3477.87},
  371.                                             { x = 8841.04,  y = 52.28,  z = 1944.09},
  372.                                             { x = 10582.93, y = 43.25,  z = 1707.35},
  373.                                             { x = 11046.10, y = 43.26,  z = 964.81},
  374.                                             { x = 11682.20, y = 43.40,  z = 1061.03},
  375.                                             { x = 12420.51, y = 46.87,  z = 1532.34},
  376.                                             { x = 12819.32, y = 45.74,  z = 1931.32},
  377.                                             { x = 13275.52, y = 45.38,  z = 2873.69},
  378.                                             { x = 11978.71, y = 45.49,  z = 2914.69},
  379.                                             { x = 13379.36, y = 45.37,  z = 3499.62},
  380.                                             { x = 12818.08, y = 45.38,  z = 3625.44},
  381.                                             { x = 10985.17, y = 45.69,  z = 6305.81},
  382.                                             { x = 11580.80, y = 41.26,  z = 9214.09},
  383.                                             { x = 9574.88,  y = 44.40,  z = 8679.65},
  384.                                             { x = 8359.96,  y = 44.37,  z = 9595.58},
  385.                                             { x = 8927.12,  y = 48.17,  z = 11175.70}  
  386.                                         },
  387.                             Colour = green,
  388.                             Enabled = lowEnabled,
  389.                             Auto = false,
  390.                             Snap = false
  391.                         },
  392.     -- blue team areas
  393.         BlueOnly = {
  394.                         Locations = {
  395.                                         { x = 2112.87, y = 43.81, z = 7047.48},
  396.                                         { x = 2646.25, y = 45.84, z = 7545.78},
  397.                                         { x = 1926.95, y = 44.83, z = 9515.71},
  398.                                         { x = 4239.97, y = 44.40, z = 7132.02},
  399.                                         { x = 6149.34, y = 42.51, z = 4481.88},
  400.                                         { x = 6630.28, y = 46.56, z = 2836.88},
  401.                                         { x = 7687.62, y = 45.54, z = 3210.98},
  402.                                         { x = 7050.22, y = 46.46, z = 2351.33}  
  403.                                     },
  404.                         Colour = blue,
  405.                         Enabled = blueEnabled,
  406.                         Auto = false,
  407.                         Snap = false
  408.                     },
  409.     -- purple team areas
  410.         PurpleOnly =    {
  411.                         Locations = {
  412.                                         { x = 7466.52, y = 41.54, z = 11720.22},
  413.                                         { x = 6945.85, y = 43.53, z = 11901.30},
  414.                                         { x = 6636.28, y = 45.03, z = 11079.65},
  415.                                         { x = 7878.53, y = 43.83, z = 10042.65},
  416.                                         { x = 9701.57, y = 45.72, z = 7298.22},
  417.                                         { x = 11358.86, y = 45.71, z = 6872.10},
  418.                                         { x = 11946.10, y = 45.80, z = 7414.81},
  419.                                         { x = 12169.52, y = 44.03, z = 4858.85}  
  420.                                     },
  421.                         Colour = purple,
  422.                         Enabled = purpEnabled,
  423.                         Auto = false,
  424.                         Snap = false
  425.                     }
  426.     }
  427. end
  428.  
  429. drawShroomSpots = false
  430.  
  431. function shroomExists(shroomSpot)
  432.     for i=1, objManager.maxObjects do
  433.     local obj = objManager:getObject(i)
  434.         if obj ~= nil and obj.name ~= nil and obj.name:find("Noxious Trap") then
  435.             if GetDistance(obj) <= 260 then
  436.                 return true
  437.             end
  438.         end
  439.     end
  440.     return false
  441. end
  442.  
  443. function PluginOnWndMsg(msg,key)
  444.     if msg == KEY_DOWN and key == string.byte("R") then
  445.         if player:CanUseSpell(SkillR.spellKey) == READY then
  446.             drawShroomSpots = true
  447.         end
  448.     elseif msg == WM_LBUTTONDOWN and drawShroomSpots and shroomSpots then
  449.         for i,group in pairs(shroomSpots) do
  450.             for x, shroomSpot in pairs(group.Locations) do
  451.                 if group.Snap or AutoCarry.PluginMenu.SnapShrooms then
  452.                     if GetDistance(shroomSpot, mousePos) <= 250 then
  453.                         CastSpell(SkillR.spellKey, shroomSpot.x, shroomSpot.z)
  454.                     end
  455.                 end
  456.             end
  457.         end
  458.     elseif msg == WM_RBUTTONDOWN and drawShroomSpots then
  459.         drawShroomSpots = false
  460.     end
  461. end
  462.  
  463. function drawShroomCircles(x,y,z,colour)
  464.     DrawCircle(x, y, z, 28, colour)
  465.     DrawCircle(x, y, z, 29, colour)
  466.     DrawCircle(x, y, z, 30, colour)
  467.     DrawCircle(x, y, z, 31, colour)
  468.     DrawCircle(x, y, z, 32, colour)
  469.     DrawCircle(x, y, z, 250, colour)
  470.     if colour == red or colour == blue
  471.         or colour == purple or colour == yellow then
  472.         DrawCircle(x, y, z, 251, colour)
  473.         DrawCircle(x, y, z, 252, colour)
  474.         DrawCircle(x, y, z, 253, colour)
  475.         DrawCircle(x, y, z, 254, colour)
  476.     end
  477. end
  478.  
  479. -- Shroom Hack
  480.  
  481. _G.AutoCarry = _G
  482.  
  483. -- Start of Encrypted
  484. _G.Teemo = _G
  485.  
  486. local traps = 0
  487. local lastTraps = 0
  488. local nextShroom = nil
  489. local freeShroom = false
  490. local lock = true
  491.  
  492. function AutoCarry.ShroomHackOnTick()
  493.     if not VIP_USER then return end
  494.     if myHero:CanUseSpell(_R) ~= NOTLEARNED and traps ~= 3 then
  495.         if nextShroom == nil then
  496.             nextShroom = GetGameTimer()
  497.         end
  498.  
  499.         if nextShroom < GetGameTimer() then
  500.             nextShroom = nextShroom + ShroomCooldown()
  501.             traps = traps + 1
  502.             ShroomHackOnDraw()
  503.  
  504.             if lock then
  505.                 if traps == 3 then
  506.                     PrintChat("Shroom: ready")
  507.                     lock = false
  508.                 else
  509.                     PrintChat("Shroom: sync in " .. round((3 - traps) * ShroomCooldown()) .. "s")
  510.                 end
  511.             end
  512.         end
  513.  
  514.         local spellCd = nextShroom - GetGameTimer()
  515.         if AutoCarry.PluginMenu.ShroomHack and spellCd < (0.01 + (GetLatency() / 1000.0)) and spellCd > 0 and traps == 2 and not lock and not freeShroom then
  516.             if not ShroomUnderEnemy() then
  517.                 CastSpell(_R, myHero.x, myHero.z)
  518.             end
  519.             freeShroom = true
  520.         end
  521.     end
  522. end
  523.  
  524. function AutoCarry.ShroomHackOnProcessSpell(unit, spell)
  525.     if not VIP_USER then return end
  526.     if unit.isMe and spell.name == "BantamTrap" then
  527.         if freeShroom then
  528.             freeShroom = false
  529.         else
  530.             if traps == 3 then
  531.                 nextShroom = GetGameTimer() + ShroomCooldown()
  532.             end
  533.  
  534.             traps = traps - 1
  535.             ShroomHackOnDraw()
  536.         end
  537.     end
  538. end
  539.  
  540. function ShroomCooldown()
  541.     return (39 - (4 * myHero:GetSpellData(_R).level)) * (1 + myHero.cdr)
  542. end
  543.  
  544. function ShroomHackOnDraw()
  545.     if not lock and AutoCarry.PluginMenu.ShroomHack then
  546.         PrintFloatText(myHero, 10, ""..traps.." Shrooms")
  547.     end
  548. end
  549. -- End of Encrypted
  550.  
  551. local ShroomHackOnTick = _G.Teemo.ShroomHackOnTick
  552. local ShroomHackOnProcessSpell = _G.Teemo.ShroomHackOnProcessSpell
  553. local ShroomHackOnDraw = _G.Teemo.ShroomHackOnDraw
  554.  
  555. function round(num, idp)
  556.     local mult = 10^(idp or 0)
  557.     return math.floor(num * mult + 0.5) / mult
  558. end
Advertisement
Add Comment
Please, Sign In to add comment