SimpleCronClone

There are two parts to SimpleCronClone: scheduled scripts based on a cron-like syntax, and scripts that are called when certain events occur.

SimpleCronClone

This part of the plugin mimics the behavior of cron (for Windows-Users: Planned Tasks) and allows you to schedule scripts and commands for execution. It uses the awesome cron4j scheduler written by Carlo Pelliccia and it's own very, very, very, very, very basic scripting language.

How does it work? Well, the file plugins/SimpleCronClone/tab.scc is used as crontab-file, but instead of whole commands, it only takes the names of scripts. The tab file is parsed and scheduled, and when according the the cron part, the script is ran.

The CronClone part is to help with automated tasks that every server needs help with. For example:

  • sending a message to the console every set amount of time.
  • running a series of scripts that are dependent on the server running (eg, backups, off-site backups and more)
  • running a series of in-game commands every so often (clearing logs, resetting arenas and much more, depending on your other plugins)
  • query OS programs for status or information and use that information inside of the SCC script

EventEngine

New in v1.0, the EventEngine is a extension to the normal SimpleCronClone that calls event scripts (ending in .sce) when certain events occur.

The idea of this is that now by adding scripts to plugins/SimpleCronClone/tab.sce you will be able to do certain stats gathering or any other kind of thing based on events that players themselves cause. An example is lets say you have an adventure world, you can set a script to be run saying "do say hey player $1 is now playing in $2 adventure map, go join!" when a world is no longer empty, and when the world is empty again have a script revert it to normal. This is just one of many things that could be done with the EventEngine. See the events page for what events can be scheduled and how.

Script Format

See here

Tab Format

See here

Warning about security

One word of warning: Whatever you'll execute, it will have the same rights as the user from which the server is run. So be careful. Also keep in mind the execution-directory of the script is the server-directory for executables, not the plugin-directory.

Source and issue tracker

source code
bug tracker

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of admalledd admalledd Mar 22, 2016 at 00:29 UTC - 0 likes

    @Scorpion_vn: Go

    You were exactly correct. UUIDs in the event engine was always going to be the way to go. Just that never had a need to update them (the one user who commissioned adding them never got back to me when I reached out). Another user who does use them reached out via PM and said that having the EE switch to just UUIDs would be fine, no need for pretty GetPlayerName stuff.

    So with MC 1.9 and the need to recompile (mumble about spigot compat here), decided to do that change over. If you are using older MC versions, please keep using the builds for those versions.

  • Avatar of Scorpion_vn Scorpion_vn Dec 04, 2015 at 16:04 UTC - 0 likes

    @admalledd: Go

    Hi, I user PlayerJoin and PlayerDeath events and they work great for me with playerName. That is in 1.7.2 though. Most probably you are having hard time with UUIDs, right?

  • Avatar of admalledd admalledd Dec 04, 2015 at 01:49 UTC - 0 likes

    @KenDerGuru: Go

    I still use it for my own servers, so I would hope it still works! Although I never really used the EventEngine portion, and never had any one willing to step up and help maintain it (or even explain what it should work like). So I am probably going to strip out a decent amount of the EE that I know is broken-ish (basically any event that includes a player name) next time it needs updating (probably 1.9).

  • Avatar of KenDerGuru KenDerGuru Dec 03, 2015 at 20:06 UTC - 0 likes

    For everyone who wants to make timed commands in bukkit like cronjobs in the Linux operating system this is still the best option. It works with Bukkit and Spigot 1.8.8 and the latest development builds.

  • Avatar of uvbeenzaned uvbeenzaned Jan 31, 2015 at 00:06 UTC - 0 likes

    @admalledd: Go

    Thanks.

    BFAK:14612,4800d22fc9e3d6603d0412ae23e59102fbd0b143eada81d248519804e3937535

  • Avatar of admalledd admalledd Jan 30, 2015 at 23:14 UTC - 1 like

    @uvbeenzaned: Go

    There are no real plans to add filtering like that for the CronEngine. Either they run or the don't. The solution is to in your backup script add logic that would query the server somehow to know if there are players online or not. Something like the bukkit JSONAPI (eg the method "players.online.count" sounds like what you want/need) is probably the way to go. Again SCC/SCE is meant for very rudimentary scheduling and any fancy filtering past that should be done by the program executed in the script.

    For the most part I would personally recommend that unless you have very specifically good reasons you should *always* be running your backups. Players online or not.

  • Avatar of uvbeenzaned uvbeenzaned Jan 30, 2015 at 22:26 UTC - 0 likes

    Hi admalledd! I love your plugin, it has been the only answer to my custom backup problem. I have, however, another issue that needs addressing. How do you get the SCC script that runs every 30 mins to run only when the server has someone on it?:

    do broadcast Starting automatic server backup... do save-all do save-off execwait /home/User/Server/manual-backup do save-on do save-all do broadcast Finished backup!

  • Avatar of admalledd admalledd Dec 22, 2014 at 07:13 UTC - 0 likes

    Note for spigot 1.8: Tested working for the CronEngine perfectly. EventEngine is not UUID-aware and sometimes barfs if users change name or such and you are trying to filter users. (AKA: Version 1.2 still works just fine for everything I said it would)

    For the future though, due to lack of other peoples interest I will only be supporting features I myself use. Contract work to update/support extended features beyond that is fine reach me via github, email or reddit. And due to the uncertanty of future minecraft servers I am not even 50% sure where this plugin will be in the future with respect to Sponge or whatever comes next, thus where my support of features I use comes in: I expect to basically always still want CronEngine and some of the basics of EventEngine (user logged in, teleported worlds, server (Not)Empty) but more than that I don't really know. Too much uncertainty.

  • Avatar of admalledd admalledd Aug 04, 2014 at 07:03 UTC - 0 likes

    @cyclo666: Go

    Well good news then for you, I should have free time to work on SCC sometime this week and the "at server start" event should be easy to add, although I would like a users perspective on how to handle reloading the whole plugin tree or even just restarting SCC:

    https://github.com/RobertZenz/org.bonsaimind.bukkitplugins/issues/36#issuecomment-51023929

  • Avatar of cyclo666 cyclo666 Aug 04, 2014 at 06:14 UTC - 0 likes

    @admalledd: Go

    You're right. I could just use cron to schedule a restart at a specific time. I have several .scc scripts where cron is sufficient, I just wanted it to be after a certain amount of uptime and cron doesn't give me that.

    It's not really that crucial though, and I could just fallback to a cronjob if I can't figure it out another way.

    RT does listen to the console.

    Last edited Aug 04, 2014 by cyclo666

Facts

Date created
Feb 06, 2013
Category
Last update
Apr 16, 2016
Development stage
Release
License
GNU General Public License version 3 (GPLv3)
Curse link
SimpleCronClone
Downloads
3,808
Recent files

Authors