本地运行 (点击展开)
# 1. 克隆项目
git clone https://github.com/SkyBlue997/MicrosoftRewardsPilot
cd MicrosoftRewardsPilot
# 2. 安装依赖
npm i
# 3. 配置文件
# 复制示例配置文件并编辑
cp config/config.json.example config/config.json
cp config/accounts.json.example config/accounts.json
# 4. 构建运行
npm run build
npm startDocker 部署(推荐) (点击展开)
# 1. 准备配置文件
# 复制示例配置文件并编辑
cp config/config.json.example config/config.json
cp config/accounts.json.example config/accounts.json
# 2. 构建
npm run build
# 3. 启动容器
docker compose up -d
# 4. 查看日志(可选)
docker logs -f microsoftrewardspilotDocker Compose 配置示例:
services:
microsoftrewardspilot:
build: .
container_name: microsoftrewardspilot
restart: unless-stopped
volumes:
- ./config/accounts.json:/usr/src/microsoftrewardspilot/config/accounts.json:ro
- ./config/config.json:/usr/src/microsoftrewardspilot/config/config.json:ro
- ./sessions:/usr/src/microsoftrewardspilot/browser/sessions
environment:
- TZ=Asia/Tokyo # 根据地理位置设置
- CRON_SCHEDULE=0 9,16 * * * # 每天9点和16点运行
- ENABLE_GEO_DETECTION=true # 启用地理位置检测
- AUTO_TIMEZONE=true # 启用自动时区设置{
"headless": true, // 无头模式运行
"parallel": true, // 并行执行任务
"clusters": 1, // 集群数量
"globalTimeout": "45min", // 全局超时时间
"runOnZeroPoints": false, // 零积分时不运行
"accountDelay": { // 多账户间隔时间
"min": "5min", // 最小间隔5分钟
"max": "15min" // 最大间隔15分钟
}
}{
"searchSettings": {
"useGeoLocaleQueries": true, // 地理位置查询
"multiLanguage": {
"enabled": true, // 多语言支持
"autoDetectLocation": true, // 自动检测位置
"fallbackLanguage": "en" // 备用语言
},
"autoTimezone": {
"enabled": true, // 自动时区
"setOnStartup": true // 启动时设置
},
"searchDelay": {
"min": "45s", // 最小延迟
"max": "2.5min" // 最大延迟
},
"humanBehavior": {
"typingErrorRate": 0.12, // 打字错误率
"thinkingPauseEnabled": true, // 思考暂停
"randomScrollEnabled": true // 随机滚动
},
"antiDetection": {
"ultraMode": true, // 终极防检测模式
"stealthLevel": "ultimate", // 最高隐身级别
"dynamicDelayMultiplier": 4.0,// 动态延迟倍数
"humanErrorSimulation": true, // 人类错误模拟
"deepPageInteraction": true, // 深度页面交互
"sessionBreaking": true // 智能会话分段
},
"chinaRegionAdaptation": {
"enabled": true, // 启用中国区域适配
"useBaiduTrends": true, // 使用百度热搜
"useWeiboTrends": true // 使用微博热搜
}
}
}{
"workers": {
"doDailySet": true, // 每日任务集
"doMorePromotions": true, // 推广任务
"doPunchCards": true, // 打卡任务
"doDesktopSearch": true, // 桌面端搜索
"doMobileSearch": true, // 移动端搜索
"doDailyCheckIn": true, // 每日签到
"doReadToEarn": true // 阅读赚取
}
}{
"popupHandling": {
"enabled": false, // 是否启用弹窗处理(默认禁用)
"handleReferralPopups": true, // 处理推荐弹窗
"handleStreakProtectionPopups": true,// 处理连击保护弹窗
"handleStreakRestorePopups": true, // 处理连击恢复弹窗
"handleGenericModals": true, // 处理通用模态框
"logPopupHandling": true // 记录弹窗处理日志
}
}{
"passkeyHandling": {
"enabled": true, // 是否启用Passkey处理
"maxAttempts": 5, // 最大尝试次数
"skipPasskeySetup": true, // 跳过Passkey设置
"useDirectNavigation": true, // 使用直接导航备选方案
"logPasskeyHandling": true // 记录处理日志
}
}问题: 移动端任务执行时提示需要双因素认证
解决方案: 使用专门的2FA验证助手工具
# 运行2FA验证助手
npx tsx src/helpers/manual-2fa-helper.ts使用流程:
- 运行命令后选择语言
- 输入需要验证的邮箱和密码
- 在打开的浏览器中完成2FA验证步骤
- 等待OAuth授权完成
- 工具自动保存移动端会话数据
- 重新运行自动化程序,移动端任务将跳过2FA验证
问题: 程序在弹窗处理时卡住不动,出现无限循环
现象: 日志显示重复的弹窗检测信息
[REWARDS-POPUP] 🎯 Detected Streak Protection Popup
[REWARDS-POPUP] 🎯 Detected Streak Protection Popup
解决方案:
- 立即解决:在
config/config.json中禁用弹窗处理
{
"popupHandling": {
"enabled": false
}
}- 选择性启用:只启用需要的弹窗类型
{
"popupHandling": {
"enabled": true,
"handleReferralPopups": true,
"handleStreakProtectionPopups": false,
"handleStreakRestorePopups": false
}
}问题: 登录后被重定向到Passkey设置页面,点击"Skip for now"后形成无限循环
现象: 程序在 "Starting login process!" 后卡住
解决方案: 系统已自动处理Passkey循环问题
- 自动检测:检测Passkey设置页面
- 多种绕过:跳过按钮、ESC键、直接导航
- 智能重试:最多5次尝试,防止无限循环
- 配置控制:可通过配置调整处理策略
配置选项:
{
"passkeyHandling": {
"enabled": true,
"maxAttempts": 5
}
}# 配置测试
npx tsx tests/test-dynamic-config.ts
# 地理位置检测测试
npx tsx tests/test-geo-language.ts
# 时区设置测试
npx tsx tests/test-timezone-auto.ts
# 弹窗处理功能测试
node tests/popup-handler-test.js
# 弹窗无限循环修复验证
node tests/popup-loop-fix-test.js
# Passkey处理功能测试
node tests/passkey-handling-test.js
# Quiz页面调试(当Quiz失效时使用)
npx tsx src/helpers/quiz-debug.ts "https://rewards.microsoft.com/quiz/xxx"积分获取受限/检测到自动化行为
现象: 连续多次搜索无积分,或积分获取不完整 解决方案: 系统已自动启用终极防检测模式
- AI级别行为模拟:真实用户错误、搜索犹豫、意外点击
- 统计学反检测:非标准时间分布、疲劳算法
- 深度伪装技术:设备传感器、Canvas指纹噪声
- 会话管理:智能分段、自动休息
- 预期效果:4-8小时内恢复95%+积分获取率
Quiz任务失败
解决方案: 使用 npx tsx src/helpers/quiz-debug.ts <URL> 分析页面结构变化
地理位置检测失败
解决方案: 检查网络连接,确保能访问地理位置API服务
时区不匹配
解决方案: 检查 TZ 环境变量设置是否正确
内存不足
解决方案: 重启容器或检查系统资源使用情况
# 查看日志
docker logs microsoftrewardspilot
# 测试网络连接
docker exec microsoftrewardspilot ping google.com
# 检查地理位置
docker exec microsoftrewardspilot curl -s http://ip-api.com/json
|
|
查看完整 config.json 示例 (点击展开)
{
"baseURL": "https://rewards.bing.com",
"sessionPath": "sessions",
"headless": true,
"parallel": false,
"runOnZeroPoints": false,
"clusters": 1,
"saveFingerprint": {
"mobile": true,
"desktop": true
},
"workers": {
"doDailySet": true,
"doMorePromotions": true,
"doPunchCards": true,
"doDesktopSearch": true,
"doMobileSearch": true,
"doDailyCheckIn": true,
"doReadToEarn": true
},
"searchOnBingLocalQueries": true,
"globalTimeout": "120min",
"accountDelay": {
"min": "8min",
"max": "20min"
},
"searchSettings": {
"useGeoLocaleQueries": true,
"scrollRandomResults": true,
"clickRandomResults": true,
"searchDelay": {
"min": "45s",
"max": "120s"
},
"retryMobileSearchAmount": 0,
"multiLanguage": {
"enabled": true,
"autoDetectLocation": true,
"fallbackLanguage": "en",
"supportedLanguages": ["ja", "en", "zh-CN", "ko", "de", "fr", "es"]
},
"autoTimezone": {
"enabled": true,
"setOnStartup": true,
"validateMatch": true,
"logChanges": true
},
"humanBehavior": {
"typingErrorRate": 0.08,
"thinkingPauseEnabled": true,
"randomScrollEnabled": true,
"clickRandomEnabled": true,
"timeBasedDelayEnabled": true,
"adaptiveDelayEnabled": true,
"cautionModeEnabled": true
},
"antiDetection": {
"ultraMode": true,
"stealthLevel": "ultimate",
"dynamicDelayMultiplier": 4.0,
"progressiveBackoff": true,
"maxConsecutiveFailures": 1,
"cooldownPeriod": "20min",
"sessionSimulation": true,
"multitaskingEnabled": true,
"behaviorRandomization": true,
"timeBasedScheduling": true,
"humanErrorSimulation": true,
"deepPageInteraction": true,
"canvasNoise": true,
"sensorDataInjection": true,
"networkBehaviorMimic": true,
"sessionBreaking": true,
"realUserErrors": true
},
"chinaRegionAdaptation": {
"enabled": false,
"useBaiduTrends": true,
"useWeiboTrends": true,
"fallbackToLocalQueries": true
}
},
"logExcludeFunc": [
"SEARCH-CLOSE-TABS"
],
"webhookLogExcludeFunc": [
"SEARCH-CLOSE-TABS"
],
"proxy": {
"proxyGoogleTrends": true,
"proxyBingTerms": true
},
"webhook": {
"enabled": false,
"url": ""
},
"popupHandling": {
"enabled": false,
"handleReferralPopups": true,
"handleStreakProtectionPopups": true,
"handleStreakRestorePopups": true,
"handleGenericModals": true,
"logPopupHandling": true
},
"passkeyHandling": {
"enabled": true,
"maxAttempts": 5,
"skipPasskeySetup": true,
"useDirectNavigation": true,
"logPasskeyHandling": true
}
}风险警告 使用自动化脚本可能导致账户被封禁
安全建议 适度使用,系统已自动启用所有反检测功能
定期更新 保持脚本为最新版本