This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
I prefer using variables for triggering everything in Tasker as this makes it easier for me to keep track of active profiles and whatnot. So instead of, for eaxmple, triggering my entire @Home profile directly by being connected to my home SSID, I have a separate profile set a %Home variable to true upon connection and activate everything else based on said variable's state (with "Restore Settings" disabled and accompanying exit tasks to reset them).
This has generally worked for me but, on a few occasions, some tasks would get stuck somewhere and cut out or there'd be a variable left unmodified and it would screw with everything. It would usually happen when the phone boots and all the tasks run for the first time. So instead of fiddling with task priorities, I decided to write a master Boot profile with one task that would take care of everything, regardless of what state any of the variables were in prior to the phone shutting down.
The task is as follows:
:START
Variable Set %BootSequence = busy
Variable Set %BootFlagsSet = false
If %BootFlagsSet ~ false & %BootSequence ~ busy (
Perform Task "Set Boot Flags"
Goto CheckTaskerPrefs
) Else (
Goto START )
End If
:CheckTaskerPrefs
If %TaskerPrefsReset ~ true (
Goto CheckVars
) Else (
Perform Task "Reset Tasker Prefs"
Goto CheckTaskerPrefs )
End If
:CheckVars
If %VariablesReset ~ true (
Goto END
) Else (
Perform Task "Reset Variables"
Goto CheckVars )
End If
:END
Variable Set %BootSequence = done
Stop
I also insert Var State %BootSequence ~ done as a trigger for all my other profiles to make sure they're disabled at boot and that they can only be re-enabled after my main flags are back to their defaults.
While this system has been working beautifully so far, I feel as though it isn't as efficient as it could be. I put a lot of checks in there to make sure that none of the subroutines are skipped and all the variables are reset before they're modified by any other profiles. So I was wondering: Are any of the actions redundant and unnecessary? And is there any way to shorten the task while still making sure that it does everything it has to? Lastly, am I overly complicating things with this system? I'd be grateful for any input.
PS Apologies if I formatted that horrendously or if I misused any terms.
Subreddit
Post Details
- Posted
- 10 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/tasker/comm...