meme wrote:
Not sure what you mean, but remember the update code only runs every minute at 0 seconds.
I made txts with name "sec", sec00, sec01.....sec59, so I have light up for the secs too and here is the full script:
Quote:
function datetimecore1OnUpdate(Sender)
{
if (eval(datetimecore1.get("%Second")) == 0)
{
ResetAllColors();
eval(datetimecore1.get("%WeekEn")).Font.Color = rgba(138,0,178,255);
eval(datetimecore1.get("%AMPM")).Font.Color = rgba(197,16,16,255);
eval("num"+datetimecore1.get("%Hour0")).Font.Color = rgba(0,93,171,255); //hour0
eval("min"+datetimecore1.get("%Minute0")).Font.Color = rgba(0,20,171,255); //minute0
eval("sec"+datetimecore1.get("%Second0")).Font.Color = rgba(84,230,0,255); //second0
}
}
function ResetAllColors() // reset colors
{
for (var m=0; m<60; m++) // count up the minutes 0-59
{
eval("min" + ("0" + m).slice(-2)).Font.Color = rgba(0,0,0,0); // reset all mins to transparent
}
for (var h=1; h<13; h++) // count up the hours 1-12
{
eval("num" + ("0" + h).slice(-2)).Font.Color = rgba(0,0,0,0); // reset all nums to transparent
}
for (var s=0; s<60; s++) // count up the seconds 0-59
{
eval("sec" + ("0" + s).slice(-2)).Font.Color = rgba(0,0,0,0); // reset all secs to transparent
}
eval(AM).Font.Color = rgba(0,0,0,0);
eval(PM).Font.Color = rgba(0,0,0,0);
eval(Monday).Font.Color = rgba(0,0,0,0);
eval(Tuesday).Font.Color = rgba(0,0,0,0);
eval(Wednesday).Font.Color = rgba(0,0,0,0);
eval(Thursday).Font.Color = rgba(0,0,0,0);
eval(Friday).Font.Color = rgba(0,0,0,0);
eval(Saturday).Font.Color = rgba(0,0,0,0);
eval(Sunday).Font.Color = rgba(0,0,0,0);
}
//To reduce system resources this code only need to run if the time/seconds = 0
//this could be add with an IF statement at the start of the function datetimecore1OnUpdate(Sender)
function widgetOnLoad()
{
eval(datetimecore1.get("%WeekEn")).Font.Color = rgba(138,0,178,255);
eval(datetimecore1.get("%AMPM")).Font.Color = rgba(197,16,16,255);
eval("num"+datetimecore1.get("%Hour0")).Font.Color = rgba(0,93,171,255); //hour0
eval("min"+datetimecore1.get("%Minute0")).Font.Color = rgba(0,20,171,255); //minute0
eval("sec"+datetimecore1.get("%Second0")).Font.Color = rgba(84,230,0,255); //second0
}
WITH RED COLOUR FOR THE EXTRA/NEW CODEDeleted the
Quote:
if (eval(datetimecore1.get("%Second")) == 0)
do the job BUT the cpu once again is "Rising To The Sky"...
I'm afraid that we can't combine both right...?
_________________
...and remember: don't take life too seriously...My profile on Deviantart:
http://jimking.deviantart.com/