Fike

Untitled

Mar 19th, 2011
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  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. Debug.Trace('Loaded');
  7. function OnGetScriptCommands() {
  8. var commands = '<ScriptCommands>';
  9. commands+='<Command>';
  10. commands+='<Name>syshelp</Name>';
  11. commands+='<Description>Lists commands in SystemInfo.</Description>';
  12. commands+='<Parameters/>';
  13. commands+='</Command>';
  14. commands+='<Command>';
  15. commands+='<Name>sysinfo</Name>';
  16. commands+='<Description>Opens a window with information about WLM and Plus! Live.</Description>';
  17. commands+='<Parameters/>';
  18. commands+='</Command>';
  19. commands+='<Command>';
  20. commands+='<Name>wlmver</Name>';
  21. commands+='<Description>Send a message to whoever you are chatting with with the version of WLM you are currently using.</Description>';
  22. commands+='<Parameters/>';
  23. commands+='</Command>';
  24. commands+='</ScriptCommands>';
  25. Debug.Trace("Commands now available.")
  26. return commands;
  27. }
  28.  
  29. function OnEvent_Initialize(MessengerStart) {
  30. MsgPlus.DisplayToast("SystemInfo", "Welcome to SysInfo! Do /syshelp in a chat window for commands!");
  31. }
  32.  
  33. function OnEvent_ChatWndSendMessage(pChatWnd, sMessage) {
  34. if (sMessage.toLowerCase() == "/syshelp") {
  35. MsgPlus.CreateWnd("SysHelp.xml", "SysHelp");
  36. return "";
  37. } else if (sMessage.toLowerCase() == "/wlmver") {
  38. return (Messenger.Version.toFixed(1)+'.0'+Messenger.VersionBuild);
  39. Debug.Trace(Messenger.Version.toFixed(1)+'.0'+Messenger.VersionBuild);
  40. } else if (sMessage.toLowerCase() == "/sysinfo") {
  41. MsgPlus.CreateWnd("SysInfo.xml", "SysInfo");
  42. var oSysHelpWnd = MsgPlus.CreateWnd()
  43. oSysHelpWnd.SetControlText('WlmVer', Messenger.Version)
  44. return "";
  45. }
  46. }
  47.  
  48. function OnWndTestEvent_CtrlClicked(Wnd, ControlId)
  49. {
  50. if(ControlId == "BtnClose")
  51. Wnd.Close(1);
  52. if(ControlId == "BtnMoreInfo")
  53. MsgPlus.CreateWnd ("SysInfo.xml", "SysInfo");
  54. }
Advertisement
Add Comment
Please, Sign In to add comment