mirror of
https://github.com/tiennm99/WPlace-AutoBOT.git
synced 2026-10-15 06:15:58 +00:00
Update Auto-Farm.js
This commit is contained in:
1 parent
059be99cc9
commit
68a85e5061
1 file changed
+10
-2
+10
-2
@@ -30,6 +30,7 @@
|
||||
|
||||
const originalFetch = window.fetch;
|
||||
let capturedCaptchaToken = null;
|
||||
let stoppedForToken = false; // flag to auto-restart after manual token capture
|
||||
window.fetch = async (url, options = {}) => {
|
||||
if (typeof url === 'string' && url.includes('https://backend.wplace.live/s0/pixel/')) {
|
||||
try {
|
||||
@@ -37,6 +38,12 @@
|
||||
if (payload.t) {
|
||||
console.log('✅ CAPTCHA Token Captured:', payload.t);
|
||||
capturedCaptchaToken = payload.t;
|
||||
// auto-restart if was stopped due to token expiry
|
||||
if (stoppedForToken) {
|
||||
stoppedForToken = false;
|
||||
const btn = document.getElementById('toggleBtn');
|
||||
if (btn) btn.click();
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
@@ -74,8 +81,9 @@
|
||||
});
|
||||
if (res.status === 403) {
|
||||
console.error('❌ 403 Forbidden. CAPTCHA token might be invalid or expired.');
|
||||
capturedCaptchaToken = null;
|
||||
return 'token_error';
|
||||
capturedCaptchaToken = null; // Invalidate our stored token.
|
||||
stoppedForToken = true;
|
||||
return 'token_error'; // Return a special status to stop the bot.
|
||||
}
|
||||
const data = await res.json();
|
||||
return data;
|
||||
|
||||
Reference in new issue
Block a user