Posts: 3658 Reputation: 61
36 / /
Joined: Aug 2006
RE: [release] Who's online
Just been trying some things out for you (none of which worked). ALT codes don't seem to go into the script very well (It'd be ALT+0015 for carriage return). I was thinking about sendkeys to create a variable with a carriage return in it, but theres not an open window
Ok so the changes I made to the script based on what alexp2_ad are working great! Now I've haded a line saying "Next count in 10 minutes". But I wanted to add some code to instead off saying allways 10 minutes to say the minutes left based on what you have chosen. Anyone knows how to do this?
| Windows Live Messenger Beta Tester | Windows Live Mail Beta Tester |
Actually, use this... it uses minutes or seconds as appropriate, and rounds the number if it's decimal:
code:var ThirtyMins = 1800000;
var SixtyMins = 3600000;
var FiveMins = 300000;
var TenMins = 600000;
// SET THE TIME YOU WANT TO USE HERE!
var mytime = ThirtyMins;
function OnEvent_Initialize(bMessengerStart){
if(!bMessengerStart){ OnEvent_SigninReady(Messenger.MyEmail); }
}
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', '[c=green]Online: '+online+'[/c]'+'[c=red]Offline: '+offline+'[/c]','Next count in '+TimeLength(mytime));
MsgPlus.AddTimer('reload', mytime) //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
}
}
Ok I see but to put 30 seconds I would have to create a new var telling what the script what is 30 seconds just like the vars in the beggining of the script. Right?
| Windows Live Messenger Beta Tester | Windows Live Mail Beta Tester |
quote:Originally posted by Zeh
Ok I see but to put 30 seconds I would have to create a new var telling what the script what is 30 seconds just like the vars in the beggining of the script. Right?
Yes. Or just set mytime = 30000; and cut the middle man.