Skip to content

Commit

Permalink
Cron explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
BenceX100 committed Jan 14, 2025
1 parent 04193e9 commit bfd5d45
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions Writerside/hi.tree
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
</toc-element>
<toc-element topic="AxKoth.md">
<toc-element topic="AxKoth-Creating-a-Koth.md"/>
<toc-element topic="AxKoth-Creating-Schedulers.md"/>
<toc-element topic="AxKoth-Commands.md">
</toc-element>
<toc-element topic="AxKoth-Placeholders.md"/>
Expand Down
Binary file added Writerside/images/image_66.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Writerside/images/image_67.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Writerside/images/image_68.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Writerside/images/image_69.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Writerside/images/image_70.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Writerside/images/image_71.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Writerside/images/image_72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Writerside/images/image_73.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Writerside/topics/AxKoth-Commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
| /koth stop \<KOTH\> | Stop koth |
| /koth stopall | Stop all running koths |
| /koth editor \<KOTH\> | Open GUI editor |
| /koth schedulers \<KOTH\> | Open scheduler editor |
| /koth tp \<KOTH\> | Teleport to koth |
| /koth list | List koths |
| /koth givestarter \<KOTH\> \<player\> \[amount\] | Give koth starter to player |
Expand Down
45 changes: 45 additions & 0 deletions Writerside/topics/AxKoth-Creating-Schedulers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Creating Schedulers

### Creating a Schedule
- This tutorial will explain how to create a koth schedule with the `/axkoth schedulers` command!
- First open the menu with the previously mentioned command, it should look something like this (by default you will have 0 or 1 schedule):
![image_66.png](image_66.png)
- Now create a new schedule with the button shown on the last image!
- Give it a name, for example I gave `tutorial schedule` to it! You should not include any none english or special characters. ('-' is okay)
![image_67.png](image_67.png)
- Click on the paper to confirm! You should see that now we have a new schedule in the menu:
![image_68.png](image_68.png)
- Open this newly created schedule by left clicking. You should see something like this:
![image_69.png](image_69.png)

### Making the Schedule Work
- If you are in the schedule editor, first you should add all the koths that you want this schedule to activate!
> Note: All of the koths will be started at the same time when the schedule is triggered, (except if 'random' is enabled) so you might want to create multiple schedules.
{style='warning'}
- To add a koth, click on the oak sign and write the name of the koth in the chat! If you did this successfull, you should see it:
![image_70.png](image_70.png)
- Next up, you need to define how often this schedule should be triggered. This requires you to use the [**cron format**](https://en.wikipedia.org/wiki/Cron).
- Don't worry, it is not that difficult, you can also use an online generator to make it easier! [**https://crontab.guru/**](https://crontab.guru/)
- If you need help with creating an expression, check out this section below: [**Understanding the CRON format**](AxKoth-Creating-Schedulers.md#understanding-the-cron-format)
- Next click on the clock in the GUI and just like when you selected the koth, write the CRON expression in the chat!
![image_71.png](image_71.png)
- That's all, everything should work now! To make sure, you should test if it works:
- Run `/koth info <name of your koth>` and see if it has a "next schedule"!
![image_72.png](image_72.png)
- Try the placeholder out! For example: `/papi parse me %\axkoth_next_tutorial-schedule_formatted%`

### Understanding the CRON format
- The cron format is a very powerful format which can allow you to create any kind of schedulers.
- It is made out of 5 segments, which are:
![image_73.png](image_73.png)
*Image source: [https://linuxhandbook.com/crontab/](https://linuxhandbook.com/crontab/)*
- Important: CRON uses the 24-hour clock format
- **Some simple examples & explanation:**
- `0 18 * * *` - runs at 6pm exactly (because minute is 0, hour is 18, rest of them are set to "every")
- `0 0 * * *` - runs at midnight exactly (because minute is 0, hour is 0, rest of them are set to "every")
- `30 12 * * *` - runs 30 minutes past noon exactly (because minute is 30, hour is 12, rest of them are set to "every")
- `0 10,12,14 * * *` - runs at 10am, 12pm and 2pm (because minute is 0, hour is 10 or 12 or 14, rest of them are set to "every")
- `0 2-4 * * *` - runs at 2am, 3am and 4am (because minute is 0, hour is between 2 and 4, rest of them are set to "every")
- `0 0/2 * * *` - runs every 2 hours starting midnight (because minute is 0, hour is starting at 0 and every 2 hours, rest of them are set to "every")
- `0 1/2 * * *` - runs every 2 hours starting 1am (because minute is 0, hour is starting at 1 and every 2 hours, rest of them are set to "every")
- `0 * * * SAT,SUN` - runs every hour on saturday and sunday (because minute is 0, day of week is saturday or sunday, rest of them are set to "every")

0 comments on commit bfd5d45

Please sign in to comment.