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

Randomize Map runs?

Zirak

New Member
Joined
Mar 8, 2014
Messages
11
Reaction score
0
Could it be possible to have a list of maps in which the bot will load from and randomize what map to run from that list? It would make detection less feasible.
 
A short term fix was added a few versions ago (which the post was lost when the forums lost data) but this is how you can do that for now (requires some coding):

1. Create a new folder in your "plugins" folder called "GrindZoneChanger".
2. Create a new file in that folder called "GrindZoneChanger.cs".
3. Copy and paste in this code:
Code:
using System;
using log4net;
using Loki.Bot.Logic;
using Loki.Bot.Logic.Bots.Grind;
using Loki.Utilities;
using Loki.Utilities.Plugins;

namespace GrindZoneChanger
{
    /// <summary> </summary>
    public class GrindZoneChanger : 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

        /// <summary> </summary>
        public string Author { get { return "pushedx"; } }

        /// <summary> </summary>
        public Version Version { get { return new Version(0, 1, 0, 0); } }

        /// <summary> </summary>
        public string Name { get { return "GrindZoneChanger"; } }

        /// <summary> </summary>
        public string Description { get { return "This plugin shows how to use the experimental grind zone changing logic."; } }

        /// <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()
        {
            // Use our specific runetime 
            Registry.UserGetGrindZoneId = new MyGetGrindZoneId();
            Registry.DontUseSmartLedgeFarming = true;
        }

        /// <summary> Executes the disabled action. This is called whent he user has disabled this specific plugin via the GUI. </summary>
        public void OnDisabled()
        {
            // Restore the default settings.
            Registry.UserGetGrindZoneId = null;
            Registry.DontUseSmartLedgeFarming = false;
        }

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

        #endregion

        /// <summary>
        /// An example grind zone changing plugin implementation. 
        /// </summary>
        internal class MyGetGrindZoneId : IGetGrindZoneId
        {
            private string _grindZoneId;

            private int _index;

            public MyGetGrindZoneId()
            {
                _grindZoneId = GrindBotSettings.Instance.GrindZoneId;
            }

            public string GetGrindZoneId()
            {
                return _grindZoneId;
            }

            public void DetermineNextGrindZone()
            {
                // You can setup how you want to change things. Whether it's in a cycle like this,
                // # of runs per area (you'd need to track that yourself) etc...

                // The bot would grind from:
                // GrindBotSettings.Instance.GrindZoneId -> Mud Flats -> Coves -> Ledge in this example.
                // Use the grind area settings gui in the bot to get the id of areas.

                if (_index == 0)
                {
                    _grindZoneId = "1_1_3"; // Mud Flats normal
                    ++_index;
                }
                else if (_index == 1)
                {
                    _grindZoneId = "1_1_10"; // The Coves normal
                    ++_index;
                }
                else if (_index == 2)
                {
                    _grindZoneId = "1_1_5"; // The Ledge normal
                    _index = 0;
                }
            }
        }
    }
}
4. Edit it as needed and save. If you don't want a specific order like is shown, you can just use some basic random logic to choose the area.
5. Restart Exilebuddy and enable the GrindZoneChanger plugin. When you start the bot, it'll use the plugin to change the zone when needed.

This functionality isn't part of the actual GUI/bot core yet because this bot was written to do one specific thing; grind an area with a waypoint. As time has gone on, it's clear that design isn't going to be good enough, so we have to change a bunch of code to do things like this. However, since this game updates so often, there's a lot of other things to keep on top of as well. Eventually though, we'll have all this stuff wrapped up in a nice and easy way to use.
 
Couldn't you just use this instead of declaring a _grindZoneId variable
Code:
private string _grindZoneId
{
	get
	{
		switch(Math.Random(1, 4)) //Randomly chooses a number from 1 to 3
		{
			case 1:
			return "1_1_3"; // Mud Flats normal
			case 2:
			return "1_1_10"; // The Coves normal
			default: //If the value is 3, or anything not handled by the previous two cases
			return "1_1_5"; // The Ledge Normal
		}
	}
}
 
Couldn't you just use this instead of declaring a _grindZoneId variable

No, because the GetGrindZoneId function cannot be destructive.

It'll be called many times by the bot at various points, so it has to return the same value until DetermineNextGrindZone is next called.
 
I followed this guide and I cant seem to get it to work. It just runs whatever area that is selected in the grind bot settings, even tho I have the grindzonechanger ticked in the plugins. Any help would be great.

thanks
 
Back
Top