mirror of
https://github.com/TheNetsky/Microsoft-Rewards-Script.git
synced 2026-01-17 21:43:59 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bca1e7c896 | ||
|
|
fd7c8e36d4 | ||
|
|
dcb0c25d46 |
@@ -12,7 +12,7 @@ Under development, however mainly for personal use!
|
|||||||
6. Run `npm run start` to start the built script
|
6. Run `npm run start` to start the built script
|
||||||
|
|
||||||
## Notes ##
|
## 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 chrome-kill` script. WINDOWS ONLY
|
- 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 chrome-kill-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.
|
- 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.
|
||||||
|
|
||||||
|
|
||||||
@@ -37,7 +37,6 @@ Under development, however mainly for personal use!
|
|||||||
- [x] Completing Polls
|
- [x] Completing Polls
|
||||||
- [x] Completing Punchcards
|
- [x] Completing Punchcards
|
||||||
- [x] Solving This Or That Quiz (Random)
|
- [x] Solving This Or That Quiz (Random)
|
||||||
- [x] Clicking Promotional Items
|
|
||||||
- [x] Solving ABC Quiz
|
- [x] Solving ABC Quiz
|
||||||
- [ ] Completing Shopping Game
|
- [ ] Completing Shopping Game
|
||||||
- [ ] Completing Gaming Tab
|
- [ ] Completing Gaming Tab
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "microsoft-rewards-script",
|
"name": "microsoft-rewards-script",
|
||||||
"version": "1.3.0",
|
"version": "1.3.1",
|
||||||
"description": "Automatically do tasks for Microsoft Rewards but in TS!",
|
"description": "Automatically do tasks for Microsoft Rewards but in TS!",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -28,14 +28,14 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^6.7.0",
|
"@typescript-eslint/eslint-plugin": "^6.7.0",
|
||||||
"eslint": "^8.54.0",
|
"eslint": "^8.54.0",
|
||||||
"eslint-plugin-modules-newline": "^0.0.6",
|
"eslint-plugin-modules-newline": "^0.0.6",
|
||||||
"typescript": "^5.2.2"
|
"typescript": "^5.3.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.6.2",
|
"axios": "^1.6.2",
|
||||||
"cheerio": "^1.0.0-rc.12",
|
"cheerio": "^1.0.0-rc.12",
|
||||||
"fingerprint-generator": "^2.1.45",
|
"fingerprint-generator": "^2.1.45",
|
||||||
"fingerprint-injector": "^2.1.45",
|
"fingerprint-injector": "^2.1.45",
|
||||||
"puppeteer": "^21.5.2",
|
"puppeteer": "^21.6.1",
|
||||||
"ts-node": "^10.9.1"
|
"ts-node": "^10.9.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export class Poll extends Workers {
|
|||||||
try {
|
try {
|
||||||
const buttonId = `#btoption${Math.floor(this.bot.utils.randomNumber(0, 1))}`
|
const buttonId = `#btoption${Math.floor(this.bot.utils.randomNumber(0, 1))}`
|
||||||
|
|
||||||
await page.waitForSelector(buttonId, { visible: true, timeout: 10_000 })
|
await page.waitForSelector(buttonId, { visible: true, timeout: 10_000 }).catch(() => { }) // We're gonna click regardless or not
|
||||||
await this.bot.utils.wait(2000)
|
await this.bot.utils.wait(2000)
|
||||||
|
|
||||||
await page.click(buttonId)
|
await page.click(buttonId)
|
||||||
|
|||||||
@@ -154,6 +154,22 @@ export class Search extends Workers {
|
|||||||
this.bot.log('SEARCH-BING', 'Search failed, An error occurred:' + error, 'error')
|
this.bot.log('SEARCH-BING', 'Search failed, An error occurred:' + error, 'error')
|
||||||
this.bot.log('SEARCH-BING', `Retrying search, attempt ${i}/5`, 'warn')
|
this.bot.log('SEARCH-BING', `Retrying search, attempt ${i}/5`, 'warn')
|
||||||
|
|
||||||
|
// Reset the tabs
|
||||||
|
const browser = searchPage.browser()
|
||||||
|
const tabs = await browser.pages()
|
||||||
|
const lastTab = await this.bot.browser.utils.getLatestTab(searchPage)
|
||||||
|
|
||||||
|
if (tabs.length === 4) {
|
||||||
|
await lastTab.close()
|
||||||
|
|
||||||
|
} else if (tabs.length === 2) {
|
||||||
|
const newPage = await browser.newPage()
|
||||||
|
await newPage.goto(this.searchPageURL)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
await lastTab.goBack()
|
||||||
|
}
|
||||||
|
|
||||||
await this.bot.utils.wait(4000)
|
await this.bot.utils.wait(4000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user