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

Suggestion for plugin or function

OneStopMMO

New Member
Joined
Jul 29, 2013
Messages
123
Reaction score
0
Please add a function for the user to be able to enter an area then simple click start on bot and the bot will explore and kill until /remaining returns a less than 10 amount.

So I roll a map with alchs or w.e then click enter it and then click start on bot and it handles the rest.
 
Using /remaining a lot is not a good idea, as you're sending a chat command to the server to which it replies with how many monsters are left. It would be an easy flag for GGG to track the excessive usage of that command on a regular basis.

The API can be used as follows to do it though:

To send the chat command:
Code:
LokiPoe.Type("/remaining");

To parse the chat messages (should look something like this):
Code:
            var monstersLeft = -1;
            var msgs = LokiPoe.InGameState.ChatMessages.ToList();
            msgs.Reverse();
            msgs = msgs.Take(10).ToList(); // don't search too far back in chat history
            foreach (var msg in msgs)
            {
                if (msg == "More than 20 monsters remain.")
                {
                    monstersLeft = 21;
                    break;
                }

                if (msg.Contains(" monsters remain."))
                {
                    var parts = msg.Split(new [] {' '}, StringSplitOptions.RemoveEmptyEntries);
                    if (!int.TryParse(parts[0], out monstersLeft))
                    {
                        monstersLeft = -1;
                    }
                    break;
                }
            }

            if (monstersLeft == -1)
            {
                // could not determine how many are left
            }
            else if (monstersLeft == 21)
            {
                // more than 20
            }
            else
            {
                // use monstersLeft
            }

It would be highly advisable to disable global, trade, guild chat.

Now to get BasicGrindBot working inside a map, all you'd need to do is remove a task specific to the overworld:

Code:
TaskManager.Remove("TravelToGrindZoneTask");

You'd just call that in a plugin or routine Start function, so the bot doesn't try to actually use the grind zone travel mechanics. That should just about do it, and that aspect should be easily testable.

You'd want to set your exploration complete behavior to Stop most likely though, so it doesn't try to loop, as otherwise it'll log if portal fails.

The current explorer will cover the entire map, but you need to code in additional logic for areas that have map boss rooms. The ExampleRoutine doesn't try to kill every single mob either, so there's no real need for the remaining logic really.
 
Code:
private bool DisableTravel
        {
            try
            {
                TaskManager.Remove("TravelToGrindZoneTask");
            }
            catch (Exception ex)
            {
                Log.Error("[DisableTravel]", ex);
                return false;
            }
            return true;
        }

        #endregion

        #region Implementation of IBase

        /// <summary>Initializes this routine.</summary>
        public void Initialize()
        {
            Log.DebugFormat("[ExampleRoutine] Initialize");

            _combatTargeting.InclusionCalcuation += CombatTargetingOnInclusionCalcuation;
            _combatTargeting.WeightCalculation += CombatTargetingOnWeightCalculation;
	    _disableTravel += DisableTravel;
        }

I think that should do it for the changes you need to make for exampleroutine to disable changing areas.

Here is the plugin to detect # of mobs remaining in a zone. You can choose in the settings the number at which you want the bot to stop.

View attachment MobsRemaining.zip
 
Last edited:
Thanx guys I will read this and google certain lines you guys have written so I can understand what im copy pasting and playing with :P
 
Ok here's what naut wanted to do, this fix will;

1 ; Choose how many remaining monsters
2. Choose how many milliseconds to run the command, I've defaulted it as 60 seconds

I've added to Tick();

Code:
            if (!LokiPoe.IsInGame || LokiPoe.Me.IsInTown || LokiPoe.Me.IsDead)
                return;
So it will only run if you are actually doing map

What you need to to inside tick is to put your logic of what to do when it reaches 10 monsters or w/e.

IE. stop the bot.

Hope that helps kinda, creds go to naut and pushedx for teaching me
Code:
Stopwatch.StartNew();
and
Code:
Stopwatch.Restart();
beats using sleep.
View attachment MobsRemaining.zip
 
Last edited:
Thank you everyone, what programming language should i read up on to understand this? is it python?


So far im having errors and cannot get it to cancel or disable the traveltogrindzone part.
Clarifying questions:
Where should I insert this
Code:
private bool DisableTravel
        {
            try
            {
                TaskManager.Remove("TravelToGrindZoneTask");
            }
            catch (Exception ex)
            {
                Log.Error("[DisableTravel]", ex);
                return false;
            }
            return true;
        }

        #endregion

        #region Implementation of IBase

        /// <summary>Initializes this routine.</summary>
        public void Initialize()
        {
            Log.DebugFormat("[ExampleRoutine] Initialize");

            _combatTargeting.InclusionCalcuation += CombatTargetingOnInclusionCalcuation;
            _combatTargeting.WeightCalculation += CombatTargetingOnWeightCalculation;
	    _disableTravel += DisableTravel;
        }
I have tried a few things which im sure were the wrong choices, so figured id ask
 
Last edited:
Thank you everyone, what programming language should i read up on to understand this? is it python?


So far im having errors and cannot get it to cancel or disable the traveltogrindzone part.
Clarifying questions:
Where should I insert this
Code:
private bool DisableTravel
        {
            try
            {
                TaskManager.Remove("TravelToGrindZoneTask");
            }
            catch (Exception ex)
            {
                Log.Error("[DisableTravel]", ex);
                return false;
            }
            return true;
        }

        #endregion

        #region Implementation of IBase

        /// <summary>Initializes this routine.</summary>
        public void Initialize()
        {
            Log.DebugFormat("[ExampleRoutine] Initialize");

            _combatTargeting.InclusionCalcuation += CombatTargetingOnInclusionCalcuation;
            _combatTargeting.WeightCalculation += CombatTargetingOnWeightCalculation;
	    _disableTravel += DisableTravel;
        }
I have tried a few things which im sure were the wrong choices, so figured id ask

you would actually put
Code:
TaskManager.Remove("TravelToGrindZoneTask");

into the plugin at Start(); and possible add task back when plugin Stop();

I'll get some code tonight, I just got an idea while reading this again.
 
I still got an error but a smaller one this time, I copy pasted the long code by naut AFTER start() but that's all i did
 
I am failing since yesterday. I did a fresh bot install called it test. Then inserted this:
Code:
private bool DisableTravel
        {
            try
            {
                TaskManager.Remove("TravelToGrindZoneTask");
            }
            catch (Exception ex)
            {
                Log.Error("[DisableTravel]", ex);
                return false;
            }
            return true;
        }

        #endregion

        #region Implementation of IBase

        /// <summary>Initializes this routine.</summary>
        public void Initialize()
        {
            Log.DebugFormat("[ExampleRoutine] Initialize");

            _combatTargeting.InclusionCalcuation += CombatTargetingOnInclusionCalcuation;
            _combatTargeting.WeightCalculation += CombatTargetingOnWeightCalculation;
	    _disableTravel += DisableTravel;
        }
in exampleroutine however it gives me an error. Then I tried it after Start() still an error. What am I doing wrong?
 
Pm me your skype info I will help you with it.
 
Back
Top