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
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;
}