Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
10 views3 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)
10 views3 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/ 3

(async () => {

const loops = 30; // 🔁 Default loop count

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

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


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

// STEP 1: Click the 3-dots icon


await wait(1000);
document.querySelector('.css-16jdthe')?.click();
console.log("🟡 Clicked .css-16jdthe");
await wait(1000);

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");
}
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");
} else {
console.log("⚠️ SVG for menu not found");
}

await wait(2000); // wait before trying to click menu item

const menuItem = document.querySelector('div.css-t3vdbq');


if (menuItem) {
menuItem.click();
console.log('✅ Clicked on .css-t3vdbq');
await wait(3000);
} else {
console.log('❌ .css-t3vdbq not found');
continue; // skip rest of loop if failed
}

// 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); // wait 3s after scroll
} 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(1000);

// STEP 5: Click Save


(() => {
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");
}
})();

await wait(3000); // wait after each loop


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

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


})();

You might also like