mirror of
https://github.com/LightZirconite/Microsoft-Rewards-Bot.git
synced 2026-01-09 17:06:15 +00:00
- Implemented a restart counter to prevent infinite update loops. - Added checks for update success using marker files. - Improved logging for update attempts and failures. - Created comprehensive documentation for npm commands and setup processes. - Introduced a new update system using GitHub API for seamless updates. - Added troubleshooting guidelines for common issues.
Setup Scripts
This folder contains setup and update scripts for the Microsoft Rewards Bot.
Files
setup.bat / setup.sh
First-time installation scripts for Windows (.bat) and Linux/macOS (.sh).
What they do:
- Check prerequisites (Node.js, npm)
- Create
accounts.jsoncfrom template - Guide you through account configuration
- Install dependencies (
npm install) - Build TypeScript project (
npm run build) - Install Playwright Chromium browser
Usage:
# Windows
.\setup\setup.bat
# Linux/macOS
./setup/setup.sh
Important: These scripts do NOT start the bot automatically. After setup, run:
npm start
update/update.mjs
Automatic update script that keeps your bot up-to-date with the latest version.
Features:
- Two update methods: Git-based or GitHub API (no Git needed)
- Preserves your configuration and accounts
- No merge conflicts with GitHub API method
- Automatic dependency installation and rebuild
Usage:
# Auto-detect method from config.jsonc
node setup/update/update.mjs
# Force GitHub API method (recommended)
node setup/update/update.mjs --no-git
# Force Git method
node setup/update/update.mjs --git
Automatic updates: The bot checks for updates on startup (controlled by update.enabled in config.jsonc).
update/setup.mjs
Interactive setup wizard used by setup.bat/setup.sh.
This is typically not run directly - use the wrapper scripts instead.
Quick Start Guide
First-time setup:
Windows:
.\setup\setup.bat
Linux/macOS:
chmod +x setup/setup.sh
./setup/setup.sh
Daily usage:
# Start the bot
npm start
# Start with TypeScript (development)
npm run dev
# View dashboard
npm run dashboard
Configuration:
- Accounts: Edit
src/accounts.jsonc - Settings: Edit
src/config.jsonc - Documentation: See
docs/folder
Troubleshooting
"npm not found"
Install Node.js from https://nodejs.org/ (v20 or newer recommended)
"Setup failed"
- Delete
node_modulesfolder - Delete
package-lock.jsonfile - Run setup again
"Build failed"
npm run clean
npm run build
Update issues
If automatic updates fail, manually update:
git pull origin main
npm install
npm run build
Need Help?
- Documentation:
docs/index.md - Getting Started:
docs/getting-started.md - Troubleshooting:
docs/troubleshooting.md - Discord: https://discord.gg/k5uHkx9mne