Fike

Untitled

Mar 19th, 2011
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // SystemInfo 1.0 by Fike.
  2. // This script could be a useful example to developers.
  3. // Twitter = @_DrunkFox_.
  4. // Thanks to matty for helping me on my way to being an awesome scripter like him :)
  5.  
  6. var SysInfoWnd = MsgPlus.CreateWnd()
  7.  
  8. Debug.Trace('Loaded');
  9. function OnGetScriptCommands() {
  10.     var commands = '<ScriptCommands>';
  11.         commands+='<Command>';
  12.             commands+='<Name>syshelp</Name>';
  13.             commands+='<Description>Lists commands in SystemInfo.</Description>';
  14.             commands+='<Parameters/>';
  15.         commands+='</Command>';
  16.         commands+='<Command>';
  17.             commands+='<Name>sysinfo</Name>';
  18.             commands+='<Description>Opens a window with information about WLM and Plus! Live.</Description>';
  19.             commands+='<Parameters/>';
  20.         commands+='</Command>';
  21.         commands+='<Command>';
  22.             commands+='<Name>wlmver</Name>';
  23.             commands+='<Description>Send a message to whoever you are chatting with with the version of WLM you are currently using.</Description>';
  24.             commands+='<Parameters/>';
  25.         commands+='</Command>';
  26.     commands+='</ScriptCommands>';
  27.     Debug.Trace("Commands now available.")
  28.     return commands;
  29. }
  30.  
  31. function OnEvent_Initialize(MessengerStart) {
  32.     MsgPlus.DisplayToast("SystemInfo", "Welcome to SysInfo! Do /syshelp in a chat window for commands!");
  33. }
  34.  
  35. function OnEvent_ChatWndSendMessage(pChatWnd, sMessage) {
  36.     if (sMessage.toLowerCase() == "/syshelp") {
  37.         MsgPlus.CreateWnd("SysHelp.xml", "SysHelp");
  38.         return "";
  39.     } else if (sMessage.toLowerCase() == "/wlmver") {
  40.         return (Messenger.Version.toFixed(1)+'.0'+Messenger.VersionBuild);
  41.         Debug.Trace(Messenger.Version.toFixed(1)+'.0'+Messenger.VersionBuild);
  42.     } else if (sMessage.toLowerCase() == "/sysinfo") {
  43.         MsgPlus.CreateWnd("SysInfo.xml", "SysInfo");
  44.         SysInfoWnd.SetControlText(WlmVer, Messenger.Version.toFixed(1)+'.0'+Messenger.VersionBuild);
  45.         return "";
  46.     }
  47. }
  48.  
  49. function OnWndTestEvent_CtrlClicked(Wnd, ControlId)
  50. {
  51.     if(ControlId == "BtnClose")
  52.         Wnd.Close(1);
  53.     if(ControlId == "BtnMoreInfo")
  54.         MsgPlus.CreateWnd ("SysInfo.xml", "SysInfo");
  55. }
Advertisement
Add Comment
Please, Sign In to add comment