IPluginArgument is no longer used, simply use "PluginArgument" instead.
In BE version 2.5 the plugin system has been changed, to make it easier creating plugins.
To create a plugin in BE version 2.5 and later, follow these simple steps:
First of all, make sure to create a new project of type Class Library - select target framework to be .NET 3.5.
Add a reference to: C:\Program Files (x86)\Blue Eye Macro\Plugin.dll
Mark your class as Serializable.
Create your plugin inheriting from BaseInstruction / BaseCriterion.
Here is an example of two plugins, an instruction which which will simply save a variable and a criterion which will always return true.
C# Plugin
Code:
using System;
using Plugin.BaseClasses;
using Plugin.Classes;
namespace MyFirstCoupleOfPlugins
{
[Serializable]
public class MyPluginInstruction : BaseInstruction
{
public override void InitArguments()
{
AddArguments(
new PluginArgument(PluginArgument.ArgumentType.Text, 100, "Variable Name", "The variable to set"),
new PluginArgument(PluginArgument.ArgumentType.Text, 100, "Text", "The text to save"));
}
public override void Execute()
{
SetVariable(Arguments[0].Value.ToString(), Arguments[1].Value.ToString());
}
public override string Name
{
get { return "Set variable"; }
}
}
[Serializable]
public class MyPluginCriterion: BaseCriterion
{
public override void InitArguments(){}
public override bool IsSatisfied()
{
return true;
}
public override string Name
{
get { return "Always true"; }
}
}
}
Compile it, and copy your new dll to the "C:\Program Files (x86)\Blue Eye Macro\Plugins" folder.
Compiled dll:
Attachment:
MyFirstCoupleOfPlugins.dll [5 KiB]
Downloaded 1063 times
Launch BE, and your all set.
Now you can use your new instruction and criterion like this inside BE:
Code:
begin
Plugins.Set variable("var", "It works!")
if Plugins.Always true()
begin
Window.Display message box("{var}", "yes")
end
end
I hope that helps, have fun creating your own building blocks
IPluginArgument is no longer used, simply use "PluginArgument" instead.
In BE version 2.5 the plugin system has been changed, to make it easier creating plugins.
To create a plugin in BE version 2.5 and later, follow these simple steps:
First of all, make sure to create a new project of type Class Library - select target framework to be .NET 3.5.
Add a reference to: C:\Program Files (x86)\Blue Eye Macro\Plugin.dll
Mark your class as Serializable.
Create your plugin inheriting from BaseInstruction / BaseCriterion.
Here is an example of two plugins, an instruction which which will simply save a variable and a criterion which will always return true.
C# Plugin
[code]
using System;
using Plugin.BaseClasses;
using Plugin.Classes;
namespace MyFirstCoupleOfPlugins
{
[Serializable]
public class MyPluginInstruction : BaseInstruction
{
public override void InitArguments()
{
AddArguments(
new PluginArgument(PluginArgument.ArgumentType.Text, 100, "Variable Name", "The variable to set"),
new PluginArgument(PluginArgument.ArgumentType.Text, 100, "Text", "The text to save"));
}
public override void Execute()
{
SetVariable(Arguments[0].Value.ToString(), Arguments[1].Value.ToString());
}
public override string Name
{
get { return "Set variable"; }
}
}
[Serializable]
public class MyPluginCriterion: BaseCriterion
{
public override void InitArguments(){}
public override bool IsSatisfied()
{
return true;
}
public override string Name
{
get { return "Always true"; }
}
}
}
[/code]
Compile it, and copy your new dll to the "C:\Program Files (x86)\Blue Eye Macro\Plugins" folder.
Compiled dll:
[attachment=0]MyFirstCoupleOfPlugins.dll[/attachment]
Launch BE, and your all set.
Now you can use your new instruction and criterion like this inside BE:
[code]
begin
Plugins.Set variable("var", "It works!")
if Plugins.Always true()
begin
Window.Display message box("{var}", "yes")
end
end
[/code]
I hope that helps, have fun creating your own building blocks :)