Advertisement
xpppppppaicyber

task fixxxxxxx

Jul 13th, 2024
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. async function taskXCPX() {
  2.           // Select all the div elements inside the specified container
  3.           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");
  4.  
  5.           let result = 'Reward ㅤ| Tier | Qty | Task <br>';
  6.  
  7.  
  8.           let indegg = 1;
  9.           elements.forEach((element, index) => {
  10.             // Get the inner text of the selected element
  11.             let innerText = element.innerText;
  12.  
  13.             // Split the inner text into an array based on newline characters
  14.             let textArray = innerText.split('\n');
  15.  
  16.             // Remove the first and last elements from the array
  17.             textArray.shift();
  18.             textArray.pop();
  19.  
  20.             // Select the first image inside the specified container if it exists
  21.             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`);
  22.  
  23.  
  24.  
  25.             // Select the second image inside the specified container if it exists
  26.             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`);
  27.             tIcon = taskIcon.src;
  28.             rIcon = rewardIcon.src;
  29.  
  30.  
  31.             rewardTask = textArray[0].padStart(4, 'ㅤ');
  32.             tierTask = textArray[1].padStart(4, 'ㅤ');
  33.             qtyTask = textArray[2].padStart(3, 'ㅤ');
  34.             nameTask = textArray[3];
  35.  
  36.             // Log the modified array to the console
  37.             result += `${rewardTask} <img src='${rIcon}' height='20px' width='20px'> | ${tierTask} | ${qtyTask} | <img src='${tIcon}' height='20px' width='20px'> ${nameTask} <br>`;
  38.             indegg++;
  39.           });
  40.  
  41.           // Format the HTML content
  42.           const htmlContent = `${result}`;
  43.  
  44.           // Set the HTML content to the div
  45.           squareBox.innerHTML = htmlContent;
  46.  
  47.           buttonNav();
  48.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement