1. PaiN submitted a new resource:

    TimedExecute - Executes a command every (x) seconds.

    Read more about this resource...
     
  2. Wulf

    Wulf Community Admin

    Congrats on your first plugin! I did notice a few issues though, especially with config generation. I made a more simplistic version below, which I'd recommend using as it fixes a couple issues, removes a lot of unused/uneeded code, and provides a better config and command run verification.
    Code:
    PLUGIN.Title = "TimedExecute"
    PLUGIN.Version = V(0, 1, 0)
    PLUGIN.Description = "Executes a command every (x) seconds."
    PLUGIN.Author = "Merka"function PLUGIN:LoadDefaultConfig()
        self.Config.Commands = {
            { command = "server.save", interval = 300 },
            { command = "say 'hello world'", interval = 600 }
        }
    endfunction PLUGIN:OnServerInitialized()
        for i, item in ipairs(self.Config.Commands) do
            timer.Repeat(item.interval, 0, function()
                print("[" .. self.Title .. "] Ran command: " .. item.command)
                rust.RunServerCommand(item.command)
            end, self.Plugin)
        end
    end
     
  3. Nice Plugin mate!
     
  4. Thanks Eshistin
     
  5. Nice work on your first plugin :)
     
  6. Thank you :)
     
  7. ;)
     
  8. Nice one Pain... I know you've been keen to get started.... I really need to work on mine.
     
  9. Thanks :)
     
  10. Anyone got a config for automatic server restart with coundown timer?
    Already got a script to restart it once it hangs or shutdowns.
    But would be nice to use the ingame restart function, maybe every 4 hours or so.
     
  11. command ="restart", interval =2400
    should work?
     
  12. Like this?

    RustDedicated.exe -batchmode +global.restart 2400
     
    Last edited by a moderator: Apr 11, 2015
  13. How do you mean that? You want to do that in the config right? Then just write this in your config:
    Code:
    {
      "ShowTimedCommands": "true",
      "TimedCommands": [
        [
          "restart",
          2400
        ]
      ]
    }
     
  14. Thanks! Just thought I might be able to use the command from server startup command line.
     
  15. maybe it could just give me the plugin so i can edit it :) and add a console command if there are only chat commands
     
  16. CHR

    CHR

    hey for some reason it dosnt work like it should, it annouces the Server restart on same time at 5hours and 3hours but they got diffrent timers.

    Code:
    {
      "ShowTimedCommands": "true",
      "TimedCommands": [
        [
          "event.run",
          3600
        ],
        [
          "say TRIPLE AIRDROP INCOMING!!!",
          3600
        ],
        [   
          "event.run",
          3600
        ],
        [
         "event.run",
          3600
        ],
        [
         "restart",
          21600
        ],
        [
         "server.save",
          21400
        ],
        [
          "say SERVERRESTART in 5 hours!",
          3600
        ],
        [
          "say SERVERRESTART in 4 hours!",
          7200
        ],
        [
          "say SERVERRESTART in 3 hours!",
          10800
        ],
        [
          "say SERVERRESTART in 2 hours!",
          14400
        ],
        [
          "say SERVERRESTART in 1 hour!",
          18000
        ],
        [
          "say SERVERRESTART in 30 min!",
          19800
        ],
      ]
    }
     
  17. Gonna update the plugin in like 5-10 mins and u will tell me okay ?
     
  18. CHR

    CHR

    Can't test it directly but I will try it ... but I can't say directly if it works cuz I must wait the timers. Btw pls add that it is printed in server.logs.