try this.
code:
var x;
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin,Message,MessageKind)
{
if (Message == "test1") {
x="test";
}
if (Message == "test2") {
MsgPlus.DisplayToast("TEST", x);
}
}
dont have time to test it right now but that should work.
if you really wanna use the WriteString call try this.
code:
var x;
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin,Message,MessageKind)
{
if (Message == "test1") {
x.WriteString(0, "test");
}
if (Message == "test2") {
MsgPlus.DisplayToast("TEST", x.ReadString(0));
}
}