OnTimeCommands
OnTimeCommands - Run sets of commands at different times of the day
Version: 1.5
Ever wanted to run certain server commands or messages at a certain time of day? If so, this is the plugin for you! OnTimeCommands lets you set up tasks that run at a set time of day. Each task can have an unlimited number of commands to run at the set time.
Features:
- Set up different tasks, each with their own time of day
- Control how often the task repeats by specifying the hours, minutes, seconds, months, days, and years between runs
- Each task can have as many commands as you want from any plugin installed on the server
- Time of day is configurable down to the second and runs every day
- Use to, for example, save and reboot the server for a system reboot so the map doesn't get corrupted.
- Run tasks on demand or enable/disable the plugin in-game
Configuration Example: I have a server computer that restarts every day at 11:00 PM to "reset" everything. The server starts as soon as the computer finishes restarting, but it never gets a chance to save when the computer shuts down. OnTimeCommands can solve this problem. Here is an example configuration file (/plugins/OnTimeCommands/config.yml):
config.yml:
//this is to fix the code tag. please remove this line when pasting. enabled: true tasks: warnshutdown: nextrun: '22:59:50 7-05-2011' repeat: day repeatspan: 1 commands: - 'say The server will restart in 10 seconds. All work will be saved.' - 'save-all' shutdown: nextrun: '23:00:00 7-05-2011' repeat: day repeatspan: 1 commands: - 'stop'
This will warn all users that the server will restart soon. It saves the work, just in case it doesn't have time to issue the "stop" command before being shut down. Then exactly at 11:00PM, the "stop" command is issued and the server is shut down properly before the computer restarts.
Configuration:
The configuration file is /plugins/OnTimeCommands/config.yml
the "enabled:" tag just tells if the tasks should be run or not. Helpful if you want to disable the plugin without deleting it.
in "tasks:", you can define different tasks with unique names. each task should have a "date:" tag with a time format of "HH:mm:ss MM-dd-yyyy", using 24-hour time (0-23 hours). You also have the option to put a "repeat:" tag with a value of "year", "month", "day", "hour", "minute", or "second", and a "repeatspan:" tag specifying how many of the "repeat" unit should go by in between runs. If you do not specify these options, the task will default to running every day. Note that the "repeat" values are singular. If you make them plural, it will crash the plugin with an "IllegalArgumentException", so if you get one of these when you start your server, check your configuration. Each task should also have a "commands:" tag with a list of server commands as run through the console (no "/"). See the example above for more detail. Note that if you have the server shut down during the time that a task is supposed to run, you need to update the time that the task should run next or it will reset to the day you start the server back up again, and will not retain the time. If you need help with an error, please post the part of your server log that contains the error AND your entire "config.yml" file.
Commands:
/otcenable - Enables the plugin Permissions: ontimecommands.enable /otcdisable - Disables the plugin Permissions: ontimecommands.disable /otcreload - Reloads the plugin configuration (without saving it) Permissions: ontimecommands.reload /runtask <taskname> - Runs the task with the specified name (does not advance nextrun date; works when plugin is disabled) Permissions: ontimecommands.run.[taskname]
Please post any bugs/glitches you find or any questions you have.
Changelog:
Version 1.5
- Plugin now works with Bukkit 1337.
- Console messages from the plugin are now sent to OPs as well.
- In next version:
There will also be a permissions node for players to receive OnTimeCommands messages.Please see poll at top right of page.
- In next version: Plugin will use the default Bukkit permissions system so any permissions plugin can be used.
Version 1.4:
- Fixed bug where plugin would not be able to compute correct run time if a run was missed
Version 1.3:
- Added support for Permissions
- Added a reload command (/otcreload) to reload the configuration without shutting down the server
- Changed the "repeat" option so that it is easier to set up and less buggy
- Misc. bug fixes, including the issue with Bukkit 1060
Version 1.2:
- Added commands to enable/disable plugin in-game
- Added command to run a task on demand
- Fixed bug causing nextrun date to advance too far
- Plugin now attempts to calculate the correct nextrun date when a run is missed (instead of resetting to server startup time)
Version 1.1:
- Added more options for configuring task repetition
- Fixed file path error on Linux and Mac OS
Version 1.0:
- Initial plugin release
Same. This seems to be the only scheduler plugin which allows you to use any interval and runs off the actual date/time (not just a mere counter). I'd really like to use this.
I would really love this plugin if you updated to 1.0.1-R1
[EDIT] It's working now, looks really good!
Soo...does this work at all on the latest recommended build?
i need help my server has major crash problems so can someoone make up the config for me so i want it to run this command every half an hour! command: /stoplag
@ArcanoxDragon
The build is the new recommended build 1.0.1-R1 (Build #1597)
@Siriuo
That must be a new error with one of the later versions of Bukkit. What build specifically are you getting this on?
Any info on when this is being released for latest bukkit build i am getting this error when task is run.
03:39:47 [WARNING] Unexpected exception while parsing console command org.bukkit.command.CommandException: Unhandled exception executing command 'runtask' in plugin OnTimeCommands v1.3 at org.bukkit.command.PluginCommand.execute(PluginCommand.java:42) at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:165) at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:378) at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:374) at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:564) at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:541) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:425) at net.minecraft.server.ThreadServerApplication.run(SourceFile:457) Caused by: java.lang.IncompatibleClassChangeError: Found interface org.bukkit.command.ConsoleCommandSender, but class was expected at briman0094.ontimecommands.OnTimeCommands.onConsoleCommand(OnTimeCommands.java:567) at briman0094.ontimecommands.OnTimeCommands.onCommand(OnTimeCommands.java:586) at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40) ... 7 more
@rex1one
I don't know why this wouldn't work with 1.0.0 as is...
Any time-table on when or if this mod will be ready for 1.0.0? I know that version's not official yet but I'm waiting for my favorite mods to catch up before I upgrade.
@dev7kasper
Can you please post a Ticket and upload your config.yml file?
@rex1one
That should work.
@TCGM
Can you please file a Ticket and upload your config.yml? I'll be able to debug it with that.
It won't run any commands. Also, whenever I try to run it manually (runtask) it says it cannot find the command. There are no errors in console.
I just to confirm that this will work before I stay up until midnight staring at the screen. I'm setting up my MC server to give a few warnings before shutting down so the server itself can perform maintenance and then reboot. I want it to do this only once a week, this is my concern:
nextrun: 23:58:00 11-15-2011
repeat: day
repeatspan: 7
commands:...
Is this formatting correct? Will this properly schedule the task to repeat every 7 days?
Thank you BTW for a mod that (IMO) everyone needs ;)
@nicquehen
Oh, sorry. I always forget to update the version number before I release it. If you downloaded it from the download link on this page, you have version 1.5. I'll fix the version number in the next version. Thanks for pointing this out!
Hi ! Great plugin !
When i run the plugin in the log file i have :
OnTimeCommands version 1.3 enabled
1.3??? ( i download the 1.5 version i think..?)
Thx to keep updating :)
@dev7kasper
"repeat" is the unit of repeat..."repeatspan" is the interval. So you'd have it as "repeat: minute" "repeatspan: 30"
what if i want it to do /reload every hour how would i set that up?