mirror of
https://github.com/TheNetsky/Microsoft-Rewards-Script.git
synced 2026-01-10 02:16:18 +00:00
849406c44f508779195f71247847e3ddaa61d1f9
* 1.4.12 * Update README.md * Update package.json * Update package.json * 1.5 initial - Added parallel mode (experimental, likely no Docker supported) - Added chalk for clearer logging - Added support for "SearchOnBing" Activities - Added more configurable options for certain things - Redone some of the popup/banner clicking for searching (Redo the entire "popup" clicking, so they're more specifically targeted) - Axios proxy is now optional in the config - Fingerprint saving is now optional for desktop and mobile There needs to be many changes for Docker support, including parallel, the new config settings and general testing! This is still highly experimental, if you use Docker or want something more stable, use the version before this commit! * Add queries.json to build * fix(Login): update URL within authorization loop to reflect current page (#210) * Many changes - Updated Packages - Fixed mobile searches erroring out for dashboard data - Reworked "bad page" detection - Catching more errors - Reworked the search and "close tabs" - More fixes to the login - Fixed to paralell and clustering, thanks to @AariaX * Docker 1.5 preliminary support (#211) * Basic docker functionality for 1.5 Preliminary docker support for 1.5. Requires headless=true, clusters=1 * Tidy up timezone, add TZ to compose file Minor changes that should improve timezone handling, and (hopefully) improve scheduling function * updated readme to simplify and clarify docker instructions also removed env vars from table * Fix syntax for cron * Fix scheduling, add .gitattributes to normalize line endings fixed line endings caused by Windows in crontab.template and run_daily.sh, which were breaking cron and script execution in the Docker container. * Removed unnecessary scheduling key from config.json This key isn't necessary for docker or the base script. * Basic docker functionality for 1.5 Preliminary docker support for 1.5. Requires headless=true, clusters=1 Tidied up timezone, add TZ to compose file Minor changes that should improve timezone handling, and (hopefully) improve scheduling function updated readme to simplify and clarify docker instructions also removed env vars from table Fixed syntax for cron Fixed scheduling, add .gitattributes to normalize line endings Fixed line endings caused by Windows in crontab.template and run_daily.sh, which were breaking cron and script execution in the Docker container. Removed unnecessary scheduling key from config.json This key isn't necessary for docker or the base script. * Improve scheduling handling, show logs in console Fixes scheduling when RUN_ON_START=true, and fixes scheduled runs not appearing in docker logs. * Update compose.yaml revert service and container name, revert volumes for better generalization, add tips to environment to set scheduling, timezone and whether to run on container start * Update README.md proper container name Co-authored-by: AariaX <196196201+AariaX@users.noreply.github.com> --------- Co-authored-by: AariaX <196196201+AariaX@users.noreply.github.com> * Fixes - Reworked some of the point counting - Reverted back to the "playwright" package - Fixed error throw for emailPrefill * Update config.json * Add pre-build script * Update package.json * Handle 2FA in parallel mode (#219) * catch error in reloadBadPage (#220) * Use pre-build and simplify dockerfile (#218) This uses the new pre-build script included in package.json to handle deps greatly simplifying the dockerfile. * Small improvements * Small fixes - Fixed log spam for "Waiting for authorization" - Increased wait from 2 to 5 seconds - Increased search to "safer" values for default * Experimenting with selectors Seeing #223 I want to try if this is a good new addition, since for most user this SHOULD work just as good as clicking the entire box. * More stuff - Added ability to exclude logs by their function name - Now caching config settings * fix: don't retry on 0 (#228) * Improvements - Check if searches for mobile are enabled before creating the new page in the browser - Return message if mobile search data cannot be found - Added more selectors for coupons * Improve Popup Dismissal - Now executes in Parallel - Respects a timeout of 1 second --------- Co-authored-by: AariaX <196196201+AariaX@users.noreply.github.com> Co-authored-by: mgrimace <55518507+mgrimace@users.noreply.github.com>
Microsoft-Rewards-Script
Automated Microsoft Rewards script, however this time using TypeScript, Cheerio and Playwright.
Under development, however mainly for personal use!
How to setup
- Download or clone source code
- Run
npm ito install the packages - Change
accounts.example.jsontoaccounts.jsonand add your account details - Change
config.jsonto your liking - Run
npm run buildto build the script - Run
npm run startto start the built script
Notes
- If you end the script without closing the browser window first (only with headless as false), you'll be left with hanging chrome instances using resources. Use taskmanager to kill these or use the included
npm run kill-chrome-winscript. (Windows) - If you automate this script, set it to run at least 2 times a day to make sure it picked up all tasks, set
"runOnZeroPoints": falseso it doesn't run when no points are found.
Docker (Experimental)
Before Starting
- If you had previously built and run the script locally, remove the
/node_modulesand/distfolders from yourMicrosoft-Rewards-Scriptdirectory. - If you had used Docker with an older version of the script (e.g., 1.4), remove any persistently saved
config.jsonand session folders. Oldaccounts.jsonfiles can be reused.
Setup the Source Files
-
Download the Source Code
-
Update
accounts.json -
Edit
config.json, ensuring the following values are set (other settings are up to your preference):"headless": true, "clusters": 1,
Customize the compose.yaml File
A basic docker compose.yaml is provided. Follow these steps to configure and run the container:
- Set Your Timezone: Adjust the
TZvariable to ensure correct scheduling. - Configure Persistent Storage:
- Map
config.jsonandaccounts.jsonto retain settings and accounts. - (Optional) Use a persistent
sessionsfolder to save login sessions.
- Map
- Customize the Schedule:
- Modify
CRON_SCHEDULEto set run times. Use crontab.guru for help. - Note: The container adds 5–50 minutes of random variability to each scheduled start time.
- Modify
- (Optional) Run on Startup:
- Set
RUN_ON_START=trueto execute the script immediately when the container starts.
- Set
- Start the Container: Run
docker compose up -dto build and launch. - Monitor Logs: Use
docker logs microsoft-rewards-scriptto view script execution and to retrieve 'passwordless' login codes.
Config
| Setting | Description | Default |
|---|---|---|
| baseURL | MS Rewards page | https://rewards.bing.com |
| sessionPath | Path to where you want sessions/fingerprints to be stored | sessions (In ./browser/sessions) |
| headless | If the browser window should be visible be ran in the background | false (Browser is visible) |
| runOnZeroPoints | Run the rest of the script if 0 points can be earned | false (Will not run on 0 points) |
| clusters | Amount of instances ran on launch, 1 per account | 1 (Will run 1 account at the time) |
| saveFingerprint | Re-use the same fingerprint each time | false (Will generate a new fingerprint each time) |
| workers.doDailySet | Complete daily set items | true |
| workers.doMorePromotions | Complete promotional items | true |
| workers.doPunchCards | Complete punchcards | true |
| workers.doDesktopSearch | Complete daily desktop searches | true |
| workers.doMobileSearch | Complete daily mobile searches | true |
| workers.doDailyCheckIn | Complete daily check-in activity | true |
| workers.doReadToEarn | Complete read to earn activity | true |
| globalTimeout | The length before the action gets timeout | 30s |
| searchSettings.useGeoLocaleQueries | Generate search queries based on your geo-location | true (Uses EN-US generated queries) |
| scrollRandomResults | Scroll randomly in search results | true |
| searchSettings.clickRandomResults | Visit random website from search result | true |
| searchSettings.searchDelay | Minimum and maximum time in miliseconds between search queries | min: 1min max: 2min |
| searchSettings.retryMobileSearchAmount | Keep retrying mobile searches for specified amount | 3 |
| logExcludeFunc | Functions to exclude out of the logs and webhooks | SEARCH-CLOSE-TABS |
| webhook.enabled | Enable or disable your set webhook | false |
| webhook.url | Your Discord webhook URL | null |
| cronStartTime | Scheduled script run-time, only available for docker implementation | 0 5,11 * * * (5:00 am, 11:00 am daily) |
| Run the script immediately when the Docker container starts | true |
Features
- Multi-Account Support
- Session Storing
- 2FA Support
- Passwordless Support
- Headless Support
- Discord Webhook Support
- Desktop Searches
- Configurable Tasks
- Microsoft Edge Searches
- Mobile Searches
- Emulated Scrolling Support
- Emulated Link Clicking Support
- Geo Locale Search Queries
- Completing Daily Set
- Completing More Promotions
- Solving Quiz (10 point variant)
- Solving Quiz (30-40 point variant)
- Completing Click Rewards
- Completing Polls
- Completing Punchcards
- Solving This Or That Quiz (Random)
- Solving ABC Quiz
- Completing Daily Check In
- Completing Read To Earn
- Clustering Support
- Proxy Support
- Docker Support (experimental)
- Automatic scheduling (via Docker)
Disclaimer
Your account may be at risk of getting banned or suspended using this script, you've been warned!
Use this script at your own risk!
Languages
TypeScript
94%
Shell
4%
Dockerfile
1.5%
Nix
0.5%