// SysInfo 1.0 by Fike. // This script could be a useful example to developers. Some lines are commented in case you're here to learn :) // Twitter = @_DrunkFox_. // Thanks to matty for helping me on my way to being an awesome scripter like him :) function OnGetScriptCommands() { // The lines below define the different commands available, so that when you do "/" in a chat window, it will show you exactly what the commands do. Self-explainatory. var commands = ''; commands+=''; commands+='syshelp'; // Don't put a / before the command here, this will be done automatically. Same goes for commands below. commands+='Lists commands in SystemInfo.'; commands+=''; commands+=''; commands+=''; commands+='sysinfo'; commands+='Opens a window with information about WLM and Plus! Live.'; commands+=''; commands+=''; commands+=''; commands+='wlmver'; commands+='Send a message to whoever you are chatting with with the version of WLM you are currently using.'; commands+=''; commands+=''; commands+=''; Debug.Trace("Commands initialised") // Sends a message to the debug window if open. return commands; // Refreshes command list. } function OnEvent_Initialize(MessengerStart) { MsgPlus.DisplayToast("SystemInfo", "Welcome to SysInfo! Do /syshelp in a chat window for commands!"); // These lines make an alert/toast when Messenger is started. } // Lines below show the script what to do when a command is issued in the chat window. // If you're having multiple commands, you must put an "else if" after the "} ", otherwise it will trigger an error message in the debug window. // return ""; tells WLM that no message needs to be sent to the contact. function OnEvent_ChatWndSendMessage(pChatWnd, sMessage) { if (sMessage.toLowerCase() == "/syshelp") { MsgPlus.CreateWnd("SysHelp.xml", "SysHelp"); // Tells Plus! that it should open a window using the XML file and the window ID. return ""; } else if (sMessage.toLowerCase() == "/wlmver") { return (Messenger.Version.toFixed(1)+'.0'+Messenger.VersionBuild); // Line tells thatwhen /wlmver is done, to send a message with the current version of WLM to the contact you're talking to. } else if (sMessage.toLowerCase() == "/sysinfo") { var oSysHelpWnd = MsgPlus.CreateWnd("SysInfo.xml", "SysInfo"); oSysHelpWnd.SetControlText("WlmVer", Messenger.Version.toFixed(1)+'.0'+Messenger.VersionBuild); // This line and the one above it are required if you wish to post something to a control in a window from the script when open. oSysHelpWnd.SetControlText("PlusVer", Messenger.Version.toFixed(1)+'.0'+Messenger.VersionBuild); return ""; } } function OnWndTestEvent_CtrlClicked(Wnd, ControlId) { if (ControlId == "BtnClose") Wnd.Close(1); if (ControlId == "BtnMoreInfo") MsgPlus.CreateWnd ("SysInfo.xml", "SysInfo"); }