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

Turn off PortalToTownPoi?

Imissme2

New Member
Joined
Jun 3, 2014
Messages
26
Reaction score
0
Is it possible to turn off Portal to town? i want it to just logout and login.
 
There's no setting for this, but one thing you can do is add a logout call when exploration is complete.

You can add this code to a plugin like so:
Code:
using System;
using log4net;
using Loki.Bot;
using Loki.Game;
using Loki.Utilities;
using Loki.Utilities.Plugins;

namespace LogoutAfterExploration
{
    public class LogoutAfterExploration : IPlugin
    {
        #region Implementation of IEquatable<IPlugin>

        /// <summary>
        ///     Indicates whether the current object is equal to another object of the same type.
        /// </summary>
        /// <returns>
        ///     true if the current object is equal to the <paramref name="other" /> parameter; otherwise, false.
        /// </returns>
        /// <param name="other">An object to compare with this object.</param>
        public bool Equals(IPlugin other)
        {
            return Name.Equals(other.Name);
        }

        #endregion

        private static readonly ILog Log = Logger.GetLoggerInstanceForType();

        #region Implementation of IPlugin

        public string Author
        {
            get { return "pushedx"; }
        }

        public Version Version
        {
            get { return new Version(0, 1, 0, 0); }
        }

        public string Name
        {
            get { return "LogoutAfterExploration"; }
        }

        public string Description
        {
            get { return "Hooks the ExplorationComplete event to logout."; }
        }

        /// <summary> Executes the start action. This is called when the bot starts. </summary>
        public void OnStart()
        {
        }

        /// <summary> Executes the stop action. This is called when the bot is stopped. </summary>
        public void OnStop()
        {
        }

        /// <summary> Executes the pulse action. This is called every "tick" of the bot. </summary>
        public void OnPulse()
        {
        }

        /// <summary>
        ///     Executes the initialize action. This is called at initial bot startup. (When the bot itself is started, not
        ///     when Start() is called)
        /// </summary>
        public void OnInitialize()
        {
        }

        /// <summary> Executes the shutdown action. This is called when the bot is shutting down. (Not when Stop() is called) </summary>
        public void OnShutdown()
        {
        }

        /// <summary> Executes the enabled action. This is called when the user has enabled this specific plugin via the GUI. </summary>
        public void OnEnabled()
        {
            BotEvents.ExplorationComplete += BotEventsOnExplorationComplete;
        }

        /// <summary> Executes the disabled action. This is called whent he user has disabled this specific plugin via the GUI. </summary>
        public void OnDisabled()
        {
            BotEvents.ExplorationComplete -= BotEventsOnExplorationComplete;
        }

        /// <summary> Executes the config action. This is called when the user clicks on the config button.</summary>
        public void OnConfig()
        {
        }

        #endregion

        private void BotEventsOnExplorationComplete(object sender, ExplorationCompleteEventArgs explorationCompleteEventArgs)
        {
            Log.DebugFormat("[BotEventsOnExplorationComplete] Now logging out.");
            LokiPoe.Gui.Logout();
        }
    }
}

You'd just make a folder called "LogoutAfterExploration" in your Exilebuddy "Plugins" folder, and then create a file, "LogoutAfterExploration.cs" with that code in the new "Plugins\LogoutAfterExploration\" folder.

Restart your bot, then you should see the plugin loaded. Enable it, and when exploration is completed, you'll see a message along the lines of:
[BotEventsOnExplorationComplete] Now logging out.

when exploration is completed.
 
There's no setting for this, but one thing you can do is add a logout call when exploration is complete.

You can add this code to a plugin like so:
Code:
using System;
using log4net;
using Loki.Bot;
using Loki.Game;
using Loki.Utilities;
using Loki.Utilities.Plugins;

namespace LogoutAfterExploration
{
    public class LogoutAfterExploration : IPlugin
    {
        #region Implementation of IEquatable<IPlugin>

        /// <summary>
        ///     Indicates whether the current object is equal to another object of the same type.
        /// </summary>
        /// <returns>
        ///     true if the current object is equal to the <paramref name="other" /> parameter; otherwise, false.
        /// </returns>
        /// <param name="other">An object to compare with this object.</param>
        public bool Equals(IPlugin other)
        {
            return Name.Equals(other.Name);
        }

        #endregion

        private static readonly ILog Log = Logger.GetLoggerInstanceForType();

        #region Implementation of IPlugin

        public string Author
        {
            get { return "pushedx"; }
        }

        public Version Version
        {
            get { return new Version(0, 1, 0, 0); }
        }

        public string Name
        {
            get { return "LogoutAfterExploration"; }
        }

        public string Description
        {
            get { return "Hooks the ExplorationComplete event to logout."; }
        }

        /// <summary> Executes the start action. This is called when the bot starts. </summary>
        public void OnStart()
        {
        }

        /// <summary> Executes the stop action. This is called when the bot is stopped. </summary>
        public void OnStop()
        {
        }

        /// <summary> Executes the pulse action. This is called every "tick" of the bot. </summary>
        public void OnPulse()
        {
        }

        /// <summary>
        ///     Executes the initialize action. This is called at initial bot startup. (When the bot itself is started, not
        ///     when Start() is called)
        /// </summary>
        public void OnInitialize()
        {
        }

        /// <summary> Executes the shutdown action. This is called when the bot is shutting down. (Not when Stop() is called) </summary>
        public void OnShutdown()
        {
        }

        /// <summary> Executes the enabled action. This is called when the user has enabled this specific plugin via the GUI. </summary>
        public void OnEnabled()
        {
            BotEvents.ExplorationComplete += BotEventsOnExplorationComplete;
        }

        /// <summary> Executes the disabled action. This is called whent he user has disabled this specific plugin via the GUI. </summary>
        public void OnDisabled()
        {
            BotEvents.ExplorationComplete -= BotEventsOnExplorationComplete;
        }

        /// <summary> Executes the config action. This is called when the user clicks on the config button.</summary>
        public void OnConfig()
        {
        }

        #endregion

        private void BotEventsOnExplorationComplete(object sender, ExplorationCompleteEventArgs explorationCompleteEventArgs)
        {
            Log.DebugFormat("[BotEventsOnExplorationComplete] Now logging out.");
            LokiPoe.Gui.Logout();
        }
    }
}

You'd just make a folder called "LogoutAfterExploration" in your Exilebuddy "Plugins" folder, and then create a file, "LogoutAfterExploration.cs" with that code in the new "Plugins\LogoutAfterExploration\" folder.

Restart your bot, then you should see the plugin loaded. Enable it, and when exploration is completed, you'll see a message along the lines of:


when exploration is completed.

Cool. ill try it out =)
Thanks
 
Back
Top