MLCycleStates request -- don't do anything sometimes

Repository of MainLobby Server plug-ins and updates not available in the current installation.
bjdraw
Senior Member
Senior Member
Posts: 246
Joined: Thu May 24, 2007 4:55 pm
Contact:

MLCycleStates request -- don't do anything sometimes

Postby bjdraw » Mon Jun 08, 2009 11:51 am

I love the MLCycleStates, but one thing that annoys me, and is now causing problems, is when I use the set command and the cycle state is already set to that state, then all the commands are still issued.

So in other words, I have one called Living.PowerStatus of which 1 is On and 2 is off.

So if I issue the command
MLCycleStates|Set~Living.PowerStatus~1

And the cycle state is already on 1, it still issues all the specified commands.

This is now a problem because for whatever reason my Pioneer Receiver treats the discrete RS-232 command power off (PF) as power toggle. So my receiver is just on at odd times.

Ideally there would be an easier way than for me to use conditionals everywhere I use the set~1 command. Like if cycle states just didn't do anything anything if it gets 'set' to a state it is already in.

Thanks
Ben Drawbaugh
How good can it be, if it isn't HD?

User avatar
mcascio
Founder
Founder
Posts: 8270
Joined: Tue Jan 28, 2003 4:03 pm
Location: Kenosha, Wi
Contact:

Postby mcascio » Mon Jun 08, 2009 12:18 pm

bjdraw,

There is an initialize command that sets the the cyclestates to 1 if it hasn't already been set to something.

Not sure if this will resolve your issue:
MLCycleStates|Initialize~Living.PowerStatus
Mario Cascio
Cinemar, Inc.
http://www.cinemaronline.com

bjdraw
Senior Member
Senior Member
Posts: 246
Joined: Thu May 24, 2007 4:55 pm
Contact:

Postby bjdraw » Tue Jun 09, 2009 10:31 am

That cycle state is already set to 1 though.

Lets say I have a cycle state with two states, On=1 and Off=2.

My problem is that when I send
MLCycleStates|Set~Living.PowerStatus~1

All the commands defined to turn on the system are sent even though the system is already on.

My work around will be to create a mlcondtional based on the state, but it'd be great if there was a way for the cycle state to just ignore the command if the cyclestate was already in that state.
Ben Drawbaugh

How good can it be, if it isn't HD?

User avatar
mcascio
Founder
Founder
Posts: 8270
Joined: Tue Jan 28, 2003 4:03 pm
Location: Kenosha, Wi
Contact:

Postby mcascio » Tue Jun 09, 2009 11:26 am

Hi BjDraw,

I would recommend using an MLConditional to see what state it is in first.

That's pretty much why it's there.

This is the first request in 5 years to change the way the Set command in CycleStates works. Changing it could negatively impact the masses.
Mario Cascio

Cinemar, Inc.

http://www.cinemaronline.com

User avatar
jjjukebox
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1024
Joined: Sat May 22, 2004 9:54 pm
Location: Toronto
Contact:

Postby jjjukebox » Tue Jun 09, 2009 11:36 am

You could use a command like:
MLConditional|IsEqual##{{Living.Power_Data}}##1##DoNothing##MLCycleStates|Set~Living.PowerStatus~1

or if you have prefix the client selected in MLCystates for Living.Power:
MLConditional|IsEqual##{{{{ClientName}}_Living.Power_Data}}##1##DoNothing##MLCycleStates|Set~Living.PowerStatus~1

Just a thought
J.J. Jukebox
Member


Return to “MLServer Plug-Ins”

Who is online

Users browsing this forum: No registered users and 1 guest