private void Game_OnGameUpdate(EventArgs args) { try { ObjectCache.myHeroCache.UpdateInfo(); CheckHeroInDanger(); if (isChanneling && channelPosition.LSDistance(ObjectCache.myHeroCache.serverPos2D) > 50 && !myHero.IsChannelingImportantSpell()) { isChanneling = false; } var limitDelay = ObjectCache.menuCache.cache["TickLimiter"].Cast <Slider>().CurrentValue; //Tick limiter if (EvadeHelper.fastEvadeMode || EvadeUtils.TickCount - lastTickCount > limitDelay && EvadeUtils.TickCount > lastStopEvadeTime) { DodgeSkillShots(); //walking ContinueLastBlockedCommand(); lastTickCount = EvadeUtils.TickCount; } EvadeSpell.UseEvadeSpell(); //using spells CheckDodgeOnlyDangerous(); RecalculatePath(); } catch (Exception e) { Console.WriteLine(e); } }
private void Game_OnGameUpdate(EventArgs args) { try { if (Evade.GetTickCount() < lastTickCount) { Game.PrintChat("Time Error"); //lastTickCount = Evade.GetTickCount(); } CheckHeroInDanger(); ContinueLastBlockedCommand(); if (isChanneling && channelPosition.Distance(myHero.ServerPosition.To2D()) > 50) { isChanneling = false; } var limitDelay = Evade.menu.Item("TickLimiter").GetValue <Slider>().Value; //Tick limiter if (Evade.GetTickCount() - lastTickCount > limitDelay && Evade.GetTickCount() > lastStopEvadeTime) { DodgeSkillShots(); //walking EvadeSpell.UseEvadeSpell(); //using spells lastTickCount = Evade.GetTickCount(); } CheckDodgeOnlyDangerous(); } catch (Exception e) { Game.PrintChat(e.StackTrace); } }
private void SpellDetector_OnProcessDetectedSpells() { GameData.HeroInfo.UpdateInfo(); if (!ConfigValue.DodgeSkillShots.GetBool()) { LastPosInfo = PositionInfo.SetAllUndodgeable(); EvadeSpell.UseEvadeSpell(); return; } if (GameData.HeroInfo.ServerPos2D.CheckDangerousPos(0) || GameData.HeroInfo.ServerPos2DExtra.CheckDangerousPos(0)) { if (EvadeSpell.PreferEvadeSpell()) { LastPosInfo = PositionInfo.SetAllUndodgeable(); } else { var calculationTimer = EvadeUtils.TickCount; var posInfo = EvadeHelper.GetBestPosition(); var caculationTime = EvadeUtils.TickCount - calculationTimer; if (NumCalculationTime > 0) { SumCalculationTime += caculationTime; AvgCalculationTime = SumCalculationTime / NumCalculationTime; } NumCalculationTime += 1; //ConsoleDebug.WriteLine("CalculationTime: " + caculationTime); /*if (EvadeHelper.GetHighestDetectedSpellID() > EvadeHelper.GetHighestSpellID(posInfo)) * { * return; * }*/ if (posInfo != null) { LastPosInfo = posInfo.CompareLastMovePos(); var travelTime = GameData.HeroInfo.ServerPos2DPing.Distance(LastPosInfo.Position) / GameData.MyHero.MoveSpeed; LastPosInfo.EndTime = EvadeUtils.TickCount + travelTime * 1000 - 100; } CheckHeroInDanger(); DodgeSkillShots(); //walking CheckLastMoveTo(); EvadeSpell.UseEvadeSpell(); //using spells } } else { LastPosInfo = PositionInfo.SetAllDodgeable(); CheckLastMoveTo(); } //ConsoleDebug.WriteLine("SkillsDodged: " + lastPosInfo.dodgeableSpells.Count + " DangerLevel: " + lastPosInfo.undodgeableSpells.Count); }
private void Game_OnGameUpdate(EventArgs args) { ObjectCache.myHeroCache.UpdateInfo(); CheckHeroInDanger(); if (isChanneling && channelPosition.LSDistance(ObjectCache.myHeroCache.serverPos2D) > 50 ) //TODO: !myHero.IsChannelingImportantSpell() { isChanneling = false; } var limitDelay = ObjectCache.menuCache.cache["TickLimiter"].Cast <Slider>().CurrentValue; //Tick limiter if (EvadeUtils.TickCount - lastTickCount > limitDelay && EvadeUtils.TickCount > lastStopEvadeTime && ObjectCache.menuCache.cache["DodgeSkillShots"].Cast <KeyBind>().CurrentValue) { DodgeSkillShots(); //walking ContinueLastBlockedCommand(); lastTickCount = EvadeUtils.TickCount; } if (ObjectCache.menuCache.cache["ActivateEvadeSpells"].Cast <KeyBind>().CurrentValue) { EvadeSpell.UseEvadeSpell(); //using spells } CheckDodgeOnlyDangerous(); RecalculatePath(); }
private void SpellDetector_OnProcessDetectedSpells() { ObjectCache.myHeroCache.UpdateInfo(); if (ObjectCache.menuCache.cache["DodgeSkillShots"].GetValue <KeyBind>().Active == false) { lastPosInfo = PositionInfo.SetAllUndodgeable(); EvadeSpell.UseEvadeSpell(); return; } if (ObjectCache.myHeroCache.serverPos2D.CheckDangerousPos(0) || ObjectCache.myHeroCache.serverPos2DExtra.CheckDangerousPos(0)) { if (EvadeSpell.PreferEvadeSpell()) { lastPosInfo = PositionInfo.SetAllUndodgeable(); } else { var calculationTimer = EvadeUtils.TickCount; var posInfo = EvadeHelper.GetBestPosition(); var caculationTime = EvadeUtils.TickCount - calculationTimer; if (numCalculationTime > 0) { sumCalculationTime += caculationTime; avgCalculationTime = sumCalculationTime / numCalculationTime; } numCalculationTime += 1; //Console.WriteLine("CalculationTime: " + caculationTime); /*if (EvadeHelper.GetHighestDetectedSpellID() > EvadeHelper.GetHighestSpellID(posInfo)) * { * return; * }*/ if (posInfo != null) { lastPosInfo = posInfo.CompareLastMovePos(); } CheckHeroInDanger(); DodgeSkillShots(); //walking CheckLastMoveTo(); EvadeSpell.UseEvadeSpell(); //using spells } } else { lastPosInfo = PositionInfo.SetAllDodgeable(); CheckLastMoveTo(); } //Console.WriteLine("SkillsDodged: " + lastPosInfo.dodgeableSpells.Count + " DangerLevel: " + lastPosInfo.undodgeableSpells.Count); }
private void Game_OnGameUpdate(EventArgs args) { try { CheckHeroInDanger(); CheckDodgeOnlyDangerous(); if (IsChanneling && ChannelPosition.Distance(GameData.HeroInfo.ServerPos2D) > 50) //TODO: !GameData.MyHero.IsChannelingImportantSpell() { IsChanneling = false; ConsoleDebug.WriteLineColor("Stopped Channeling.", ConsoleColor.Yellow); } //if (() Properties.Properties.Data["ResetConfig"].Cast<CheckBox>().CurrentValue) //{ // ResetConfig(); // menu["ResetConfig"].Cast<CheckBox>().CurrentValue = false; //} //if (() Properties.Properties.Data["ResetConfig200"].Cast<CheckBox>().CurrentValue) //{ // SetPatchConfig(); // menu["ResetConfig200"].Cast<CheckBox>().CurrentValue = false; //} var limitDelay = ConfigValue.TickLimiter.GetInt(); //Tick limiter if (EvadeUtils.TickCount - LastTickCount > limitDelay && EvadeUtils.TickCount > LastStopEvadeTime) { DodgeSkillShots(); //walking ContinueLastBlockedCommand(); LastTickCount = EvadeUtils.TickCount; } EvadeSpell.UseEvadeSpell(); //using spells RecalculatePath(); } catch (Exception e) { ConsoleDebug.WriteLine(e); } }
private void Game_OnGameUpdate(EventArgs args) { try { ObjectCache.myHeroCache.UpdateInfo(); CheckHeroInDanger(); if (isChanneling && channelPosition.Distance(ObjectCache.myHeroCache.serverPos2D) > 50 && !myHero.IsChannelingImportantSpell()) { isChanneling = false; } if (ObjectCache.menuCache.cache["ResetConfig"].GetValue <bool>()) { ResetConfig(); menu.Item("ResetConfig").SetValue(false); } if (ObjectCache.menuCache.cache["ResetConfig200"].GetValue <bool>()) { SetPatchConfig(); menu.Item("ResetConfig200").SetValue(false); } var limitDelay = ObjectCache.menuCache.cache["TickLimiter"].GetValue <Slider>().Value; //Tick limiter if (EvadeUtils.TickCount - lastTickCount > limitDelay && EvadeUtils.TickCount > lastStopEvadeTime) { DodgeSkillShots(); //walking ContinueLastBlockedCommand(); lastTickCount = EvadeUtils.TickCount; } EvadeSpell.UseEvadeSpell(); //using spells CheckDodgeOnlyDangerous(); } catch (Exception e) { Console.WriteLine(e); } }
private void SpellDetector_OnProcessDetectedSpells() { if (EvadeHelper.CheckDangerousPos(myHero.ServerPosition.To2D(), 0)) { if (Evade.menu.SubMenu("Main").Item("DodgeSkillShots").GetValue <KeyBind>().Active == false || EvadeSpell.PreferEvadeSpell()) { lastPosInfo = EvadeHelper.SetAllUndodgeable(); EvadeSpell.UseEvadeSpell(); //using spells } else { var posInfo = EvadeHelper.GetBestPosition(); /*if (EvadeHelper.GetHighestDetectedSpellID() > EvadeHelper.GetHighestSpellID(posInfo)) * { * return; * }*/ if (lastPosInfo != null && posInfo != null && lastPosInfo.posDangerCount < posInfo.posDangerCount) { return; } lastPosInfo = posInfo; CheckHeroInDanger(); DodgeSkillShots(); //walking EvadeSpell.UseEvadeSpell(); //using spells } } else { lastPosInfo = EvadeHelper.SetAllDodgeable(); } //Game.PrintChat("SkillsDodged: " + lastPosInfo.dodgeableSpells.Count + " DangerLevel: " + lastPosInfo.undodgeableSpells.Count); }
private void DodgeSkillShots() { if (!Situation.ShouldDodge()) { isDodging = false; return; } /* * if (isDodging && playerInDanger == false) //serverpos test * { * myHero.IssueOrder(GameObjectOrder.HoldPosition, myHero, false); * }*/ if (isDodging) { if (lastPosInfo != null) { /*foreach (KeyValuePair<int, Spell> entry in SpellDetector.spells) * { * Spell spell = entry.Value; * * Game.PrintChat("" + (int)(GetTickCount()-spell.startTime)); * }*/ Vector2 lastBestPosition = lastPosInfo.position; if (menu.SubMenu("MiscSettings").Item("RecalculatePosition").GetValue <bool>())//recheck path { var path = myHero.Path; if (path.Length > 0) { var movePos = path[path.Length - 1].To2D(); if (movePos.Distance(lastPosInfo.position) < 5) //more strict checking { var posInfo = EvadeHelper.CanHeroWalkToPos(movePos, myHero.MoveSpeed, 0, 0, false); if (EvadeHelper.isSamePosInfo(posInfo, lastPosInfo) && posInfo.posDangerCount > lastPosInfo.posDangerCount) { var newPosInfo = EvadeHelper.GetBestPosition(); if (newPosInfo.posDangerCount < posInfo.posDangerCount) { lastPosInfo = newPosInfo; CheckHeroInDanger(); } else if (EvadeSpell.PreferEvadeSpell()) { lastPosInfo = EvadeHelper.SetAllUndodgeable(); EvadeSpell.UseEvadeSpell(); //using spells) } } } } } EvadeCommand.MoveTo(lastBestPosition); } } else //if not dodging { //Check if hero will walk into a skillshot var path = myHero.Path; if (path.Length > 0) { var movePos = path[path.Length - 1].To2D(); if (EvadeHelper.CheckMovePath(movePos)) { var posInfo = EvadeHelper.GetBestPositionMovementBlock(movePos); if (posInfo != null) { EvadeCommand.MoveTo(posInfo.position); } return; } } } }