XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently 2017年 May 27日 05:49

All times are UTC - 8 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Blinking lights
PostPosted: 2015年 Dec 9日 07:53 
Offline
User avatar

Joined: 2012年 Dec 5日 17:52
Posts: 4460
Guys I created a christmas decoration widget with 13 lights and I want to make them blink.
I used 13 TimeCores for each light, I changed the Refresh interval(ms) of each one (same value for the same color light) and I used this script.

Code:
function timercore1OnUpdate(Sender)
{
  l1.Visible = true;
  sleep(1000);
  l1.Visible = false;
}

function timercore2OnUpdate(Sender)
{
  l2.Visible = true;
  sleep(1000);
  l2.Visible = false;
}

function timercore3OnUpdate(Sender)
{
  l3.Visible = true;
  sleep(2000);
  l3.Visible = false;
}

function timercore4OnUpdate(Sender)
{
  l4.Visible = true;
  sleep(1000);
  l4.Visible = false;
}

function timercore5OnUpdate(Sender)
{
  l5.Visible = true;
  sleep(1000);
  l5.Visible = false;
}

function timercore6OnUpdate(Sender)
{
  l6.Visible = true;
  sleep(1000);
  l6.Visible = false;
}

function timercore7OnUpdate(Sender)
{
  l7.Visible = true;
  sleep(1000);
  l7.Visible = false;
}

function timercore8OnUpdate(Sender)
{
  l8.Visible = true;
  sleep(1000);
  l8.Visible = false;
}

function timercore9OnUpdate(Sender)
{
  l9.Visible = true;
  sleep(1000);
  l9.Visible = false;
}

function timercore10OnUpdate(Sender)
{
  l10.Visible = true;
  sleep(1000);
  l10.Visible = false;
}

function timercore11OnUpdate(Sender)
{
  l11.Visible = true;
  sleep(1000);
  l11.Visible = false;
}

function timercore12OnUpdate(Sender)
{
  l12.Visible = true;
  sleep(1000);
  l12.Visible = false;
}

function timercore13OnUpdate(Sender)
{
  l13.Visible = true;
  sleep(1000);
  l13.Visible = false;
}


The script seems to work partially but the bad is that the cpu is too high(!)..
Any idea or any other way to do this...?

_________________
Image
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
 Post subject: Re: Blinking lights
PostPosted: 2015年 Dec 9日 08:02 
Offline
User avatar

Joined: 2012年 Dec 5日 17:52
Posts: 4460
Nevermind.. I found a trick using more than one datetime cores changing the refresh interval only a little.
..and with no cpu consumption this time! :D

_________________
Image
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: Bing [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group