This line:
Form1 ele = new Form1();
Creates a new form.. and everything under that is also new. That means you have a new, completely separate form with its own RichTextBox
sitting in memory. That is what you are appending text to.
What you need to do, is pass the instance of the form you're currently working with.. in. Read the comments here:
// Add the Form as an argument at the end ---------------> ___here___
public static void AiProccess(string pType, String[] pArgs, Form1 form)
{
if (pType == "event")
{
string pEvent = pArgs[0];
aiEvent(pEvent, form); // pass it in
}
}
public static void aiEvent(string pEvent, Form1 form){
if (pEvent == "powerOn")
{
// use the "form" variable here
form.Mind.Text = "test";
form.Mind.AppendText("Are you my Creator?");
}
}
Read the comments in the code. You can then pass the current instance in like this:
String[] eventArgs = new String[] {"powerOn"};
Program.AiProccess("event", eventArgs, this); // <---- pass "this"