What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Making a /command

Making a /command
Author: Message:
Suma
New Member
*


Posts: 7
33 / Male / –
Joined: Aug 2006
O.P. RE: RE: Making a /command
quote:
Originally posted by alexp2_ad
You have to add it to the list by putting something like this in your code:

code:
function OnGetScriptCommands(){
    var commands = '<ScriptCommands>';
        commands+='<Command>';
            commands+='<Name>pause</Name>';
            commands+='<Description>'+langstrings[94]+'</Description>';
            commands+='<Parameters/>';
        commands+='</Command>';
    commands+='</ScriptCommands>';
    return commands;
}


For more on commands:
http://mpwiki.net/Script_Commands

I don't get it :S because the code in this code:
code:
function OnEvent_Initialize( Messenger )
{

  if(!LoadInstall())
  {
 
    LoadInstall();
 
  }
 
}

function OnEvent_Signin(Email)
{

  if(ReadReg("todaysDate") != datum())
  {

    WriteReg("todaysDate", datum());
    WriteReg("today", 0);

  }
 
  WriteReg("today", parseInt(ReadReg("today"))+1);
  WriteReg("total", parseInt(ReadReg("total"))+1);

  if(LoadInstall())
  {

    tostie("Overzicht - Totaal", data("totaal"));
    tostie("Overzicht - Vandaag", data("vandaag"));

  }
  else
  {

    tostie("Hersteld", "Het script heeft zich hersteld van een fout!");

  }

}

function datum()
{

  var datum = new Date();
  var month = datum.getMonth()+1;

  if(month < 9)
  {

    month = "0" + month;

  }

  var vandaag = datum.getDate() + "/" + month + "/" + datum.getYear(); 
  return vandaag;

}

function WriteReg(titel, value)
{

  var Shell = new ActiveXObject("WScript.Shell");
  var ValRegPath = MsgPlus.ScriptRegPath + Messenger.MyUserId + "\\" + titel;
  Shell.RegWrite(ValRegPath, value);

}

function ReadReg(titel)
{

  var Shell = new ActiveXObject("WScript.Shell");
  var ValRegPath = MsgPlus.ScriptRegPath + Messenger.MyUserId + "\\" + titel;
 
  try
  {

    BackDo = Shell.RegRead( ValRegPath );
                 
    if ( BackDo != '' )
    {
                 
      return Shell.RegRead(ValRegPath);
                         
    }
    else
    {
                 
      return false;
                         
    }
                 
  }
  catch( exception )
  {

    return false;
                 
   }

}

function LoadInstall()
{

  var i = 0;

  if(!ReadReg("todaysDate"))
  {

    WriteReg("todaysDate", datum());
    i++;

  }

  if(!ReadReg("total"))
  {

    WriteReg("total", 1);
    i++;

  }

  if(!ReadReg("today"))
  {

    WriteReg("today", 1);
    i++;

  }

  if(i == 0) {

    return true;

  }
  else
  {

    return false;

  }

}

function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{

  if(Message == "/singelogd")
  {

    if(LoadInstall()){

      if(ReadReg("todaysDate") != datum())
      {

        WriteReg("todaysDate", datum());
        WriteReg("today", 0);

      }

      tostie("Overzicht - Totaal", data("totaal"));
      tostie("Overzicht - Vandaag", data("vandaag"));

    }
    else
    {

      tostie("Hersteld", "Het script heeft zich hersteld van een fout!");

    }

    return "";
   
  }

}

function tostie(titel, msg)
{

  MsgPlus.DisplayToast(titel, msg);

}

function data(type)
{

  if(type == "vandaag")
  {

    return "Je bent vandaag al " + ReadReg("today") + " keer ingelogd.";

  }
  else if(type == "totaal")
  {

    return "In het totaal ben je al " + ReadReg("total") + " keer ingelogd.";

  }

}

does appeard in the /list without :
code:
function OnGetScriptCommands(){
    var commands = '<ScriptCommands>';
        commands+='<Command>';
            commands+='<Name>pause</Name>';
            commands+='<Description>'+langstrings[94]+'</Description>';
            commands+='<Parameters/>';
        commands+='</Command>';
    commands+='</ScriptCommands>';
    return commands;
}

08-10-2006 01:33 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Making a /command - by Suma on 08-10-2006 at 01:11 PM
RE: Making a /command - by markee on 08-10-2006 at 01:14 PM
RE: Making a /command - by alexp2_ad on 08-10-2006 at 01:19 PM
RE: RE: Making a /command - by Suma on 08-10-2006 at 01:24 PM
RE: Making a /command - by Veggie on 08-10-2006 at 01:28 PM
RE: Making a /command - by alexp2_ad on 08-10-2006 at 01:28 PM
RE: RE: Making a /command - by Suma on 08-10-2006 at 01:33 PM
RE: Making a /command - by J-Thread on 08-10-2006 at 01:39 PM
RE: RE: Making a /command - by Suma on 08-10-2006 at 01:43 PM
RE: Making a /command - by RaceProUK on 08-10-2006 at 03:32 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On