Introduce new sh_schedule.lua module for managing scheduled announcements using either interval-based (every) or cron-based scheduling. Supports both preset announcements and custom title/text combinations.
Features:
- Interval-based scheduling: every = "30m" format (s/m/h/d units)
- Cron-based scheduling: "minute hour day month weekday" format
- Preset reuse from sh_presets.lua or custom title/text
- Server timezone for cron execution
- Pre-configured examples for Discord reminders and custom tips
Add reusable announcement presets that can be selected through the menu (/bannonce) and used by the scheduler. Includes five preset templates: restart, shutdown, maintenance, event, and discord with customizable titles, messages, styles, and durations.
Add two new configuration options to the announcement system:
- announcement_max_length: limit message length to 80 characters
- announcement_sound: specify a sound file to play when announcement appears
Also improve alignment and clarify comments for existing options.
Initialize the BladW.Announcement.Conf configuration table with announcement style and duration settings. The announcement_style can be set to either 'simple' or 'loader', and announcement_duration controls the display time in seconds for loader style announcements.
Replace simple prefix matching with full glob pattern support for discovering root folders.
Changes:
- Add EscapePattern() to escape Lua magic characters
- Add GlobToPattern() to convert glob patterns (e.g., "bladw_*") to Lua regex patterns
- Refactor FindRootFolders() to support:
• Exact matches without wildcards (e.g., "bladw_announcement")
• Glob patterns with * in prefix/suffix/middle positions
- Update default config root from "bladw_*" to "bladw_announcement"
- Improve documentation with usage examples
- Add new announcement module with client, server, and shared files
- Update rndx.lua library (formatting/whitespace changes)
BREAKING CHANGE: The root config now expects exact folder names or glob patterns instead of simple prefixes. Existing configs using "bladw_*" will still work but the matching behavior changes from prefix-only to glob-based pattern matching.