What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Reqest] Script that says heyy to whoever signs on

[Reqest] Script that says heyy to whoever signs on
Author: Message:
ryannathans
New Member
*


Posts: 4
Joined: Apr 2009
O.P. [Reqest] Script that says heyy to whoever signs on
heyy everyone! this is a request for someone who can make a script that says "heyy" to whoever just signs in. shouldn't be too hard?

thanks
04-30-2009 08:27 AM
Profile E-Mail PM Find Quote Report
Baggins
Full Member
***

Avatar
B000ALFAZO

Posts: 387
Reputation: 13
29 / Male / Flag
Joined: Oct 2006
RE: [Reqest] Script that says heyy to whoever signs on
In the scripts menu click Scripts Prefrences, then create a new script and paste this code in. If you want to change the message, just change what is in the quotes at the top.
Javascript code:
var sMessage = "Hey!";
function OnEvent_ContactSignin(sEmail)
{
    oChatWnd = Messenger.OpenChat(sEmail);
    oCahtWnd.SendMessage(sMessage);
}


This post was edited on 04-30-2009 at 07:59 PM by Baggins.
04-30-2009 10:23 AM
Profile E-Mail PM Web Find Quote Report
ryannathans
New Member
*


Posts: 4
Joined: Apr 2009
O.P. RE: [Reqest] Script that says heyy to whoever signs on
im trying it now :) thanks
04-30-2009 10:39 AM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
35 / Male / Flag
Joined: Aug 2006
RE: [Reqest] Script that says heyy to whoever signs on
Javascript code:
function OnEvent_ContactSignin(x){
    Messenger.OpenChat(x).SendMessage("Hey!");
}


Even Simpler...
<Eljay> "Problems encountered: shit blew up" :zippy:
04-30-2009 12:00 PM
Profile PM Find Quote Report
ryannathans
New Member
*


Posts: 4
Joined: Apr 2009
O.P. RE: [Reqest] Script that says heyy to whoever signs on
lol yeah and the other guy spelt his wrong...

how about a code for saying heyy only if the contact has NOT been on in the last 10 mins?
04-30-2009 12:27 PM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
RE: [Reqest] Script that says heyy to whoever signs on
quote:
Originally posted by ryannathans
how about a code for saying heyy only if the contact has NOT been on in the last 10 mins?
That's a bit more difficult. Basically, you'd have to store the time when they went online in some kind of global object and when they come online again, check the time difference first before sending the message.

Here's some documented example code. Have a look at it first, make sure you understand what I've done and then try it out.
Javascript code:
/* Global variables */
var sHelloMessage = "Hey!"; //Message to send on contact sign-in
var oContactSigninTimes = {};   // Store for the contact signin times
var nMinSigninInterval = 10 * 60 * 1000;    // 10 minutes (expressed in milliseconds)
 
function OnEvent_ContactSignin( sEmail ) {
    // Set up some local variables
    var nTime = new Date().getTime();   //Get the current time, as a number
    var nLastSignin = 0;    //Placeholder for the contact's last sign-in time
    // First check if we have a logged sign-in time
    if( nLastSignin = oContactSigninTimes[sEmail] ) {
        // Compare it to the time now
        if( (nTime - nLastSignin) < nMinSigninInterval ) {
            // If the difference is less than the configured interval,
            // stop further execution of this function.
            return;
        }
    }
    // If we don't have a previously logged sign-in time or
    // if the difference is greater than the configured interval,
    // store the current time and send the message.
    oContactSigninTimes[sEmail] = nTime;
    Messenger.OpenChat(sEmail).SendMessage(sHelloMessage);
}

Oh, and by the way: we have an [Image: edit.gif] button here, no need for double post in less than a minute! :P

This post was edited on 04-30-2009 at 04:13 PM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
04-30-2009 04:12 PM
Profile E-Mail PM Web Find Quote Report
ryannathans
New Member
*


Posts: 4
Joined: Apr 2009
O.P. RE: [Reqest] Script that says heyy to whoever signs on
ohh i diddnt see the edit button, thanks
05-01-2009 07:39 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


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