Shoutbox

1 hour interval, who's online - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: 1 hour interval, who's online (/showthread.php?tid=64547)

1 hour interval, who's online by Jimbo on 08-06-2006 at 02:32 PM

alexp2_ad recently made this code for me so it would show how many people were online when i signed into msn

Is it possible for someone to edit the code below so that every 30mins or 1hour or something, it showed a toast with xx contacts are online and xx contacts are offline.

Is it possible to make the time ie 30 mins, 1hr etc a variable so there is someway of customizing it.

Thanks

134jimbodude




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.DisplayToastContact('Online',online+' contacts are online',offline+' contacts are offline');
}


RE: 1 hour interval, who's online by matty on 08-06-2006 at 02:43 PM

code:
var ThirtyMins = 1800000;
var SixtyMins = 3600000;

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.DisplayToastContact('Online',online+' contacts are online',offline+' contacts are offline');
    MsgPlus.AddTimer('reload', ThirtyMins) //Repalce with SixtyMins if you want an hour
}

function OnEvent_Timer(sTimerId){
    if (sTimerId == 'reload'){
        OnEvent_SigninReady(Messenger.MyEmail); //Simply call the function so you dont duplicate code
    }
}

RE: 1 hour interval, who's online by Jimbo on 08-06-2006 at 02:45 PM

thanks

What would it be for 5 mins,10 mins, 15 mins etc or how would i work it out?


RE: 1 hour interval, who's online by absorbation on 08-06-2006 at 02:47 PM

quote:
Originally posted by 134jimbodude
What would it be for 5 mins,10 mins, 15 mins etc or how would i work it out?

It's done in seconds. So for 5 mins just times 60 by 5.

Edit: Then add 3 0's by the looks of it on the end :P.
RE: 1 hour interval, who's online by Jimbo on 08-06-2006 at 02:47 PM

oh thanks


RE: 1 hour interval, who's online by matty on 08-06-2006 at 02:50 PM

1000 is 1 second.


RE: 1 hour interval, who's online by Jimbo on 08-06-2006 at 02:50 PM

ok thanks so much matty


RE: 1 hour interval, who's online by Jimbo on 08-06-2006 at 02:57 PM

How would i make 'contacts are online' green

and how would i make 'contacts are offline' red

thanks


RE: 1 hour interval, who's online by Veggie on 08-06-2006 at 03:03 PM

cant you try yourself even a little bit?
MsgPlus.DisplayToastContact
Supports plus formatting codes.


RE: 1 hour interval, who's online by Jimbo on 08-06-2006 at 03:03 PM

i am sorry but i am useless at this sort of stuff
please help me out someone


RE: 1 hour interval, who's online by Jimbo on 08-06-2006 at 03:05 PM

someone just told me that it supports plus formatting codes like [c=46] but i cant seem to get it to work


it is possible?


RE: 1 hour interval, who's online by matty on 08-06-2006 at 03:11 PM

code:
var ThirtyMins = 1800000;
var SixtyMins = 3600000;

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.DisplayToastContact('contact counter', '·$3contacts online : '+online+'·$0', '' , '' ,'', '');
    MsgPlus.DisplayToastContact('contact counter', '·$4contacts offline : '+offline+'·$0', '' , '' ,'', '');   
    MsgPlus.AddTimer('reload', ThirtyMins) //Repalce with SixtyMins if you want an hour
}

function OnEvent_Timer(sTimerId){
    if (sTimerId == 'reload'){
        OnEvent_SigninReady(Messenger.MyEmail); //Simply call the function so you dont duplicate code
    }
}

RE: 1 hour interval, who's online by Jimbo on 08-06-2006 at 03:13 PM

thanks again


RE: 1 hour interval, who's online by Lukeyy19 on 08-06-2006 at 03:14 PM

ok i got the online to be green but the offline does not come out red, i cannot work out why?

code:
var ThirtyMins = 1800000;
var SixtyMins = 3600000;

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.DisplayToastContact('Who is Online?',online+'[c=9] Contacts are Online![/c]',offline+'[c=4] Contacts are Offline[/c]');
MsgPlus.AddTimer('reload', ThirtyMins) //Repalce with SixtyMins if you want an hour
}

function OnEvent_Timer(sTimerId){
if (sTimerId == 'reload'){
OnEvent_SigninReady(Messenger.MyEmail); //Simply call the function so you dont duplicate code
}
}


oh also i changed the toast title, as i didnt like the original

Edit: oh Matty already did it :(
RE: 1 hour interval, who's online by Jimbo on 08-06-2006 at 03:23 PM

i have packaged everything into a plsc file including the colours
thanks to matty for the code


RE: 1 hour interval, who's online by 4penguino on 08-06-2006 at 09:19 PM

well i really need some thing like that but.....i go to import script and it says "an error occured during import" and ive tried loads of times but i dont work can i get help


RE: RE: 1 hour interval, who's online by alexp2_ad on 08-06-2006 at 09:23 PM

quote:
Originally posted by 134jimbodude
thanks to matty for the code

Ouch.  Harsh considering it's mostly my code.  :(

It's far from complicated and didn't take me long, but still... *-)

EDIT:  And the script fails to import because of a bad scriptinfo file.

Attached a working one.
RE: 1 hour interval, who's online by 4penguino on 08-06-2006 at 09:29 PM

thanks ill try that now
it works thanks mate


RE: 1 hour interval, who's online by Jimbo on 08-07-2006 at 09:43 AM

really sorry alex

I forgot you gave me the main code

thanks a bunch for that again