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

Reminder
Author: Message:
mrfireman
Junior Member
**


Posts: 25
Joined: Oct 2008
O.P. RE: Reminder
It is still doesn't working at me, but I am sure, i am the noob to misswrote something... (I am newbie at scripting) My script now:

jscript code:
//set globals
var time;
var own_message;
var chatwnds=[];

//display the toast
//hehe toast.... mmm butter...
function toast() {
    var t_title = "Time's Up!";
    var t_msg;
   
    //if personal message set
    if(own_message == "") {
        var t_msg = "You set a timer for "+time+" minute(s) and your time is up!";
    }
    //if default message
    else {
        var t_msg = time+" minute(s) has passed - \""+own_message+"\"";
    }
    //display the toast
    MsgPlus.DisplayToast(t_title,t_msg,"alarm.mp3");
   
    //unset variables
    time = "";
    own_message = "";
}

//check input for function
function OnEvent_ChatWndSendMessage(ChatWnd,Message) {
    //generate new array
    var input = new Array();
    //assign values to array
    input = Message.split(" ");
   
    if(input[0] == "/remind") {
        // set a reminder
        time = input[1];
        if(input[2]) {
            // own message
            var input_no = 3;
            own_message = input[2];
           
            //if the message is more than one word
            if(input[3]) {
                //string together message
                while(input_no < input.length) {
                    own_message+=" "+input[input_no];
                    input_no = input_no+1;
                }
            }
           
        }
        //convert to milliseconds
        var time_ms = time*60000;
        //set timer
        MsgPlus.AddTimer("toaster2", time_ms);
        //return nowt
        return "";
    }
}
var chatwnds=[];

function OnEvent_Timer(TimerId){
    chatwnds[TimerId].SendMessage("time's up!"); // Sends a message to contact..
    delete chatwnds[TimerId];
    }
   
function OnEvent_ChatWndSendMessage(ChatWnd,Message){
    if(/^\/(\S*)\s*(.*)/.exec(Message))
        if(RegExp.$1.toLowerCase()=="reminder"){
            var m=RegExp.$2*60000;
            chatwnds[m]=ChatWnd;
            MsgPlus.AddTimer(m,m);
            Debug.Trace("Done and done. Reminding in "+m/60000+" minute(s)");
            return "";
            }
    /* usage: /reminder <minutes> */
    }
function OnEvent_Initialize(MessengerStart) {}
function OnEvent_Uninitialize(MessengerExit) {}

This post was edited on 12-17-2008 at 11:08 PM by mrfireman.
12-17-2008 11:07 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Reminder - by mrfireman on 12-16-2008 at 10:18 PM
RE: Reminder - by roflmao456 on 12-17-2008 at 10:13 PM
RE: Reminder - by mrfireman on 12-17-2008 at 10:53 PM
RE: Reminder - by roflmao456 on 12-17-2008 at 11:02 PM
RE: Reminder - by mrfireman on 12-17-2008 at 11:07 PM
RE: Reminder - by roflmao456 on 12-17-2008 at 11:08 PM
RE: Reminder - by mrfireman on 12-17-2008 at 11:11 PM
RE: Reminder - by Spunky on 12-17-2008 at 11:35 PM
RE: Reminder - by mrfireman on 12-17-2008 at 11:40 PM
RE: Reminder - by roflmao456 on 12-18-2008 at 12:00 AM


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