Now, it simply stays on Time Online: 0 Hours, 0 Mins, 0 Seconds
What have i done wrong?
code:
var s=0,m=0,h=0,d=0;
function OnEvent_Initialize(MessengerStart)
{
MsgPlus.DisplayToast("P.M. Time", "Displays uptime as personal message.");
MsgPlus.AddTimer("second", 1000);
}
function OnEvent_Timer(id)
{
if(id=="second")
{
s+s+1;
if (s==60)
{
s=0;
m=m+1;
}
if (m==60)
{
m=0;
h=h+1;
}
if (h==24)
{
h=0;
d=d+1;
}
if (m==0)
{
uptime="Time Online: " + s + " Seconds";
}
if (h==0)
{
uptime="Time Online: " + m + " Minutes, " + s + " Seconds";
}
if (d==0)
{
uptime="Time Online: " + h + " Hours, " + m + " Minutes, " + s + " Seconds";
}
if (d!=0)
{
uptime="Time Online: " + d + " Days, " + h + " Hours, " + m + " Minutes, " + s + " Seconds";
}
Messenger.MyPersonalMessage=uptime;
MsgPlus.AddTimer("second", 1000);
}
}