Help with Else If logic
Posted: Tuesday 07 March 2017 11:32
I'm having a problem with one of my blocky events. I suspect I've got a fundamental misunderstanding of the way it works. Maybe someone can help me?
Essentially, I want some logic as follows:
If SwitchA = 1 and SwitchB = 1, set SwitchB to 2.
Else if Switch A = 1 and Switch B =2, set SwitchB to 3.
I have implemented this in Blocky but if I then set Switch A to 1 and Switch B to 1, Switch B changes to 3 whereas I would expect it to be 2.
From the log, I can see that what is happening is that the first part is running (and Switch B is set to 2) and then the event is immediately triggered again and this time the second part is applied and Switch B is set to 3.
Can anyone give me any tips?
Essentially, I want some logic as follows:
If SwitchA = 1 and SwitchB = 1, set SwitchB to 2.
Else if Switch A = 1 and Switch B =2, set SwitchB to 3.
I have implemented this in Blocky but if I then set Switch A to 1 and Switch B to 1, Switch B changes to 3 whereas I would expect it to be 2.
From the log, I can see that what is happening is that the first part is running (and Switch B is set to 2) and then the event is immediately triggered again and this time the second part is applied and Switch B is set to 3.
Can anyone give me any tips?