• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Translation Needed

spammehere

Lurker
Mar 11, 2015
4
1
What I want to do is

1. Set up a Task to toggle something
2. Set a variable, Let's say %Something, for the status of "something"
3. If something only with 2 statuses, On and Off, I'd like to set variable like:
%Something=(%Something+1) mod 2​
4. Print out %Something for debuging​

How can I do it in Tasker?
 
In a task, have this:

Variables > Variable Set > Name: %Something ; To: 1 - %Something ; Do maths = true
Alert > Flash > Something = %Something

You can create a task shortcut on your Home screen.


EDIT: you'll need to initialise manually the variable with either the value 0 or 1 before the first use.
 
Last edited by a moderator:
  • Like
Reactions: codesplice
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones