Register on condition
cscovino opened this issue · comments
Carlos Scovino commented
I'm working with Spike Prime and I was trying to register a task when a condition is met but I couldn't figure out what I have to pass as the third parameter. Do you know how this method works?
vm.register_on_condition('condition_met', displaysomething, ?)
Carlos Scovino commented
I found the solution:
def conditionDistance(vm, stack):
return distance.get_distance_percentage() != None and distance.get_distance_percentage() < 10
...
vm.register_on_condition("on_condition", displaysomething, conditionDistance)
Azzie commented
Nice find, note that you can now see decoded word blocks on our reference sheet: https://github.com/azzieg/mindstorms-inventor/tree/main/word_blocks