Cron-like realtime scheduled actions

  • 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!

RiCkYB_667

New Member
Feb 11, 2018
5
0
1
40
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.

Thanks!

-R
 
Last edited:
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.

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!

Could you please help me if and how could i achieve this?

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.

Thanks!

-R
There's a format request that you have to use.
https://forums.skunity.com/threads/format-script-request-format.170/
 
TIMEZONE!

Unbelievable! Thank you! Will implement right away!

Oh and the keepalive loop is also a great idea, thank you!
[doublepost=1519636719,1519633516][/doublepost]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_language.skript:
on load:
    set {_cronran::*} to 0
    while true is true:
        set {_realtimenow} to time in timezone "GMT+1"
      
        # --- Cron 01 ---
        if subtext of {_realtimenow} from characters 10 to (the length of {_realtimenow}) is "06:00":
            if {_cronran::01} is 0:
                set {_cronran::01} to 1
                # Do Stuff
        else:
            set {_cronran::01} to 0
      
        # --- Cron 02 ---
        if subtext of {_realtimenow} from characters 10 to (the length of {_realtimenow}) is "18:00":
            if {_cronran::02} is 0:
                set {_cronran::02} to 1
                # Do Something Else
        else:
            set {_cronran::02} to 0

        # --- End ---
        wait 10 seconds

I am also trying to figure out weekly runs and other methods. Might have to use time variables...
 
Last edited: