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.