About AutoRestart UI
AutoRestart is an advanced and fully configurable plugin to facilitate automatic restarts of Rust servers, ensuring consistent performance and minimizing downtime through effective scheduling and notifications.
The plugin has been tested in Pterodactyl and Wisp without problems. Windows could have problems due to how each administrator has configured their bat file and that may cause the plugin to not be able to start the server again.
Main Features
-
Interactive UI: Includes an interactive UI that allows administrators to modify all plugin settings easily.
-
Scheduled Restarts: Configures automatic server restarts at defined intervals using UTC timezone for uniform scheduling.
-
Discord Integration: Sends notifications to designated Discord channels to keep the community informed about restarts and server availability.
-
Player Alerts: Notifies in-game through both UI and chat, with configurable countdowns (e.g., 60, 30, 10 minutes), including a visible final-minute countdown.
-
Sound Alerts: Provides optional auditory notifications to accompany visual or chat alerts.
-
Manual Admin Restarts: Administrators can initiate manual restarts with the /restart [seconds] command, including real-time alerts.
-
Cancel Restarts: Allows administrators to cancel or reschedule restarts using the /restartstop command.
-
Player Limit Protection: Prevents restarts during high player activity by setting a player count threshold.
-
uMod Update Support: Automates checking for and applying uMod updates, followed by a server restart.
-
Rewards System: Comprehensive reward system for players who connect after server restarts, supporting Economics, ServerRewards, and custom item rewards.
-
Multilanguage messages: English, Spanish, Italian, Russian, Ukrainian, French, Portugues.
Permissions
-
autorestart.use: Grants administrative privileges to execute manual restarts, cancel scheduled or manual restarts, modify restart settings, and access the configuration UI.
Chat Commands
-
/restart config: Opens the main configuration UI.
-
/restart <time> (e.g., 30s/5m/1h): Schedules a manual restart for the specified time.
-
/restart now: Initiates an immediate server restart.
-
/restart cancel: Cancels any scheduled restart.
-
/restart status: Checks the time until the next scheduled restart.
Console Commands
-
restart: Shows the time until the next scheduled restart.
-
restart <time> (e.g., 30s/5m/1h): Schedules a manual restart for the specified time.
-
restart now: Initiates an immediate server restart.
-
restart cancel: Cancels any scheduled restart.
API Methods
Available Hooks OnRestartScheduled Called when a restart is scheduled (both automatic and manual) void OnRestartScheduled(int seconds, bool isCustom) { // seconds: Time until restart in seconds // isCustom: true if manually triggered, false if automatic schedule Puts($"Restart scheduled in {seconds} seconds (Custom: {isCustom})"); } OnRestartCancelled Called when a restart is cancelled void OnRestartCancelled(string reason) { // reason: Why the restart was cancelled // Possible values: "Manual cancellation", "Too many players", "Plugin unload" Puts($"Restart cancelled: {reason}"); } OnRestartWarning Called during countdown warnings (every significant interval) void OnRestartWarning(int secondsLeft) { // secondsLeft: Seconds remaining until restart // Called at: 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 seconds if (secondsLeft <= 10) Puts($"URGENT: Server restarting in {secondsLeft} seconds!"); } OnRestartInitiated Called right before the server restart process begins void OnRestartInitiated() { // Server save and quit commands will execute after this hook Puts("Server restart initiated - saving and shutting down now!"); }
Config
{ "Version": "3.0.0", "Restart": { "RestartTimes": [ "12:00", "12:15", "12:30", "13:55", "20:40", "15:40", "09:20", "08:20" ], "AlertSound": "assets/prefabs/locks/keypad/effects/lock.code.lock.prefab", "UseSound": true, "UseChatAlerts": true, "SkipWipeDays": false, "WipeDays": [ "Monday", "Wednesday", "Thursday", "Sunday" ] }, "PlayerRestrictions": { "MaxPlayersBeforeCancel": 10, "RestrictPlayerCount": false }, "Alerts": { "InGameWarningTimes": [ 30, 15, 10, 5, 3, 2, 1 ], "DiscordWarningTimes": [ 30, 15, 10, 5, 1 ] }, "UpdateCheck": { "CheckForUpdates": true, "CheckInterval": 1200 }, "UI": { "UseCustomUI": true, "UseRustUI": true, "CustomUI": { "AnchorMin": "0 0.5", "AnchorMax": "0 0.5", "OffsetMin": "10 -45.9695", "OffsetMax": "177.325 46.7435", "CheckIcon": "✓", "CrossIcon": "✗", "CheckIconColor": "0.5568627 0.7764706 0.1843137 1", "CrossIconColor": "0.7764706 0.5137255 0.4196078 1", "TitleColor": "1 1 1 1", "MessageColor": "0.9 0.9 0.9 1", "IconColor": "0.3 0.6 1 1", "CurrentIcon": "assets/icons/download.png", "BorderType": "None", "CustomTitle": "reinicio", "CustomMessage": "The server will restart in {0}.", "BackgroundColorHex": "#191919", "TitleFontSize": 14, "MessageFontSize": 12 }, "GametipStyle": 1 }, "Discord": { "WebhookUrl": "https://discord.com/api/webhooks/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "ServerName": "Rust Server", "DiscordNotifications": true, "UseFullMinuteCountdown": true, "MessageContent": "@everyone Server restart | @here | <@&role-id>", "BotName": "AutoRestart Bot", "BotAvatarUrl": "https://codefling.com/uploads/set_resources_13/cf0d9ad89a1246bdc528542aa98e2147_cf_logo_23_res.png", "Embeds": {}, "Embed": { "AuthorName": "Server Restart", "AuthorIconUrl": "https://codefling.com/uploads/set_resources_13/cf0d9ad89a1246bdc528542aa98e2147_cf_logo_23_res.png", "Title": "Scheduled Server Restart", "Description": "The server will restart in {0}", "ThumbnailUrl": "https://codefling.com/uploads/set_resources_13/cf0d9ad89a1246bdc528542aa98e2147_cf_logo_23_res.png", "FooterText": "Server Restart | {DateTime}", "FooterIconUrl": "https://codefling.com/uploads/set_resources_13/cf0d9ad89a1246bdc528542aa98e2147_cf_logo_23_res.png", "FieldTitle": "Server Info", "FieldContent": "The server will be back online in approximately 3-5 minutes", "ColorHex": "#FF9900" } }, "DisableDiscordCountdownMessages": false, "Rewards": { "EnableRewards": true, "UseEconomics": false, "UseServerRewards": false, "EconomicsAmount": 10.0, "ServerRewardsPoints": 10, "RewardTimeLimit": 300, "RewardItems": [] } }
Lang
{ "Version": "3.0.0", "ChatRestartAlert": "Server restart scheduled in {0}.", "ChatRestartCanceled": "The server restart has been canceled.", "ChatRestartNow": "RESTARTING...", "ChatRestartCanceledTooManyPlayers": "Restart canceled due to too many players.", "NoRestartScheduled": "No restart is currently scheduled.", "RustUITitle": "SCHEDULED SERVER RESTART", "RustUIMessage": "The server will restart in {0}.", "CustomUITitle": "SCHEDULED SERVER RESTART", "CustomUIMessage": "The server will restart in {0}.", "NoPermission": "You do not have permission to use this command.", "Usage": "Usage: /restart <time>[s|m|h] (e.g., 30s, 5m, 1h)", "InvalidNumber": "Invalid time format. Use <number>[s|m|h] (e.g., 30s, 5m, 1h)", "UpdateDetected": "A uMod update has been detected. The server will restart to apply the update.", "DiscordRestartAlert": " **SERVER RESTART**\nServer will restart in {0}.", "DiscordRestarting": " **RESTARTING**\nServer is restarting now. Please wait 5 minutes for the server to be back online.", "DiscordOnline": " **SERVER ONLINE**\nServer is now online and ready to play!", "TimeMinute": "minute", "TimeMinutes": "minutes", "TimeHour": "hour", "TimeHours": "hours", "TimeSecond": "second", "TimeSeconds": "seconds", "RewardEconomicsReceived": "You received ${0} from Economics reward!", "RewardPointsReceived": "You received {0} RP from ServerRewards!", "RewardItemReceived": "You received {0}x {1} from Item rewards!", "RewardTimeLeft": "You received rewards for connecting during server restart. Rewards will be available for {0} more.", "RewardPeriodEnded": "The reward period has ended.", "ConfigTitle": "AutoRestart UI Configurator", "DiscordSettings": "Discord Settings", "RewardSettings": "Reward Settings", "TimeSettings": "Restart Times Settings", "NotificationSettings": "Notification Settings", "Save": "Save", "Close": "Close", "Back": "Back", "SavedSuccessfully": "Configuration saved successfully!", "Search": "Search items...", "AllCategories": "All Categories", "CategoryWeapons": "Weapons", "CategoryTools": "Tools", "CategoryConstruction": "Construction", "CategoryItems": "Items", "CategoryResources": "Resources", "CategoryAttire": "Attire", "CategoryMedical": "Medical", "CategoryFood": "Food", "CategoryAmmo": "Ammunition", "CategoryTraps": "Traps", "CategoryMisc": "Miscellaneous", "CategoryComponents": "Components", "CategoryElectrical": "Electrical", "CategoryFun": "Fun", "ManageRewards": "AutoRestart - Reward Manager", "ItemSelector": "AutoRestart - Item Selector", "NoRewards": "No rewards configured. Click the 'Add Reward' button to add some.", "EnterQuantity": "Enter quantity for {0}", "AddReward": "Add Reward", "RemoveAll": "Remove All", "ConfirmRemoveAll": "Are you sure you want to remove all rewards?", "Yes": "Yes", "No": "No", "RewardAdded": "Added {0}x {1} to restart rewards.", "RewardRemoved": "Removed {0}x {1} from restart rewards.", "RewardUpdated": "Updated {0} quantity to {1}.", "InvalidItem": "Invalid item. Please try again.", "InvalidQuantity": "Please enter a valid quantity greater than 0.", "CategoriesReset": "Item categories have been reset to default values.", "TimesListTitle": "Restart Times (UTC)", "AddTime": "Add Time", "RemoveTime": "Remove", "InvalidTimeFormat": "Invalid time format. Please use HH:MM format (e.g., 04:30)", "AddWipeDay": "Add Wipe Day", "WipeDaysTitle": "Wipe Days (Restarts Skipped)", "WipeDayAdded": "Added {0} to wipe days. Restarts will be skipped on this day.", "WipeDayRemoved": "Removed {0} from wipe days.", "MessageSettings": "Message Settings", "EmbedSettings": "Embed Settings", "WebhookSettings": "Webhook Settings" }