Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Making an app that will only work between the hours of 6pm and 6am...

LokitoesLokitoes Posts: 143Member, PRO

Just to double check, since I've never used this function before, do I do this with the 'device: clock' function? As I gather it is just pulling from the phone's clock time?

I've read a bunch of threads concerning the clock attribute but can't find any tutorial info in the cookbook - does anyone know if such a thing exists?



  • tatiangtatiang Posts: 11,907Member, Sous Chef, PRO, Senior Sous-Chef
    edited January 2019

    Yes and yes and I'm not sure.

    The OSTime Demo really helped me figure out things related to time and timers. I'm not sure it's still posted anywhere so here you go:

    The game.Clock.Hour attribute is in 24-hour format so you'd want to do something like this:

    When game.Clock.Hour ≥ 18 OR game.Clock.Hour ≤ 6
         [allow app to function]

    That's oversimplified since it doesn't take into account minutes but hopefully you get the idea.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.