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

New API?

Emmitt

Member
Joined
Jul 24, 2011
Messages
79
Reaction score
1
I know you guys basically rewrote this entire bot so is there an api functions list for us to use yet?
 
As always, it's in the Exilebuddy.xml file. (It's the intellisense file for Visual Studio) Contains all the documentation.
 
Some of the api actions do not work. Loki.bot.lokipoe the exploration things don't compile correctly. I ccan post more when I get to my comp. A log file and such
 
View attachment 117347
Just the gemleveler here but does it with other plugins as well.

Since it's mostly a new in terms of layout and how functionality changed for input, old code doesn't compile. That's the issue you are seeing, code written for the old api.

What are you trying to do/make? Maybe we can get you pointed in the right direction.
 
Since it's mostly a new in terms of layout and how functionality changed for input, old code doesn't compile. That's the issue you are seeing, code written for the old api.

What are you trying to do/make? Maybe we can get you pointed in the right direction.
Yea I was looking through it :P That was just the gem leveler plugin been actually trying to learn C# via designing plugins (may not be the best but should be fun). I just have no idea how to get intillisense to properly pull the api...most likely because I am a noob and not familiar with the design environment yet.
 
Yea I was looking through it :P That was just the gem leveler plugin been actually trying to learn C# via designing plugins (may not be the best but should be fun). I just have no idea how to get intillisense to properly pull the api...most likely because I am a noob and not familiar with the design environment yet.

Ok so basically you want to do the following:

1. Start up your Visual Studio and make a new Visual C# -> Class Library. I'll just name it "EmmittPlugin".

2. In the "Solution Explorer", right click on "References" and choose "Add Reference".

3. Select "Browse..." at the bottom, and navigate to your Exilebuddy/Beta folder. Choose the "ExilebuddyBETA.exe" or "Exilebuddy.exe" file. You will typically also want to do the same for log4net for logging.

4. Now you can double click the "Exilebuddy/Beta" reference to view it in the Object Browser. Loki.Game is the actual game api. Loki.Bot is our bot api using the game api.

An example plugin would be the following:
Code:
using System;
using log4net;
using Loki.Utilities;
using Loki.Utilities.Plugins;

namespace EmmittPlugin
{
    public class GemLeveler : 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 "Emmitt"; }
        }

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

        public string Name
        {
            get { return "Emmitt Plugin"; }
        }

        public string Description
        {
            get { return "<TODO>"; }
        }

        /// <summary> Executes the start action. This is called when the bot starts. </summary>
        public void OnStart()
        {
            Log.DebugFormat("[{0}] OnStart", Name);
        }

        /// <summary> Executes the stop action. This is called when the bot is stopped. </summary>
        public void OnStop()
        {
            Log.DebugFormat("[{0}] OnStop", Name);
        }

        /// <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()
        {
            Log.DebugFormat("[{0}] OnInitialize", Name);
        }

        /// <summary> Executes the shutdown action. This is called when the bot is shutting down. (Not when Stop() is called) </summary>
        public void OnShutdown()
        {
            Log.DebugFormat("[{0}] OnShutdown", Name);
        }

        /// <summary> Executes the enabled action. This is called when the user has enabled this specific plugin via the GUI. </summary>
        public void OnEnabled()
        {
            Log.DebugFormat("[{0}] OnEnabled", Name);
        }

        /// <summary> Executes the disabled action. This is called whent he user has disabled this specific plugin via the GUI. </summary>
        public void OnDisabled()
        {
            Log.DebugFormat("[{0}] OnDisabled", Name);
        }

        /// <summary> Executes the config action. This is called when the user clicks on the config button.</summary>
        public void OnConfig()
        {
            Log.DebugFormat("[{0}] OnConfig", Name);
        }

        #endregion
    }
}

Inside your Exilebuddy plugin folder, make a new folder for your plugin, "EmmittPlugin" and the copy over your main cs file (Class1.cs by default) into that folder.

If all goes well, you should be able to restart the bot and see your plugin listed. You'll get the debug notifications when you enable it or click config, like so.

As for using the api, we don't really have examples or guides on writing bots and stuff, just because of how much we've had to change it, but you can play around with things. if you have any questions about it though, feel free to ask, we try to help people as needed, but lately we've been spending all our time rewriting the bot and trying to fix the new bugs. :)
 
Thank you very much! This is exactly what I needed, just getting the environment set up is the best damn thing ever! I can always mess around with the api ;) Don't really need a written example as it seems really straight forward. Just have to sit down and try to do what you want it to do.
In all seriousness though. I love you xD thanks for the help hopefully I will be able to start designing and who knows maybe put out something cool
 
Back
Top