
Jlucben

Hello
I'm a french new user and trying to connect my bot which is based on Synbot and SIML Package in an EZB Plugin
I'm using Nugget to include the Syn Package in my solution.
The plugin is working fine without reference to Syn. With a Windows forms appplication (Not a Plugin) , bot and reference to Syn are working fine.
But when I include reference to Syn Package in the plugin , I get an error :
Thanks for your help
Here is my code for Plugin
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.IO; using System.Threading.Tasks; using System.Windows.Forms; using Syn.Bot;
namespace Plugin_SIML { public partial class Mainform : EZ_Builder.UCForms.FormPluginMaster { public Mainform() { InitializeComponent(); Console.SetOut(new ControlWriter(Textconsole)); } /// /// This method is called by ARC when it requests the configuration for your plugin. /// ARC will request the configuration when the control is created and when the project is saved. /// The data set in this configuration will be serialized and saved in the ARC user's project. /// Custom data may be stored in the STORAGE dictionary. /// public override EZ_Builder.Config.Sub.PluginV1 GetConfiguration() {
return base.GetConfiguration();
}
///
/// This method is called by ARC when a project is loaded or when the control is added to a project.
/// Set your default data in here!
/// The configuration from the user's project file will be set using this method.
/// *Note: The plugin must call Base.SetConfiguration(cf) in your override. See the example!
/// Also note that this is a good place to ensure all required configuration data exists.
/// In the case of a newer version of your plugin where different configuration data may be required outside of the users configuration file, set it here.
///
public override void SetConfiguration(EZ_Builder.Config.Sub.PluginV1 cf)
{
base.SetConfiguration(cf);
}
///
/// This method is called by ARC when another control sends a command to this control using the EZ-Script ControlCommand() function.
/// The available ControlCommand() functions for this control should be returned in the GetSupportedControlCommandsMethodsForSlave() override.
///
public override void SendCommand(string windowCommand, params string[] values)
{
base.SendCommand(windowCommand, values);
}
///
/// This method is called by ARC for the Cheat Sheet to receive all available ControlCommand() syntax for this control.
/// When the ControlCommand() is called for this function, see the SendCommand() override.
///
public override object[] GetSupportedControlCommands()
{
return base.GetSupportedControlCommands();
}
private void button1_Click(object sender, EventArgs e)
{
Console.WriteLine("Test Create Bot");
var simlBot = new Syn.Bot.Siml.SimlBot();
}
private void button2_Click(object sender, EventArgs e)
{
Console.WriteLine("Stop");
}
private void Textconsole_TextChanged(object sender, EventArgs e)
{
}
}
public class ControlWriter : TextWriter
{
private Control textbox;
public ControlWriter(Control textbox)
{
this.textbox = textbox;
}
public override void Write(char value)
{
textbox.Text += value;
}
public override void Write(string value)
{
textbox.Text += value;
}
public override Encoding Encoding
{
get { return Encoding.ASCII; }
}
}
}
Yes it works.
Unfortunately PCL assemblies are becoming more frequent, some of them don't offer a non PCL version.
DJ did you tried the Plugin+PCL issue in debug Mode (ARC code open in the visual studio) ?
If you want to dig the issue, you can try to call the plugin early as possible in your ARC code to confirm if the problem surfaces immediately or after loading other assemblies.
Figured it out. I'll release an update this evening. Thanks for your help!
Can you close this assistance thread? The latest ARC resolves this issue.
It's fine now