1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Replenish

Easily reset/replenish loot in storage boxes and containers after a certain amount of time.

Total Downloads: 1,598 - First Release: Jun 10, 2016 - Last Update: Apr 5, 2018

5/5, 11 likes

  1. Wulf
    Replenish for Rust allows you to setup containers (ie. storage boxes, furnaces, camp fires, etc.) to regenerate or replenish their loot after a certain amount of time. Loot is only replenished when it is taken from the inventory.

    Features:
    • Very easily setup storage containers to regenerate loot.
    • Configurable timers for loot replenishing.
    • Permissions included.
    • Replenishing containers persist through restarts (a file in the Data folder is used to store data).
    Examples:
    • Minigame chests that restock themselves, saving you time and effort.
    • King of the Hill capture rewards, generating resources on a timer.
    • Arena PVP power weapons (Halo style), where powerful weapons such as Rocket Launchers can spawn on a timer.
    • More examples are up to your imagination :p

    How it Works:
    Using Replenish is super simple. Just type in /replenish_add (assuming you have the necessary permissions) and then hit an allowed container (see below) with the Hammer. That container will now replenish the loot that was in it 30s after the loot is taken (time is configurable, see Commands below). The plugin only regenerates loot that was in the container BEFORE you hit it with the Hammer, so loot added later won't be replenished.

    Commands:
    Replenish currently supports 8 commands.
    • /replenish: Shows the available commands.
    • /replenish_add <time>: Add a new replenishing container. Command is disabled after hitting a container.
    • /replenish_addm <time>: Add multiple new replenishing containers. Command won't be disabled after hitting the first container.
    • /replenish_remove {Optional:ContainerUID}: Remove a replenishing container. Command is disabled after hitting a container. If a UID is specified, it will remove the container with that UID. Use /replenish_list to get the containers UID. This allows you to remove containers without having to go up to them.
    • /replenish_removem: Remove multiple replenishing containers. Command won't be disabled after hitting the first container.
    • /replenish_test: Test if a containeris replenishing. Command is disabled after hitting a container.
    • /replenish_testm: Test if multiple containers are replenishing. Command won't be disabled after hitting the first container.
    • /replenish_list: Shows a list of all the replenishing containers and their locations.
    • /replenish_stop: Stop adding/removing/testing multiple containers. Enter this command after any of the "multiple" commands to stop.
    The <time> parameters for the adding commands are optional. Leaving it out will use the default 30s replenish timer. Time must be in whole seconds, ie. 5, 15, 10932.

    Permissions:

    • replenish.admin: Grants access to all the Replenish commands.
    • replenish.edit: Grants access to the add, remove and stop commands.
    • replenish.test: Grants access to the /replenish_test and /replenish_testm commands.
    • replenish.list: Grants access to the /replenish_list command.
    Using the Permissions:
    Permissions are granted using Oxides permissions system.

    To grant permission to a user:
    Code:
    oxide.grant user "PLAYERNAME" PERMISSIONNAME
    To grant permission to a group:
    Code:
    oxide.grant group "GROUPNAME" PERMISSIONNAME
    Config Options:
    The available configuration options are:
    • RequireAllSlotsEmpty: Loot will only be replenished once every item has been removed from the container, rather than after the first.
    • DefaultTimerLength: The default timer length when adding new replenishable containers and a time was not specified.
    • UsePermissionsOnly: Removes the IsAdmin() tag as valid authority to use the commands.
    • AllowXXX: Allows the specified container type to be replenishable.
    The config file is generated at oxide/config/Replenish.json.

    Default Config:

    Code:
    {
      "DefaultTimerLength": 30,
      "RequireAllSlotsEmpty": false,
      "UsePermissionsOnly": false
    }
    
    Data File:
    The data file can be found at oxide/Data/ReplenishData.json. I'd recommend not messing with it unless you're okay with losing all the replenishing boxes you have setup.

    To-Do:
    • Save current timer values so that really long timers can persist through restarts (ie. if server restarts every 24 hours, a 48 hour replenishing timer will not work properly).
    • Investigate what happens if server restarts during replenishing timer. Does loot ever respawn?
    • Add commands to delete all replenishing boxes.
    Credits:
    As this is the first Rust plugin I've released, I must acknowledge those who's plugins assisted my with this. While the majority of the code in this plugin is my own, some of it was learnt from other plugins.
    • k1lly0u for EventManager. The two methods for saving and replenishing the storage box items are inspired from this plugin.
    • Wulf for his help with Lang API and other Oxide standards.