Hi, first time Rule Machine user and while I got it working it's probably not ideal so I'm looking to learn the best way to do this in rule machine and hopefully pick up a few tricks along the way. I couldn't find any other posts trying to do something similar although there probably are and I just couldn't find them.
I have 2 switches (left and right) and with them I want to either increment or decrement a variable based on which switch is on and I would also like the value of the variable to rollover after I get to 3. Similarly I don't want the variable to go negative.
Below is how I ended up implementing it, but it doesn't seem elegant at all.
I used the values 1 to 3, but I could just as easily use 0 to 2 if doing that makes the rule simpler.
I tried using the modulo (%) operator and while it worked when the value increased beyond my limit, the problem with the modulo operator is that it allows the variable to have a negative value
Thanks very much guys