Hi mate!
I really liked your script, and its running now 'all' the time ...
anyway, one of my mate while chatting to me told me that she was getting annoyed because of the script updating it self every sec, so I changed it a bit, removed second wise display updates. i haven't asked anyone to see if its work out better now. but i am putting the edited script here, so other people can try it and see if it works in lesser updates sent out ...
cheerios to everyone doing a good [or bad] job ..
////////////////////////////SCRIPT//////////////////////////////////
var Sec = 0;
var Min = 0;
var Hrs = 0;
var Days = 0;
var Weeks = 0;
function OnEvent_Signin(Email)
{
RegUserPath = (MsgPlus.ScriptRegPath).replace(/GlobalSettings/, Email) + '\\';
MsgPlus.AddTimer("Time",1000);
var lang = readreg('lang');
if (lang == '') {
writereg('lang', 'English', 'str');
}
}
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
}
//Language Options
var lang = readreg('lang');
if (lang == 'English') {
var OnlineTime = "Online Time: " + Min + " Minutes " + Hrs + " Hours " + Days + " Days";
}
if (lang == 'Spanish') {
var OnlineTime = "Tiempo que Tengo Conectado: " + Min + " Minutos " + Hrs + " Horas " + Days + " Dias";
}
Messenger.MyPersonalMessage = OnlineTime
Debug.Trace(OnlineTime);
Sec = Sec + 1;
MsgPlus.AddTimer("Time",1000);
}
}
function onGetScriptMenu(nLocation) {
var sMenu = '<ScriptMenu>';
sMenu += '<SubMenu Label="Language">Languages ';
sMenu += '<MenuEntry Id="English">English</MenuEntry>';
sMenu += '<MenuEntry Id="Spanish">Spanish</MenuEntry>';
sMenu += '</SubMenu>';
sMenu += '</ScriptMenu>';
return sMenu;
}
function onEvent_MenuClicked(sMenuId, nLocation, Wnd)
{
if (sMenuId == 'English') {
writereg('lang', 'English', 'str');
}
if (sMenuId == "Spanish") {
writereg('lang', 'Spanish', 'str');
}
}
//Functions taken from theRand i hope you dont mind i needed them for settings and i didnt know how to do them
function isreg(path) {
var reg, tmp;
try {
reg = new ActiveXObject("WScript.Shell");
tmp = reg.RegRead(RegUserPath + path);
if(tmp != "") return true;
} catch
{
return false;
}
}
function readreg(path) {
if(!isreg(path)) return false;
var reg = new ActiveXObject("WScript.Shell");
return reg.RegRead(RegUserPath + path);
}
function writereg(path, val, type) {
var reg = new ActiveXObject("WScript.Shell");
switch(type) {
case 'num':
return reg.RegWrite(RegUserPath + path, val, 'REG_DWORD');
break;
case 'str':
return reg.RegWrite(RegUserPath + path, val, 'REG_SZ');
break;
}
}