I'm trying to learn Tasker, and it seems that it runs its steps asynchronously, so I end up with a race condition where my task doesn't have the data it needs to continue. I made a simple pair of tasks to test. (Hardware info: LG G2 on Verizon running stock KitKat ROM, rooted.)
Task 1: Echo
- Variable Set: [Name: %ret; To: %par1]
- Flash: [Text: Par1 = %par1]
- Return: [Value: %ret; Stop: On]
Task 2: Echo Test
- Perform Task: [Name: Echo; Priority: 2; Parameter 1 (%par1): 5; Return Value Variable: %var]
- Variable Set: [Name: %dbl; To: %var * 2; Do Maths: On]
- Flash: [Text: %var * 2 = %dbl]
Expected output:
- Flash: "Par1 = 5"
- Flash: "5 * 2 = 10"
Actual output:
- Flash: "%var * 2 = 0"
- Flash: "Par1 = 5"
My question is, why doesn't Tasker wait for step 1 to complete before continuing on to step 2? In fact, I'm not even sure it's working correctly in the first place. In my Echo Test task, I added a 2-second wait after calling the Echo task, and now my output is this:
- Flash: "Par1 = 5"
- Flash: "%var * 2 = 0"
So the %var
variable doesn't seem to get set at all. Am I doing something wrong, or is my Tasker installation bad?