Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can you add a Scheduler function? #9

Open
Jecvay opened this issue Feb 18, 2019 · 1 comment
Open

can you add a Scheduler function? #9

Jecvay opened this issue Feb 18, 2019 · 1 comment

Comments

@Jecvay
Copy link

Jecvay commented Feb 18, 2019

use Cron's format to edit the config file:

sayhi {
    commands=["broadcast &6游戏开始!"]
    schedule {
        type="Cron"
        schedule="10 22 * * *"
    }
}

desayhi {
    commands=["broadcast &6游戏结束!"]
    schedule {
        type="Cron"
        schedule="11 22 * * *"
    }
}

@randombyte-developer
Copy link
Owner

Just for me to note down, I think I will go with https://github.com/jmrozanec/cron-utils. It also seems to support similar but extended formats which build upon the cron format.

I will add a new config file for the scheduler and it will look something like this:

schedules {
  mySchedule1 {
    commands = [
      "myCommand"
    ],
    schedule = "10 22 * * *"
    type = "Cron" #Quartz, Cron4J or whatever that library offers
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants