Is it possible to make Twine check the system time?

Hello all, pfm2001 here. I'm using Harlowe and I would like to know if I can make Twine check the system time, so for example, on a certain day, it can say "Happy Birthday, (name)!". Would this be possible?

Comments

  • Harlowe has a (current-date: ) macro which will give you today's date (including the Day's Name).
    (set: $today to (current-date:))
    Today is $today
    
    Assuming you have some means of obtaining the reader's birthday in a similar format (excluding the Day Name).
    note: it is current the 08-dec-2015 where I am, you may need to change the date in the following example for it to work.
    (set: $birthday to "Dec 08 2015")
    Your birthday is $birthday
    
    Then you could compare the two values using an (if:) and the (substring: ) macro like so:
    (if: (substring: $today, -11, $today's length) is $birthday)[Today is your birthday!]
    
    ... the -11 tells the (substring:) macro to count 11 characters backwards from the end of the $today value which is Month Day Year part of the value.
  • Thank you!