XWidgetSoft Forum
https://www.bbs.xwidget.com/

Blinking lights
https://www.bbs.xwidget.com/viewtopic.php?f=8&t=6068
Page 1 of 1

Author:  Jimking [ December 9th, 2015, 7:53 am ]
Post subject:  Blinking lights

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...?

Author:  Jimking [ December 9th, 2015, 8:02 am ]
Post subject:  Re: Blinking lights

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

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/