Page 1 of 1

CTBstate along with CTBicon

Posted: 21 May 2013 15:34
by klownboy
Hi Don, I've been testing or maybe just playing with the new CTBstate scripting function and I'm not sure if this is an issue or not it just seems odd. Using CTBicon along with the CTBstate function doesn't appear to work properly. I took your example script in the Beta for v12.40.0204 and modified it slightly to have a message pop-up to indicate the CTB "state" condition. See the little script below.

Code: Select all

  if (ctbstate() == 1) {
     ctbstate(0);
     msg "State Off";
      //ctbicon(":cfi");
      } else {
     ctbstate(1);
     msg "State On";
     //ctbicon(":home");
     }
The script "as shown" works fine, but then try the same thing with ctbicon lines not remarked out and see what happens. It appears the the use of CTBicon affects the state in some way. I end up seeing the "state on" message and the "home" icon and the state is "on", but I never see the "cofi" icon only the default CTB icon and the state never goes off. Am I missing something or doing something I shouldn't...can you not change the CTB icon using CTBicon with a state change? Like I said I was just testing.
Thanks,
Ken

Re: CTBstate along with CTBicon

Posted: 21 May 2013 16:22
by serendipity
Yes, tried with my examples too and not working. Using icon state turns my custom icons to generic ones.
I thought I am not using it right.

Re: CTBstate along with CTBicon

Posted: 21 May 2013 17:21
by admin
Confirmed, I'll check that.

Re: CTBstate along with CTBicon

Posted: 22 May 2013 13:33
by klownboy
Hi Don, CTBicon and CTBstate work fine together now in v12.40.0205. :appl: Now to dream up some nice ideas for using CTBstate. :idea:
Thanks,
Ken