From a51a957511dc11d29009c4ed8e43e98156da5a1d Mon Sep 17 00:00:00 2001 From: Arty Date: Mon, 28 Aug 2017 20:46:38 +0400 Subject: [PATCH 1/9] v 1.08 Add option for autouse midas on clone Not try to use midas on ancient creeps --- ArcWardenHelper.lua | 65 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 49 insertions(+), 16 deletions(-) diff --git a/ArcWardenHelper.lua b/ArcWardenHelper.lua index a4fbaf5..7184ac5 100644 --- a/ArcWardenHelper.lua +++ b/ArcWardenHelper.lua @@ -1,9 +1,11 @@ +-- Version 1.08 local ArcHelper= {} -ArcHelper.optionEnable = Menu.AddOption({ "Hero Specific","Arc Warden"}, "Enable", "Arc Warden Help Scrip") +ArcHelper.optionEnable = Menu.AddOption({ "Hero Specific","Arc Warden"}, "Enable", "Arc Warden Help Script") ArcHelper.optionKey = Menu.AddKeyOption({ "Hero Specific","Arc Warden"}, "Clone Combo", Enum.ButtonCode.KEY_P) ArcHelper.optionMainKey = Menu.AddKeyOption({ "Hero Specific","Arc Warden"}, "Main Hero Combo", Enum.ButtonCode.KEY_P) ArcHelper.pushKey = Menu.AddKeyOption({ "Hero Specific","Arc Warden"}, "Clone Push", Enum.ButtonCode.KEY_P) ArcHelper.useHurricanKey = Menu.AddKeyOption({ "Hero Specific","Arc Warden"}, "Use Hurrican", Enum.ButtonCode.KEY_C) +ArcHelper.optionAutoUseCloneMidas = Menu.AddOption({ "Hero Specific","Arc Warden"}, "Auto Use Clone Midas", "Arc Warden Help Script") ArcHelper.cache = {} @@ -123,7 +125,7 @@ function ArcHelper.OnUpdate() return end - ArcHelper.useMidas(ArcHelper.clone) + if Menu.IsEnabled(ArcHelper.optionAutoUseCloneMidas) then ArcHelper.useMidas(ArcHelper.clone) end ArcHelper.clonePush() ArcHelper.cloneAttack() end @@ -341,7 +343,7 @@ function ArcHelper.clonePush() local bot2 = NPC.GetItem(ArcHelper.clone, "item_travel_boots_2") if bot2 then bot = bot2 end - ArcHelper.useMidas(ArcHelper.clone) + if Menu.IsEnabled(ArcHelper.optionAutoUseCloneMidas) then ArcHelper.useMidas(ArcHelper.clone) end local creep = ArcHelper.GetClosestLaneCreepsToPos(Entity.GetAbsOrigin(ArcHelper.clone), false, true) @@ -589,15 +591,44 @@ function ArcHelper.useMidas(myHero) if not midas then return end for i= 1, NPCs.Count() do local entity = NPCs.Get(i) - if entity and not Entity.IsSameTeam(myHero, entity) and (NPC.IsCreep(entity) or NPC.IsLaneCreep(entity) or NPC.IsNeutral(entity)) and not NPC.IsAncient(entity) and NPC.IsEntityInRange(myHero, entity, 1000) then - if Ability.IsReady(midas) then - Ability.CastTarget(midas, entity) - return - end - end + if ArcHelper.isMidasableCreep(myHero, entity) and Ability.IsReady(midas) then + Ability.CastTarget(midas, entity) + return + end end end +function ArcHelper.isMidasableCreep(myHero, entity) + if entity and + not Entity.IsSameTeam(myHero, entity) + and (NPC.IsCreep(entity) + or NPC.IsLaneCreep(entity) + or NPC.IsNeutral(entity)) + and not NPC.IsAncient(entity) + and NPC.IsEntityInRange(myHero, entity, 1000) then + local name = NPC.GetUnitName(entity) + local w, h = Renderer.GetScreenSize() + if name == "npc_dota_neutral_black_dragon" + or name == "npc_dota_neutral_black_drake" + or name == "npc_dota_neutral_black_dragon" + or name == "npc_dota_neutral_blue_dragonspawn_sorcerer" + or name == "npc_dota_neutral_blue_dragonspawn_overseer" + or name == "npc_dota_neutral_granite_golem" + or name == "npc_dota_neutral_elder_jungle_stalker" + or name == "npc_dota_neutral_prowler_acolyte" + or name == "npc_dota_neutral_prowler_shaman" + or name == "npc_dota_neutral_rock_golem" + or name == "npc_dota_neutral_small_thunder_lizard" + or name == "npc_dota_neutral_jungle_stalker" + or name == "npc_dota_neutral_big_thunder_lizard" + or name == "npc_dota_roshan" then + return false + end + return true + end + return false +end + function ArcHelper.calculateHits(myHero, enemy) if not myHero or not enemy then return end local trueDamage = NPC.GetDamageMultiplierVersus(myHero, enemy) * (NPC.GetTrueDamage(myHero) * NPC.GetArmorDamageMultiplier(enemy)) @@ -637,13 +668,15 @@ function ArcHelper.DrawCloneMidasMsg() local midas = NPC.GetItem(ArcHelper.clone, "item_hand_of_midas") local bot = NPC.GetItem(ArcHelper.clone, "item_travel_boots") - if not midas then return end - local w, h = Renderer.GetScreenSize() - --Renderer.SetDrawColor(255, 255, 255) - Renderer.DrawTextCentered(ArcHelper.font, w-200, 100, "Midas:"..math.floor(Ability.GetCooldownTimeLeft(midas)), 1) + if midas then + local w, h = Renderer.GetScreenSize() + --Renderer.SetDrawColor(255, 255, 255) + Renderer.DrawTextCentered(ArcHelper.font, w-200, 100, "Midas:"..math.floor(Ability.GetCooldownTimeLeft(midas)), 1) + end - if not bot then return end - Renderer.DrawTextCentered(ArcHelper.font, w-200, 150, "Bot:"..math.floor(Ability.GetCooldownTimeLeft(bot)), 1) + if bot then + Renderer.DrawTextCentered(ArcHelper.font, w-200, 150, "Bot:"..math.floor(Ability.GetCooldownTimeLeft(bot)), 1) + end end function ArcHelper.DrawCloneSwitchMsg() if not ArcHelper.clone then return end @@ -701,4 +734,4 @@ function ArcHelper.processHero(enemy, duration) local origin = NPC.GetAbsOrigin(enemy) return origin + direction end -return ArcHelper \ No newline at end of file +return ArcHelper From 49677a7ad3c365637b1781f8b5bbbc6e99a28e2d Mon Sep 17 00:00:00 2001 From: Arty Date: Mon, 28 Aug 2017 22:14:05 +0400 Subject: [PATCH 2/9] Fix not showing boots of travel timer --- ArcWardenHelper.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ArcWardenHelper.lua b/ArcWardenHelper.lua index 7184ac5..404fe84 100644 --- a/ArcWardenHelper.lua +++ b/ArcWardenHelper.lua @@ -1,4 +1,4 @@ --- Version 1.08 +-- Version 1.09 local ArcHelper= {} ArcHelper.optionEnable = Menu.AddOption({ "Hero Specific","Arc Warden"}, "Enable", "Arc Warden Help Script") ArcHelper.optionKey = Menu.AddKeyOption({ "Hero Specific","Arc Warden"}, "Clone Combo", Enum.ButtonCode.KEY_P) @@ -667,10 +667,9 @@ function ArcHelper.DrawCloneMidasMsg() if not ArcHelper.clone then return end local midas = NPC.GetItem(ArcHelper.clone, "item_hand_of_midas") local bot = NPC.GetItem(ArcHelper.clone, "item_travel_boots") - + local w, h = Renderer.GetScreenSize() + if midas then - local w, h = Renderer.GetScreenSize() - --Renderer.SetDrawColor(255, 255, 255) Renderer.DrawTextCentered(ArcHelper.font, w-200, 100, "Midas:"..math.floor(Ability.GetCooldownTimeLeft(midas)), 1) end @@ -678,6 +677,7 @@ function ArcHelper.DrawCloneMidasMsg() Renderer.DrawTextCentered(ArcHelper.font, w-200, 150, "Bot:"..math.floor(Ability.GetCooldownTimeLeft(bot)), 1) end end + function ArcHelper.DrawCloneSwitchMsg() if not ArcHelper.clone then return end if not Entity.IsAlive(ArcHelper.clone) then return end From 643dee7b5a50f883a3800b7bf7167b2e7c8feb7f Mon Sep 17 00:00:00 2001 From: Artem Skripka Date: Tue, 29 Aug 2017 13:04:28 +0400 Subject: [PATCH 3/9] Fix trailing whitespaces make timer work for BoT lvl2 also --- ArcWardenHelper.lua | 284 ++++++++++++++++++++++---------------------- 1 file changed, 143 insertions(+), 141 deletions(-) diff --git a/ArcWardenHelper.lua b/ArcWardenHelper.lua index 404fe84..dc7ab86 100644 --- a/ArcWardenHelper.lua +++ b/ArcWardenHelper.lua @@ -49,25 +49,25 @@ function ArcHelper.OnUpdate() -- local value = Entity.GetAngVelocity(myHero):Length2D() -- if value >0.1 then -- Log.Write("value:"..value.." TurnRate:".. NPC.GetTurnRate(myHero).." X:"..value/(NPC.GetTurnRate(myHero))) - -- end - if myHero == nill then return end + -- end + if myHero == nill then return end local myName = NPC.GetUnitName(myHero) - if myName ~= "npc_dota_hero_arc_warden" then return end + if myName ~= "npc_dota_hero_arc_warden" then return end if Menu.IsKeyDown(ArcHelper.optionMainKey) then - if GameRules.GetGameTime() > ArcHelper.mainTick then + if GameRules.GetGameTime() > ArcHelper.mainTick then ArcHelper.mainAttack() - end - end + end + end -- if not ArcHelper.enemyFountain then -- local enemyTeamNum =2 -- if Entity.GetTeamNum(myHero) == 2 then -- enemyTeamNum = 3 - -- end + -- end -- ArcHelper.enemyFountain = ArcHelper.foundFountain(enemyTeamNum) -- Log.Write(ArcHelper.enemyFountain:__tostring()) - -- end + -- end local ultimate = NPC.GetAbilityByIndex(myHero,3) if Menu.IsKeyDownOnce(ArcHelper.optionKey) then @@ -76,19 +76,19 @@ function ArcHelper.OnUpdate() ArcHelper.cloneAttacking = true ArcHelper.clonePushing = false Ability.CastNoTarget(ultimate) - else + else ArcHelper.cloneAttacking = not ArcHelper.cloneAttacking if not ArcHelper.cloneAttacking then ArcHelper.cloneAttackingTarget = nil else ArcHelper.clonePushing = false - end + end end - end + end if Menu.IsKeyDownOnce(ArcHelper.useHurricanKey) then ArcHelper.useHurrican = not ArcHelper.useHurrican - end + end if Menu.IsKeyDownOnce(ArcHelper.pushKey) then if Ability.IsReady(ultimate) then @@ -97,24 +97,24 @@ function ArcHelper.OnUpdate() ArcHelper.clonePushing = true ArcHelper.cloneAttacking = false ArcHelper.clonePushCreep = ArcHelper.GetClosestLaneCreepsToPos(Input.GetWorldCursorPos(), true, true) - end + end -- Find Clone Object if ArcHelper.clone == nil and ultimate and Ability.GetLevel(ultimate)>0 then for i= 1, NPCs.Count() do local entity = NPCs.Get(i) - if entity and NPC.IsEntityInRange(myHero, entity, 200) then + if entity and NPC.IsEntityInRange(myHero, entity, 200) then local name = NPC.GetUnitName(entity) if name == "npc_dota_hero_arc_warden" and myHero~= entity then ArcHelper.clone = entity - end - end + end + end end return end -- Reset varibles when clone is dead - if ArcHelper.clone and not Entity.IsAlive(ArcHelper.clone) and not Ability.IsReady(ultimate) then + if ArcHelper.clone and not Entity.IsAlive(ArcHelper.clone) and not Ability.IsReady(ultimate) then ArcHelper.cloneAttacking = false ArcHelper.clonePushing = false ArcHelper.cloneAttackingTarget = nil @@ -131,7 +131,7 @@ function ArcHelper.OnUpdate() end function ArcHelper.foundFountain(teamNum) - for i = 1, NPCs.Count() do + for i = 1, NPCs.Count() do local npc = NPCs.Get(i) if Entity.GetTeamNum(npc) == teamNum and NPC.IsStructure(npc) then @@ -152,7 +152,7 @@ function ArcHelper.autoDefend(myHero) local bloodthorn = NPC.GetItem(myHero,"item_bloodthorn") local hex = NPC.GetItem(myHero, "item_sheepstick") local hurrican = NPC.GetItem(myHero,"item_hurricane_pike") - if not orchid and not bloodthorn and not hex and not hurrican then return end + if not orchid and not bloodthorn and not hex and not hurrican then return end for i= 1, Heroes.Count() do local enemy = Heroes.Get(i) local sameTeam = Entity.GetTeamNum(enemy) == myTeam @@ -164,7 +164,7 @@ function ArcHelper.autoDefend(myHero) local hex_main = NPC.GetItem(mainHero, "item_sheepstick") local hurrican_main = NPC.GetItem(mainHero,"item_hurricane_pike") local hurrican = NPC.GetItem(myHero,"item_hurricane_pike") - if not NPC.IsSilenced(enemy) then + if not NPC.IsSilenced(enemy) then if NPC.IsEntityInRange(myHero, mainHero,1000) and NPC.IsEntityInRange(mainHero,enemy, 1000) then if (not orchid or not Ability.IsReady(orchid_main)) and (not bloodthorn or not Ability.IsReady(bloodthorn_main)) and (not hex or not Ability.IsReady(hex_main)) then if hex and Ability.IsReady(hex) then @@ -183,8 +183,8 @@ function ArcHelper.autoDefend(myHero) Ability.CastTarget(hurrican, enemy) return end - end - else + end + else if hex and Ability.IsReady(hex) then Ability.CastTarget(hex, enemy) return @@ -202,10 +202,10 @@ function ArcHelper.autoDefend(myHero) return end end - end - end - end - end + end + end + end + end end function ArcHelper.mainAttack() @@ -224,66 +224,66 @@ function ArcHelper.mainAttack() if not NPC.IsPositionInRange(target, mousePos, 2000) then target = nil - end + end if target then if NPC.IsLinkensProtected(target) then if Ability.IsReady(flux) then ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 Ability.CastTarget(flux,target) return - end - end + end + end if hex and Ability.IsReady(hex) and not NPC.HasModifier(target, "modifier_sheepstick_debuff") and not NPC.IsStunned(target) then if not ArcHelper.clone or not Entity.IsAlive(ArcHelper.clone) then Ability.CastTarget(hex,target) -- or not(NPC.IsEntityInRange(ArcHelper.clone, target, 400) and NPC.IsEntityInRange(myHero, target, 800)) - end + end if ArcHelper.clone and Entity.IsAlive(ArcHelper.clone) and NPC.IsEntityInRange(ArcHelper.clone, target, 800) and NPC.IsEntityInRange(myHero, target, 800) then local clone_hex = NPC.GetItem(ArcHelper.clone, "item_sheepstick"); - if Ability.GetCooldownLength(clone_hex)-Ability.GetCooldownTimeLeft(clone_hex)>=0.1 then + if Ability.GetCooldownLength(clone_hex)-Ability.GetCooldownTimeLeft(clone_hex)>=0.1 then Ability.CastTarget(hex,target) - end + end else Ability.CastTarget(hex,target) end - end + end if hex and Ability.IsReady(hex) and NPC.HasModifier(target, "modifier_sheepstick_debuff") then local modifier = NPC.GetModifier(target, "modifier_sheepstick_debuff") ArcHelper.mainHexTick = Modifier.GetCreationTime(modifier) + 3.35 --Log.Write(ArcHelper.mainHexTick..":"..GameRules.GetGameTime()) - if GameRules.GetGameTime() > ArcHelper.mainHexTick then + if GameRules.GetGameTime() > ArcHelper.mainHexTick then Ability.CastTarget(hex,target) - end - end + end + end if bloodthorn and Ability.IsReady(bloodthorn) and (not NPC.IsSilenced(target) or NPC.HasModifier(target, "modifier_sheepstick_debuff") and ArcHelper.useOrchidDuringHex) then if ArcHelper.clone and Entity.IsAlive(ArcHelper.clone) and NPC.IsEntityInRange(myHero, target, 1000) and NPC.IsEntityInRange(myHero, ArcHelper.clone, 1000) then local clone_bloodthorn = NPC.GetItem(ArcHelper.clone, "item_bloodthorn") if Ability.GetCooldownLength(clone_bloodthorn)-Ability.GetCooldownTimeLeft(clone_bloodthorn)>=0.1 and not NPC.IsSilenced(target)then Ability.CastTarget(bloodthorn,target) - end - else + end + else Ability.CastTarget(bloodthorn,target) - end - end + end + end if orchid and Ability.IsReady(orchid) and (not NPC.IsSilenced(target) or NPC.HasModifier(target, "modifier_sheepstick_debuff") and ArcHelper.useOrchidDuringHex) then if ArcHelper.clone and Entity.IsAlive(ArcHelper.clone) and NPC.IsEntityInRange(myHero, target, 1000) and NPC.IsEntityInRange(myHero, ArcHelper.clone, 1000) then local clone_orchid = NPC.GetItem(ArcHelper.clone, "item_orchid") if Ability.GetCooldownLength(clone_orchid)-Ability.GetCooldownTimeLeft(clone_orchid)>=0.1 then Ability.CastTarget(orchid,target) - end - else + end + else Ability.CastTarget(orchid,target) - end - end + end + end if mjollnir and Ability.IsReady(mjollnir) then Ability.CastTarget(mjollnir,myHero) - end + end if Ability.IsReady(flux) then ArcHelper.mainTick = GameRules.GetGameTime() + 0.1 Ability.CastTarget(flux,target) return - end + end if Ability.IsReady(spark) then ArcHelper.mainTick = GameRules.GetGameTime() + 0.1 Ability.CastPosition(spark,ArcHelper.PredictPosition(target)) @@ -302,19 +302,19 @@ function ArcHelper.mainAttack() pos:SetY(pos:GetY()/2) pos:SetZ(pos:GetZ()/2) Ability.CastPosition(magnetic,pos) - end + end return - end + end Ability.CastPosition(magnetic,pos) return - end - Player.AttackTarget(Players.GetLocal(), myHero, target) + end + Player.AttackTarget(Players.GetLocal(), myHero, target) ArcHelper.mainTick = GameRules.GetGameTime() + NPC.GetAttackTime(myHero)/2 - end + end end function ArcHelper.GetClosestLaneCreepsToPos(pos, isRanged, isAlly) - if not ArcHelper.clone then return end + if not ArcHelper.clone then return end local max_distance = 9999999 local candidate = nil for i= 1, NPCs.Count() do @@ -327,16 +327,16 @@ function ArcHelper.GetClosestLaneCreepsToPos(pos, isRanged, isAlly) max_distance = len candidate = entity end - end + end end return candidate -end +end function ArcHelper.clonePush() - if not ArcHelper.clone or not Entity.IsAlive(ArcHelper.clone) then return end - if not ArcHelper.clonePushing then return end - if GameRules.GetGameTime() < ArcHelper.clonePushTick then return end - if NPC.IsChannellingAbility(ArcHelper.clone) then return end + if not ArcHelper.clone or not Entity.IsAlive(ArcHelper.clone) then return end + if not ArcHelper.clonePushing then return end + if GameRules.GetGameTime() < ArcHelper.clonePushTick then return end + if NPC.IsChannellingAbility(ArcHelper.clone) then return end local myHero = Heroes.GetLocal() local bot = NPC.GetItem(ArcHelper.clone, "item_travel_boots") @@ -344,12 +344,12 @@ function ArcHelper.clonePush() if bot2 then bot = bot2 end if Menu.IsEnabled(ArcHelper.optionAutoUseCloneMidas) then ArcHelper.useMidas(ArcHelper.clone) end - + local creep = ArcHelper.GetClosestLaneCreepsToPos(Entity.GetAbsOrigin(ArcHelper.clone), false, true) - if bot and not Ability.IsReady(bot) then + if bot and not Ability.IsReady(bot) then ArcHelper.clonePushCreep = nil - end + end if bot and Ability.IsReady(bot) and ArcHelper.clonePushCreep and not NPC.IsEntityInRange(ArcHelper.clone, ArcHelper.clonePushCreep, 1500) then --and (not creep or not ArcHelper.closerToFountain(myHero, creep)) Ability.CastPosition(bot, Entity.GetAbsOrigin(ArcHelper.clonePushCreep)) @@ -359,20 +359,20 @@ function ArcHelper.clonePush() local magnetic = NPC.GetAbilityByIndex(ArcHelper.clone, 1) local spark = NPC.GetAbilityByIndex(ArcHelper.clone, 2) - if not creep then return end + if not creep then return end if NPC.IsEntityInRange(ArcHelper.clone, creep, 500) then if not NPC.IsRunning(ArcHelper.clone) and NPC.IsAttacking(creep) then if magnetic and Ability.IsReady(magnetic) then Ability.CastPosition(magnetic, Entity.GetAbsOrigin(ArcHelper.clone)) ArcHelper.clonePushTick = GameRules.GetGameTime() + 1 return - end + end -- if spark and Ability.IsReady(spark) then -- Ability.CastPosition(spark, Entity.GetAbsOrigin(creep)) -- ArcHelper.clonePushTick = GameRules.GetGameTime() + 1 -- return -- end - end + end Player.PrepareUnitOrders(Players.GetLocal(), Enum.UnitOrder.DOTA_UNIT_ORDER_ATTACK_MOVE, creep, Entity.GetAbsOrigin(creep), ability, Enum.PlayerOrderIssuer.DOTA_ORDER_ISSUER_PASSED_UNIT_ONLY, ArcHelper.clone, queue, true) ArcHelper.clonePushTick = GameRules.GetGameTime() + 0.3 else @@ -387,7 +387,7 @@ function ArcHelper.clonePush() Player.PrepareUnitOrders(Players.GetLocal(), Enum.UnitOrder.DOTA_UNIT_ORDER_MOVE_TO_TARGET, creep, Vector(), ability, Enum.PlayerOrderIssuer.DOTA_ORDER_ISSUER_PASSED_UNIT_ONLY, ArcHelper.clone, queue, true) ArcHelper.clonePushTick = GameRules.GetGameTime() + 1 end -end +end function ArcHelper.closerToFountain(myHero, creep) local creepPos = Entity.GetAbsOrigin(creep) @@ -400,10 +400,10 @@ function ArcHelper.closerToFountain(myHero, creep) end function ArcHelper.cloneAttack() - if not ArcHelper.clone or not Entity.IsAlive(ArcHelper.clone) then return end + if not ArcHelper.clone or not Entity.IsAlive(ArcHelper.clone) then return end ArcHelper.autoDefend(ArcHelper.clone) - if GameRules.GetGameTime() < ArcHelper.cloneTick then return end + if GameRules.GetGameTime() < ArcHelper.cloneTick then return end local myHero = Heroes.GetLocal() local flux = NPC.GetAbilityByIndex(ArcHelper.clone, 0) local magnetic = NPC.GetAbilityByIndex(ArcHelper.clone, 1) @@ -423,109 +423,109 @@ function ArcHelper.cloneAttack() local myRange = NPC.GetAttackRange(ArcHelper.clone) if dragon_lance or hurrican then myRange = myRange + 140 - end + end if silver_edge then invisible_candidate_blade = silver_edge end - if ArcHelper.cloneAttacking then + if ArcHelper.cloneAttacking then if not ArcHelper.cloneAttackingTarget or not Entity.IsAlive(ArcHelper.cloneAttackingTarget) or not NPC.IsEntityInRange(ArcHelper.cloneAttackingTarget, ArcHelper.clone, 2500) then ArcHelper.cloneAttackingTarget = Input.GetNearestHeroToCursor(Entity.GetTeamNum(myHero), Enum.TeamType.TEAM_ENEMY) if not ArcHelper.cloneAttackingTarget then return end if not NPC.IsEntityInRange(ArcHelper.cloneAttackingTarget, ArcHelper.clone, 2500) then ArcHelper.cloneAttackingTarget = nil - end + end if ArcHelper.cloneAttackingTarget then local hits = ArcHelper.calculateHits(ArcHelper.clone, ArcHelper.cloneAttackingTarget) local hitsDuringHex = 7/NPC.GetAttackTime(ArcHelper.clone)*2 Log.Write(hits..","..hitsDuringHex) if not NPC.IsEntityInRange(myHero,ArcHelper.cloneAttackingTarget, 800) then hitsDuringHex = hitsDuringHex /2 - end + end ArcHelper.useOrchidDuringHex = hitsDuringHex <= hits*0.8 Log.Write("hitsDuringHex:"..hitsDuringHex.." hits*0.5:"..hits*0.8) - end - end + end + end if ArcHelper.cloneAttackingTarget then if dagger and Ability.IsReady(dagger) then - if NPC.IsEntityInRange(ArcHelper.clone,ArcHelper.cloneAttackingTarget, 1500) then + if NPC.IsEntityInRange(ArcHelper.clone,ArcHelper.cloneAttackingTarget, 1500) then ArcHelper.useDagger(ArcHelper.clone, dagger, Entity.GetAbsOrigin(ArcHelper.cloneAttackingTarget)) - else + else Player.AttackTarget(Players.GetLocal(), ArcHelper.clone, ArcHelper.cloneAttackingTarget) ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 - end + end return - end + end if invisible_candidate_blade and Ability.IsReady(invisible_candidate_blade) then Ability.CastNoTarget(invisible_candidate_blade) ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 return - end + end if NPC.IsLinkensProtected(ArcHelper.cloneAttackingTarget) then if Ability.IsReady(flux) then ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 Ability.CastTarget(flux,ArcHelper.cloneAttackingTarget) return - end - end - if NPC.HasModifier(ArcHelper.clone,"modifier_item_silver_edge_windwalk") or NPC.HasModifier(ArcHelper.clone,"modifier_item_invisibility_edge_windwalk") then + end + end + if NPC.HasModifier(ArcHelper.clone,"modifier_item_silver_edge_windwalk") or NPC.HasModifier(ArcHelper.clone,"modifier_item_invisibility_edge_windwalk") then if NPC.IsEntityInRange(ArcHelper.cloneAttackingTarget, ArcHelper.clone, 700) then - Player.AttackTarget(Players.GetLocal(), ArcHelper.clone, ArcHelper.cloneAttackingTarget) + Player.AttackTarget(Players.GetLocal(), ArcHelper.clone, ArcHelper.cloneAttackingTarget) ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 return - else + else Player.PrepareUnitOrders(Players.GetLocal(), Enum.UnitOrder.DOTA_UNIT_ORDER_MOVE_TO_TARGET, ArcHelper.cloneAttackingTarget, Vector(), ability, Enum.PlayerOrderIssuer.DOTA_ORDER_ISSUER_PASSED_UNIT_ONLY, ArcHelper.clone, queue, true) ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 - end - return - end + end + return + end - if hurrican and Ability.IsReady(hurrican) and ArcHelper.isTarget(ArcHelper.clone,ArcHelper.cloneAttackingTarget, 1800) and not NPC.IsEntityInRange(ArcHelper.cloneAttackingTarget, ArcHelper.clone, 500) and ArcHelper.useHurrican then + if hurrican and Ability.IsReady(hurrican) and ArcHelper.isTarget(ArcHelper.clone,ArcHelper.cloneAttackingTarget, 1800) and not NPC.IsEntityInRange(ArcHelper.cloneAttackingTarget, ArcHelper.clone, 500) and ArcHelper.useHurrican then ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 Ability.CastTarget(hurrican,ArcHelper.clone) return - end + end if hex and Ability.IsReady(hex) and not NPC.HasModifier(ArcHelper.cloneAttackingTarget, "modifier_sheepstick_debuff") and not NPC.IsStunned(ArcHelper.cloneAttackingTarget) then Ability.CastTarget(hex,ArcHelper.cloneAttackingTarget) Log.Write("hex1") ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 return - end + end if hex and Ability.IsReady(hex) and NPC.HasModifier(ArcHelper.cloneAttackingTarget, "modifier_sheepstick_debuff") then Log.Write("hex2") local modifier = NPC.GetModifier(ArcHelper.cloneAttackingTarget, "modifier_sheepstick_debuff") ArcHelper.cloneHexTick = Modifier.GetCreationTime(modifier) + 3.35 --Log.Write(ArcHelper.cloneHexTick..":"..GameRules.GetGameTime()) - if GameRules.GetGameTime() > ArcHelper.cloneHexTick then + if GameRules.GetGameTime() > ArcHelper.cloneHexTick then Ability.CastTarget(hex,ArcHelper.cloneAttackingTarget) return - end - end + end + end if bloodthorn and Ability.IsReady(bloodthorn) and (not NPC.IsSilenced(ArcHelper.cloneAttackingTarget) or NPC.HasModifier(ArcHelper.cloneAttackingTarget, "modifier_sheepstick_debuff") and ArcHelper.useOrchidDuringHex) then Ability.CastTarget(bloodthorn,ArcHelper.cloneAttackingTarget) - end + end if orchid and Ability.IsReady(orchid) and (not NPC.IsSilenced(ArcHelper.cloneAttackingTarget) or NPC.HasModifier(ArcHelper.cloneAttackingTarget, "modifier_sheepstick_debuff") and ArcHelper.useOrchidDuringHex) then Ability.CastTarget(orchid,ArcHelper.cloneAttackingTarget) - end + end if mjollnir and Ability.IsReady(mjollnir) then ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 Ability.CastTarget(mjollnir,ArcHelper.clone) return - end + end if Ability.IsReady(flux) then ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 Ability.CastTarget(flux,ArcHelper.cloneAttackingTarget) Log.Write("flux") return - end + end if Ability.IsReady(spark) then ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 Ability.CastPosition(spark,ArcHelper.PredictPosition(ArcHelper.cloneAttackingTarget)) @@ -546,22 +546,22 @@ function ArcHelper.cloneAttack() pos:SetX(pos:GetX()/2) pos:SetY(pos:GetY()/2) pos:SetZ(pos:GetZ()/2) - end + end Ability.CastPosition(magnetic,pos) return - end - Player.AttackTarget(Players.GetLocal(), ArcHelper.clone, ArcHelper.cloneAttackingTarget) + end + Player.AttackTarget(Players.GetLocal(), ArcHelper.clone, ArcHelper.cloneAttackingTarget) ArcHelper.cloneTick = GameRules.GetGameTime() + NPC.GetAttackTime(myHero)/2 - end - end + end + end end function ArcHelper.OnDraw() if not Menu.IsEnabled(ArcHelper.optionEnable) then return end if not Engine.IsInGame() then ArcHelper.init() - return - end + return + end local myHero = Heroes.GetLocal() -- local modifiers = NPC.GetModifiers(myHero) @@ -571,10 +571,10 @@ function ArcHelper.OnDraw() -- end ArcHelper.DrawCloneMidasMsg() ArcHelper.DrawCloneSwitchMsg() -end +end function ArcHelper.useDagger(myHero, dagger, vector) - if dagger == nill or not Ability.IsReady(dagger) then return end + if dagger == nill or not Ability.IsReady(dagger) then return end local dir = vector - NPC.GetAbsOrigin(myHero) dir:SetZ(0) dir:Normalize() @@ -585,12 +585,12 @@ function ArcHelper.useDagger(myHero, dagger, vector) end function ArcHelper.useMidas(myHero) - if not myHero or not Entity.IsAlive(myHero) then return end - if NPC.HasModifier(myHero,"modifier_item_silver_edge_windwalk") or NPC.HasModifier(myHero,"modifier_item_invisibility_edge_windwalk") then return end + if not myHero or not Entity.IsAlive(myHero) then return end + if NPC.HasModifier(myHero,"modifier_item_silver_edge_windwalk") or NPC.HasModifier(myHero,"modifier_item_invisibility_edge_windwalk") then return end local midas = NPC.GetItem(myHero, "item_hand_of_midas") - if not midas then return end + if not midas then return end for i= 1, NPCs.Count() do - local entity = NPCs.Get(i) + local entity = NPCs.Get(i) if ArcHelper.isMidasableCreep(myHero, entity) and Ability.IsReady(midas) then Ability.CastTarget(midas, entity) return @@ -599,16 +599,16 @@ function ArcHelper.useMidas(myHero) end function ArcHelper.isMidasableCreep(myHero, entity) - if entity and - not Entity.IsSameTeam(myHero, entity) - and (NPC.IsCreep(entity) - or NPC.IsLaneCreep(entity) - or NPC.IsNeutral(entity)) - and not NPC.IsAncient(entity) + if entity and + not Entity.IsSameTeam(myHero, entity) + and (NPC.IsCreep(entity) + or NPC.IsLaneCreep(entity) + or NPC.IsNeutral(entity)) + and not NPC.IsAncient(entity) and NPC.IsEntityInRange(myHero, entity, 1000) then local name = NPC.GetUnitName(entity) local w, h = Renderer.GetScreenSize() - if name == "npc_dota_neutral_black_dragon" + if name == "npc_dota_neutral_black_dragon" or name == "npc_dota_neutral_black_drake" or name == "npc_dota_neutral_black_dragon" or name == "npc_dota_neutral_blue_dragonspawn_sorcerer" @@ -625,19 +625,19 @@ function ArcHelper.isMidasableCreep(myHero, entity) return false end return true - end + end return false end function ArcHelper.calculateHits(myHero, enemy) - if not myHero or not enemy then return end + if not myHero or not enemy then return end local trueDamage = NPC.GetDamageMultiplierVersus(myHero, enemy) * (NPC.GetTrueDamage(myHero) * NPC.GetArmorDamageMultiplier(enemy)) local pos = NPC.GetAbsOrigin(enemy) local x, y, visible = Renderer.WorldToScreen(pos) local healthLeft = Entity.GetHealth(enemy) local hitCount = math.ceil(healthLeft/trueDamage) return hitCount -end +end function ArcHelper.isTarget(source,target, range) local angle = Entity.GetRotation(source) @@ -652,23 +652,25 @@ function ArcHelper.isTarget(source,target, range) local origin = Entity.GetAbsOrigin(source) local pointsNum = math.floor(range/55) + 1 - for i = pointsNum,1,-1 do + for i = pointsNum,1,-1 do direction:Normalize() direction:Scale(50*(i-1)) local pos = direction + origin - if NPC.IsPositionInRange(target, pos, radius + NPC.GetHullRadius(target), 0) then - return true + if NPC.IsPositionInRange(target, pos, radius + NPC.GetHullRadius(target), 0) then + return true end - end + end return false -end +end function ArcHelper.DrawCloneMidasMsg() - if not ArcHelper.clone then return end + if not ArcHelper.clone then return end local midas = NPC.GetItem(ArcHelper.clone, "item_hand_of_midas") local bot = NPC.GetItem(ArcHelper.clone, "item_travel_boots") + local bot2 = NPC.GetItem(ArcHelper.clone, "item_travel_boots_2") + if bot2 then bot = bot2 end local w, h = Renderer.GetScreenSize() - + if midas then Renderer.DrawTextCentered(ArcHelper.font, w-200, 100, "Midas:"..math.floor(Ability.GetCooldownTimeLeft(midas)), 1) end @@ -676,48 +678,48 @@ function ArcHelper.DrawCloneMidasMsg() if bot then Renderer.DrawTextCentered(ArcHelper.font, w-200, 150, "Bot:"..math.floor(Ability.GetCooldownTimeLeft(bot)), 1) end -end +end function ArcHelper.DrawCloneSwitchMsg() - if not ArcHelper.clone then return end - if not Entity.IsAlive(ArcHelper.clone) then return end + if not ArcHelper.clone then return end + if not Entity.IsAlive(ArcHelper.clone) then return end local w, h = Renderer.GetScreenSize() Renderer.SetDrawColor(255, 0, 255) if ArcHelper.cloneAttacking then Renderer.DrawTextCentered(ArcHelper.font, w / 2, h / 2 + 300, "ON", 1) - else + else Renderer.DrawTextCentered(ArcHelper.font, w / 2, h / 2 + 300, "OFF", 1) end if ArcHelper.clonePushing then Renderer.DrawTextCentered(ArcHelper.font, w / 2, h / 2 + 350, "PUSHING", 1) end - if ArcHelper.useHurrican then + if ArcHelper.useHurrican then Renderer.DrawTextCentered(ArcHelper.font, w / 2, h / 2 + 400, "Use Hurrican", 1) - end - -- if ArcHelper.dummy then + end + -- if ArcHelper.dummy then -- local x, y, vis = Renderer.WorldToScreen(Entity.GetAbsOrigin(ArcHelper.dummy)) -- local x1, y1, vis1 = Renderer.WorldToScreen(ArcHelper.enemyFountain) -- Renderer.DrawLine(x, y, x1, y1) -- Renderer.DrawTextCentered(ArcHelper.font, x, y, "CREEP", 1) - -- end + -- end - -- if ArcHelper.enemyFountain then + -- if ArcHelper.enemyFountain then -- local x, y, vis = Renderer.WorldToScreen(Entity.GetAbsOrigin(ArcHelper.clone)) -- local x1, y1, vis1 = Renderer.WorldToScreen(ArcHelper.enemyFountain) -- Renderer.DrawLine(x, y, x1, y1) -- Renderer.DrawTextCentered(ArcHelper.font, x1, y1, "Fountain", 1) - -- end + -- end -end +end function ArcHelper.PredictPosition(enemy) if NPC.IsRunning(enemy) then return ArcHelper.processHero(enemy, 2.3) - end - + end + return NPC.GetAbsOrigin(enemy) -end +end function ArcHelper.processHero(enemy, duration) local speed = NPC.GetMoveSpeed(enemy) @@ -733,5 +735,5 @@ function ArcHelper.processHero(enemy, duration) local origin = NPC.GetAbsOrigin(enemy) return origin + direction -end +end return ArcHelper From af8557f77291e0b9853ea86c9983e3fd2caa7358 Mon Sep 17 00:00:00 2001 From: Artem Skripka Date: Tue, 29 Aug 2017 13:08:41 +0400 Subject: [PATCH 4/9] bump version --- ArcWardenHelper.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArcWardenHelper.lua b/ArcWardenHelper.lua index dc7ab86..f2ebd70 100644 --- a/ArcWardenHelper.lua +++ b/ArcWardenHelper.lua @@ -1,4 +1,4 @@ --- Version 1.09 +-- Version 1.10.1 local ArcHelper= {} ArcHelper.optionEnable = Menu.AddOption({ "Hero Specific","Arc Warden"}, "Enable", "Arc Warden Help Script") ArcHelper.optionKey = Menu.AddKeyOption({ "Hero Specific","Arc Warden"}, "Clone Combo", Enum.ButtonCode.KEY_P) From 34280cb8677053367350792413b52f4d3f9aaeb9 Mon Sep 17 00:00:00 2001 From: Arty Date: Thu, 31 Aug 2017 20:50:58 +0400 Subject: [PATCH 5/9] auto diffusal blade for clone v1.11 --- ArcWardenHelper.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/ArcWardenHelper.lua b/ArcWardenHelper.lua index f2ebd70..e89c8df 100644 --- a/ArcWardenHelper.lua +++ b/ArcWardenHelper.lua @@ -1,10 +1,11 @@ --- Version 1.10.1 +-- Version 1.11 local ArcHelper= {} ArcHelper.optionEnable = Menu.AddOption({ "Hero Specific","Arc Warden"}, "Enable", "Arc Warden Help Script") ArcHelper.optionKey = Menu.AddKeyOption({ "Hero Specific","Arc Warden"}, "Clone Combo", Enum.ButtonCode.KEY_P) ArcHelper.optionMainKey = Menu.AddKeyOption({ "Hero Specific","Arc Warden"}, "Main Hero Combo", Enum.ButtonCode.KEY_P) ArcHelper.pushKey = Menu.AddKeyOption({ "Hero Specific","Arc Warden"}, "Clone Push", Enum.ButtonCode.KEY_P) ArcHelper.useHurricanKey = Menu.AddKeyOption({ "Hero Specific","Arc Warden"}, "Use Hurrican", Enum.ButtonCode.KEY_C) +ArcHelper.optionUseCloneDiffusalBlade = Menu.AddOption({ "Hero Specific","Arc Warden"}, "Auto Use Clone Diffusal Blade", "Arc Warden Help Script") ArcHelper.optionAutoUseCloneMidas = Menu.AddOption({ "Hero Specific","Arc Warden"}, "Auto Use Clone Midas", "Arc Warden Help Script") ArcHelper.cache = {} @@ -152,6 +153,7 @@ function ArcHelper.autoDefend(myHero) local bloodthorn = NPC.GetItem(myHero,"item_bloodthorn") local hex = NPC.GetItem(myHero, "item_sheepstick") local hurrican = NPC.GetItem(myHero,"item_hurricane_pike") + if not orchid and not bloodthorn and not hex and not hurrican then return end for i= 1, Heroes.Count() do local enemy = Heroes.Get(i) @@ -418,7 +420,11 @@ function ArcHelper.cloneAttack() local invisible_candidate_blade = shadowblade local hurrican = NPC.GetItem(ArcHelper.clone,"item_hurricane_pike") local dragon_lance = NPC.GetItem(ArcHelper.clone,"item_dragon_lance") + local diffusal1 = NPC.GetItem(ArcHelper.clone,"item_diffusal_blade") + local diffusal2 = NPC.GetItem(ArcHelper.clone,"item_diffusal_blade_2") + local diffusal = (Menu.IsEnabled(ArcHelper.optionUseCloneDiffusalBlade) and diffusal1 or diffusal2 or nil) + if diffusal and Item.GetCurrentCharges(diffusal) == 0 then diffusal = nil end local myRange = NPC.GetAttackRange(ArcHelper.clone) if dragon_lance or hurrican then @@ -471,6 +477,7 @@ function ArcHelper.cloneAttack() return end end + if NPC.HasModifier(ArcHelper.clone,"modifier_item_silver_edge_windwalk") or NPC.HasModifier(ArcHelper.clone,"modifier_item_invisibility_edge_windwalk") then if NPC.IsEntityInRange(ArcHelper.cloneAttackingTarget, ArcHelper.clone, 700) then Player.AttackTarget(Players.GetLocal(), ArcHelper.clone, ArcHelper.cloneAttackingTarget) @@ -483,12 +490,22 @@ function ArcHelper.cloneAttack() return end + if diffusal and Ability.IsReady(diffusal) and not NPC.HasModifier(ArcHelper.cloneAttackingTarget, "modifier_item_diffusal_blade_slow") and + not NPC.HasModifier(ArcHelper.cloneAttackingTarget, "modifier_sheepstick_debuff") and not NPC.IsStunned(ArcHelper.cloneAttackingTarget)then + + Log.Write("diffu") + ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 + Ability.CastTarget(diffusal,ArcHelper.cloneAttackingTarget) + return + end + if hurrican and Ability.IsReady(hurrican) and ArcHelper.isTarget(ArcHelper.clone,ArcHelper.cloneAttackingTarget, 1800) and not NPC.IsEntityInRange(ArcHelper.cloneAttackingTarget, ArcHelper.clone, 500) and ArcHelper.useHurrican then ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 Ability.CastTarget(hurrican,ArcHelper.clone) return end + if hex and Ability.IsReady(hex) and not NPC.HasModifier(ArcHelper.cloneAttackingTarget, "modifier_sheepstick_debuff") and not NPC.IsStunned(ArcHelper.cloneAttackingTarget) then Ability.CastTarget(hex,ArcHelper.cloneAttackingTarget) Log.Write("hex1") From bd2916b2a1b273910049f64f887f94c35fe58d83 Mon Sep 17 00:00:00 2001 From: Arty Date: Mon, 4 Sep 2017 04:35:52 +0400 Subject: [PATCH 6/9] Add mana check for abilities --- ArcWardenHelper.lua | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/ArcWardenHelper.lua b/ArcWardenHelper.lua index e89c8df..29cae56 100644 --- a/ArcWardenHelper.lua +++ b/ArcWardenHelper.lua @@ -1,4 +1,4 @@ --- Version 1.11 +-- Version 1.12 local ArcHelper= {} ArcHelper.optionEnable = Menu.AddOption({ "Hero Specific","Arc Warden"}, "Enable", "Arc Warden Help Script") ArcHelper.optionKey = Menu.AddKeyOption({ "Hero Specific","Arc Warden"}, "Clone Combo", Enum.ButtonCode.KEY_P) @@ -464,14 +464,14 @@ function ArcHelper.cloneAttack() return end - if invisible_candidate_blade and Ability.IsReady(invisible_candidate_blade) then + if invisible_candidate_blade and Ability.IsReady(invisible_candidate_blade) and ArcHelper.isEnougthMana(ArcHelper.clone, invisible_candidate_blade) then Ability.CastNoTarget(invisible_candidate_blade) ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 return end if NPC.IsLinkensProtected(ArcHelper.cloneAttackingTarget) then - if Ability.IsReady(flux) then + if Ability.IsReady(flux) and ArcHelper.isEnougthMana(ArcHelper.clone, flux) then ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 Ability.CastTarget(flux,ArcHelper.cloneAttackingTarget) return @@ -499,21 +499,27 @@ function ArcHelper.cloneAttack() return end - if hurrican and Ability.IsReady(hurrican) and ArcHelper.isTarget(ArcHelper.clone,ArcHelper.cloneAttackingTarget, 1800) and not NPC.IsEntityInRange(ArcHelper.cloneAttackingTarget, ArcHelper.clone, 500) and ArcHelper.useHurrican then + if hurrican and Ability.IsReady(hurrican) and ArcHelper.isTarget(ArcHelper.clone,ArcHelper.cloneAttackingTarget, 1800) + and not NPC.IsEntityInRange(ArcHelper.cloneAttackingTarget, ArcHelper.clone, 500) and ArcHelper.useHurrican then + ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 Ability.CastTarget(hurrican,ArcHelper.clone) return end - if hex and Ability.IsReady(hex) and not NPC.HasModifier(ArcHelper.cloneAttackingTarget, "modifier_sheepstick_debuff") and not NPC.IsStunned(ArcHelper.cloneAttackingTarget) then + if hex and Ability.IsReady(hex) and not NPC.HasModifier(ArcHelper.cloneAttackingTarget, "modifier_sheepstick_debuff") + and not NPC.IsStunned(ArcHelper.cloneAttackingTarget) then + Ability.CastTarget(hex,ArcHelper.cloneAttackingTarget) Log.Write("hex1") ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 return end - if hex and Ability.IsReady(hex) and NPC.HasModifier(ArcHelper.cloneAttackingTarget, "modifier_sheepstick_debuff") then + if hex and Ability.IsReady(hex) and NPC.HasModifier(ArcHelper.cloneAttackingTarget, "modifier_sheepstick_debuff") + and ArcHelper.isEnougthMana(ArcHelper.clone, hex) then + Log.Write("hex2") local modifier = NPC.GetModifier(ArcHelper.cloneAttackingTarget, "modifier_sheepstick_debuff") ArcHelper.cloneHexTick = Modifier.GetCreationTime(modifier) + 3.35 @@ -537,13 +543,13 @@ function ArcHelper.cloneAttack() return end - if Ability.IsReady(flux) then + if Ability.IsReady(flux) and ArcHelper.isEnougthMana(ArcHelper.clone, flux) then ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 Ability.CastTarget(flux,ArcHelper.cloneAttackingTarget) Log.Write("flux") return end - if Ability.IsReady(spark) then + if Ability.IsReady(spark) and ArcHelper.isEnougthMana(ArcHelper.clone, spark) then ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 Ability.CastPosition(spark,ArcHelper.PredictPosition(ArcHelper.cloneAttackingTarget)) Log.Write("spark") @@ -555,7 +561,11 @@ function ArcHelper.cloneAttack() main_magnetic = NPC.GetAbilityByIndex(myHero, 1) end - if Ability.IsReady(magnetic) and not NPC.HasModifier(ArcHelper.clone, "modifier_arc_warden_magnetic_field") and NPC.IsEntityInRange(ArcHelper.cloneAttackingTarget, ArcHelper.clone, myRange) and not Ability.IsInAbilityPhase(main_magnetic) then + if Ability.IsReady(magnetic) and not NPC.HasModifier(ArcHelper.clone, "modifier_arc_warden_magnetic_field") + and NPC.IsEntityInRange(ArcHelper.cloneAttackingTarget, ArcHelper.clone, myRange) + and not Ability.IsInAbilityPhase(main_magnetic) + and ArcHelper.isEnougthMana(ArcHelper.clone, magnetic) then + ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 local pos = Entity.GetAbsOrigin(ArcHelper.clone) if NPC.IsEntityInRange(myHero, ArcHelper.clone, 270*2) then @@ -729,7 +739,6 @@ function ArcHelper.DrawCloneSwitchMsg() end - function ArcHelper.PredictPosition(enemy) if NPC.IsRunning(enemy) then return ArcHelper.processHero(enemy, 2.3) @@ -753,4 +762,9 @@ function ArcHelper.processHero(enemy, duration) local origin = NPC.GetAbsOrigin(enemy) return origin + direction end + +function ArcHelper.isEnougthMana(myHero, ability) + return NPC.GetMana(myHero) > Ability.GetManaCost(ability) +end + return ArcHelper From 6b7756ae2a3489b4976159cd938540945d8c6c14 Mon Sep 17 00:00:00 2001 From: Arty Date: Mon, 4 Sep 2017 16:42:41 +0400 Subject: [PATCH 7/9] add manacheck for all clone abilities --- ArcWardenHelper.lua | 45 +++++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/ArcWardenHelper.lua b/ArcWardenHelper.lua index 29cae56..2c52242 100644 --- a/ArcWardenHelper.lua +++ b/ArcWardenHelper.lua @@ -464,7 +464,9 @@ function ArcHelper.cloneAttack() return end - if invisible_candidate_blade and Ability.IsReady(invisible_candidate_blade) and ArcHelper.isEnougthMana(ArcHelper.clone, invisible_candidate_blade) then + if invisible_candidate_blade + and Ability.IsReady(invisible_candidate_blade) + and ArcHelper.isEnougthMana(ArcHelper.clone, invisible_candidate_blade) then Ability.CastNoTarget(invisible_candidate_blade) ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 return @@ -478,7 +480,9 @@ function ArcHelper.cloneAttack() end end - if NPC.HasModifier(ArcHelper.clone,"modifier_item_silver_edge_windwalk") or NPC.HasModifier(ArcHelper.clone,"modifier_item_invisibility_edge_windwalk") then + if NPC.HasModifier(ArcHelper.clone,"modifier_item_silver_edge_windwalk") + or NPC.HasModifier(ArcHelper.clone,"modifier_item_invisibility_edge_windwalk") then + if NPC.IsEntityInRange(ArcHelper.cloneAttackingTarget, ArcHelper.clone, 700) then Player.AttackTarget(Players.GetLocal(), ArcHelper.clone, ArcHelper.cloneAttackingTarget) ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 @@ -490,8 +494,10 @@ function ArcHelper.cloneAttack() return end - if diffusal and Ability.IsReady(diffusal) and not NPC.HasModifier(ArcHelper.cloneAttackingTarget, "modifier_item_diffusal_blade_slow") and - not NPC.HasModifier(ArcHelper.cloneAttackingTarget, "modifier_sheepstick_debuff") and not NPC.IsStunned(ArcHelper.cloneAttackingTarget)then + if diffusal and Ability.IsReady(diffusal) + and not NPC.HasModifier(ArcHelper.cloneAttackingTarget, "modifier_item_diffusal_blade_slow") and + not NPC.HasModifier(ArcHelper.cloneAttackingTarget, "modifier_sheepstick_debuff") + and not NPC.IsStunned(ArcHelper.cloneAttackingTarget) then Log.Write("diffu") ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 @@ -499,8 +505,11 @@ function ArcHelper.cloneAttack() return end - if hurrican and Ability.IsReady(hurrican) and ArcHelper.isTarget(ArcHelper.clone,ArcHelper.cloneAttackingTarget, 1800) - and not NPC.IsEntityInRange(ArcHelper.cloneAttackingTarget, ArcHelper.clone, 500) and ArcHelper.useHurrican then + if hurrican and Ability.IsReady(hurrican) + and ArcHelper.isEnougthMana(ArcHelper.clone, hurrican) + and ArcHelper.isTarget(ArcHelper.clone,ArcHelper.cloneAttackingTarget, 1800) + and not NPC.IsEntityInRange(ArcHelper.cloneAttackingTarget, ArcHelper.clone, 500) + and ArcHelper.useHurrican then ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 Ability.CastTarget(hurrican,ArcHelper.clone) @@ -508,7 +517,9 @@ function ArcHelper.cloneAttack() end - if hex and Ability.IsReady(hex) and not NPC.HasModifier(ArcHelper.cloneAttackingTarget, "modifier_sheepstick_debuff") + if hex and Ability.IsReady(hex) + and ArcHelper.isEnougthMana(ArcHelper.clone, hex) + and not NPC.HasModifier(ArcHelper.cloneAttackingTarget, "modifier_sheepstick_debuff") and not NPC.IsStunned(ArcHelper.cloneAttackingTarget) then Ability.CastTarget(hex,ArcHelper.cloneAttackingTarget) @@ -517,7 +528,9 @@ function ArcHelper.cloneAttack() return end - if hex and Ability.IsReady(hex) and NPC.HasModifier(ArcHelper.cloneAttackingTarget, "modifier_sheepstick_debuff") + if hex and Ability.IsReady(hex) + and ArcHelper.isEnougthMana(ArcHelper.clone, hex) + and NPC.HasModifier(ArcHelper.cloneAttackingTarget, "modifier_sheepstick_debuff") and ArcHelper.isEnougthMana(ArcHelper.clone, hex) then Log.Write("hex2") @@ -530,14 +543,21 @@ function ArcHelper.cloneAttack() end end - if bloodthorn and Ability.IsReady(bloodthorn) and (not NPC.IsSilenced(ArcHelper.cloneAttackingTarget) or NPC.HasModifier(ArcHelper.cloneAttackingTarget, "modifier_sheepstick_debuff") and ArcHelper.useOrchidDuringHex) then + if bloodthorn and Ability.IsReady(bloodthorn) + and ArcHelper.isEnougthMana(ArcHelper.clone, bloodthorn) + and (not NPC.IsSilenced(ArcHelper.cloneAttackingTarget) or NPC.HasModifier(ArcHelper.cloneAttackingTarget, "modifier_sheepstick_debuff") and ArcHelper.useOrchidDuringHex) then + Ability.CastTarget(bloodthorn,ArcHelper.cloneAttackingTarget) end - if orchid and Ability.IsReady(orchid) and (not NPC.IsSilenced(ArcHelper.cloneAttackingTarget) or NPC.HasModifier(ArcHelper.cloneAttackingTarget, "modifier_sheepstick_debuff") and ArcHelper.useOrchidDuringHex) then + + if orchid and Ability.IsReady(orchid) + and ArcHelper.isEnougthMana(ArcHelper.clone, orchid) + and (not NPC.IsSilenced(ArcHelper.cloneAttackingTarget) or NPC.HasModifier(ArcHelper.cloneAttackingTarget, "modifier_sheepstick_debuff") and ArcHelper.useOrchidDuringHex) then + Ability.CastTarget(orchid,ArcHelper.cloneAttackingTarget) end - if mjollnir and Ability.IsReady(mjollnir) then + if mjollnir and Ability.IsReady(mjollnir) and ArcHelper.isEnougthMana(ArcHelper.clone, mjolnir) then ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 Ability.CastTarget(mjollnir,ArcHelper.clone) return @@ -561,7 +581,8 @@ function ArcHelper.cloneAttack() main_magnetic = NPC.GetAbilityByIndex(myHero, 1) end - if Ability.IsReady(magnetic) and not NPC.HasModifier(ArcHelper.clone, "modifier_arc_warden_magnetic_field") + if Ability.IsReady(magnetic) + and not NPC.HasModifier(ArcHelper.clone, "modifier_arc_warden_magnetic_field") and NPC.IsEntityInRange(ArcHelper.cloneAttackingTarget, ArcHelper.clone, myRange) and not Ability.IsInAbilityPhase(main_magnetic) and ArcHelper.isEnougthMana(ArcHelper.clone, magnetic) then From 422b25b01e951d16a6185ef31efacfc109c8a2fc Mon Sep 17 00:00:00 2001 From: Arty Date: Tue, 5 Sep 2017 19:26:31 +0400 Subject: [PATCH 8/9] Update ArcWardenHelper.lua --- ArcWardenHelper.lua | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/ArcWardenHelper.lua b/ArcWardenHelper.lua index 2c52242..d8e01f1 100644 --- a/ArcWardenHelper.lua +++ b/ArcWardenHelper.lua @@ -1,12 +1,14 @@ --- Version 1.12 +-- Version 1.13 local ArcHelper= {} ArcHelper.optionEnable = Menu.AddOption({ "Hero Specific","Arc Warden"}, "Enable", "Arc Warden Help Script") -ArcHelper.optionKey = Menu.AddKeyOption({ "Hero Specific","Arc Warden"}, "Clone Combo", Enum.ButtonCode.KEY_P) -ArcHelper.optionMainKey = Menu.AddKeyOption({ "Hero Specific","Arc Warden"}, "Main Hero Combo", Enum.ButtonCode.KEY_P) -ArcHelper.pushKey = Menu.AddKeyOption({ "Hero Specific","Arc Warden"}, "Clone Push", Enum.ButtonCode.KEY_P) -ArcHelper.useHurricanKey = Menu.AddKeyOption({ "Hero Specific","Arc Warden"}, "Use Hurrican", Enum.ButtonCode.KEY_C) -ArcHelper.optionUseCloneDiffusalBlade = Menu.AddOption({ "Hero Specific","Arc Warden"}, "Auto Use Clone Diffusal Blade", "Arc Warden Help Script") -ArcHelper.optionAutoUseCloneMidas = Menu.AddOption({ "Hero Specific","Arc Warden"}, "Auto Use Clone Midas", "Arc Warden Help Script") +ArcHelper.optionKey = Menu.AddKeyOption({ "Hero Specific","Arc Warden", "Hotkeys"}, "Clone Combo", Enum.ButtonCode.KEY_P) +ArcHelper.optionStopCloneAttackKey = Menu.AddKeyOption({ "Hero Specific","Arc Warden", "Hotkeys"}, "Stop clone attacking", Enum.ButtonCode.KEY_P) +ArcHelper.optionMainKey = Menu.AddKeyOption({ "Hero Specific","Arc Warden", "Hotkeys"}, "Main Hero Combo", Enum.ButtonCode.KEY_P) +ArcHelper.pushKey = Menu.AddKeyOption({ "Hero Specific","Arc Warden", "Hotkeys"}, "Clone Push", Enum.ButtonCode.KEY_P) + +ArcHelper.useHurricanKey = Menu.AddKeyOption({ "Hero Specific","Arc Warden", "Items Usage"}, "Use Hurrican", Enum.ButtonCode.KEY_C) +ArcHelper.optionUseCloneDiffusalBlade = Menu.AddOption({ "Hero Specific","Arc Warden", "Items Usage"}, "Auto Use Clone Diffusal Blade", "Arc Warden Help Script") +ArcHelper.optionAutoUseCloneMidas = Menu.AddOption({ "Hero Specific","Arc Warden", "Items Usage"}, "Auto Use Clone Midas", "Arc Warden Help Script") ArcHelper.cache = {} @@ -60,6 +62,11 @@ function ArcHelper.OnUpdate() ArcHelper.mainAttack() end end + + if Menu.IsKeyDown(ArcHelper.optionStopCloneAttackKey) then + ArcHelper.cloneAttacking = false + Player.HoldPosition(Players.GetLocal(), ArcHelper.clone, queue) + end -- if not ArcHelper.enemyFountain then -- local enemyTeamNum =2 @@ -557,8 +564,9 @@ function ArcHelper.cloneAttack() Ability.CastTarget(orchid,ArcHelper.cloneAttackingTarget) end - if mjollnir and Ability.IsReady(mjollnir) and ArcHelper.isEnougthMana(ArcHelper.clone, mjolnir) then + if mjollnir and Ability.IsReady(mjollnir) and ArcHelper.isEnougthMana(ArcHelper.clone, mjollnir) then ArcHelper.cloneTick = GameRules.GetGameTime() + 0.1 + Log.Write("clone mjolnir") Ability.CastTarget(mjollnir,ArcHelper.clone) return end @@ -731,6 +739,7 @@ end function ArcHelper.DrawCloneSwitchMsg() if not ArcHelper.clone then return end if not Entity.IsAlive(ArcHelper.clone) then return end + local pike = NPC.GetItem(ArcHelper.clone, "item_hurricane_pike") local w, h = Renderer.GetScreenSize() Renderer.SetDrawColor(255, 0, 255) if ArcHelper.cloneAttacking then @@ -741,7 +750,7 @@ function ArcHelper.DrawCloneSwitchMsg() if ArcHelper.clonePushing then Renderer.DrawTextCentered(ArcHelper.font, w / 2, h / 2 + 350, "PUSHING", 1) end - if ArcHelper.useHurrican then + if pike and ArcHelper.useHurrican then Renderer.DrawTextCentered(ArcHelper.font, w / 2, h / 2 + 400, "Use Hurrican", 1) end -- if ArcHelper.dummy then From c2cc281721fb43e1609f4307f85bacdb409b6528 Mon Sep 17 00:00:00 2001 From: Arty Date: Tue, 5 Sep 2017 20:40:03 +0400 Subject: [PATCH 9/9] Enable/disable autodefend Add option to enable/disable clone autodefend: autouse of hex/orchid/bloodthorn on blinked enemies --- ArcWardenHelper.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ArcWardenHelper.lua b/ArcWardenHelper.lua index d8e01f1..a011261 100644 --- a/ArcWardenHelper.lua +++ b/ArcWardenHelper.lua @@ -1,4 +1,4 @@ --- Version 1.13 +-- Version 1.14 local ArcHelper= {} ArcHelper.optionEnable = Menu.AddOption({ "Hero Specific","Arc Warden"}, "Enable", "Arc Warden Help Script") ArcHelper.optionKey = Menu.AddKeyOption({ "Hero Specific","Arc Warden", "Hotkeys"}, "Clone Combo", Enum.ButtonCode.KEY_P) @@ -9,6 +9,7 @@ ArcHelper.pushKey = Menu.AddKeyOption({ "Hero Specific","Arc Warden", "Hotkeys"} ArcHelper.useHurricanKey = Menu.AddKeyOption({ "Hero Specific","Arc Warden", "Items Usage"}, "Use Hurrican", Enum.ButtonCode.KEY_C) ArcHelper.optionUseCloneDiffusalBlade = Menu.AddOption({ "Hero Specific","Arc Warden", "Items Usage"}, "Auto Use Clone Diffusal Blade", "Arc Warden Help Script") ArcHelper.optionAutoUseCloneMidas = Menu.AddOption({ "Hero Specific","Arc Warden", "Items Usage"}, "Auto Use Clone Midas", "Arc Warden Help Script") +ArcHelper.optionAutoDefend = Menu.AddOption({ "Hero Specific","Arc Warden"}, "Clone autodefend", "Autoorchid/autohex etc.") ArcHelper.cache = {} @@ -410,7 +411,10 @@ end function ArcHelper.cloneAttack() if not ArcHelper.clone or not Entity.IsAlive(ArcHelper.clone) then return end - ArcHelper.autoDefend(ArcHelper.clone) + + if Menu.IsEnabled(ArcHelper.optionAutoDefend) then + ArcHelper.autoDefend(ArcHelper.clone) + end if GameRules.GetGameTime() < ArcHelper.cloneTick then return end local myHero = Heroes.GetLocal()