Almost got it. Stuck on if statement.

Discussion in 'Tasker' started by shakeya.tucker, Mar 2, 2016.

  1. shakeya.tucker

    shakeya.tucker New Member

    Joined:
    Mar 2, 2016
    Messages:
    3
    Likes Received:
    0
    I'm using Tasker and AutoInput. I work for a delivery service. To get a route I have to open the app wait a second to see if there is a button that says "Ready To Deliver" pop up. Then I have to click on it wait 2 seconds and click the follow-up button "Accept Deliveries". If the "Ready to Deliver" button doesn't appear I have to keep refreshing the app until it does.

    I've got the launch app and refresh part down and I'm pretty confident the "Ready To Deliver" click will work if I can figure out the if statement? Right now I have the if statement condition set to if %Ready to Deliver matches Ready to Deliver. Which has to be wrong as it didn't work. I don't know the name of the button and it disappears too quickly to finding its code name. I can only reference it by its display text (if that makes any sense). Any help or pointing in the right direction would be appreciated.


    [​IMG]

    [​IMG]

    [​IMG]

    Sent from my MotoE2(4G-LTE) using Tapatalk
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    You usually don't have to wait for the button to show up. You can simply use the AutoInput action to click it and AutoInput will wait until what you want to click is present and then click it. :)

    Hope this clarifies it.
     
  3. shakeya.tucker

    shakeya.tucker New Member

    Joined:
    Mar 2, 2016
    Messages:
    3
    Likes Received:
    0
    If I take out steps 3 and 8 What if after I refresh the app the "Ready" button doesn't appear? Its not guaranteed it will. Hence the need to keep refreshing the app. Will it know to skip actions 4-7 automatically?

    Sometimes the "Ready To Deliver" text switches to "Schedule More" can I also put that text in the fieldId and it will click any button that pops up with any of the text/words: Ready, To, Deliver, Schedule, and More?

    [​IMG]

    Thank you for your help. The program is great, and has immense possibilities.

    Sent from my MotoE2(4G-LTE) using Tapatalk
     
  4. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    You can make the AutoInput action timeout after 10 seconds for example and check the "Continue after error" option and the task will continue on even if not clicked :)
    Or you can do a AutoInput UI query beforehand to check if the text is present and if not wait a bit and try again.
    You cannot use multiple texts in one AutoInput action right now, sorry.
     
  5. shakeya.tucker

    shakeya.tucker New Member

    Joined:
    Mar 2, 2016
    Messages:
    3
    Likes Received:
    0
    Okey dokey. I researched your suggestions (thank you) went back read up on how to do an AIQ, watched videos & tutorials, stalked blogs, boards, and Reddit. Am I going in the right direction?

    Variables:
    uploadfromtaptalk1457461412360.png

    AIQ:
    uploadfromtaptalk1457461556194.png
    uploadfromtaptalk1457461565518.png

    Task:
    uploadfromtaptalk1457461607531.png
    uploadfromtaptalk1457461624622.png
    uploadfromtaptalk1457461634896.png


    Sent from my MotoE2(4G-LTE) using Tapatalk
     
  6. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    I think so but that UI Query has to have some timeout because that way it won't be able to return any values :) Set a 10 second timeout for example.
     

Share This Page