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

Plugins - The default file (plugin skeleton)

Status
Not open for further replies.

ChuckyEgg

Member
Joined
Jun 14, 2012
Messages
635
Reaction score
8
The GW2Buddy Plugin Skeleton
What the plugin needs to contain when first created​


Use this skeleton file to create your plugins. For those with DemonBuddy plugin creation experience, the skeleton is virtually identical.

Difference between DemonBuddy and GW2Buddy plugin skeleton file (only the name of the method/event differs, functionality is the same):

[table="width: 500, class: outer_border, align: left"]
[tr]
[td]Namespaces:[/td]
[td][/td]
[/tr]
[tr]
[td]GW2Buddy [/td]
[td]DemonBuddy[/td]
[/tr]
[tr]
[td]Typhon[/td]
[td]Zeta[/td]
[/tr]
[tr]
[td][/td]
[td][/td]
[/tr]
[tr]
[td]Methods/Events:[/td]
[td][/td]
[/tr]
[tr]
[td]GW2Buddy[/td]
[td]DemonBuddy[/td]
[/tr]
[tr]
[td]Initialise()[/td]
[td]Initialize()[/td]
[/tr]
[tr]
[td]Shutdown()[/td]
[td]OnShutDown()[/td]
[/tr]
[tr]
[td]Pulse()[/td]
[td]OnPulse()[/td]
[/tr]
[tr]
[td]ConfigurationWindow[/td]
[td]DisplayWindow[/td]
[/tr]
[/table]

GW2Buddy, at time of writing, does not have an OnEnabled() or OnDisabled() method/event.


The Skeleton File Contents

PHP:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

using Typhon;
using Typhon.Common;
using Typhon.CommonBot;

namespace MyPlugin
{
    partial class MyPlugin : IPlugin
    {
        public string Author { get { return "ChuckyEgg"; } }
        public string Description { get { return ""; } }
        public string Name { get { return "Uber Plugin!" + Version.ToString(); } }
        public Version Version { get { return new Version(0, 1); } }

        public Window ConfigurationWindow { get { return null; } }
        public void Log(string message, LogLevel level = LogLevel.Normal)
        {
            Logging.Write(level, string.Format("[{0}] {1}", Name, message));
        }

        public void Initialise()
        {
            Log("Initialised");
			// enter code here that will be executed when the bot is first run (not totally certain about this)
        }
        public void Shutdown()
        {
			// enter code here that will be executed when the bot is shutdown
        }		
        public bool Equals(IPlugin other)
        {
            return (other.Name == Name) && (other.Version == Version);
        }


        public void Pulse()
        {
			// enter code here that will be executed every so often - seconds, less than a second, you get my drift :)
        }
    }
}


FILE DOWNLOAD
The file goes into the Plugins folder, and within its own folder.
example:
this attachment, MyPlugin.cs would be
GW2Buddy\Plugins\MyPlugin\MyPlugin.cs
 

Attachments

<reserved>

I'll add more information as and when I find it. This page will be altered to reflect any changes in the bot, as no doubt things will be added, altered, and removed in time :)

This is all I have found out so far. I have no idea what other events GW2Buddy has, but I'll post my findings just as soon as I am sure of them :)

Thanks go to superreeen (guidance) and sinterlkaas (original thread in the DB forums), in the information obtained for this thread.
 
Last edited:
Status
Not open for further replies.
Back
Top