0% found this document useful (0 votes)
25 views4 pages

Code

Uploaded by

ainewsamerica001
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)
25 views4 pages

Code

Uploaded by

ainewsamerica001
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
You are on page 1/ 4

(async () => {

const loops = 30; // 🔁 Default loop count


const wait = ms => new Promise(res => setTimeout(res, ms));

const click3Dots = async (label = '', shouldClickPlus = true) => {


await wait(1000);
if (shouldClickPlus) {
document.querySelector('.css-16jdthe')?.click();
console.log(`🟡 Clicked .css-16jdthe (${label})`);
await wait(1000);
} else {
console.log(`⏩ Skipped clicking .css-16jdthe (${label})`);
}

const dots = document.querySelector('.css-1q7tpu8-IconMeatballsContainer');


if (dots) {
dots.style.display = 'block';
dots.style.opacity = '1';
dots.style.visibility = 'visible';
console.log(`🟡 Made dots visible (${label})`);
}

await wait(1000);
const svg = document.querySelector('.css-1q7tpu8-IconMeatballsContainer svg');
if (svg) {
svg.dispatchEvent(new MouseEvent('mouseenter', { bubbles: true }));
svg.dispatchEvent(new MouseEvent('mouseover', { bubbles: true }));
console.log(`🟡 Hovered over SVG (${label})`);
} else {
console.log(`⚠️ SVG for menu not found (${label})`);
}

await wait(2000);
const menuItem = document.querySelector('div.css-t3vdbq');
if (menuItem) {
menuItem.click();
console.log(`✅ Clicked on .css-t3vdbq (${label})`);
await wait(3000);
return true;
} else {
console.log(`❌ .css-t3vdbq not found (${label})`);
return false;
}
};

const clickSave = () => {


const buttons = document.querySelectorAll('button.ant-btn');
let clicked = false;
buttons.forEach(button => {
const span = button.querySelector('span');
if (span && span.textContent.trim().toLowerCase() === 'save') {
button.click();
console.log("✅ Clicked 'Save'");
clicked = true;
}
});
if (!clicked) {
console.log("❌ 'Save' button not found");
}
};

for (let i = 0; i < loops; i++) {


console.log(`🔁 Starting Loop ${i + 1} of ${loops}`);

const firstClick = await click3Dots("1st", true);


if (!firstClick) continue;

// STEP 2: Click "Advanced" tab


await wait(2000);
const tabs = document.querySelectorAll('div[role="tab"].ant-tabs-tab');
let advancedClicked = false;
for (const tab of tabs) {
if (tab.textContent.trim() === "Advanced") {
tab.click();
console.log("✅ Clicked on Advanced tab");
advancedClicked = true;
break;
}
}
if (!advancedClicked) {
console.log("❌ 'Advanced' tab not found");
continue;
}

await wait(2000);

// STEP 3: Scroll to "Hardware"


let scrollAttempts = 0;
const maxScrolls = 60;
const getScrollableParent = el => {
while (el) {
const style = getComputedStyle(el);
if ((style.overflowY === 'auto' || style.overflowY === 'scroll') &&
el.scrollHeight > el.clientHeight) {
return el;
}
el = el.parentElement;
}
return null;
};

await new Promise(resolve => {


const scrollInterval = setInterval(() => {
const hardware = [...document.querySelectorAll('div.css-12e1ult')]
.find(el => el.textContent.trim().toLowerCase() === 'hardware');

if (hardware) {
hardware.scrollIntoView({ behavior: "smooth", block: "center" });
console.log("✅ Scrolled to Hardware");
clearInterval(scrollInterval);
setTimeout(resolve, 3000);
} else {
const activeTab = document.querySelector('.ant-tabs-tabpane-active');
const scrollParent = getScrollableParent(activeTab) ||
document.documentElement;
scrollParent.scrollBy(0, 150);
scrollAttempts++;
if (scrollAttempts >= maxScrolls) {
console.log("❌ Gave up. 'Hardware' not found");
clearInterval(scrollInterval);
resolve();
}
}
}, 300);
});

// STEP 4: Click Noise


await wait(1000);
(() => {
const labels = document.querySelectorAll('label.ant-radio-button-wrapper');
let clicked = false;

labels.forEach(label => {
const spans = label.querySelectorAll('span');
spans.forEach(span => {
if (span.textContent.trim().toLowerCase() === 'noise') {
const input = label.querySelector('input[type="radio"]');
if (input && !input.checked) {
input.click();
console.log("✅ Clicked 'Noise'");
clicked = true;
}
}
});
});

if (!clicked) {
console.log("❌ 'Noise' radio not found or already selected");
}
})();

await wait(3000);

// STEP 5: Click Save


clickSave();
await wait(3000);

// ✅ STEP 6: Click 3-dots again, but skip clicking plus button


const secondClick = await click3Dots("2nd", false);
if (!secondClick) continue;

// STEP 7A: Click Overview Tab (force event)


(() => {
const tab = [...document.querySelectorAll('div[role="tab"]')]
.find(el => el.textContent.trim() === 'Overview');

if (tab) {
tab.dispatchEvent(new MouseEvent('pointerdown', { bubbles: true }));
tab.dispatchEvent(new MouseEvent('mousedown', { bubbles: true }));
tab.dispatchEvent(new MouseEvent('mouseup', { bubbles: true }));
tab.dispatchEvent(new MouseEvent('click', { bubbles: true }));
console.log("✅ Clicked on 'Overview' tab");
} else {
console.log("❌ 'Overview' tab not found");
}
})();
await wait(1500);

// STEP 7B: Click "New Fingerprint"


(() => {
const button = [...document.querySelectorAll('button.ant-btn.css-dwsiir')]
.find(btn => btn.textContent.trim() === 'New Fingerprint');

if (button) {
button.click();
console.log("✅ Clicked 'New Fingerprint'");
} else {
console.log("❌ 'New Fingerprint' button not found");
}
})();

await wait(1000);

// STEP 8: Final Save


clickSave();
await wait(3000);

console.log(`✅ Loop ${i + 1} complete\n`);


}

console.log("🎉 All loops completed!");


})();

You might also like