Diff
checker
टेक्स्ट
टेक्स्ट
छवियां
दस्तावेज़
Excel
फ़ोल्डर्स
Legal
Enterprise
डेस्कटॉप
मूल्य
साइन इन करें
Diffchecker डेस्कटॉप डाउनलोड करें
टेक्स्ट की तुलना करें
दो टेक्स्ट फ़ाइलों के बीच अंतर ढूंढें
उपकरण
इतिहास
प्रदर्शन
लेआउट
विभाजित
संयुक्त
रियल-टाइम एडिटर
रिक्त स्थान छिपाएँ
अपरिवर्तित संक्षिप्त करें
लाइन रैप बंद
परिवर्तन हाइलाइट करें
स्मार्ट
सिंटैक्स
कोई नहीं
दिखावट बदलें
प्रोसेसिंग
अनदेखा करें
टेक्स्ट बदलें
पहले अंतर पर जाएँ
इनपुट संपादित करें
Diffchecker Desktop
Diffchecker चलाने का सबसे सुरक्षित तरीका। Diffchecker Desktop ऐप पाएं: आपके diffs कभी आपके कंप्यूटर से बाहर नहीं जाते!
Desktop पाएं
Untitled diff
बनाया गया
12 वर्ष पहले
Diff कभी समाप्त नहीं होता
साफ़
निर्यात करें
शेयर करें
समझाएं
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
सेव किए गए Diffs
ऑरिजनल टेक्स्ट
फ़ाइल खोलें
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; } } } }
अंतर खोजें