1. PaiN updated TimedExecute with a new update entry:

    Edited Default Config

     
  2. Code:
    {
      "RepeatTimedCommands": [
        [
          "server.save",
          300
        ],
        [
          "say 'hello world'",
          5
        ]
      ],
      "ShowTimedCommands": "true",
      "TimerOnceCommands": [
        [
          "say 'Restart in 1 MINUTE!'",
          60
        ],
        [
          "say 'Restart in 30 Seconds!'",
          90
        ],
        [
          "restart",
          120
        ],
        [
          "reset.oncetimer",
          121
        ]
      ]
    }

    In overview reset.oncetimer wount go through because the server goes down already ?
    [DOUBLEPOST=1433694470][/DOUBLEPOST]Thanks for the once update though^^
     
  3. It's just an example how to use this command of other things :)

    but if u leave it as it is it wont throw an error or something :)
     
  4. PaiN you made a mistake with the config setup
    You had:
    Code:
    function PLUGIN:LoadDefaultConfig()
        self.Config.ShowTimedCommands = "true"
        self.Config.TimerOnceCommands = {
    {"say 'Restart in 1 MINUTE!'",60},
    {"say 'Restart in 30 Seconds!'",90},
    {"restart",120},
    {"reset.oncetimer",121},
    }
        self.Config.RepeatTimedCommands = {
    {"server.save",300},
    {"say 'hello world'",5},
    }
    end
    You should be doing:

    Code:
    function PLUGIN:LoadDefaultConfig()
        self.Config.ShowTimedCommands = self.Config.ShowTimedCommands or "true" 
        self.Config.TimerOnceCommands = self.Config.TimerOnceCommands or { 
            {"say 'Restart in 1 MINUTE!'",60}, 
            {"say 'Restart in 30 Seconds!'",90}, 
            {"restart",120},
            {"reset.oncetimer",121}
        }
        self.Config.RepeatTimedCommands = self.Config.RepeatTimedCommands or { 
            {
            "server.save",
            300
            },
           
            {
            "say 'hello world'",
            5
            }
        }
        self:SaveConfig()
    end
    
     
  5. This plugin uses my first config pattern ... it generates the same config as the old one does.. Also i forgot the saveconfig so i will add the save only .. yeah happens i will fix it Thank you
     
  6. PaiN updated TimedExecute with a new update entry:

    config fix

     
  7. Also, you need to use that "Config = Config or value" as if not, it will overwrite the config everytime
    [DOUBLEPOST=1433706157][/DOUBLEPOST]
    I don't know what you got, but I came up with this now :)
    Code:
    {
      "RepeatTimedCommands": [
        [
          "server.save",
          300
        ]
      ],
      "ShowTimedCommands": "true",
      "TimerOnceCommands": [
        [
          "say 'Restart in 3 hours!'",
          7200
        ],
        [
         "say 'Restart in 2 hours!'",
         10800
        ],
        [
         "say 'Restart in 1 hour!'",
         14400
        ],
        [
         "say 'Restart in 30 minutes!'",
         16200
        ],
        [
         "say 'Restart in 15 minutes!'",
         17100
        ],
        [
         "say 'Restart in 5 minutes!'",
         17700
        ],
        [
         "say 'Restart NOW!'",
         18000
        ],
        [
          "restart",
          18000
        ]
      ]
    }
     
  8. For me its not overwriting and no1 said anything .. i will let it as is for now.. I'm gonna test it and edit this post
    [DOUBLEPOST=1433706479][/DOUBLEPOST]
    Is it overwriting on your server ? bcs i tested it and it works perfect... There are many config patterns dont forget
     
  9. Wulf

    Wulf Community Admin

    Not sure why you'd using those commands, but those are persistent already.
     
  10. Here is an error I am getting trying to load the plugin.

    Code:
    File: p-TimedExecute.lua Line: 68 invalid arguments to method call:
      at NLua.Lua.ThrowExceptionFromError (Int32 oldTop) [0x00000] in <filename unknown>:0
      at NLua.Lua.CallFunction (System.Object function, System.Object[] args, System.Type[] returnTypes) [0x00000] in <filename unknown>:0
      at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
      at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
    Here is my config. I have no clue what I am doing. I just want 5 planes every 5 minutes. I dont care about restarts.

    Code:
    {
      "RepeatTimedCommands": [
        [
          "server.save",
          300
        ],
        [
          "airdrop.massdrop 5",
          300
        ],
        [
          "say 'hello world'",
          5
        ],
      ],
      "ShowTimedCommands": "true",
      "TimerOnceCommands": [
        [
        ]
      ]
    }
     
  11. I will Update the plugin in a sec to help people like u managing the config :)

    This will be the config your look like after update (CARE ABOUT COMMAS)
    Code:
    {
      "EnableTimerOnceCommands": "true",
      "EnableTimerRepeatCommands": "false",
      "RepeatTimedCommands": [
        [
          "server.save'",
          300
        ],
        [
          "airdrop.massdrop 5",
          300
        ]
      ],
      "TimerOnceCommands": [
        [
          "say 'Restart in 1 MINUTE!'",
          6
        ],
        [
          "say 'Restart in 30 Seconds!'",
          10
        ],
        [
          "restart",
          120
        ],
        [
          "reset.oncetimer",
          15
        ]
      ]
    }
    
     
    Last edited by a moderator: Jun 9, 2015
  12. PaiN updated TimedExecute with a new update entry:

    Fixes

     
  13. whats the config so i can make the server restart every 8 hours? with a count from 8 hours > 5 hours > 2 hours > 1 hour > 30 min > 5 min > now and then restart?
     
  14. 1. Read the overview and the TIMER ONCE NOTES
    2. http://www.unitconversion.org/time/hours-to-seconds-conversion.html
    3. Make your config
    4. If you want you can wait 5 mins i will update the plugin with less code and better config
     
  15. PaiN updated TimedExecute with a new update entry:

    Less code, Better Config and better functionality


    [DOUBLEPOST=1433846551][/DOUBLEPOST]
    Make it with the instructions given above and show me i will tell you if its okay :) Dont Forget the notes!
     
  16. In the default config ovefview :
    Code:
    "command": "say 'Restart in 1 minute",
    you fail one '

    Code:
    "command": "say 'Restart in 1 minute'",
    Don't know if it's important ;)
     
  17. It's not actually important but i will fix it .. maybe some new people will get in trouble. Thanks i will fix it in a sec
     
  18. I want to automatically restart my server once every day, Would this config work? Does the reset.oncetimer mean the time after the commands start back up again? Sorry for the silly question i just want to be sure.
    Code:
    {
      "EnableTimerOnceCommands": "true",
      "EnableTimerRepeatCommands": "true",
      "OnceCommands": [
        {
          "command": "say 'Restart in 1 minute'",
          "seconds": 60
        },
        {
          "command": "say 'Restart in 30 seconds'",
          "seconds": 90
        },
        {
          "command": "say 'Restarting Now'",
          "seconds": 120
        },
        {
          "command": "restart",
          "seconds": 120
        },
        {
          "command": "reset.oncetimer",
          "seconds": 86400
        }
      ],
      "RepeaterCommands": [
        {
          "command": "stability.updateall",
          "seconds": 300
        }
      ]
    }