What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » erm... im not sure :S :(

erm... im not sure :S :(
Author: Message:
cameron.stokes3
New Member
*


Posts: 12
32 / Male / –
Joined: Jan 2007
O.P. erm... im not sure :S :(
code:
function OnEvent_SigninReady(sEmail){
var contacts = Messenger.MyContacts;
var online = 0;
var offline = 0;
for(var e = new Enumerator(contacts); !e.atEnd(); e.moveNext()){
item = e.item();
if(item.Status != 1 && item.Status != 0){
online++;
} else {
offline++;
}
}
MsgPlus.DisplayToast('Welcome!', 'Hello '+sEmail+' You have '+online+' contacts online.');
}


that is what i have so far... it all works and im happy with it but i want to take it one step further... how would i make it so instead of saying "Hello name@domain.com" its just says the first part of the email and disregards the @ and everything after it... so when you sign in it just says "Hello name"
01-28-2007 10:05 AM
Profile E-Mail PM Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
29 / Male / Flag
Joined: Apr 2006
Status: Away
RE: erm... im not sure :S :(
code:
function OnEvent_SigninReady(sEmail){
    var Contacts = Messenger.MyContacts;
    var Online = 0;
    var Offline = 0
    var e = new Enumerator(Contacts);
    for(; !e.atEnd(); e.moveNext()) {
        if(e.item().Status > 2)
            Online++;
        else
            Offline++;
    }
    sName = sEmail.split("@")[0];
    MsgPlus.DisplayToast("Welcome "+sName, "You have "+Online+" Contacts online and "+Offline+" Contacts offline.");
}

01-28-2007 10:55 AM
Profile E-Mail PM Web Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
RE: erm... im not sure :S :(
Or, by using a substr():
code:
sName = sEmail.substr(0, sEmail.indexOf("@"));
MsgPlus.DisplayToast("Welcome "+sName, "You have "+Online+" Contacts online and "+Offline+" Contacts offline.");
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
01-28-2007 11:07 AM
Profile E-Mail PM Web Find Quote Report
cameron.stokes3
New Member
*


Posts: 12
32 / Male / –
Joined: Jan 2007
O.P. RE: erm... im not sure :S :(
thanks =]
01-28-2007 03:22 PM
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