### Build and Run Script - Bash Source: https://github.com/thenetsky/microsoft-rewards-script/blob/main/README.md Builds the project and then starts the Microsoft Rewards script. These commands are executed after dependencies are installed and configurations are set. ```bash npm run build npm run start ``` -------------------------------- ### Start Docker Compose - Bash Source: https://github.com/thenetsky/microsoft-rewards-script/blob/main/README.md Starts the Microsoft Rewards script service using Docker Compose in detached mode. This command requires a configured compose.yaml file and assumes Docker is installed. ```bash docker compose up -d ``` -------------------------------- ### Copy Configuration File - Bash Source: https://github.com/thenetsky/microsoft-rewards-script/blob/main/README.md Copies the example account configuration file to a new file that the script will use. This is required for Linux, macOS, and WSL environments. ```bash cp src/accounts.example.json src/accounts.json ``` -------------------------------- ### Example Docker Compose Configuration - YAML Source: https://github.com/thenetsky/microsoft-rewards-script/blob/main/README.md An example configuration file for running the Microsoft Rewards script using Docker Compose. It defines services, volumes, environment variables, and resource limits for the container. ```yaml services: microsoft-rewards-script: image: ghcr.io/your-org/microsoft-rewards-script:latest container_name: microsoft-rewards-script restart: unless-stopped volumes: - ./src/accounts.json:/usr/src/microsoft-rewards-script/dist/accounts.json:ro - ./src/config.json:/usr/src/microsoft-rewards-script/dist/config.json:ro - ./sessions:/usr/src/microsoft-rewards-script/dist/sessions environment: TZ: "Europe/Amsterdam" NODE_ENV: "production" CRON_SCHEDULE: "0 7,16,20 * * *" RUN_ON_START: "true" # MIN_SLEEP_MINUTES: "5" # MAX_SLEEP_MINUTES: "50" # SKIP_RANDOM: "true" deploy: resources: limits: cpus: "1.0" memory: "1g" ``` -------------------------------- ### Install Dependencies and Prepare Browser - Bash Source: https://github.com/thenetsky/microsoft-rewards-script/blob/main/README.md Installs project dependencies, clears previous builds, and installs the Playwright Chromium browser. This command is essential for preparing the environment before building and running the script. ```bash npm run pre-build ``` -------------------------------- ### Docker CLI Commands for Managing Microsoft Rewards Script Source: https://context7.com/thenetsky/microsoft-rewards-script/llms.txt Provides essential Docker commands for managing the Microsoft Rewards script container. Includes commands to start the container in detached mode, monitor logs in real-time, and shows example log output indicating cron scheduling and bot activity. ```bash # Start the container docker compose up -d # Monitor logs docker logs -f microsoft-rewards-script # Output: # [CRON] Next execution: 2025-11-25 16:00:00 # [SLEEP] Random delay: 23 minutes # [MAIN] Bot started with 1 clusters # [LOGIN] Starting login process! # [DAILY-SET] Started solving "Daily Set" items # [SEARCH-BING] 150 Points Remaining | Query: artificial intelligence ``` -------------------------------- ### Clone Repository and Navigate - Bash Source: https://github.com/thenetsky/microsoft-rewards-script/blob/main/README.md Clones the Microsoft Rewards Script repository using Git and changes the directory to the cloned repository. This is the initial step for all system setups. ```bash git clone https://github.com/TheNetsky/Microsoft-Rewards-Script.git cd Microsoft-Rewards-Script ``` -------------------------------- ### Run Script with Nix - Bash Source: https://github.com/thenetsky/microsoft-rewards-script/blob/main/README.md Executes the Microsoft Rewards script using Nix, first running the pre-build step and then starting the script via a shell script. This method is specifically for users of the Nix package manager. ```bash npm run pre-build ./run.sh ``` -------------------------------- ### Initialize and Run Microsoft Rewards Bot (TypeScript) Source: https://context7.com/thenetsky/microsoft-rewards-script/llms.txt Initializes and executes the Microsoft Rewards automation bot. It loads accounts from 'accounts.json' and starts the task execution process. The function handles potential errors during initialization and execution, exiting the process if an error occurs. It supports desktop or mobile modes. ```typescript import { MicrosoftRewardsBot } from './index' // Initialize bot instance const rewardsBot = new MicrosoftRewardsBot(false) // false = desktop mode, true = mobile mode // Initialize and run async function main() { try { await rewardsBot.initialize() // Loads accounts from accounts.json await rewardsBot.run() // Starts task execution } catch (error) { console.error('Bot execution failed:', error) process.exit(1) } } main() // Output: // [MAIN] Bot started with 1 clusters // [LOGIN] Starting login process! // [MAIN-POINTS] Current point count: 1523 // [MAIN-POINTS] You can earn 270 points today // [DAILY-SET] Started solving "Daily Set" items // [SEARCH-BING] Starting Bing searches // [MAIN-POINTS] The script collected 270 points today ``` -------------------------------- ### Account Configuration JSON Source: https://github.com/thenetsky/microsoft-rewards-script/blob/main/README.md Defines the structure for the `src/accounts.json` file, which is a flat array of account objects. Each object requires an email and password, with optional proxy configuration for API requests. ```json [ { "email": "email_1", "password": "password_1", "proxy": { "proxyAxios": true, "url": "", "port": 0, "username": "", "password": "" } }, { "email": "email_2", "password": "password_2", "proxy": { "proxyAxios": true, "url": "", "port": 0, "username": "", "password": "" } } ] ``` -------------------------------- ### Enable Parallel Execution for Desktop and Mobile Tasks in TypeScript Source: https://context7.com/thenetsky/microsoft-rewards-script/llms.txt Demonstrates how to configure the Microsoft Rewards bot to run desktop and mobile tasks in parallel using TypeScript. It involves creating separate bot instances and using `Promise.all` to execute their respective task methods concurrently. The output shows the points collected by each task and the total. ```typescript const bot = new MicrosoftRewardsBot(false) bot.config.parallel = true async function runParallelTasks(account: Account) { // Creates two bot instances const desktopInstance = new MicrosoftRewardsBot(false) const mobileInstance = new MicrosoftRewardsBot(true) // Both share same axios instance for proxy mobileInstance.axios = desktopInstance.axios // Execute simultaneously const [desktopResult, mobileResult] = await Promise.all([ desktopInstance.Desktop(account), mobileInstance.Mobile(account) ]) console.log('Desktop Points Collected:', desktopResult.collectedPoints) console.log('Mobile Points Collected:', mobileResult.collectedPoints) console.log('Total Points:', desktopResult.collectedPoints + mobileResult.collectedPoints) } // Output: // Desktop Points Collected: 180 // Mobile Points Collected: 120 // Total Points: 300 ``` -------------------------------- ### Manage Browser Contexts with Fingerprinting and Proxy in TypeScript Source: https://context7.com/thenetsky/microsoft-rewards-script/llms.txt Manages isolated browser contexts with advanced features like fingerprinting and proxy support. It allows for the creation of browser instances with unique fingerprints (canvas, WebGL, audio spoofing), configurable proxies, and session persistence. This ensures a unique and secure browsing environment for each session. Dependencies include the Browser class and MicrosoftRewardsBot. ```typescript import Browser from './browser/Browser' import { MicrosoftRewardsBot } from './index' const bot = new MicrosoftRewardsBot(false) const browserFactory = new Browser(bot) async function createBrowserSession(proxyConfig: AccountProxy, email: string) { // Create browser with fingerprint and proxy const browser = await browserFactory.createBrowser(proxyConfig, email) // Features: // - Unique browser fingerprint per session // - Canvas, WebGL, and audio fingerprint spoofing // - Proxy configuration (HTTP, HTTPS, SOCKS) // - Session persistence (cookies, localStorage) // - User agent rotation (desktop/mobile) const page = await browser.newPage() // Session data is automatically saved await bot.browser.func.closeBrowser(browser, email) // Next run will reuse session without re-login return browser } ``` -------------------------------- ### Account Configuration for Microsoft Rewards Bot (JSON) Source: https://context7.com/thenetsky/microsoft-rewards-script/llms.txt Defines the configuration structure for multiple Microsoft accounts, including email, password, and optional proxy settings. Each account entry can specify proxy details such as URL, port, username, and password, along with a flag to enable proxy usage with Axios. This enables distributed execution and enhances security. ```json [ { "email": "user@outlook.com", "password": "SecurePassword123!", "proxy": { "proxyAxios": true, "url": "proxy.example.com", "port": 8080, "username": "proxyuser", "password": "proxypass" } }, { "email": "second@hotmail.com", "password": "AnotherPassword456!", "proxy": { "proxyAxios": false, "url": "", "port": 0, "username": "", "password": "" } } ] ``` -------------------------------- ### Monitor Docker Logs - Bash Source: https://github.com/thenetsky/microsoft-rewards-script/blob/main/README.md Displays the logs for the running Microsoft Rewards script Docker container. This is useful for monitoring the script's activity and troubleshooting issues. ```bash docker logs microsoft-rewards-script ``` -------------------------------- ### Complete Mobile App Activities with Access Token in TypeScript Source: https://context7.com/thenetsky/microsoft-rewards-script/llms.txt Executes mobile-specific Microsoft Rewards activities using an access token for authentication. It includes functionalities for daily check-ins (earning progressive points) and 'Read to Earn' (reading articles for points). It also demonstrates how to fetch available app-related points. Dependencies include the Activities class and MicrosoftRewardsBot. ```typescript import Activities from './functions/Activities' import { MicrosoftRewardsBot } from './index' const mobileBot = new MicrosoftRewardsBot(true) const activities = new Activities(mobileBot) async function completeMobileActivities(accessToken: string, dashboardData: DashboardData) { // Daily check-in (sequential day rewards) await activities.doDailyCheckIn(accessToken, dashboardData) // Earns progressive points: Day 1: 2pts, Day 2: 3pts, ..., Day 7: 15pts // Read to Earn (article reading) await activities.doReadToEarn(accessToken, dashboardData) // Reads 3 articles for 10 points each (30 points total) console.log('Mobile activities completed') } // API request example for mobile activities const appEarnablePoints = await mobileBot.browser.func.getAppEarnablePoints(accessToken) console.log('Check-in Points Available:', appEarnablePoints.checkIn) console.log('Read to Earn Points Available:', appEarnablePoints.readToEarn) console.log('Total App Points:', appEarnablePoints.totalEarnablePoints) ``` -------------------------------- ### Configure Cluster-based Multi-Account Processing in TypeScript Source: https://context7.com/thenetsky/microsoft-rewards-script/llms.txt Explains the configuration and mechanism for distributing account processing across multiple Node.js worker processes using clusters. The `config.json` file specifies the number of clusters. The main process forks workers, distributes accounts, and aggregates results, significantly reducing total runtime. ```typescript // Set clusters in config.json { "clusters": 4 } // Automatically spawns 4 worker processes // Each handles a subset of accounts in parallel // Main process: // - Splits accounts into 4 chunks // - Forks 4 worker processes // - Collects summaries from all workers // - Sends conclusion webhook after all complete // Worker process: // - Receives account chunk // - Executes tasks sequentially per account // - Reports summary back to main process // Example with 12 accounts and 4 clusters: // Worker 1: accounts[0,1,2] // Worker 2: accounts[3,4,5] // Worker 3: accounts[6,7,8] // Worker 4: accounts[9,10,11] // All execute in parallel, reducing total runtime by ~4x ``` -------------------------------- ### Docker Compose Configuration for Microsoft Rewards Script Source: https://context7.com/thenetsky/microsoft-rewards-script/llms.txt Defines the Docker services, volumes, and environment variables for deploying the Microsoft Rewards script. It specifies the image, container name, restart policy, and configuration file mounts. The cron schedule and sleep durations are configurable via environment variables. ```yaml # compose.yaml services: microsoft-rewards-script: image: ghcr.io/thenetsky/microsoft-rewards-script:latest container_name: microsoft-rewards-script restart: unless-stopped volumes: - ./src/accounts.json:/usr/src/microsoft-rewards-script/dist/accounts.json:ro - ./src/config.json:/usr/src/microsoft-rewards-script/dist/config.json:ro - ./sessions:/usr/src/microsoft-rewards-script/dist/sessions environment: TZ: "America/New_York" NODE_ENV: "production" CRON_SCHEDULE: "0 7,16,20 * * *" # Run at 7 AM, 4 PM, 8 PM RUN_ON_START: "true" MIN_SLEEP_MINUTES: "5" MAX_SLEEP_MINUTES: "50" deploy: resources: limits: cpus: "1.0" memory: "1g" ``` -------------------------------- ### Bot Configuration Settings for Microsoft Rewards (JSON) Source: https://context7.com/thenetsky/microsoft-rewards-script/llms.txt Customizes the behavior of the Microsoft Rewards bot through the config.json file. This configuration includes settings for base URL, session path, headless operation, parallel execution, and the number of clusters. It also defines worker tasks, search behaviors like random scrolling and clicking, delays, and webhook integrations for notifications. ```json { "baseURL": "https://rewards.bing.com", "sessionPath": "sessions", "headless": true, "parallel": false, "runOnZeroPoints": false, "clusters": 2, "saveFingerprint": { "mobile": true, "desktop": true }, "workers": { "doDailySet": true, "doMorePromotions": true, "doPunchCards": true, "doDesktopSearch": true, "doMobileSearch": true, "doDailyCheckIn": true, "doReadToEarn": true }, "searchSettings": { "useGeoLocaleQueries": false, "scrollRandomResults": true, "clickRandomResults": true, "searchDelay": { "min": "3min", "max": "5min" }, "retryMobileSearchAmount": 2 }, "webhook": { "enabled": true, "url": "https://discord.com/api/webhooks/YOUR_WEBHOOK_ID/YOUR_WEBHOOK_TOKEN" }, "conclusionWebhook": { "enabled": true, "url": "https://discord.com/api/webhooks/YOUR_SUMMARY_WEBHOOK_ID/YOUR_SUMMARY_WEBHOOK_TOKEN" } } ``` -------------------------------- ### TypeScript: Microsoft Account Login with 2FA Source: https://context7.com/thenetsky/microsoft-rewards-script/llms.txt Handles Microsoft account authentication, including email/password entry, 2FA authenticator app verification, SMS verification, passkey dismissal, and session cookie storage. It also retrieves a mobile access token for app-based activities. ```typescript import { Login } from './functions/Login' import { MicrosoftRewardsBot } from './index' const bot = new MicrosoftRewardsBot(false) const login = new Login(bot) // Login with credentials async function performLogin(page: Page, email: string, password: string) { try { await login.login(page, email, password) // Handles: // - Email/password entry // - 2FA authenticator app verification // - SMS verification with manual code input // - Passkey prompt dismissal // - Session cookie storage console.log('Login successful - session saved') } catch (error) { console.error('Login failed:', error) } } // Get mobile access token for app-based activities async function getMobileToken(page: Page, email: string) { try { const accessToken = await login.getMobileAccessToken(page, email) // Returns OAuth access token for Microsoft Rewards API console.log('Access token obtained:', accessToken.substring(0, 20) + '...') return accessToken } catch (error) { console.error('Token retrieval failed:', error) throw error } } ``` -------------------------------- ### Send Discord Webhook Notifications for Microsoft Rewards Script Source: https://context7.com/thenetsky/microsoft-rewards-script/llms.txt Implements a system to send real-time activity updates and summary reports to Discord webhooks. It utilizes utility functions for sending basic messages and rich embeds. Dependencies include the 'Webhook' and 'ConclusionWebhook' utilities. ```typescript import { Webhook } from './util/Webhook' import { ConclusionWebhook } from './util/ConclusionWebhook' // Real-time activity logging async function sendActivityUpdate(config: Config, message: string) { await Webhook(config, `[${new Date().toISOString()}] ${message}`) } // Example usage during execution await sendActivityUpdate(config, 'Daily Set completed: +30 points') await sendActivityUpdate(config, 'Desktop searches completed: +150 points') await sendActivityUpdate(config, 'Mobile searches completed: +100 points') // Summary webhook with rich embeds const accountSummaries = [ { email: 'user@outlook.com', durationMs: 450000, desktopCollected: 150, mobileCollected: 100, totalCollected: 250, initialTotal: 8543, endTotal: 8793, errors: [] } ] // Automatically sends formatted embed with: // - Total points collected // - Desktop vs mobile breakdown // - Execution duration // - Error summary (if any) await ConclusionWebhook(config, 'Execution Complete', { embeds: [{ title: '🎯 Microsoft Rewards Summary', color: 0x32CD32, fields: [ { name: 'Total Collected', value: '250 points' }, { name: 'Desktop', value: '150 points' }, { name: 'Mobile', value: '100 points' } ] }] }) ``` -------------------------------- ### Solve Quiz Activities Automatically in TypeScript Source: https://context7.com/thenetsky/microsoft-rewards-script/llms.txt Handles and automatically solves quiz activities on the Microsoft Rewards platform. It navigates to the quiz page, extracts quiz data (type, question count, points), and uses the Quiz class to submit answers. Supports multiple-choice, multiple-selection, true/false, and drag-and-drop quizzes. Dependencies include the Quiz class and MicrosoftRewardsBot. ```typescript import { Quiz } from './functions/activities/Quiz' import { MicrosoftRewardsBot } from './index' const bot = new MicrosoftRewardsBot(false) const quiz = new Quiz(bot) async function solveQuiz(page: Page) { try { // Navigates to quiz page and extracts quiz data const quizData = await bot.browser.func.getQuizData(page) // Quiz data structure: console.log('Quiz Type:', quizData.quizOptions.quizType) console.log('Question Count:', quizData.quizOptions.numberOfQuestions) console.log('Points Per Answer:', quizData.quizOptions.pointsPerAnswer) // Automatically solves quiz await quiz.doQuiz(page) // Handles quiz types: // - Multiple choice (single answer) // - Multiple selection (correct answers) // - True/False questions // - Drag and drop matching // Waits for completion indicator await bot.browser.func.checkQuizCompleted(page) console.log('Quiz completed successfully') } catch (error) { console.error('Quiz solving failed:', error) } } ``` -------------------------------- ### TypeScript: Automated Bing Search Execution Source: https://context7.com/thenetsky/microsoft-rewards-script/llms.txt Performs automated Bing searches using queries sourced from Google Trends. This script simulates human-like browsing behavior, including random delays, scrolling, and link clicking, while monitoring point accumulation. Supports both desktop and mobile search modes. ```typescript import { Search } from './functions/activities/Search' import { MicrosoftRewardsBot } from './index' const bot = new MicrosoftRewardsBot(false) // Desktop mode const search = new Search(bot) async function performSearches(page: Page, dashboardData: DashboardData) { try { // Executes search workflow: // 1. Fetches Google Trends queries // 2. Navigates to Bing // 3. Performs searches with delays // 4. Scrolls and clicks random results // 5. Monitors point accumulation await search.doSearch(page, dashboardData) // Automatically handles: // - Query generation and deduplication // - Random delays between searches (3-5 min configurable) // - Result page scrolling // - Random link clicking // - Point progress tracking // - Retry logic for failed searches console.log('Search completion detected') } catch (error) { console.error('Search execution failed:', error) } } // For mobile searches: const mobileBot = new MicrosoftRewardsBot(true) // Mobile mode const mobileSearch = new Search(mobileBot) await mobileSearch.doSearch(mobilePage, dashboardData) ``` -------------------------------- ### Complete Daily Set Activities in TypeScript Source: https://context7.com/thenetsky/microsoft-rewards-script/llms.txt Automates the completion of daily Microsoft Rewards activities such as quizzes, polls, and promotional tasks. It uses worker functions to handle different activity types including URL rewards, quizzes, polls, 'This or That', 'ABC quizzes', and punch cards. Dependencies include the Workers class and MicrosoftRewardsBot. ```typescript import { Workers } from './functions/Workers' import { MicrosoftRewardsBot } from './index' const bot = new MicrosoftRewardsBot(false) const workers = new Workers(bot) async function completeDailyActivities(page: Page, dashboardData: DashboardData) { // Complete daily set await workers.doDailySet(page, dashboardData) // Automatically solves: // - URL rewards (visit and complete) // - Quizzes (multiple choice, true/false) // - Polls (single selection) // - This or That (binary choices) // - ABC quizzes (sequential questions) // Complete more promotions await workers.doMorePromotions(page, dashboardData) // Handles promotional offers with automatic detection // Complete punch cards await workers.doPunchCard(page, dashboardData) // Multi-step promotional campaigns console.log('All daily activities completed') } ``` -------------------------------- ### TypeScript: Fetch Microsoft Rewards Dashboard Data Source: https://context7.com/thenetsky/microsoft-rewards-script/llms.txt Retrieves comprehensive data from the Bing Rewards dashboard, including current points, available daily set activities, promotions, and punch cards. It also provides specific search progress (desktop and mobile) and calculates total earnable points. ```typescript import BrowserFunc from './browser/BrowserFunc' import { MicrosoftRewardsBot } from './index' const bot = new MicrosoftRewardsBot(false) const browserFunc = new BrowserFunc(bot) async function getDashboardInfo() { // Get complete dashboard data const dashboardData = await browserFunc.getDashboardData() console.log('Current Points:', dashboardData.userStatus.availablePoints) console.log('Daily Set Activities:', dashboardData.dailySetPromotions) console.log('More Promotions:', dashboardData.morePromotions) console.log('Punch Cards:', dashboardData.punchCards) // Get specific search progress const searchPoints = await browserFunc.getSearchPoints() console.log('Desktop Search Progress:', searchPoints.pcSearch) console.log('Mobile Search Progress:', searchPoints.mobileSearch) // Calculate earnable points const earnablePoints = await browserFunc.getBrowserEarnablePoints() console.log('Desktop Search Points:', earnablePoints.desktopSearchPoints) console.log('Mobile Search Points:', earnablePoints.mobileSearchPoints) console.log('Daily Set Points:', earnablePoints.dailySetPoints) console.log('More Promotions Points:', earnablePoints.morePromotionsPoints) console.log('Total Earnable:', earnablePoints.totalEarnablePoints) } // Output: // Current Points: 8543 // Desktop Search Points: 150 // Mobile Search Points: 100 // Daily Set Points: 30 // More Promotions Points: 50 // Total Earnable: 330 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.