What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Issue regarding grindzone changer and Naut's piety fight

roneo1

Member
Joined
Mar 21, 2014
Messages
480
Reaction score
20
I've double checked to make sure, and the problem is that if I run grindzone changer with naut's piety fight, whenever the bot changes grind zone to lunaris level 3 it will get to piety but will tp out and not kill her.

However, if I run lunaris lvl3 with naut's piety fight and grind zone changer disabled, it will kill piety, can this be fixed somehow?
 
I've double checked to make sure, and the problem is that if I run grindzone changer with naut's piety fight, whenever the bot changes grind zone to lunaris level 3 it will get to piety but will tp out and not kill her.

However, if I run lunaris lvl3 with naut's piety fight and grind zone changer disabled, it will kill piety, can this be fixed somehow?
ya, i'll look into this for ya, but Naut can fix it easily.
 
The issue is that the grindzone changer plugin is based around the exploration complete task.

When the bot detects you have fully explored piety's room you are switching to the next grindzone.

Customize your grindzone changer plugin to detect piety and not engage unless she is dead.

Edit it to look like this:

Code:
private void ExplorationCompleteTaskOnCompleted(object sender, ExplorationCompleteTask.ExplorationCompleteEventArgs explorationCompleteEventArgs)
       {
	    var Piety = LokiPoe.ObjectManager.GetObjectByName<Monster>("Piety");
            if (Piety == null || Piety != null && Piety.IsDead)
            {
		var roll = Utility.Random.Next(0, 3);
		string name = "";
		switch (roll)
		{
			case 0:
				name = "The Ledge";
				break;
			case 1:
				name = "The Upper Prison";
				break;
			case 2:
				name = "The Coves";
				break;
		}
		Log.InfoFormat("[GrindZoneChanger] New grind zone being set to {0}.", name);
		BasicGrindBotSettings.Instance.GrindZoneName = name; 
            }
       }
 
Last edited:
This doesn't seem to be working, could you paste your already modified grindzone changer? I've modified it exactly the way it is there and it's not even changing zones anymore, has anyone else tried?
 
This doesn't seem to be working, could you paste your already modified grindzone changer? I've modified it exactly the way it is there and it's not even changing zones anymore, has anyone else tried?

I do not use this plugin.

That fix should work.. in the case piety doesn't exist it will execute the logic on exploration complete.. so the fact it isnt changing zones at all anymore makes me think that it wasn't edited properly.

Do you get any red compile errors when starting the bot with this new plugin? It may just be missing a needed reference,
 
Last edited:
I did get some errors so I just added the stuff from the dominus plugin at the top of the file and it looks like this, it doesn't change areas, kills piety that's it and loops level 3.

Code:
using System.Windows.Controls;
using log4net;
using Loki.Bot;
using System;
using Loki.Bot.Logic.Bots.BasicGrindBot;
using Loki.Utilities;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Markup;
using Loki.Bot.v3;
using Loki.Game;
using Loki.Game.Objects;


namespace GrindZoneChanger
{
    internal class GrindZoneChanger : IPlugin
    {
        private static readonly ILog Log = Logger.GetLoggerInstanceForType();

        private bool _enabled;

        #region Implementation of IPlugin

        /// <summary> The name of the plugin. </summary>
        public string Name
        {
            get { return "GrindZoneChanger"; }
        }

        /// <summary> The description of the plugin. </summary>
        public string Description
        {
            get { return "A plugin example showing how to change the grind zone when exploration has been completed. Users need to implement custom logic and change the code for this to work as they want."; }
        }

        /// <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("[GrindZoneChanger] Initialize");
        }

        /// <summary> The plugin start callback. Do any initialization here. </summary>
        public void Start()
        {
            Log.DebugFormat("[GrindZoneChanger] Start");
            ExplorationCompleteTask.Completed += ExplorationCompleteTaskOnCompleted;
        }

        /// <summary> The plugin tick callback. Do any update logic here. </summary>
        public void Tick()
        {
        }

        /// <summary> The plugin stop callback. Do any pre-dispose cleanup here. </summary>
        public void Stop()
        {
            Log.DebugFormat("[GrindZoneChanger] Stop");
            ExplorationCompleteTask.Completed -= ExplorationCompleteTaskOnCompleted;
        }

        public JsonSettings Settings
        {
            get { return null; }
        }

        /// <summary> The plugin's settings control. This will be added to the Exilebuddy Settings tab.</summary>
        public UserControl Control
        {
            get { return null; }
        }

        /// <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("[GrindZoneChanger] Enable");
            _enabled = true;
        }

        /// <summary> The plugin is being disabled.</summary>
        public void Disable()
        {
            Log.DebugFormat("[GrindZoneChanger] 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 ExplorationCompleteTaskOnCompleted(object sender, ExplorationCompleteTask.ExplorationCompleteEventArgs explorationCompleteEventArgs)
       {
	    var Piety = LokiPoe.ObjectManager.GetObjectByName<Monster>("Piety");
            if (Piety == null || Piety != null && Piety.IsDead)
            {
		var roll = Utility.Random.Next(0, 3);
		string name = "";
		switch (roll)
		{
			case 0:
				name = "The Lunaris Temple Level 3";
				break;
			case 1:
				name = "The Library";
				break;
			case 2:
				name = "The Catacombs";
				break;
		}
		Log.InfoFormat("[GrindZoneChanger] New grind zone being set to {0}.", name);
		BasicGrindBotSettings.Instance.GrindZoneName = name; 
         }
     }
  }
}

Edit: it looks like if I start off with library or catacombs in this case, it will be able to switch zone, but as soon as it starts doing lunaris 3, it stays there and won't switch anymore. Also I have your piety fight plugin enabled of course.
 
Last edited:
Hmm.. trying editing it to just be

Code:
private void ExplorationCompleteTaskOnCompleted(object sender, ExplorationCompleteTask.ExplorationCompleteEventArgs explorationCompleteEventArgs)
       {
	    var Piety = LokiPoe.ObjectManager.GetObjectByName<Monster>("Piety");
            if (Piety == null)
            {
		var roll = Utility.Random.Next(0, 3);
		string name = "";
		switch (roll)
		{
			case 0:
				name = "The Ledge";
				break;
			case 1:
				name = "The Upper Prison";
				break;
			case 2:
				name = "The Coves";
				break;
		}
		Log.InfoFormat("[GrindZoneChanger] New grind zone being set to {0}.", name);
		BasicGrindBotSettings.Instance.GrindZoneName = name; 
            }
       }

I think the problem is that after piety the bot is trying to teleport to town and switch grindzones at the same time.. That fix above should allow the piety plugin to finish its task of going to town, and when the bot detects you are in town and piety is no longer present it will change grindzones.
 
GrindZoneChanger is dependent on ExplorationCompleteTask executing.

ExplorationCompleteTask is never executed when using DominusFight, nor would it be using naut's plugin, since it was based on the same code.

I'll make a change to DominusFight that can be reflected in other boss fighting plugins to avoid this issue by not making the task trigger a town run, and marking itself to not execute anymore. That way, ExplorationCompleteTask will trigger normally, but only after the boss is dead, and plugins like GrindZoneChanger should work as-is. This change will be in the next Beta, but if you want to test it now, you can see the changes from the following link: https://www.diffchecker.com/wz6sw644. The right side contains the modified file.
 
Back
Top