forked from k5dash/LuaDota2
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAutoBottle.lua
More file actions
16 lines (12 loc) · 762 Bytes
/
AutoBottle.lua
File metadata and controls
16 lines (12 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
local autoBottle = {}
autoBottle.optionEnable = Menu.AddOption({ "Utility" }, "Auto Bottle", "Auto Bottle when you on your base. Script by Rednelss")
function autoBottle.OnUpdate()
if not Menu.IsEnabled(autoBottle.optionEnable) then return end
local myHero = Heroes.GetLocal()
if not NPC.HasModifier(myHero, "modifier_fountain_aura_buff") then return end
if Entity.GetHealth(myHero) >= Entity.GetMaxHealth(myHero) and NPC.GetMana(myHero) >= NPC.GetMaxMana(myHero) then return end
local bottle = NPC.GetItem(myHero, "item_bottle", true)
if bottle == nill or not Ability.IsReady(bottle) or NPC.HasModifier(myHero, "modifier_bottle_regeneration") or NPC.IsChannellingAbility(myHero) then return end
Ability.CastNoTarget(bottle)
end
return autoBottle