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

[Request] How to initialize a plugin project

Raoul

New Member
Joined
Jul 5, 2012
Messages
87
Reaction score
0
Hi there,
I am an IT consultant, with an extended knowledge in Perl, C, Bash script....

However, most of my experience comes from coding in a textbased ide (Emacs FTW), and a little bit of Netbeans. I don't have any experience regarding programming on Windows Environnement, let alone C# or the .Net framework.
I am fairly motivated to participate in this community, maybe by helping some plugin developper to debug or test some plugins.

I would really like one of the current developper to write a quick Guide explaining the basics "How to write a plugin for Demonbuddy".

Basically, what kind of IDE do I need (Visual studio ?), and what kind of manipulations do I have to do in order to initialize a plugin "hooked up" to the Demonbuddy API ?
I tried to study some plugins written, but I don't get how do they link their sourcecode to the DB API.

Thanks by advance to anyone willing to fulfill this request, I think I am not the only one motivated to invest some time and make useful plugins !
 
Last edited:
There are more threads about this in support section I think.

I am using Microsoft visual studio Express C# which can be found here Visual C# 2010 Express | Microsoft Visual Studio

Install MSVC Express C#


Open Microsoft visual studio Express
Click: File -> New Project -> Class Library -> (give it a name) -> Ok
You have now created a new Class library project

You need to add references now
Right you will see your Solution Explorer
Here you will find a folder named References -> Right click it -> Add references -> goto .NET tab -> Add the following references
  • PresentationCore
  • PresentationFramework
  • WindowsBase
  • System.Xaml

Add Demonbuddy reference
Right you will see your Solution Explorer
Here you will find a folder named References -> Right click it -> Add references -> goto Browse tab -> locate to your demonbuddy.exe and add it

Replace content from class1.cs with
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

using Zeta;
using Zeta.Common;
using Zeta.CommonBot;
using Zeta.Common.Plugins;

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

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

        public void OnInitialize()
        {
            Log("Initialized");
        }
        public void OnShutdown()
        {
        }

        public void OnEnabled()
        {
            Log("Enabled");
        }
        public void OnDisabled()
        {
            Log("Disabled");
        }
        public bool Equals(IPlugin other)
        {
            return (other.Name == Name) && (other.Version == Version);
        }

        public void OnPulse()
        {
        }
    }
}


Find API functions in Demonbuddy
Right you will see your Solution Explorer
Here you will find a folder named References -> Expand it -> Double click on Demonbuddy
The object browser opens and you can find all the Demonbuddy API functions

Create a default template for all this
File -> Export Template -> Follow Export Template Wizzard
Now you can use this template to skip all the stuff mentioned aboved when you start a new project


hope this is enough info .. :)
 
Awesome, thanks to both of you !
Sinterlkaas, can I reproduce your post and put it in the OP in order to improve its visibility and make sure that people see it ?

I will try all this during the week end.
 
@OP; good question, i was just about to type about the same thing you did.
@sinterlkaas; very simple guide, thankyou.
 
Back
Top