Files
Microsoft-Rewards-Script/README.md
Netsky 849406c44f 1.5 inital (#234)
* 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>
2025-02-15 16:14:47 +01:00

5.7 KiB
Raw Blame History

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

  1. Download or clone source code
  2. Run npm i to install the packages
  3. Change accounts.example.json to accounts.json and add your account details
  4. Change config.json to your liking
  5. Run npm run build to build the script
  6. Run npm run start to 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-win script. (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": false so 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_modules and /dist folders from your Microsoft-Rewards-Script directory.
  • If you had used Docker with an older version of the script (e.g., 1.4), remove any persistently saved config.json and session folders. Old accounts.json files can be reused.

Setup the Source Files

  1. Download the Source Code

  2. Update accounts.json

  3. 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:

  1. Set Your Timezone: Adjust the TZ variable to ensure correct scheduling.
  2. Configure Persistent Storage:
    • Map config.json and accounts.json to retain settings and accounts.
    • (Optional) Use a persistent sessions folder to save login sessions.
  3. Customize the Schedule:
    • Modify CRON_SCHEDULE to set run times. Use crontab.guru for help.
    • Note: The container adds 550 minutes of random variability to each scheduled start time.
  4. (Optional) Run on Startup:
    • Set RUN_ON_START=true to execute the script immediately when the container starts.
  5. Start the Container: Run docker compose up -d to build and launch.
  6. Monitor Logs: Use docker logs microsoft-rewards-script to 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!