TheNetsky / Microsoft-Rewards-Script

Automated Microsoft Rewards script, using TypeScript, Cheerio and Playwright.
231 stars 51 forks source link

Adding auto-restart #96

Open serzak51 opened 7 months ago

serzak51 commented 7 months ago

Recently there have been a lot of random crash (the sessions issues, sometimes connection issue, or other errors that doesn't seem consistant). But a lot of these errors can be fixed with bruteforce and restarting the script multiple times. But it gets kinda annoying when it crash 5 times before booting, and when it end-up crashing in the middle of a 15 account batch. An auto-restart would be really great to tackle temporary issues I tried using pm2, but it's not restarting. I'm not sure if it's because my command is wrong or if it's because the code was never made with pm2 in mind

TheNetsky commented 7 months ago

I do not have plans of adding this, however feel free to create a fork and submit a PR with this feature.

xunilalala commented 7 months ago

I have also observed this phenomenon and through testing, gradually discovered that there are two locations where this issue occurs frequently. The first is when accessing rewards.bing.com at the beginning of startup, and the second is when the search page fails to load, resulting in the inability to locate sb_form_q. I believe that instead of compensating for this issue through automatic restarts, it would be more effective to perform targeted page refresh operations on the problematic sections. This is because automatic restarts consume time for tasks such as checking login status and points, among others.

serzak51 commented 7 months ago

Yeah, i guess that would make more sense. Thing is, i am not really good at programming things. I can modify simple things, but that's it. My solution is with a .bat that execute npm run start 2000 times, so that when the first command stop, the second one execute. Haven't tested it yet, but i don't see why it wouldn't work. But yeah it's really a temporary solution, there isn't even a loop to truly make it infinite (for some reason each time i tried to make a loop it just didn't work.). For those who want to make it, make a .bat with npm run start, copy it, make a line break, paste it, another line break, paste it again. From time to time copy everything to make it faster. This solution isn't pretty, but at least it works. Just be sure that it's working after ~10 minutes, because then it probably means something is wrong.

devallareddyb commented 1 month ago

Recently there have been a lot of random crash (the sessions issues, sometimes connection issue, or other errors that doesn't seem consistant). But a lot of these errors can be fixed with bruteforce and restarting the script multiple times. But it gets kinda annoying when it crash 5 times before booting, and when it end-up crashing in the middle of a 15 account batch. An auto-restart would be really great to tackle temporary issues I tried using pm2, but it's not restarting. I'm not sure if it's because my command is wrong or if it's because the code was never made with pm2 in mind

How many account we can run? I have 20 own dedicated mobile proxy setup. Could you please help me in deciding accounts count?

xunilalala commented 1 month ago

@devallareddyb Don't deploy everything at once. Start with two to three proxies and test them out first. Then gradually increase over time in batches (weekly increments) without using newly registered accounts. Ensure that your proxies are private and highly reliable, and make sure your accounts have been registered for at least a week (accounts registered within one week will be directly rejected, and the proxy will be blacklisted). Each proxy should have a fixed relationship with an account and should not be mixed to avoid being blacklisted.
----- This text was machine translated -----

devallareddyb commented 1 month ago

@devallareddyb Don't deploy everything at once. Start with two to three proxies and test them out first. Then gradually increase over time in batches (weekly increments) without using newly registered accounts. Ensure that your proxies are private and highly reliable, and make sure your accounts have been registered for at least a week (accounts registered within one week will be directly rejected, and the proxy will be blacklisted). Each proxy should have a fixed relationship with an account and should not be mixed to avoid being blacklisted. ----- This text was machine translated -----

Thank you very much for info. Proxies are completely my own, I have my own proxy farm with 20 USB modems and SIM Cards.

Yeh I am planning to run 10-15 new accounts every week.

So you want me to avoid newly created accounts?

I am planning max 2-3 accounts per proxy and new IP every day