Diff
checker
テキスト
テキスト
画像
ドキュメント
Excel
フォルダ
Legal
Enterprise
デスクトップ
料金
ログイン
Diffchecker デスクトップのダウンロード
テキスト比較
2 つのテキスト ファイルの違いを見つける
ツール
履歴
表示
レイアウト
分割
統合
ライブエディター
空白の変更を非表示
未変更行を折りたたむ
折り返しなし
比較精度
スマート
構文
なし
外観を変更
処理
無視
テキスト変換
最初の差分へ移動
入力を編集
Diffchecker Desktop
Diffcheckerを実行する最も安全な方法。Diffchecker Desktopアプリを入手:あなたの差分はコンピューターから出ることはありません!
Desktopを入手
Untitled diff
作成日
12 年前
差分は期限切れになりません
クリア
エクスポート
共有
説明
1 削除
行
合計
削除
文字
合計
削除
この機能を引き続き使用するには、アップグレードしてください
Diff
checker
Pro
価格を見る
326 行
すべてコピー
21 追加
行
合計
追加
文字
合計
追加
この機能を引き続き使用するには、アップグレードしてください
Diff
checker
Pro
価格を見る
344 行
すべてコピー
using System.IO;
using System.IO;
using System.Linq;
using System.Linq;
using System.Threading.Tasks;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Controls;
using System.Windows.Markup;
using System.Windows.Markup;
using log4net;
using log4net;
using System;
using System;
using Loki.Bot;
using Loki.Bot;
using Loki.Bot.Logic.Bots.BasicGrindBot;
using Loki.Bot.Logic.Bots.BasicGrindBot;
using Loki.Bot.Pathfinding;
using Loki.Bot.Pathfinding;
using Loki.Bot.v3;
using Loki.Bot.v3;
using Loki.Game;
using Loki.Game;
using Loki.Game.Objects;
using Loki.Game.Objects;
using Loki.Utilities;
using Loki.Utilities;
namespace DominusFight
namespace DominusFight
{
{
internal class DominusFight : IPlugin
internal class DominusFight : IPlugin
{
{
private static readonly ILog Log = Logger.GetLoggerInstanceForType();
private static readonly ILog Log = Logger.GetLoggerInstanceForType();
private bool _enabled;
private bool _enabled;
private bool _skip;
private bool _skip;
/// <summary> The name of the plugin. </summary>
/// <summary> The name of the plugin. </summary>
public string Name
public string Name
{
{
get { return "DominusFight"; }
get { return "DominusFight"; }
}
}
/// <summary> The description of the plugin. </summary>
/// <summary> The description of the plugin. </summary>
public string Description
public string Description
{
{
get { return "A plugin that handles the logic required for fighting Dominus."; }
get { return "A plugin that handles the logic required for fighting Dominus."; }
}
}
/// <summary>The author of the plugin.</summary>
/// <summary>The author of the plugin.</summary>
public string Author
public string Author
{
{
get { return "Bossland GmbH"; }
get { return "Bossland GmbH"; }
}
}
/// <summary>The version of the plugin.</summary>
/// <summary>The version of the plugin.</summary>
public Version Version
public Version Version
{
{
get { return new Version(0, 0, 1, 1); }
get { return new Version(0, 0, 1, 1); }
}
}
/// <summary>Initializes this plugin.</summary>
/// <summary>Initializes this plugin.</summary>
public void Initialize()
public void Initialize()
{
{
Log.DebugFormat("[DominusFight] Initialize");
Log.DebugFormat("[DominusFight] Initialize");
}
}
/// <summary> The plugin start callback. Do any initialization here. </summary>
/// <summary> The plugin start callback. Do any initialization here. </summary>
public void Start()
public void Start()
{
{
Log.DebugFormat("[DominusFight] Start");
Log.DebugFormat("[DominusFight] Start");
GameEventManager.AreaChanged += GameEventManagerOnAreaChanged;
GameEventManager.AreaChanged += GameEventManagerOnAreaChanged;
Reset();
Reset();
// Check to see if the current grind zone is for Dominus.
// Check to see if the current grind zone is for Dominus.
if (BasicGrindBotSettings.Instance.GrindZoneName != "The Upper Sceptre of God")
if (BasicGrindBotSettings.Instance.GrindZoneName != "The Upper Sceptre of God")
{
{
Log.InfoFormat("[DominusFight] The area to grind is not Dominus. Skipping execution until a restart or area change.");
Log.InfoFormat("[DominusFight] The area to grind is not Dominus. Skipping execution until a restart or area change.");
_skip = true;
_skip = true;
return;
return;
}
}
// We want to change the behavior after exploration, so we can start the boss fight, and stay in it
// We want to change the behavior after exploration, so we can start the boss fight, and stay in it
// though different phases.
// though different phases.
if (!TaskManager.AddAfter(new HandleDominusArea(), "ExploreTask"))
if (!TaskManager.AddAfter(new HandleDominusArea(), "ExploreTask"))
{
{
Log.ErrorFormat("[DominusFight] AddAfter failed.");
Log.ErrorFormat("[DominusFight] AddAfter failed.");
BotManager.Stop();
BotManager.Stop();
}
}
}
}
/// <summary> The plugin tick callback. Do any update logic here. </summary>
/// <summary> The plugin tick callback. Do any update logic here. </summary>
public void Tick()
public void Tick()
{
{
if (_skip)
if (_skip)
return;
return;
if (!LokiPoe.IsInGame || LokiPoe.Me.IsInTown || LokiPoe.Me.IsDead)
if (!LokiPoe.IsInGame || LokiPoe.Me.IsInTown || LokiPoe.Me.IsDead)
return;
return;
}
}
/// <summary> The plugin stop callback. Do any pre-dispose cleanup here. </summary>
/// <summary> The plugin stop callback. Do any pre-dispose cleanup here. </summary>
public void Stop()
public void Stop()
{
{
Log.DebugFormat("[DominusFight] Stop");
Log.DebugFormat("[DominusFight] Stop");
GameEventManager.AreaChanged -= GameEventManagerOnAreaChanged;
GameEventManager.AreaChanged -= GameEventManagerOnAreaChanged;
}
}
#region Implementation of IConfigurable
#region Implementation of IConfigurable
public JsonSettings Settings
public JsonSettings Settings
保存された差分
原文
ファイルを開く
using System.IO; using System.Linq; using System.Threading.Tasks; using System.Windows.Controls; using System.Windows.Markup; using log4net; using System; using Loki.Bot; using Loki.Bot.Logic.Bots.BasicGrindBot; using Loki.Bot.Pathfinding; using Loki.Bot.v3; using Loki.Game; using Loki.Game.Objects; using Loki.Utilities; namespace DominusFight { internal class DominusFight : IPlugin { private static readonly ILog Log = Logger.GetLoggerInstanceForType(); private bool _enabled; private bool _skip; /// <summary> The name of the plugin. </summary> public string Name { get { return "DominusFight"; } } /// <summary> The description of the plugin. </summary> public string Description { get { return "A plugin that handles the logic required for fighting Dominus."; } } /// <summary>The author of the plugin.</summary> public string Author { get { return "Bossland GmbH"; } } /// <summary>The version of the plugin.</summary> public Version Version { get { return new Version(0, 0, 1, 1); } } /// <summary>Initializes this plugin.</summary> public void Initialize() { Log.DebugFormat("[DominusFight] Initialize"); } /// <summary> The plugin start callback. Do any initialization here. </summary> public void Start() { Log.DebugFormat("[DominusFight] Start"); GameEventManager.AreaChanged += GameEventManagerOnAreaChanged; Reset(); // Check to see if the current grind zone is for Dominus. if (BasicGrindBotSettings.Instance.GrindZoneName != "The Upper Sceptre of God") { Log.InfoFormat("[DominusFight] The area to grind is not Dominus. Skipping execution until a restart or area change."); _skip = true; return; } // We want to change the behavior after exploration, so we can start the boss fight, and stay in it // though different phases. if (!TaskManager.AddAfter(new HandleDominusArea(), "ExploreTask")) { Log.ErrorFormat("[DominusFight] AddAfter failed."); BotManager.Stop(); } } /// <summary> The plugin tick callback. Do any update logic here. </summary> public void Tick() { if (_skip) return; if (!LokiPoe.IsInGame || LokiPoe.Me.IsInTown || LokiPoe.Me.IsDead) return; } /// <summary> The plugin stop callback. Do any pre-dispose cleanup here. </summary> public void Stop() { Log.DebugFormat("[DominusFight] Stop"); GameEventManager.AreaChanged -= GameEventManagerOnAreaChanged; } #region Implementation of IConfigurable public JsonSettings Settings { get { return DominusFightSettings.Instance; } } /// <summary> The plugin's settings control. This will be added to the Exilebuddy Settings tab.</summary> public UserControl Control { get { using (var fs = new FileStream(@"Plugins\DominusFight\SettingsGui.xaml", FileMode.Open)) { var root = (UserControl)XamlReader.Load(fs); // Your settings binding here. // Your settings event handlers here. return root; } } } #endregion #region Implementation of IEnableable /// <summary>Is this plugin currently enabled?</summary> public bool IsEnabled { get { return _enabled; } } /// <summary> The plugin is being enabled.</summary> public void Enable() { Log.DebugFormat("[DominusFight] Enable"); _enabled = true; } /// <summary> The plugin is being disabled.</summary> public void Disable() { Log.DebugFormat("[DominusFight] Disable"); _enabled = false; } #endregion #region Implementation of IDisposable /// <summary> </summary> public void Dispose() { } #endregion #region Override of Object /// <summary> /// /// </summary> /// <returns></returns> public override string ToString() { return Name + ": " + Description; } #endregion private void GameEventManagerOnAreaChanged(object sender, AreaChangedEventArgs areaChangedEventArgs) { Reset(); } private void Reset() { Log.DebugFormat("[DominusFight] Now resetting task state."); _skip = false; } /// <summary> /// This task helps BasicGrindBot stay in the Dominus boss fight area, resetting exploration to /// keep the bot moving around to trigger different phases. /// </summary> public class HandleDominusArea : ITask { private bool _enabled = true; /// <summary>The name of this task.</summary> public string Name { get { return "HandleDominusArea"; } } /// <summary>A description of what this task does.</summary> public string Description { get { return "This task helps BasicGrindBot stay in the Dominus boss fight area, resetting exploration to keep the bot moving around to trigger different phases."; } } /// <summary>The author of this task.</summary> public string Author { get { return "Bossland GmbH"; } } /// <summary>The version of this task.</summary> public Version Version { get { return new Version(0, 0, 1, 1); } } private Vector2i _towerFightStarterPos; /// <summary> /// The tasks's execution logic. /// </summary> /// <returns>true if the TaskManager should not execute any other tasks, and false if it should.</returns> public async Task<bool> Execute() { if (!LokiPoe.CurrentWorldArea.IsOverworldArea) return false; // When we first spawn into the area, exploration should take us within range of everything. // Start out by triggering the fight itself. if (_towerFightStarterPos == Vector2i.Zero) { var fightStarter = LokiPoe.ObjectManager.GetObjectByMetadata( "Metadata/Monsters/Demonmodular/TowerSpawners/TowerFightStarter"); if (fightStarter != null) { _towerFightStarterPos = ExilePather.WalkablePositionFor(fightStarter, 10); Log.InfoFormat("[DominusFight] _fightStarterPos: {0}.", _towerFightStarterPos); if (!await Coroutines.MoveToLocation(_towerFightStarterPos, 10, 30000)) { Log.ErrorFormat("[DominusFight] MoveToLocation failed."); } return true; } } // Check to see if the boss fight is over. Logic for actually completing the quest for the first time // is not implemented. var npc = LokiPoe.ObjectManager.GetObjectByName<Npc>("Lady Dialla"); if (npc != null) { // Wait for her to spawn in and be usable. if (npc.IsTargetable) { Log.InfoFormat("[DominusFight] Lady Dialla was found. Now completing the boss fight."); BasicGrindBotSettings.Instance.NeedsTownRun = 2; } return true; } // Simply move towards Dominus if nothing else is running. var dom = LokiPoe.ObjectManager.GetObjectByName<Monster>("Dominus, High Templar"); if (dom != null) { if (!dom.IsDead) { PlayerMover.MoveTowards(dom.Position); return true; } } dom = LokiPoe.ObjectManager.GetObjectByName<Monster>("Dominus, Ascendant"); if (dom != null) { if (!dom.IsDead) { PlayerMover.MoveTowards(dom.Position); return true; } } // Reset the explorer, so we move around the area looking for things that might be out of view. // It's up to the CR to avoid getting stuck killing Miscreations near their spawner. if (AreaStateCache.Current.Explorer != null) { Log.InfoFormat("[DominusFight] Now resetting the explorer."); AreaStateCache.Current.Explorer.Reset(); } // Don't execute any tasks afterwards. This forces the BasicGrindBot to say in the boss area. return true; } /// <summary>The bot Start event.</summary> public void Start() { } /// <summary>The bot Tick event.</summary> public void Tick() { } /// <summary>The bot Stop event.</summary> public void Stop() { } /// <summary>Is this task currently enabled?</summary> public bool IsEnabled { get { return _enabled; } } /// <summary>Called when the task should be enabled.</summary> public void Enable() { _enabled = true; } /// <summary>Called when the task should be disabled.</summary> public void Disable() { _enabled = false; } } } }
変更されたテキスト
ファイルを開く
using System.IO; using System.Linq; using System.Threading.Tasks; using System.Windows.Controls; using System.Windows.Markup; using log4net; using System; using Loki.Bot; using Loki.Bot.Logic.Bots.BasicGrindBot; using Loki.Bot.Pathfinding; using Loki.Bot.v3; using Loki.Game; using Loki.Game.Objects; using Loki.Utilities; namespace DominusFight { internal class DominusFight : IPlugin { private static readonly ILog Log = Logger.GetLoggerInstanceForType(); private bool _enabled; private bool _skip; /// <summary> The name of the plugin. </summary> public string Name { get { return "DominusFight"; } } /// <summary> The description of the plugin. </summary> public string Description { get { return "A plugin that handles the logic required for fighting Dominus."; } } /// <summary>The author of the plugin.</summary> public string Author { get { return "Bossland GmbH"; } } /// <summary>The version of the plugin.</summary> public Version Version { get { return new Version(0, 0, 1, 1); } } /// <summary>Initializes this plugin.</summary> public void Initialize() { Log.DebugFormat("[DominusFight] Initialize"); } /// <summary> The plugin start callback. Do any initialization here. </summary> public void Start() { Log.DebugFormat("[DominusFight] Start"); GameEventManager.AreaChanged += GameEventManagerOnAreaChanged; Reset(); // Check to see if the current grind zone is for Dominus. if (BasicGrindBotSettings.Instance.GrindZoneName != "The Upper Sceptre of God") { Log.InfoFormat("[DominusFight] The area to grind is not Dominus. Skipping execution until a restart or area change."); _skip = true; return; } // We want to change the behavior after exploration, so we can start the boss fight, and stay in it // though different phases. if (!TaskManager.AddAfter(new HandleDominusArea(), "ExploreTask")) { Log.ErrorFormat("[DominusFight] AddAfter failed."); BotManager.Stop(); } } /// <summary> The plugin tick callback. Do any update logic here. </summary> public void Tick() { if (_skip) return; if (!LokiPoe.IsInGame || LokiPoe.Me.IsInTown || LokiPoe.Me.IsDead) return; } /// <summary> The plugin stop callback. Do any pre-dispose cleanup here. </summary> public void Stop() { Log.DebugFormat("[DominusFight] Stop"); GameEventManager.AreaChanged -= GameEventManagerOnAreaChanged; } #region Implementation of IConfigurable public JsonSettings Settings { get { return DominusFightSettings.Instance; } } /// <summary> The plugin's settings control. This will be added to the Exilebuddy Settings tab.</summary> public UserControl Control { get { using (var fs = new FileStream(@"Plugins\DominusFight\SettingsGui.xaml", FileMode.Open)) { var root = (UserControl)XamlReader.Load(fs); // Your settings binding here. // Your settings event handlers here. return root; } } } #endregion #region Implementation of IEnableable /// <summary>Is this plugin currently enabled?</summary> public bool IsEnabled { get { return _enabled; } } /// <summary> The plugin is being enabled.</summary> public void Enable() { Log.DebugFormat("[DominusFight] Enable"); _enabled = true; } /// <summary> The plugin is being disabled.</summary> public void Disable() { Log.DebugFormat("[DominusFight] Disable"); _enabled = false; } #endregion #region Implementation of IDisposable /// <summary> </summary> public void Dispose() { } #endregion #region Override of Object /// <summary> /// /// </summary> /// <returns></returns> public override string ToString() { return Name + ": " + Description; } #endregion private void GameEventManagerOnAreaChanged(object sender, AreaChangedEventArgs areaChangedEventArgs) { Reset(); } private void Reset() { Log.DebugFormat("[DominusFight] Now resetting task state."); _skip = false; } /// <summary> /// This task helps BasicGrindBot stay in the Dominus boss fight area, resetting exploration to /// keep the bot moving around to trigger different phases. /// </summary> public class HandleDominusArea : ITask { private bool _enabled = true; private bool _skip; /// <summary>The name of this task.</summary> public string Name { get { return "HandleDominusArea"; } } /// <summary>A description of what this task does.</summary> public string Description { get { return "This task helps BasicGrindBot stay in the Dominus boss fight area, resetting exploration to keep the bot moving around to trigger different phases."; } } /// <summary>The author of this task.</summary> public string Author { get { return "Bossland GmbH"; } } /// <summary>The version of this task.</summary> public Version Version { get { return new Version(0, 0, 1, 1); } } private Vector2i _towerFightStarterPos; /// <summary> /// The tasks's execution logic. /// </summary> /// <returns>true if the TaskManager should not execute any other tasks, and false if it should.</returns> public async Task<bool> Execute() { if (!LokiPoe.CurrentWorldArea.IsOverworldArea) return false; if (_skip) return false; // When we first spawn into the area, exploration should take us within range of everything. // Start out by triggering the fight itself. if (_towerFightStarterPos == Vector2i.Zero) { var fightStarter = LokiPoe.ObjectManager.GetObjectByMetadata( "Metadata/Monsters/Demonmodular/TowerSpawners/TowerFightStarter"); if (fightStarter != null) { _towerFightStarterPos = ExilePather.WalkablePositionFor(fightStarter, 10); Log.InfoFormat("[DominusFight] _fightStarterPos: {0}.", _towerFightStarterPos); if (!await Coroutines.MoveToLocation(_towerFightStarterPos, 10, 30000)) { Log.ErrorFormat("[DominusFight] MoveToLocation failed."); } return true; } } // Check to see if the boss fight is over. Logic for actually completing the quest for the first time // is not implemented. var npc = LokiPoe.ObjectManager.GetObjectByName<Npc>("Lady Dialla"); if (npc != null) { // Wait for her to spawn in and be usable. if (npc.IsTargetable) { Log.InfoFormat("[DominusFight] Lady Dialla was found. Now marking this task to skip executing."); //BasicGrindBotSettings.Instance.NeedsTownRun = 2; _skip = true; } return true; } // Simply move towards Dominus if nothing else is running. var dom = LokiPoe.ObjectManager.GetObjectByName<Monster>("Dominus, High Templar"); if (dom != null) { if (!dom.IsDead) { PlayerMover.MoveTowards(dom.Position); return true; } } dom = LokiPoe.ObjectManager.GetObjectByName<Monster>("Dominus, Ascendant"); if (dom != null) { if (!dom.IsDead) { PlayerMover.MoveTowards(dom.Position); return true; } } // Reset the explorer, so we move around the area looking for things that might be out of view. // It's up to the CR to avoid getting stuck killing Miscreations near their spawner. if (AreaStateCache.Current.Explorer != null) { Log.InfoFormat("[DominusFight] Now resetting the explorer."); AreaStateCache.Current.Explorer.Reset(); } // Don't execute any tasks afterwards. This forces the BasicGrindBot to say in the boss area. return true; } /// <summary>The bot Start event.</summary> public void Start() { GameEventManager.AreaChanged += GameEventManagerOnAreaChanged; } /// <summary>The bot Tick event.</summary> public void Tick() { } /// <summary>The bot Stop event.</summary> public void Stop() { GameEventManager.AreaChanged -= GameEventManagerOnAreaChanged; } /// <summary>Is this task currently enabled?</summary> public bool IsEnabled { get { return _enabled; } } /// <summary>Called when the task should be enabled.</summary> public void Enable() { _enabled = true; } /// <summary>Called when the task should be disabled.</summary> public void Disable() { _enabled = false; } private void GameEventManagerOnAreaChanged(object sender, AreaChangedEventArgs areaChangedEventArgs) { Reset(); } private void Reset() { Log.DebugFormat("[HandleDominusArea] Now resetting task state."); _skip = false; } } } }
違いを見つける