0% found this document useful (0 votes)
56 views5 pages

Fast Claim Button Automation Script

This document is a userscript designed to optimize the claiming process on specific gaming websites using MutationObserver for ultra-fast claims without continuous scanning. It defines configurations for claim button detection, click attempts, and retry mechanisms, while logging actions for debugging purposes. The script initializes by scanning for claim buttons and sets up an observer to handle dynamic changes in the DOM, ensuring efficient interaction with claim buttons as they appear.

Uploaded by

lewissikanyika35
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views5 pages

Fast Claim Button Automation Script

This document is a userscript designed to optimize the claiming process on specific gaming websites using MutationObserver for ultra-fast claims without continuous scanning. It defines configurations for claim button detection, click attempts, and retry mechanisms, while logging actions for debugging purposes. The script initializes by scanning for claim buttons and sets up an observer to handle dynamic changes in the DOM, ensuring efficient interaction with claim buttons as they appear.

Uploaded by

lewissikanyika35
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

// ==UserScript==

// @name One of Wun Claude mutations(Optimized)


// @namespace [Link]
// @version 7.0
// @description Ultra-fast claim with MutationObserver only (no scanning)
// @author Modified
// @match [Link]
// @match [Link]
// @grant none
// ==/UserScript==

(function() {
'use strict';

// Configuration
const config = {
debug: true,
targetTexts: ['CLAIM'],
claimButtonSelectors: [
'button',
'[class*="claim"]'
],
retryDelay: 50, // ms - time to wait before retry attempt
maxRetries: 0 // maximum retry attempts per button
};

// State
const state = {
processedButtons: new WeakMap(), // stores {button: {attempts: number,
lastAttempt: timestamp}}
observer: null
};

function log(message) {
if ([Link]) {
[Link](`[FastClaim] ${message}`);
}
}

function hasClaimText(button) {
const btnText = ([Link] || '').toUpperCase().trim();
return [Link](text =>
[Link]([Link]()));
}

function isButtonClickable(button) {
return button &&
[Link] &&
![Link] &&
[Link] !== 'none' &&
[Link] !== 'hidden' &&
[Link](button);
}

function attemptClick(button) {
try {
if (isButtonClickable(button)) {
[Link]();
log(`✓ CLICKED: "${[Link]()}"`);
return true;
}
return false;
} catch(e) {
log(`✗ Click error: ${[Link]}`);
return false;
}
}

function scheduleRetry(button) {
const buttonData = [Link](button);

if (!buttonData || [Link] >= [Link]) {


return; // Already exhausted retries
}

setTimeout(() => {
if (![Link](button)) {
log(`Button removed from DOM, skipping retry`);
return;
}

[Link]++;
[Link] = [Link]();

if (attemptClick(button)) {
log(`✓ RETRY SUCCESS (attempt ${[Link]})`);
} else {
log(`✗ Retry ${[Link]} failed, button not clickable`);
}
}, [Link]);
}

function processNewButton(button) {
// Skip if already processed
if ([Link](button)) {
return;
}

// Mark as processed immediately


[Link](button, {
attempts: 0,
lastAttempt: [Link]()
});

log(`NEW CLAIM BUTTON DETECTED!`);

// Immediate first attempt


if (attemptClick(button)) {
log(`✓ FIRST CLICK SUCCESS`);
// Schedule retry anyway in case it needs confirmation
scheduleRetry(button);
} else {
log(`✗ First click failed, scheduling retry`);
scheduleRetry(button);
}
}

function scanForButtons() {
let buttons = [];

for (const selector of [Link]) {


try {
const found = [Link](selector);
buttons = [Link]([...found]);
} catch(e) {
log(`Selector error: ${selector}`);
}
}

const claimButtons = [Link](btn =>


btn &&
hasClaimText(btn) &&
![Link](btn)
);

[Link](button => {
processNewButton(button);
});

if ([Link] > 0) {
log(`Initial scan found ${[Link]} claim button(s)`);
}
}

function handleMutations(mutations) {
const newButtons = [];

[Link]((mutation) => {
// Check added nodes
[Link](node => {
if ([Link] === Node.ELEMENT_NODE) {
[Link](selector => {
try {
// Check if node itself matches
if ([Link] && [Link](selector) &&
hasClaimText(node)) {
[Link](node);
}
// Check children
const children = [Link](selector);
[Link](child => {
if (hasClaimText(child)) {
[Link](child);
}
});
} catch(e) {}
});
}
});

// Check attribute changes (button becoming enabled)


if ([Link] === 'attributes' &&
[Link] === Node.ELEMENT_NODE) {
const target = [Link];

if (hasClaimText(target) &&
['disabled', 'style',
'class'].includes([Link])) {

if (![Link](target)) {
[Link](target);
}
}
}
});

// Process unique buttons only


const uniqueButtons = [...new Set(newButtons)];
[Link](button => {
processNewButton(button);
});
}

function setupObserver() {
if ([Link]) {
[Link]();
}

[Link] = new MutationObserver(handleMutations);


[Link]([Link], {
childList: true,
subtree: true,
attributes: true,
attributeFilter: ['style', 'class', 'disabled', 'hidden', 'aria-
disabled']
});

log("MutationObserver active - watching for claim buttons");


}

function init() {
log("=== OPTIMIZED FAST CLAIM SYSTEM INITIALIZED ===");
log(`Retry delay: ${[Link]}ms, Max retries: $
{[Link]}`);
log("Using MutationObserver only (no continuous scanning)");

if ([Link]) {
scanForButtons(); // Initial scan only
setupObserver();
} else {
const bodyObserver = new MutationObserver((mutations, obs) => {
if ([Link]) {
[Link]();
scanForButtons();
setupObserver();
}
});
[Link]([Link], { childList: true });
}
}

if ([Link] === 'loading') {


[Link]('DOMContentLoaded', init);
} else {
init();
}
// Cleanup on page unload
[Link]('beforeunload', () => {
if ([Link]) {
[Link]();
}
});

// Expose config for runtime adjustment


[Link] = config;
log("Tip: Adjust settings via [Link] (e.g.,
[Link] = 100)");

})();

You might also like