Skip to content

LilSadPanda/PySpigot-Script-Updater

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 

Repository files navigation

PySpigot Script Updater

Keep your Minecraft server's PySpigot scripts always up-to-date β€” automatically or manually β€” by syncing directly from a GitHub repo (even private ones)! Designed with performance, safety, and flexibility in mind.


🎯 Features

  • πŸ” Async GitHub script downloading (supports private repos)
  • 🧠 SHA-based caching to skip unchanged scripts
  • πŸ” Permission-based access (script_updater.admin)
  • πŸ’¬ Color-coded, clean in-game reload summary
  • 🧷 /updatescripts force support
  • πŸ“… Auto-sync every X minutes via config
  • βœ… Supports script_targets: all or specific scripts

πŸ›  Optimizations & Methods

  • 🧡 Asynchronous file downloads to prevent main-thread lag
  • βœ… Synchronous reloading handled safely via main-thread scheduling
  • ✨ UTF-8 encoding and color handling via safe replacements (no § issues)
  • βš™οΈ Uses GitHub REST API with base64 decoding for reliable private/public repo access

πŸ“œ Commands

/updatescripts
/updatescripts force
  • force reloads all scripts, ignoring hash cache
  • Only accessible to users with permission

πŸ§ͺ Tab Completion

/updatescripts [force]

πŸ›‘ Permissions

Node Description
script_updater.admin Required to run /updatescripts

🧰 Configuration

After first run, a config file is generated:

πŸ“„ Path: plugins/PySpigot/configs/script_updater_config.yml

github_repo_url: https://github.com/YourUser/YourRepo
private_repo: true
repo_sub_directory: scripts
github_pat_token: ghp_XXXXXXXXXXXXXXXXXXXX
local_directory: github
script_targets: all                # or: script1.py,script2.py
auto_sync_minutes: 10

πŸ”„ script_targets Options:

  • all β€” download and reload all .py scripts in the repo subdirectory
  • script1.py,script2.py β€” only update specific scripts by name

πŸ“ Example File Structure

πŸ”— GitHub Repo Example

MyRepo/
└── scripts/
    β”œβ”€β”€ example1.py
    β”œβ”€β”€ example2.py
    └── helper.py

Set repo_sub_directory: scripts to point at this folder.


πŸ“‚ Local Server Structure

plugins/
└── PySpigot/
    β”œβ”€β”€ scripts/
    β”‚   └── github/
    β”‚       β”œβ”€β”€ example1.py
    β”‚       β”œβ”€β”€ example2.py
    β”‚       └── helper.py
    └── configs/
        β”œβ”€β”€ script_updater_config.yml
        └── .script_updater_hashes.json

local_directory: github puts synced files into scripts/github/.


βœ… Installation

  1. Place script_updater.py in your PySpigot scripts/ folder
  2. Restart the server or run:
    /pyspigot reload script_updater.py
  3. Edit the generated config file to match your GitHub repo
  4. Use /updatescripts (or force) as needed
  5. Set auto_sync_minutes to enable background auto-updates

Created by LilSadPanda with ❀️
Feel free to fork or contribute!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages