Welcome to the Allonis forum! Tell us and our members who you are, what you like and why you became a member of this site. We welcome all new members and hope to see you around a lot!

command and or

Sat32's Avatar Topic Author
User User
  • Posts: 133
  • Thanks: 5

command and or

2 years 6 months ago
#1489
Does any one know is there a way to use AND: OR: in macro's and how it would be written

"if|IsNE##{{av_47_power}}##1## AND: if|IsNE##{{av_49_power}}##on## DO|command##elseDo|command"

Also what happened to the WaitUntill command in the command builder still listed as No Such Command "Not Available"
is that going to be added or fixed?

Thanks
 

Please Log in or Create an account to join the conversation.

andrew's Avatar
User User
  • Posts: 341
  • Thanks: 28

Re: command and or

2 years 6 months ago - 2 years 6 months ago
#1492
You could replicate simple ANDs and ORs by nesting IFs although it will get complicated quickly. For instance:

if A and B then
do this

could be written:
Code:
if A then     if B then         do this

And:

if A or B then
do that

could be written:
Code:
if A then     do that if B then     do that

You just need to translate that into myServer syntax.

Andrew
Last edit: 2 years 6 months ago by andrew.

Please Log in or Create an account to join the conversation.

Sat32's Avatar Topic Author
User User
  • Posts: 133
  • Thanks: 5

Re: command and or

2 years 6 months ago
#1496
 
You just need to translate that into myServer syntax.

Andrew

Yeah thats the hard part the header on the nested command syntax says Beta
so I'm not sure it's even impimented and there's no working examples in the documentaion.
here is what i was testing.

macro|
// test!

IF (livingroom_avamp_id = 50) THEN
    Lighting|8~Off;
ENDIF

Not sure if variables need to be wrapped in {{brackets}} or not
Tried both neither worked.

Please Log in or Create an account to join the conversation.

andrew's Avatar
User User
  • Posts: 341
  • Thanks: 28

Re: command and or

2 years 6 months ago - 2 years 6 months ago
#1497
The one line syntax should work (although it's very confusing). From the docs, if a=3 then do this else do that is written:

if|isequal##a##3##do this##do that

and then you can substitute another if/then instead of 'do this' or 'do that', but you have to use different delimiters to enable it to parse so it looks something like:

if|isequal##a##3##if|isequal&&b&&4&&do one&&do two##do that

Andrew
Last edit: 2 years 6 months ago by andrew.
The following user(s) said Thank You: Sat32

Please Log in or Create an account to join the conversation.

Sat32's Avatar Topic Author
User User
  • Posts: 133
  • Thanks: 5

Re: command and or

2 years 6 months ago
#1498
that was it never even looked at delimiters.
Thanks

Now what about WaitUntill command?
I think a lot could be done with it.

Please Log in or Create an account to join the conversation.

andrew's Avatar
User User
  • Posts: 341
  • Thanks: 28

Re: command and or

2 years 6 months ago
#1499
My 'just' in 'You just need to translate that into myServer syntax' was doing a bit of heavy lifting...

Andrew

Please Log in or Create an account to join the conversation.

Time to create page: 0.277 seconds