More help needed *sigh* - 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: More help needed *sigh* (/showthread.php?tid=97135)
More help needed *sigh* by Fike on 03-19-2011 at 06:11 PM
Don't mean to spam the forums with these type threads, but I'm a newb who needs help
Say I have this:
function OnEvent_ChatWndSendMessage(pChatWnd, sMessage) {
if (sMessage.toLowerCase() == "/syshelp") {
MsgPlus.CreateWnd("SysHelp.xml", "SysHelp");
return "";
} else if (sMessage.toLowerCase() == "/wlmver") {
return (Messenger.Version.toFixed(1)+'.0'+Messenger.VersionBuild);
} else if (sMessage.toLowerCase() == "/sysinfo") {
var oSysHelpWnd = MsgPlus.CreateWnd("SysInfo.xml", "SysInfo");
oSysHelpWnd.SetControlText("WlmVer", Messenger.Version.toFixed(1)+'.0'+Messenger.VersionBuild);
return "";
}
}
and I want to add another SetControl, how would I achieve this? I've copy/pasted the same oSysHelpWnd.SetControlText line below it and modified it for my second control but it wont work...
RE: More help needed *sigh* by foaly on 03-19-2011 at 06:27 PM
that actually should work, does the scriptdebugger give any errors?
RE: RE: More help needed *sigh* by Fike on 03-19-2011 at 06:36 PM
quote: Originally posted by foaly
that actually should work, does the scriptdebugger give any errors?
Nope.
RE: More help needed *sigh* by CookieRevised on 03-19-2011 at 07:56 PM
You mean you did this: code: var oSysHelpWnd = MsgPlus.CreateWnd("SysInfo.xml", "SysInfo");
oSysHelpWnd.SetControlText("WlmVer", Messenger.Version.toFixed(1)+'.0'+Messenger.VersionBuild);
oSysHelpWnd.SetControlText("id_of_whatever_other_control_you_want_to_set_the_text_for", "some text");
return "";
?
Are you sure you actually do have that text control (id_of_whatever_other_control_you_want_to_set_the_text_for) properly defined in SysInfo.xml too?
RE: More help needed *sigh* by Fike on 03-19-2011 at 08:04 PM
Yep.
matty couldn't see anything wrong either.
Here's the current code:
code: oSysHelpWnd.SetControlText("PlusVer", Messenger.Version.toFixed(1)+'.0'+Messenger.VersionBuild);
RE: More help needed *sigh* by CookieRevised on 03-19-2011 at 08:08 PM
Remember: always provide all the related script files if you want people to help you.
(in this case it also means posting the complete code of SysInfo.xml)
RE: More help needed *sigh* by Fike on 03-19-2011 at 08:10 PM
JS: http://pastebin.com/1cKBEZea
XML: http://pastebin.com/ahurkkBb
RE: More help needed *sigh* by matty on 03-19-2011 at 08:24 PM
Worked fine when I ran it here.
(Note I was on a mobile [my blackberry] when I was first looking into it)
js code: function OnWndTestEvent_CtrlClicked(Wnd, ControlId)
{
if (ControlId == "BtnClose")
Wnd.Close(1);
if (ControlId == "BtnMoreInfo")
MsgPlus.CreateWnd ("SysInfo.xml", "SysInfo");
}
Also note this code will never get hit because WndTest doesn't exist. Your windows are called SysHelp and SysInfo.
Also a trick is to call your buttons BtnCancel if you want to close a window and Plus! will automatically interpret that as to close the window.
RE: RE: More help needed *sigh* by Fike on 03-19-2011 at 08:36 PM
quote: Originally posted by matty
Worked fine when I ran it here.
(Note I was on a mobile [my blackberry] when I was first looking into it)
js code: function OnWndTestEvent_CtrlClicked(Wnd, ControlId)
{
if (ControlId == "BtnClose")
Wnd.Close(1);
if (ControlId == "BtnMoreInfo")
MsgPlus.CreateWnd ("SysInfo.xml", "SysInfo");
}
Also note this code will never get hit because WndTest doesn't exist. Your windows are called SysHelp and SysInfo.
Also a trick is to call your buttons BtnCancel if you want to close a window and Plus! will automatically interpret that as to close the window.
Ah, it worked for me but only after about 10 seconds
|