[ADMN] OnTimeCommands v1.4 - Commands that run at a certain time of day [1337]

Discussion in 'Inactive/Unsupported Plugins' started by briman0094, May 29, 2011.

  1. Offline

    briman0094

    OnTimeCommands is now on BukkitDev. Support will no longer be provided here. If you need help, put a ticket in on the BukkitDev page.
     
    monotonehell likes this.
  2. Offline

    briman0094

    the date has to be in single quotes.

    EDIT: just realized the example was wrong. fixed now.
     
  3. Offline

    monotonehell

    On debian linux the plug atempted to create the config.yml but used a \ instead of a /. So it made a file called "OnTimeCommands\config.yml" and of course failed to write to it. :D

    Windows uses a \ for paths while all other OSs use a /.
     
  4. Offline

    briman0094

    Really? I always remember Java correcting that. I'll fix that in the next version. For now, just make a folder called OnTimeCommands and inside it a file called config.yml, and it should find it.
     
  5. Offline

    monotonehell

    Unfortunately it doesn't - it still cant find it and makes an other misplaced file. Looking forward to the fix :D
     
  6. Offline

    briman0094

    Plugin updated to version 1.1! This fixes the aforementioned file path error, and also adds more precise control for task execution and repetition. Please post any bugs/glitches you find as new versions of anything are prone to bugs. Especially spiders.
     
  7. Offline

    monotonehell

    I've installed OnTimeCommands again, seems happy this time. Set it to save-all every 15mins and warn, backup & restart once a day in the AM. I'll let you know how I go.

    Wonderful idea for a plugin - I've wanted something like this for a while. Most timed plugins repeat from the point in time you restart the server, which is a problem when you want a backup or restart to occur not during peak usage.

    Just a minor point, you've used US date format, this could lead to confusion. Might be better to use the logical international format where the units are in order of size:
    YYYY-MM-DD-HH-MM-SS
    this would make, "Time between runs: 0:0:0 0-1-0" a bit more intuitive for those of us not a product of the US educational system. ;)
     
  8. Offline

    briman0094

    Ok, I'll use that format in the next update. I also need to fix a couple of bugs:
    • If you miss a run of a task, it will reset to when you start the server
    • Startup message says "OnTimeCommands 1.0 enabled" instead of "OnTimeCommands 1.1 enabled"
    Please let me know if you find any others!
     
  9. Offline

    monotonehell

    Perhaps have the date part optional, and make the date logic retrospective?

    So if for example:
    Code:
        saveall:
            nextrun: '0000-00-00-12:00:00'
            repeat:
                hours: 0
                minutes: 15
                seconds: 0
                months: 0
                days: 0
                years: 0
            commands:
                - 'save-all'
    
    The plugin will repeat the save-all command every 15 minutes from midday starting "yesterday" from the plugin's point of view. Ie. any date in the past is treated as yesterday for the purpose of calculating when the next timer event is.

    But if for example:
    Code:
        saveall:
            nextrun: '2011-07-10-12:00:00'
            repeat:
                hours: 0
                minutes: 15
                seconds: 0
                months: 0
                days: 0
                years: 0
            commands:
                - 'save-all'
    
    The plugin will do the same but starting next Sunday?


    I know date logic/timers like this are a pain in the rear to code -- much appreciated that you are doing it. ;)
     
  10. Offline

    briman0094

    Yeah...a LARGE pain, lol. I have all of the timers done, I just have it make a new thread to loop and check the dates. I think trying to have your idea of checking for "yesterday" would be a little complicated, and Date objects in Java cannot store "dates" earlier than like September, 1970, so I would have to do a lot of custom coding. I like the idea, but it would definitely take a lot to make it work. I'm glad that more people are using this, when I released it I didn't know how many people actually had a need for it, but as I can see now, a lot of people do :). Thanks for the support!
     
  11. Offline

    morizuki

    can you give me a config..

    removearrows: remove-arrows -1 (every 30min)
    restartannouncement: server will restart in 15mins.. (15mins before the restart)
    restart: restart (every 3hours)
     
  12. Offline

    briman0094

    I can make the base layout of the configuration, but you will have to set up the first run dates for them so that it knows when to start. If you want the restart announcement to happen 15 minutes sooner than the restart, you need to set up the announcement's first run 15 minutes before the restart's first run.

    here is the layout:

    Code:
    enabled: true
    
    tasks:
        removearrows:
            date: '00:00:00 0-0-0000'
            repeat:
                hours: 0
                minutes: 30
                seconds: 0
                months: 0
                days: 0
                years: 0
            commands:
                - 'remove-arrows'
        restartannouncement:
            firstrun: ''
            repeat:
                hours: 3
                minutes: 0
                seconds: 0
                months: 0
                days: 0
                years: 0
            commands:
                - 'say The server will restart in 15 minutes.'
        restart:
            firstrun: ''
            repeat:
                hours: 3
                minutes: 0
                seconds: 0
                months: 0
                days: 0
                years: 0
            commands:
                - 'restart'
    
     
    morizuki likes this.
  13. Offline

    Leon Philips

    Hi,
    I'm having a problem with my config,
    i tried to solve it on my own but i Couldn'd fix it myself
    it is supposted to save every hour 1 second after the time is told (also at every hour)

    can anyone help me?
    I would realy appreciate that.
    (sorry for my bad english :p)
     

    Attached Files:

  14. Offline

    briman0094

    I was looking at your config, what exactly was wrong with it? I changed a couple of things (put date in quotes, made it so the task names didn't start with numbers) to see if it would help. I also bumped the nextrun up to July 8th so you can make sure they all execute. I will be fixing this bug soon. Let me know if this config doesn't work right.
     

    Attached Files:

  15. Offline

    Leon Philips

    thank you so much for you fast reply :)!
    I am testing it right now ! :D

    *Edit*
    I waited until 19:01 still nothing... it's like my server doesn't see the file at all??
    but the strange part is when i just installed it it worked and now it is....DOOMED :'(
    I think this is realy weird...thank you for helping anyway, I will still look at this thread
    until I can find the answer :D!
    becouse I need this plugin ;) (I forget time alot and so does other players)
    if you want to checkout my server (to see some errors if you are intrested)
    my IP is: 84.72.45.45 it's 24/7 :p
     
  16. Offline

    briman0094

    You're very welcome. I hope it works! :D
     
  17. Offline

    Leon Philips

    hmm... Just an idea...but are maby to many ontimecommands in the config??
    (i cannot make plugins so it is just a guessing around question:rolleyes:)
     
  18. Offline

    briman0094

    Thats weird that it doesn't work. I don't think there are too many commands, I think that it might be a bug in my programming :p. I'll take a look and try to fix it as soon as possible.
     
  19. Offline

    o0AzzA0o

    I found a problem with the yml formatting on line 235

    config.zip updated to 7-10-2011 with yml formating fix

    config2.zip removed date and just set to run each day? i have done this correctly?
     

    Attached Files:

  20. Offline

    Leon Philips

    Thanks! for how long have you been looking at the file :eek:!!
     
  21. Offline

    o0AzzA0o

    took me 3 mins use this for editing yml http://www.geany.org/
     
  22. Offline

    Leon Philips

    oh... :) I edit every file with the ordinairy notepad ++ (I find it very useful tough :cool:)
     
  23. Offline

    briman0094

    Plugin updated to 1.2! New features! Bug fixes! Yay!
     
  24. Offline

    Chasingu

    I keep getting a YAML Error on the Parser.

    config.yml
    Show Spoiler

    Code:
    enabled: true
    
    tasks:
        warnshutdown:
            nextrun: '22:30:00 7-11-11'
            repeat:
                hours: 0
                minutes: 0
                seconds: 0
                months: 0
                days: 1
                years: 0
             commands:
                 - 'say Server will be shutting down in 35 Minutes.'
                 - 'say Server will start again at 4 A.M. Pacific Time.'
        warnshutdown5minutes:
            nextrun: '23:00:00 7-11-11'
            repeat:
                hours: 0
                minutes: 0
                seconds: 0
                months: 0
                days: 1
                years: 0
             commands:
                 - 'say Server will be shutting down in 5 Minutes.'
                 - 'say Server will start again at 4 A.M. Pacific Time.'
         autosave:
             nextrun: '5:00:00 7-12-11'
             repeat:
                 hours: 1
                 minutes: 0
                 seconds: 0
                 months: 0
                 days: 0
                 years: 0
              commands:
                  - 'save-all'
          shutdown:
              nextrun: '23:05:00 7-11-11'
              repeat:
                  hours: 0
                  minutes: 0
                  seconds: 0
                  months: 0
                  days: 1
                  years: 0
               commands:
                   - 'save-all'
                   - 'stop'


    Online YAML Parser Error:
    Show Spoiler

    Code:
    ERROR:
    
    while parsing a block mapping
      in "<unicode string>", line 5, column 9:
                nextrun: '22:30:00 7-11-11'
                ^
    expected <block end>, but found '<block mapping start>'
      in "<unicode string>", line 13, column 10:
                 commands:
                 ^
     
  25. Offline

    briman0094

    Every time there was a "commands:" tag, the text was indented one more space. Here is the fixed version:
    config.yml (open)

    Code:
    enabled: true
    
    tasks:
        warnshutdown:
            nextrun: '22:30:00 7-11-11'
            repeat:
                hours: 0
                minutes: 0
                seconds: 0
                months: 0
                days: 1
                years: 0
            commands:
                - 'say Server will be shutting down in 35 Minutes.'
                - 'say Server will start again at 4 A.M. Pacific Time.'
        warnshutdown5minutes:
            nextrun: '23:00:00 7-11-11'
            repeat:
                hours: 0
                minutes: 0
                seconds: 0
                months: 0
                days: 1
                years: 0
            commands:
                - 'say Server will be shutting down in 5 Minutes.'
                - 'say Server will start again at 4 A.M. Pacific Time.'
        autosave:
            nextrun: '5:00:00 7-12-11'
            repeat:
                hours: 1
                minutes: 0
                seconds: 0
                months: 0
                days: 0
                years: 0
            commands:
                - 'save-all'
        shutdown:
            nextrun: '23:05:00 7-11-11'
            repeat:
                hours: 0
                minutes: 0
                seconds: 0
                months: 0
                days: 1
                years: 0
            commands:
                - 'save-all'
                - 'stop'
    
     
  26. Offline

    morizuki

    can you add a multiple world support? like different running commands in different world?
     
  27. Offline

    briman0094

    The problem with that is that the commands are run from the console so it doesn't know which world to use. It would have to "follow" a certain player and choose the world they are in, which could result in numerous consistency problems. Also, commands are always run "worldless", but certain plugins will monitor what world the player is in and do different things depending on the world. Why do you want multiworld on-time commands?
     
  28. Offline

    morizuki

    i want to run a certain commands in another world that needs to auto remove drops and arrows in a little minute than the main world, and also i don't want to auto remove drops in main world
     
  29. Offline

    briman0094

    Can you give the command a world to use? Due to the way this plugin runs commands, there isn't a "world" the command is run from. The only way you could do that is to run commands through a player, which is unfortunately impossible for a plugin to do by itself.
     
  30. Offline

    morizuki

    hmm ok.. if it can't.. then that's ok :D
     
  31. Offline

    Chasingu

    Thanks for the fix before. Im having another question though. I use your plugin to stop my server, and then I have a cron script start it up the next day. However, for some reason the cron doesn't like to open the console so I don't get a feedback area at all. Im looking to get this fixed but in the meantime, does this plugin need the console to function?
     

Share This Page