1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cron-like realtime scheduled actions

Discussion in 'Requests' started by RiCkYB_667, Feb 25, 2018.

  1. RiCkYB_667

    RiCkYB_667 New Member

    Feb 11, 2018
    Likes Received:
    Hi everyone!

    I was doing my research but unfortunately it seems i missed something or there is no real solution yet. Unless there is a plugin or something that i missed.

    This is what i would like to achieve:

    Category: schedule, timing, cron, etc.

    Suggested name: skron (?)

    What I want:
    I would like to be able to run scripts at a certain time. For example run at 06:00 in the morning every day, or at 19:00 on fridays. Meaning real time, NOT minecraft time!

    Ideas for commands: at realtime %time% [every (day|monday|tuesday|etc... ] ? I don't know how to format this, but i guess you get the idea :emoji_slight_smile:

    Ideas for permissions: retinal scanner ? probably not...

    When I'd like it by: Anytime anyone has a chance to get a look into it

    I had a plugin called MCCron, but i would like to eliminate all plugins i can replace with Skript. Also i did it with the cron on the linux server sending commands to screen, but it still not very effective and easy to update configurationwise.


    #1 RiCkYB_667, Feb 25, 2018
    Last edited: Feb 25, 2018
  2. KingAlterIV

    KingAlterIV Active Member

    Jan 26, 2017
    Likes Received:
    There's a format request that you have to use.
  3. Donut

    Donut Well-Known Member

    Mar 27, 2017
    Likes Received:
    RiCkYB_667 likes this.
  4. RiCkYB_667

    RiCkYB_667 New Member

    Feb 11, 2018
    Likes Received:

    Unbelievable! Thank you! Will implement right away!

    Oh and the keepalive loop is also a great idea, thank you!
    --- Double Post Merged, Feb 26, 2018, Original Post Date: Feb 26, 2018 ---
    Okay, so since my format of time is DD/MM/YY HH:MM i had to extract the time only and run the evaluation on that.
    This way i can do daily triggers setting only the time, and making them run once when time triggers.

    This is what i came up with, please do tell me if there is anything else, or a simple way!

    Code (Skript):
    1. on load:
    2.     set {_cronran::*} to 0
    3.     while true is true:
    4.         set {_realtimenow} to time in timezone "GMT+1"
    6.         # --- Cron 01 ---
    7.         if subtext of {_realtimenow} from characters 10 to (the length of {_realtimenow}) is "06:00":
    8.             if {_cronran::01} is 0:
    9.                 set {_cronran::01} to 1
    10.                 # Do Stuff
    11.         else:
    12.             set {_cronran::01} to 0
    14.         # --- Cron 02 ---
    15.         if subtext of {_realtimenow} from characters 10 to (the length of {_realtimenow}) is "18:00":
    16.             if {_cronran::02} is 0:
    17.                 set {_cronran::02} to 1
    18.                 # Do Something Else
    19.         else:
    20.             set {_cronran::02} to 0
    22.         # --- End ---
    23.         wait 10 seconds
    I am also trying to figure out weekly runs and other methods. Might have to use time variables...
    #4 RiCkYB_667, Feb 26, 2018
    Last edited: Feb 26, 2018

Share This Page