NiteMare
Veteran Member
Giga-Byte me
Posts: 2497 Reputation: 37
37 / /
Joined: Aug 2003
|
RE: Children Timer
quote: Originally posted by thedestroyer
Ok, something like...
quote: var Sec = 0;
var Min = 0;
var Hrs = 0;
var Days = 0;
var Weeks = 0;
function OnEvent_Signin(Email)
{
var Email_1 = "default@hotmail.com"; // Your children email
var Email_2 = "";
if (Email_1 == Email || Email_2 == Email) {
MsgPlus.AddTimer("Time",1000);
}
}
function OnEvent_Timer(sTimerId)
{
if (sTimerId == "Time") {
if (Sec == "60") {
Sec = 0;
Min = Min + 1;
}
if (Min == "60") {
Hrs = Hrs + 1;
Min = 0;
}
if (Hrs == "24") {
Hrs = 0;
Days = Days + 1;
}
if (Days == "7") {
Days = 0;
Weeks = Weeks + 1
}
var OnlineTime = "Online: " + Days + " days, " + Hrs + " hours, " + Min + " mins and " + Sec + " seconds";
Messenger.MyPersonalMessage = OnlineTime
Debug.Trace(OnlineTime);
Sec = Sec + 1;
MsgPlus.AddTimer("Time",1000);
if ((Hrs == "2") && (Sec >= "0") && (Min >=0)) {
var Message = "Your time is over !" ;
Message = MsgPlus.RemoveFormatCodes(Message);
MsgPlus.DisplayToast("Max Time", Message,'notify.mp3');
Messenger.signout();
}
}
}[/code]
i don't see a differance there
but this is what i'm talking about, mind you its not tested, and could have bugs
code: //put this where you force them to sign out
AddTimer("access",60 * 60 * 1000); //Sets a timer for an hour
OnEvent_Timer(TimerId ){
//if the timer is the access timer
if (TimerId == "access")
//set the variable to true, allowing signin access
allowaccess == true;
}
}
OnEvent_Signin(sEmail){
//if the time is to short between signing back in
if (allowaccess == false){
//auto sign them out again
Messenger.Signout();
}
}
|
|