1. Introducing Channels - a new way to chat with other Android users!
    Dismiss Notice

Tasker Help


Last Updated:

  1. Darushe

    Darushe New Member This Topic's Starter

    Joined:
    Sep 23, 2010
    Messages:
    1
    Likes Received:
    0
    Does anyone have any experience with tasker, specifically in regards to making a talking clock to announce the hour. There are some profiles on tasker wiki, but the DL file won't download into tasker, says the URI cannot contain spaces...I attempted manual entry, but still cannot get it to work. I attempted another one I found on the site, that was fairly easy to enter, but cannot get it to talk in 12 hour format...

    any ideas?
     

    Advertisement
  2. Steven58

    Steven58 Reformed PH VIP Member

    Joined:
    Feb 19, 2010
    Messages:
    32,920
    Likes Received:
    25,271
    Welcome to the Android Forums community! Glad you signed up! Feel free to join the conversations! :D

    Steven


    I'll move this to the Apps section for you.
     
    Darushe likes this.
  3. UncleMike

    UncleMike Well-Known Member

    Joined:
    Nov 15, 2009
    Messages:
    2,319
    Likes Received:
    482
    This may help:

    Variable Set %MYTIME %TIME
    Variable Split %MYTIME "."
    Variable Set %MYAMPM "a m"
    Variable Set %MYAMPM "p m" If %MYTIME1 > 11
    Variable Subtract %MYTIME1 12 If %MYTIME1 > 12
    Variable Add %MYTIME1 12 If %MYTIME1 = 0
    Variable Set %MYTIME1 %MYTIME1 [Do Maths] (should eliminate any leading zeros)
    Variable Set %MYTIME2 %MYTIME2 [Do Maths] (should eliminate any leading zeros)
    Variable Set %MYTIME2 "o %MYTIME2" If %MYTIME2 < 10
    Say %MYTIME1 %MYTIME2 %MYAMPM

    Tested at 18:09 it said "six oh nine pee em"

    NOTE: Edited from original post to address some overlooked issues.
     
    jshugart likes this.
  4. Maris

    Maris Well-Known Member

    Joined:
    Jun 1, 2010
    Messages:
    188
    Likes Received:
    24
    I import profiles by first saving them to the SD card under Tasker/profiles. Then from the main screen select menu/profiles/import single profile. That will show you a list of profiles from which to select one.
     
  5. jshugart

    jshugart New Member

    Joined:
    Feb 8, 2011
    Messages:
    2
    Likes Received:
    0
    Much thanks UncleMike, this helped me.

    I added the bolded task below to make it so 6:00 pm would be read as "Six O Clock P M"

    Variable Set %MYTIME %TIME
    Variable Split %MYTIME "."
    Variable Set %MYAMPM "a m"
    Variable Set %MYAMPM "p m" If %MYTIME1 > 11
    Variable Subtract %MYTIME1 12 If %MYTIME1 > 12
    Variable Add %MYTIME1 12 If %MYTIME1 = 0
    Variable Set %MYTIME1 %MYTIME1 [Do Maths] (should eliminate any leading zeros)
    Variable Set %MYTIME2 %MYTIME2 [Do Maths] (should eliminate any leading zeros)
    Variable Set %MYTIME2 "O Clock" If %MYTIME2 = 0
    Variable Set %MYTIME2 "o %MYTIME2" If %MYTIME2 < 10
    Say %MYTIME1 %MYTIME2 %MYAMPM
     
  6. dcampbe1

    dcampbe1 New Member

    Joined:
    Feb 26, 2011
    Messages:
    4
    Likes Received:
    0

    I have a profile that does not use DO MATHS and has no problem with its leading zeros, except for when I split the time variable, and add 2 hours. When I join the variables I get single digit hours when the time is <10:00. I have succeeded in writing the whole thing using DO MATHS but would like to learn how to utilize different logic.

    I've followed your logic on removing zeros but do you have one for creating leading zeros?
     
  7. takeshi

    takeshi Well-Known Member

    Joined:
    Dec 6, 2009
    Messages:
    3,354
    Likes Received:
    281
    %20 is interpreted as a space in URL's.
     
  8. UncleMike

    UncleMike Well-Known Member

    Joined:
    Nov 15, 2009
    Messages:
    2,319
    Likes Received:
    482
    I'm not quite sure what you're asking, but the only reason I eliminated the leading zeros was to get a preferred pronunciation by the Say action - so instead of saying "six zero nine pee em" it would say "six oh nine pee em".
     
  9. dcampbe1

    dcampbe1 New Member

    Joined:
    Feb 26, 2011
    Messages:
    4
    Likes Received:
    0
    Basically, I'm looking for a snippet that will pad a single digit variable with a leading zero. I just want to do the reverse of what you've done to eliminate a leading zero.
     
  10. UncleMike

    UncleMike Well-Known Member

    Joined:
    Nov 15, 2009
    Messages:
    2,319
    Likes Received:
    482
    As long as the values are integers you could do something like this:

    Variable Set %VAR %VAR [Do Maths]
    Variable Set %VAR 0%VAR [If %VAR < 10]

    This should make sure the leading zeros are eliminated, then add them back in where needed to get two digits.
     

Share This Page

Loading...