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