Can i Create a Daily timer?

  • Hi guys, I'm trying to create a new app in C3.

    Can i make a timer for example, every 15 hours, (need to count even offline) or, for example, save the day in a variable and compare every day if the current day is greater than the previous day?

    but how would I do it on the 30th?

    It will click the button and a message will appear, every day I want the message to be changed.

    If anyone can give me an idea or solution, please ...

    I'm Brazilian, sorry for my english xD

  • You could make a variable for the day, month, year, hour, minute and compare the last set time with the current time. And then with comparing the variables do the action you desire.

    You can get the time and date with ExecJS(Date()), here's a tutorial even on how to get the datetime and you can use expressions to split the datetime and put the day into the day variable, month into the month variable etc. It's all explained in the tutorial https://www.scirra.com/tutorials/940/how-to-easily-capture-date-and-time-and-insert-them-in-a-project

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You could make a variable for the day, month, year, hour, minute and compare the last set time with the current time.

    You can get the time and date with ExecJS(Date()), here's a tutorial even on how to get the datetime and you can use expressions to split the datetime and put the day into the day variable, month into the month variable etc. It's all explained in the tutorial https://www.scirra.com/tutorials/940/how-to-easily-capture-date-and-time-and-insert-them-in-a-project

    i used

    Browser.ExecJS("var currentdate = new Date(); currentdate.getHours() ':' currentdate.getMinutes();")

    set text Browser.ExecJS("Date()")

    it works, and show me all xD

    but i no find how to save JUST the DAY/MONTH, to compare..

    if i save Just DAY, will not work, example.. if var DAY2> var DAY1 - do something, else, nothing.

    but when are day 30, and back to day 1( of next month), 30 will be > than 1 :(

    i need to get numbers of month, or how can i do?

    and how i save the Result of the ExecJS in a VAR?

  • camboriu

    Try to use Rex_timer plugins its very easy and should get you going.

  • Hi guys, I'm trying to create a new app in C3.

    Can i make a timer for example, every 15 hours, (need to count even offline) or, for example, save the day in a variable and compare every day if the current day is greater than the previous day?

    but how would I do it on the 30th?

    It will click the button and a message will appear, every day I want the message to be changed.

    If anyone can give me an idea or solution, please ...

    I'm Brazilian, sorry for my english xD

    Get Full time UTC and Local

    Is based on w3schools get time and date tutorials

    you can save the values in Global variables or XML or Json or local C3 file even on a server and then compare it to the game current time.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)