Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async function taskXCPX() {
- // Select all the div elements inside the specified container
- let elements = document.querySelectorAll("#__next > div > div.room-layout > div > div.Store_storeDialog__K3NJB > div.Store_box__j6_U4.Store_modal-box-container__S2ExC.commons_uikit__Nmsxg.commons_frame__f5hXE.commons_purpleinset___KfX2 > div > div.Store_store-tabs-wrapper__OfH4C > div > div > div.Store_items-content__FtMRE > div");
- let result = 'Reward ㅤ| Tier | Qty | Task <br>';
- let indegg = 1;
- elements.forEach((element, index) => {
- // Get the inner text of the selected element
- let innerText = element.innerText;
- // Split the inner text into an array based on newline characters
- let textArray = innerText.split('\n');
- // Remove the first and last elements from the array
- textArray.shift();
- textArray.pop();
- // Select the first image inside the specified container if it exists
- let rewardIcon = document.querySelector(`#__next > div > div.room-layout > div > div.Store_storeDialog__K3NJB > div.Store_box__j6_U4.Store_modal-box-container__S2ExC.commons_uikit__Nmsxg.commons_frame__f5hXE.commons_purpleinset___KfX2 > div > div.Store_store-tabs-wrapper__OfH4C > div > div > div.Store_items-content__FtMRE > div:nth-child(${indegg}) > div > div > div.Store_card-header__FTHH8 > div:nth-child(2) > div > img`);
- // Select the second image inside the specified container if it exists
- let taskIcon = document.querySelector(`#__next > div > div.room-layout > div > div.Store_storeDialog__K3NJB > div.Store_box__j6_U4.Store_modal-box-container__S2ExC.commons_uikit__Nmsxg.commons_frame__f5hXE.commons_purpleinset___KfX2 > div > div.Store_store-tabs-wrapper__OfH4C > div > div > div.Store_items-content__FtMRE > div:nth-child(${indegg}) > div > div > div.Store_card-img-wrapper__hyk51 > img`);
- tIcon = taskIcon.src;
- rIcon = rewardIcon.src;
- rewardTask = textArray[0].padStart(4, 'ㅤ');
- tierTask = textArray[1].padStart(4, 'ㅤ');
- qtyTask = textArray[2].padStart(3, 'ㅤ');
- nameTask = textArray[3];
- // Log the modified array to the console
- result += `${rewardTask} <img src='${rIcon}' height='20px' width='20px'> | ${tierTask} | ${qtyTask} | <img src='${tIcon}' height='20px' width='20px'> ${nameTask} <br>`;
- indegg++;
- });
- // Format the HTML content
- const htmlContent = `${result}`;
- // Set the HTML content to the div
- squareBox.innerHTML = htmlContent;
- buttonNav();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement