Shoutbox

Window example from Scripting Doc and questions - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Window example from Scripting Doc and questions (/showthread.php?tid=61458)

Window example from Scripting Doc and questions by Aloshi on 06-25-2006 at 11:13 PM

I've been at this for an hour and a half or so and have followed the Scripting Documentation to the letter. Looking in the section Working with scripts->Windows for your scripts it isn't working. I checked the debug window and no errors. The code in the script is this:
function OnEvent_Initialize(MessengerStart)
{
var Wnd = MsgPlus.CreateWnd("InterfaceTest.xml", "WndTest");
}
function OnEvent_Uninitialize(MessengerExit)
{
}

And I made the file InterfaceTest.xml (Which is really a .txt file...) with the exact copy/pasted code in it (Its a bit large so I wont post it...). I have also tried making a copy of another XML file, editing what it said, and using it instead. I have no idea what to try now. Any help would be appreaciated.

EDIT: It works, but now I have another question XD. Can someone just give me an example of a working OpenChat command? I have been trying to simply open a chat for a long time...>.>


RE: Window example from Scripting Doc not working by pollolibredegrasa on 06-25-2006 at 11:17 PM

Try saving the xml file in Unicode if you aren't already. Read this thread for more info ;)

Hope this helps...


RE: Window example from Scripting Doc and questions by Aloshi on 06-26-2006 at 02:38 AM

It works! :D

Err, now I have a question XD. Can someone just give me an example of a working OpenChat command? I have been trying to simply open a chat for a long time...>.>


RE: Window example from Scripting Doc and questions by matty on 06-26-2006 at 03:20 AM

Matty's reply to Notification Toast Problem


RE: Window example from Scripting Doc and questions by ivan300 on 06-26-2006 at 03:20 AM

try
Messenger.OpenChat(email) ;)


RE: Window example from Scripting Doc and questions by Aloshi on 06-26-2006 at 02:22 PM

Doesn't work...Heres what I have (The email is just an example):
function OnEvent_Initialize(MessengerStart)
{
Messenger.OpenChat(smarterchild@hotmail.com);
}

function OnEvent_Uninitialize(MessengerExit)
{
}


RE: Window example from Scripting Doc and questions by matty on 06-26-2006 at 02:25 PM

quote:
Originally posted by Aloshi
Doesn't work...Heres what I have (The email is just an example):
function OnEvent_Initialize(MessengerStart)
{
Messenger.OpenChat(smarterchild@hotmail.com);
}

function OnEvent_Uninitialize(MessengerExit)
{
}
You need to put the address in quotes if you are specifying the address

code:
    function OnEvent_Initialize(MessengerStart) {
        Messenger.OpenChat('smarterchild@hotmail.com');
    }

RE: Window example from Scripting Doc and questions by Yomeh on 06-26-2006 at 02:28 PM

code:
function OnEvent_Initialize(MessengerStart)
{
var contact = "xxx@hotmail.com"
Messenger.OpenChat(contact);
}


that works for me
RE: Window example from Scripting Doc and questions by Aloshi on 06-26-2006 at 02:59 PM

Works. I think it was because it wasnt running the script when I saved (I unchecked dit and couldnt recheck, so I made a new script)...I had tried some of the other suggestions before too. Now I'm trying to get the SendMessage command to work...


RE: Window example from Scripting Doc and questions by Aloshi on 06-26-2006 at 06:21 PM

Alright (Sorry for double post :S), I am using this code:

code:
function OnEvent_Initialize(MessengerStart)
{
var Wnd = MsgPlus.CreateWnd("InterfaceTest.xml", "WndTest");
}

function OnEvent_Uninitialize(MessengerExit)
{
}
function OnWndTestEvent_CtrlClicked(Wnd, ControlId)
{
if(ControlId == "BtnClose")
Wnd.Close(1);
var contact = "Email@email.com"
Messenger.OpenChat(contact);
ChatWnd.SendMessage("Test");
}
But it's not sending a message...The gui pops up, I hit the button, it brings up a chat, but no message is sent.
RE: Window example from Scripting Doc and questions by mathieumg on 06-26-2006 at 06:29 PM

ChatWnd is attached to no chat window, you need to give it the right handle.


RE: Window example from Scripting Doc and questions by pollolibredegrasa on 06-26-2006 at 06:30 PM

Try something like this

code:
function OnEvent_Initialize(MessengerStart)
{
var Wnd = MsgPlus.CreateWnd("InterfaceTest.xml", "WndTest");
}

function OnEvent_Uninitialize(MessengerExit)
{
}
function OnWndTestEvent_CtrlClicked(Wnd, ControlId)
{
if(ControlId == "BtnClose")
Wnd.Close(1);
var contact = "Email@email.com"
var convo = Messenger.OpenChat(contact);
convo.SendMessage("Test");
}




RE: Window example from Scripting Doc and questions by Aloshi on 06-26-2006 at 06:33 PM

Ah, works. (I hope I'm not bugging you guys to death with these questions XD)


RE: Window example from Scripting Doc and questions by Aloshi on 07-01-2006 at 02:14 PM

Now I'm trying to make a .plsc file with WinRAR, when I do it, the file looks exactly like a .plsc file, I have a ScriptInfo.xml in unicode in it but it still wont work. It says not a valid script pack...Any idea why?


RE: Window example from Scripting Doc and questions by pollolibredegrasa on 07-01-2006 at 02:18 PM

When creating the file, do you change the Archive Format to .zip? I found if you leave it as .rar it doesnt work.


RE: Window example from Scripting Doc and questions by Aloshi on 07-01-2006 at 03:30 PM

Yes. Still didn't work. :S


RE: Window example from Scripting Doc and questions by matty on 07-01-2006 at 03:38 PM

quote:
Originally posted by Aloshi
Yes. Still didn't work. :S
[Developers] Script Packager
RE: Window example from Scripting Doc and questions by Aloshi on 07-01-2006 at 05:34 PM

I can't run that either because I get an error. :S (My system is a bit messed up so I cant paste the file into the proper directory that I need)