How to check if a variable is true or false within a task

827 views
Skip to first unread message

ענדרעש טאנתאנעללא

unread,
Sep 5, 2016, 8:11:59 PM9/5/16
to Tasker
So I'm not very good at arrays or variables but what I'm trying to do is run a task but decide what to do when an element or variable of a task is true or false. I'm other words, if the variable throws an error or simply doesn't do its intended task. I don't know how to post what I have but basically I'm using Auto Input to activate a specific text on the screen. How can I make a variable that checks if that Auto Input was successful and if not to do something else. Can I use the "If" part of the variable?

Rich D

unread,
Sep 5, 2016, 8:40:40 PM9/5/16
to Tasker Google Groups Post

I don't know how to post what I have

To post your profile or task here...  Long press on the profile or task name / ( 3 dot menu with 4.0+ ) export / export "DESCRIPTION" to clipboard (not XML)

Any linked tasks will be exported with the profile they are linked to..

To be able to export, The beginner mode needs to be off and the profile needs to be named by you (Not the Tasker listed name.  Tasker will list your profile with the context name if you have not given it one).

ענדרעש טאנתאנעללא

unread,
Sep 7, 2016, 9:00:17 PM9/7/16
to Tasker
Home (CellBased)/ARLO Stay (15)
A1: WiFi [ Set:On ]
A2: Alarm Volume [ Level:7 Display:Off Sound:Off ]
A3: Ringer Volume [ Level:4 Display:Off Sound:Off ]
A4: Wait [ MS:0 Seconds:0 Minutes:3 Hours:0 Days:0 ]
<Check if connected to Home WiFi>
A5: If [ %WIFII ~ *connection* ]
A6: Secure Settings [ Configuration:Screen & Keyboard Lights On
35 Seconds Timeout (Seconds):0 ]
A7: Keyguard [ Set:Off ]
A8: Secure Settings [ Configuration:Clear Password Timeout (Seconds):0 ]
A9: Keyguard [ Set:Toggle ]
A10: AutoInput Unlock Screen [ Configuration:Unlocking Screen.
VERY IMPORTANT: it's highly recommended that you use the Tasker 'System Lock' action at the end of this task. If you don't, your screen's lock will be permanently off and your system might even become unstable.

This action WILL NOT work on Marshmallow with a secure screen lock even if you are using Smart Unlock. It will only work if you have screen lock security set to none or swipe. Timeout (Seconds):10 ]
<Kill App>
A11: Run Shell [ Command:am force-stop com.netgear.android Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
<Kill App>
A12: Kill App [ App:Arlo Use Root:On ]
<Launch App>
A13: Launch App [ App:Arlo:main.MainActivity Data: Exclude From Recent Apps:Off Always Start New Copy:On ]
A14: Wait [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ]
<Click Mode>
A15: AutoInput Action [ Configuration:Type: Text
Value: Mode
Action : Click
Is Tasker Action: false
Check Screen State: false Timeout (Seconds):20 ]
A16: Wait [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ]
<Click Back>
A17: AutoInput Action [ Configuration:Type: Point
Value: 720,532
Action : Click
Is Tasker Action: false
Check Screen State: false Timeout (Seconds):20 Continue Task After Error:On ]
A18: Wait [ MS:0 Seconds:1 Minutes:0 Hours:0 Days:0 ]
<Click Tantanella Residence>
A19: AutoInput Action [ Configuration:Type: Text
Value: Tantanella Residence
Action : Click
Is Tasker Action: false
Check Screen State: false Timeout (Seconds):20 ]
A20: Wait [ MS:0 Seconds:1 Minutes:0 Hours:0 Days:0 ]
<Activate 'Front Only'>
A21: AutoInput Action [ Configuration:Type: Text
Value: Front
Action : Click
Is Tasker Action: false
Check Screen State: false Timeout (Seconds):20 ]
<Time Context>
A22: Else If [ %TIME > 21.30 & %TIME < 08.30 ]
<Select Schedule>
A23: AutoInput Action [ Configuration:Type: Text
Value: Schedule
Action : Click
Is Tasker Action: false
Check Screen State: false Timeout (Seconds):20 ]
A24: End If
A25: Wait [ MS:0 Seconds:0 Minutes:10 Hours:0 Days:0 ]
<Kill Arlo>
A26: Kill App [ App:Arlo Use Root:On ]
A27: Toggle Data 5.0 [ Configuration:switch off Timeout (Seconds):0 ]
A28: Secure Settings [ Configuration:Clear Password/Wait For Unlock Timeout (Seconds):0 Continue Task After Error:On ]
A29: AutoInput Unlock Screen [ Configuration:Unlocking Screen.
VERY IMPORTANT: it's highly recommended that you use the Tasker 'System Lock' action at the end of this task. If you don't, your screen's lock will be permanently off and your system might even become unstable.

This action WILL NOT work on Marshmallow with a secure screen lock even if you are using Smart Unlock. It will only work if you have screen lock security set to none or swipe. Timeout (Seconds):10 ]
A30: Wait [ MS:0 Seconds:0 Minutes:3 Hours:0 Days:0 ]
A31: Bluetooth [ Set:Off ] If [ %BLUE !~ *connection* ]
A32: Secure Settings [ Configuration:GPS Disabled Timeout (Seconds):0 ]

ענדרעש טאנתאנעללא

unread,
Sep 7, 2016, 9:06:35 PM9/7/16
to Tasker
Basically, what I have is a task that launches ARLO (my wireless camera app) with a fresh load, signs in, then selects various menus in the app. Ultimately what I would like to do is have a way for Tasker to know if a "tap" on a specific menu was NOT successful to proceed to another step, otherwise just continue on through the tasks. I imagine the most proficient way is using arrays but I'm not too good with those. Is there a way to use the "IF" with the variables so that is if it fails to succeed it will go to a different task?

Robert Ryan

unread,
Sep 7, 2016, 9:33:19 PM9/7/16
to tas...@googlegroups.com

If an AutoInput action fails to tap on something it will eventually time out. This should throw an error and set the %err variable.

If you check Continue Task After Error in the action settings, the task will continue running and you can check the %err variable to see if the action succeeded or not.

Reply all
Reply to author
Forward
0 new messages