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

Do actions in shuffle

Joe Nicolas

Lurker
Hello guys. I have a question. I want to make a simple task that execute 5 different actions. For example:
1. Turn on GPS
2. Turn on Wi-Fi
3. Turn on NFC
4. Turn on flashlight
5. Turn on mobile data
But, I need to execute those 5 actions in shuffle. Meaning, every time I run the task, the actions should be executed randomly. The first actions executed could be number 2, 1, 3, 5, then 4. Actions that already performed shouldn't be executed again. Anyone know how to do it? And please give me some example codes how to do it. Thanks before. :)
 
In your ex ample ... how/when do they get turned off after you turn them on?

Some of them cannot be done unless you are root-ed ... GPS ... Mobile Data.
Some of them don't have an easy access ... Flashlight ... NFC

You previously got a number selected from a matrix. Insert that number in a variable (like %current) and then execute ...

A1: Perform Task [ Name:xxx1 Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ] If [ %current ~ 1 ]
A2: Perform Task [ Name:xxx2 Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ] If [ %current ~ 2 ]
A3: Perform Task [ Name:xxx3 Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ] If [ %current ~ 3 ]

... Thom
 
In your ex ample ... how/when do they get turned off after you turn them on?

Some of them cannot be done unless you are root-ed ... GPS ... Mobile Data.
Some of them don't have an easy access ... Flashlight ... NFC

You previously got a number selected from a matrix. Insert that number in a variable (like %current) and then execute ...

A1: Perform Task [ Name:xxx1 Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ] If [ %current ~ 1 ]
A2: Perform Task [ Name:xxx2 Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ] If [ %current ~ 2 ]
A3: Perform Task [ Name:xxx3 Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ] If [ %current ~ 3 ]

... Thom
Okay, thank you very much for your aid. Problem solved. :)
 
Great.

Keep chipping away at it ... that is really the only way to learn Tasker.

My first year with Tasker the one drawback was remembering what area an action was in in the Tasker menu structure. I thought the line "Filter" was a decoration. I never realized I could type on that line and it would show me all the Actions with that string in its name. (Yes more than a year.)

... Thom
 
Back
Top Bottom