u2u

try to take over the world!

// ==UserScript==
// @name         u2u
// @namespace    http://tampermonkey.net/
// @version      14.1
// @description  try to take over the world!
// @author       You
// @match        *://*.blockx.fun/*
// @match        *://*.sidequest.rcade.game/*
// @match        *://*.forge.gg/*
// @match        *://*.points.reddio.com/*
// @match        https://park.skatechain.org/en/nft
// @match        *://*.space3.gg/*
// @match        https://plume-testnet.realtyx.co/
// @match        *://*.adamdefi.io/*
// @match        https://swap.hemi.xyz/?chain=Hemi+Sepolia
// @match        https://swap.hemi.xyz/
// @match        https://www.360.cn/
// @match        *://*.testnet.kappalending.com/*
// @match        *://*.testnet.zulunetwork.io/*
// @match        https://testnet.zulunetwork.io/lwazi?code=6S4TVJ
// @match        *://*.testnet.grofidex.io/*
// @match        *://*.u2quest.io/*
// @match        *://*.app.infinityai.network/*
// @match        https://www.communitygaming.io/
// @match        https://testnet.musicprotocol.finance/
// @match        https://miles.plumenetwork.xyz/
// @match        https://backpack.app/
// @match        https://app.pluralfinance.com/plume-testnet/
// @match        https://app.elyfi.world/pools/plumetestnet/10
// @match        https://app.mysticfinance.xyz/en/lend
// @match        https://dev-plume.landx.co/
// @match        *://*.faucet.uniultra.xyz/*
// @match        *://*.testnet.blockfun.io/*
// @match        *://*.miles.plumenetwork.xyz/*
// @match        *://*.plume.ambient.finance/*
// @match        *://*.faucet.plumenetwork.xyz/*
// @match        *://*.miles.plumenetwork.xyz/*
// @match        *://*.theiachat.chainbase.com/*
// @match        *://*.genesis.chainbase.com/*
// @match        *://*.landshare-plume-sandbox.web.app/*
// @match        *://*.plume.kuma.bond/*
// @match        *://*.app.solidviolet.com/*
// @license MIT
// @icon         https://www.google.com/s2/favicons?sz=64&domain=grofidex.io
// @grant        none
// ==/UserScript==
/**
 * ......................我佛慈悲......................
 *                       _oo0oo_
 *                      o8888888o
 *                      88" . "88
 *                      (| -_- |)
 *                      0\  =  /0
 *                    ___/`---'\___
 *                  .' \\|     |// '.
 *                 / \\|||  :  |||// \
 *                / _||||| -卍-|||||- \
 *               |   | \\\  -  /// |   |
 *               | \_|  ''\---/''  |_/ |
 *               \  .-\__  '-'  ___/-. /
 *             ___'. .'  /--.--\  `. .'___
 *          ."" '<  `.___\_<|>_/___.' >' "".
 *         | | :  `- \`.;`\ _ /`;.`/ - ` : | |
 *         \  \ `_.   \_ __\ /__ _/   .-` /  /
 *     =====`-.____`.___ \_____/___.-`___.-'=====
 *                       `=---='
 *
 *..................佛祖开光 ,永无BUG...................
*/
function checkTextContent(selector, expectedText) {
    try {
        var element = document.querySelector(selector);
        if (element.textContent.trim() === expectedText) {
            return true;
        } else {
            return false;
        }
    } catch (error) {
    }
}
const originalStringify = JSON.stringify;

const Delay = Math.random() * 10000;
(function() {
    'use strict';
    // 获取按钮元素
    if (window.location.href == 'https://park.skatechain.org/en/nft') {
        setInterval(() => {
            const mintButton = document.querySelector("body > main > div > div > div.MuiContainer-root.MuiContainer-maxWidthXl.css-1ekb41w > div > div.MuiGrid-root.MuiGrid-item.MuiGrid-grid-xs-12.MuiGrid-grid-sm-12.MuiGrid-grid-md-6.css-1rp7odp > div > div.MuiBox-root.css-1yjvs5a > button");
            if (mintButton.classList.contains('Mui-disabled')) {
                console.log('按钮已禁用(点击状态)');
            } else {
                setTimeout(() => {
                    mintButton.dispatchEvent(clickEvent);
                    JSON.stringify({ clicked: true, mintButton: mintButton.outerHTML })
                }, Delay);
            }
            var btnhide = document.querySelector("body > div.MuiDialog-root.MuiModal-root.css-fps1dg > div.MuiDialog-container.MuiDialog-scrollPaper.css-ekeie0 > div > div > div > div.MuiBox-root.css-1l4w6pd > button");
            if (btnhide){
                btnhide.dispatchEvent(clickEvent);
                JSON.stringify({ clicked: true, btnhide: btnhide.outerHTML })
            }
        }, 3000);
    }
    // Your code here...
})();
(function() {
    var falg1 = true;var falg2 = true;var falg3 = true;
    var falg4 = true;var falg5 = true;var falg6 = true;
    var falg7 = true;var falg8 = true; var falg9 = true;
    var falg10= true;var falg11= true;var falg12= true;
    var falg13= true; var falg15= true;var falg16= true;
    var falg17= true;var falg18= true;var falg19= true;
    var falg20= true;var falg21= true;var falg22= true;
    var falg23= true;var falg24= true;var falg25= true;
    var falg26= true;var falg27= true;var falg14= false;
    var falg28= true;var falg29= true;var falg30= true;
    var falg31= true;var falg32= true;var falg33= true;
    var falg34= true;
    'use strict';
    const Delaya = Math.floor(Math.random() * 30 + 1) * 1000;
    setInterval(() => {
        if (document.readyState === "complete") {
            if (window.location.href == 'https://points.reddio.com/task' || window.location.href == 'https://points.reddio.com/task?invite_code=2IFX9'){
                var metamask = document.querySelector("body > div:nth-child(16) > div > div > div._9pm4ki5.ju367va.ju367v15.ju367v8r > div > div > div > div > div.iekbcc0.ju367va.ju367v15.ju367v4y._1vwt0cg3 > div.iekbcc0.ju367v6p._1vwt0cg2.ju367v7a.ju367v7v > div:nth-child(2) > div:nth-child(1) > button")
                if(metamask && falg1){
                    falg1=false;
                    metamask.click();
                }
            }
        }
        if (window.location.href == 'https://testnet.grofidex.io/trade?chain=u2uNebulas' || window.location.href == 'https://testnet.grofidex.io/trade'){
            var sus = document.querySelector("#__next > section > ol > li > div > div > div.sc-jrkPcm.iqWDBF > div")
            if(sus){
                window.open('https://u2quest.io/group/191837?type=campaign&ref=4236134392','_self');
            }
            var result = document.querySelector("#__next > div > div > button")
            var erralBUY = document.querySelector("#__next > div:nth-child(5) > div > div.sc-hLclGa.sc-fEyylQ.kkKarq.cagFIC > div > div.sc-eDnVMP.sc-gKHVLF.sc-fnOeiS.bZbwon.UlmxL.fRzEWC > div > div > div > div._1a5xov70._1qhetbfe._1qhetbf2qz._1qhetbfa4 > div._1a5xov70._1qhetbf7._1qhetbf1d._1qhetbf8k.sc-b22f96bc-0.iowtNR > div")
            if(erralBUY || result && falg29){
                falg29=false;
                setTimeout(() => {
                    window.open('https://testnet.blockfun.io/head-or-tail', '_self');
                }, Delaya);
            }
        }
        //var vvv1 ="body > div > main > div > section:nth-child(1) > div.sc-cwHqhk.cuzMIw.slider-128970.border.border-\\[\\#FFFFFF20\\].recent-quests-bg.rounded-xl.mt-10 > div.rounded-3xl.\\!rounded-tl-none.px-2.pt-3.sm\\:py-6.sm\\:px-4.sm\\:mb-0.shadow-lg > div.slick-slider.left.slick-initialized > div > div > div.slick-slide.slick-active.slick-current > div > div > article > div.px-3.py-5.md\\:p-5.flex.justify-between.items-center > div > button > span"
        //simulateButtonClick(vvv1)
        var vvv =document.querySelector("body > div > main > div > section:nth-child(1) > div.sc-cwHqhk.cuzMIw.slider-128970.border.border-\\[\\#FFFFFF20\\].recent-quests-bg.rounded-xl.mt-10 > div.rounded-3xl.\\!rounded-tl-none.px-2.pt-3.sm\\:py-6.sm\\:px-4.sm\\:mb-0.shadow-lg > div.slick-slider.left.slick-initialized > div > div > div:nth-child(2) > div > div > article > div.px-3.py-5.md\\:p-5.flex.justify-between.items-center > div > span > span > svg > path")
        var vvvv =document.querySelector("body > div > main > div > section:nth-child(1) > div.sc-cwHqhk.cuzMIw.slider-128970.border.border-\\[\\#FFFFFF20\\].recent-quests-bg.rounded-xl.mt-10 > div.rounded-3xl.\\!rounded-tl-none.px-2.pt-3.sm\\:py-6.sm\\:px-4.sm\\:mb-0.shadow-lg > div.slick-slider.left.slick-initialized > div > div > div.slick-slide.slick-active.slick-current > div > div > article > div.px-3.py-5.md\\:p-5.flex.justify-between.items-center > div > span > span > svg > path")
        var v = document.querySelector("body > div > main > div > section:nth-child(1) > div.sc-dAlxHm.dVCGcC.slider-128970.border.border-\\[\\#FFFFFF20\\].recent-quests-bg.rounded-xl.mt-10 > div.rounded-3xl.\\!rounded-tl-none.px-2.pt-3.sm\\:py-6.sm\\:px-4.sm\\:mb-0.shadow-lg > div.slick-slider.left.slick-initialized > div > div > div.slick-slide.slick-active.slick-current > div > div > article > div.px-3.py-5.md\\:p-5.flex.justify-between.items-center > div > span > span > svg > path")
        var vv = document.querySelector("body > div > main > div > section:nth-child(1) > div.sc-dAlxHm.dVCGcC.slider-128970.border.border-\\[\\#FFFFFF20\\].recent-quests-bg.rounded-xl.mt-10 > div.rounded-3xl.\\!rounded-tl-none.px-2.pt-3.sm\\:py-6.sm\\:px-4.sm\\:mb-0.shadow-lg > div.slick-slider.left.slick-initialized > div > div > div:nth-child(2) > div > div > article > div.px-3.py-5.md\\:p-5.flex.justify-between.items-center > div > span > span > svg")
        if(v && vv || vvv && vvvv && falg28){
            falg28=false;
            window.open('https://www.communitygaming.io/quests','_self');
        }
        var res = checkTextContent("body > div.el-notification.right > div > div.el-notification__content > p","Wrong re-captcha")
        var res11 = checkTextContent("body > div.el-notification.right > div > div.el-notification__content > p","You just got coin recently");if(res||res11){window.open('https://testnet.grofidex.io/trade','_self');}
    },1000)
    setInterval(() => {
        if (window.location.href == 'https://testnet.blockfun.io/head-or-tail'){
            var switch2u2 = "body > div:nth-child(1) > div.fixed.top-0.left-0.w-full.z-10 > div > div > div.gap-2.h-\\[80px\\].w-full.flex.justify-between.items-center.px-6.py-4.border-b.border-neutral-5.bg-header > div.hidden.desktop\\:block > div > button"
            simulateButtonClick(switch2u2)
        }
       var qt ="#rc-tabs-0-tab-2"
       simulateButtonClick(qt)
       var qtmask = "#rc-tabs-0-panel-2 > div > ul > li:nth-child(3)"
       if(falg27){simulateButtonClick(qtmask).then((result) => {if(result){falg27=false;}})}
        var sw ="#__next > div:nth-child(5) > div > div.sc-hLclGa.sc-fEyylQ.kkKarq.cagFIC > div > div.sc-eDnVMP.sc-gKHVLF.sc-fnOeiS.ksCtWD.UlmxL.fRzEWC > div > button.sc-bcPKhP.eeYIdX.button-hover"
        if(falg26){simulateButtonClick(sw).then((result) => {if(result){falg26=false;}})}
        var join = "body > div > main > div > div.flex.justify-center.z-10 > button > span"
        simulateButtonClick(join)
        //var bluev1 = checkTextContent("body > div > main > div > div.flex.flex-col.items-center.justify-center.mt-12.mx-6 > div.container.flex.flex-col.sm\:flex-row.sm\:space-x-8 > div > div.flex.flex-col.mt-6.w-full > div.p-4.cursor-pointer.flex.flex-col.sm\:flex-row.justify-between.items-center.rounded-full.bg-main3.px-16.false > span","COMPLETED")
        var bluev2 = checkTextContent("body > div > main > div > div.flex.flex-col.items-center.justify-center.mt-12.mx-6 > div.container.flex.flex-col.sm\\:flex-row.sm\\:space-x-8 > div > div.flex.flex-col.mt-6.w-full > div.p-4.cursor-pointer.flex.flex-col.sm\\:flex-row.justify-between.items-center.rounded-full.border-b-1.border-white.rounded-none.mx-12.false > span","COMPLETED")
        if(bluev2 && window.location.href== 'https://u2quest.io/group/128970?type=campaign&ref=4236134392' && falg30){
            //falg30=false;
            //window.open('https://u2quest.io/quests','_self');
        }

        function observeDOMChanges(selector) {
            const targetNode = document.querySelector(selector);

            if (targetNode) {
                runYourCode();
            } else {
                // 创建一个 MutationObserver
                const observer = new MutationObserver((mutations, obs) => {
                    const node = document.querySelector(selector);
                    if (node) {
                        obs.disconnect(); // 停止观察
                        runYourCode();
                    }
                });

                // 开始观察文档的变化
                observer.observe(document.body, { childList: true, subtree: true });
            }
        }

        // 运行您的代码的函数
        function runYourCode() {
            var vit1 = document.querySelector("body > div > main > div > div.flex.flex-col.items-center.justify-center.mt-12.mx-6 > div.container.flex.flex-col.sm\\:flex-row.sm\\:space-x-8 > div > div.flex.flex-col.mt-6.w-full > div > button > span");
            if (falg13) {
                if (vit1) {
                    falg13 = false;
                    vit1.dispatchEvent(clickEvent);
                    console.log(JSON.stringify({ clicked: true, vit1: vit1.outerHTML }));
                }
            }

            var v3 = "body > div > main > div > div.flex.flex-col.items-center.justify-center.mt-12.mx-6 > div.container.flex.flex-col.sm\\:flex-row.sm\\:space-x-8 > div > div.flex.flex-col.mt-6.w-full > div.p-4.cursor-pointer.flex.flex-col.sm\\:flex-row.justify-between.items-center.rounded-full.border-b-1.border-white.rounded-none.mx-12.false > button > span";
            simulateButtonClick(v3);
        }

// 调用 observeDOMChanges 并传入要监视的节点选择器
observeDOMChanges("body > div > main > div");
        var btnx = document.querySelector("body > div:nth-child(19) > div > div.ant-modal-wrap.ant-modal-centered > div > div:nth-child(2) > div > button > span > svg")
        if(btnx){
            btnx.dispatchEvent(clickEvent);
            JSON.stringify({ clicked: true, btnx: btnx.outerHTML });
        }
        var v1 = "body > div > main > div > section:nth-child(2) > div.sc-dAlxHm.dVCGcC.slider-239.border.border-\\[\\#FFFFFF20\\].recent-quests-bg.rounded-xl.mt-10 > div.rounded-3xl.\\!rounded-tl-none.px-2.pt-3.sm\\:py-6.sm\\:px-4.sm\\:mb-0.shadow-lg > div.slick-slider.left.slick-initialized > div > div > div.slick-slide.slick-active.slick-current > div > div > article > div.px-3.py-5.md\\:p-5.flex.justify-between.items-center > div > button > span";var v2 ="body > div > main > div > section:nth-child(2) > div.sc-dAlxHm.dVCGcC.slider-239.border.border-\\[\\#FFFFFF20\\].recent-quests-bg.rounded-xl.mt-10 > div.rounded-3xl.\\!rounded-tl-none.px-2.pt-3.sm\\:py-6.sm\\:px-4.sm\\:mb-0.shadow-lg > div.slick-slider.left.slick-initialized > div > div > div:nth-child(2) > div > div > article > div.px-3.py-5.md\\:p-5.flex.justify-between.items-center > div > button > span";var v5 = "body > div > main > div > section:nth-child(2) > div.sc-dAlxHm.dVCGcC.slider-241.border.border-\\[\\#FFFFFF20\\].recent-quests-bg.rounded-xl.mt-10 > div.rounded-3xl.\\!rounded-tl-none.px-2.pt-3.sm\\:py-6.sm\\:px-4.sm\\:mb-0.shadow-lg > div.slick-slider.left.slick-initialized > div > div > div.slick-slide.slick-active.slick-current > div > div > article > div.px-3.py-5.md\\:p-5.flex.justify-between.items-center > div > button > span";var v4 = "body > div > main > div > section:nth-child(2) > div.sc-dAlxHm.dVCGcC.slider-241.border.border-\\[\\#FFFFFF20\\].recent-quests-bg.rounded-xl.mt-10 > div.rounded-3xl.\\!rounded-tl-none.px-2.pt-3.sm\\:py-6.sm\\:px-4.sm\\:mb-0.shadow-lg > div.slick-slider.left.slick-initialized > div > div > div:nth-child(2) > div > div > article > div.px-3.py-5.md\\:p-5.flex.justify-between.items-center > div > button > span";simulateButtonClick(v1);simulateButtonClick(v2);simulateButtonClick(v5);simulateButtonClick(v4);
        var err = document.querySelector("#\\32  > div.Toastify__toast-body > div:nth-child(2)")
        if(err){location.reload();}
        var ver= "body > div > main > div > section:nth-child(1) > div.sc-dAlxHm.dVCGcC.slider-128970.border.border-\\[\\#FFFFFF20\\].recent-quests-bg.rounded-xl.mt-10 > div.rounded-3xl.\\!rounded-tl-none.px-2.pt-3.sm\\:py-6.sm\\:px-4.sm\\:mb-0.shadow-lg > div.slick-slider.left.slick-initialized > div > div > div:nth-child(2) > div > div > article > div.px-3.py-5.md\\:p-5.flex.justify-between.items-center > div > button > span"
        //simulateButtonClick(ver)
        var dasz = document.querySelector("body > div:nth-child(1) > div.z-10.block.desktop\\:flex.desktop\\:grid.desktop\\:grid-flow-col.desktop\\:auto-cols-\\[auto_minmax\\(900px\\,_1fr\\)\\] > div.bg-base-bg > div > div > div > div.p-4.desktop\\:p-0.w-full.flex.flex-col.gap-10 > div:nth-child(2) > div > div > div.gap-10.flex.flex-col.p-6 > div.gap-4.flex.flex-col.items-center.justify-center > div > svg > rect")
        if(dasz && falg31){falg31=false;window.open('https://u2quest.io/group/128970?type=campaign&ref=4236134392','_self');}
        if (checkTextContent("body > div.ant-message.ant-message-top.css-1r287do > div > div > div > div > span:nth-child(2)", "This task has not been completed.") && window.location.href!== 'https://u2quest.io/group/128970?type=campaign&ref=4236134392' && window.location.href!== 'https://u2quest.io/quests' && falg32){ falg32=false;window.open('https://testnet.grofidex.io/trade?chain=u2uNebulas','_self');}
        if (window.location.href == 'https://u2quest.io/group/191837?type=campaign&ref=4236134392'){
            setTimeout(function(){location.reload();},30000);
            var test = "body > div:nth-child(24) > div > div.ant-modal-wrap > div > div:nth-child(2) > div > div > div > div > div > div.my-5 > ul > li:nth-child(2) > button";simulateButtonClick(test)
        }
        if (window.location.href == 'https://u2quest.io/quests'){setTimeout(function() {location.reload();}, 60000);}
        if (window.location.href == 'https://faucet.uniultra.xyz/'){setTimeout(function() {location.reload();}, 40000);}
        if (checkTextContent("body > div.ant-message.ant-message-top.css-1r287do > div > div > div > div > span:nth-child(2)", "This task has not been completed.") && window.location.href== 'https://u2quest.io/group/128970?type=campaign&ref=4236134392') {
            window.open('https://www.communitygaming.io/quests', '_self');
            setTimeout(() => {
               window.open('https://testnet.blockfun.io/head-or-tail', '_self');
            },3000);
        }
        var s = checkTextContent("body > div > main > div > div.flex.flex-col.items-center.justify-center.mt-12.mx-6 > div.container.flex.flex-col.sm\\:flex-row.sm\\:space-x-8 > div > div.flex.flex-col.mt-6.w-full > div > span","COMPLETED")
        if(s && falg33){
            falg33=false;
            if (confirm("你确定要跳转到 https://swap.hemi.xyz 吗?")) {
                window.open('https://swap.hemi.xyz/', '_self');
            }else{
                window.open('chrome-extension://dhdgffkkebhmkfjojejmpbldmpobfkfo/options.html#nav=dashboard', '_self');
            }
        }
        var x1 =document.querySelector("#__next > div:nth-child(5) > div > div.sc-hLclGa.sc-fEyylQ.kkKarq.cagFIC > div > div.sc-eDnVMP.sc-gKHVLF.sc-ksJisA.kgAlCw.UlmxL.bLpEZq > button > svg > path")
        if (x1) {
            x1.dispatchEvent(clickEvent);
            JSON.stringify({ clicked: true, x1: x1.outerHTML });
        }
        var buy1 = document.querySelector("#swap-button")
        var result1 = checkTextContent("#swap-button","Buy")
        if (result1) {if(falg16){falg16=false;buy1.dispatchEvent(clickEvent);;JSON.stringify({ clicked: true, x1: x1.outerHTML });}}
        var al = document.querySelector("#__next > section > ol > li > div > div > div.sc-jrkPcm.iqWDBF > div")
        var al1 = document.querySelector("#__next > section > ol > li > div > div > div.sc-pqitP.elKUtv > svg")
        if(al || al1){
            falg5=false
        }
        var suss = document.querySelector("#__next > div:nth-child(5) > div > div.sc-hLclGa.sc-fEyylQ.kkKarq.cagFIC > div > div.sc-eDnVMP.sc-gKHVLF.sc-fnOeiS.bZbwon.UlmxL.fRzEWC > div > div > div.sc-eDnVMP.fERNPe > svg")
        var result = checkTextContent("#swap-button","Insufficient U2U balance")
        if(suss || result){setTimeout(function() {falg5=false}, 20000)}
        var apt ="#__next > div:nth-child(5) > div > div.sc-hLclGa.sc-fEyylQ.kkKarq.cagFIC > div > div.sc-eDnVMP.sc-gKHVLF.sc-fnOeiS.bZbwon.UlmxL.fRzEWC > div > div > div:nth-child(1) > div > div.sc-c1d8d089-0.bdZQEa > div._1a5xov70._1qhetbfe._1qhetbf2qz._1qhetbf9x._1qhetbf2jl.sc-hbyTTC.jNUJnG > div > button";simulateButtonClick(apt)
        document.addEventListener('DOMContentLoaded', function() {
            var button = document.querySelector("body > div:nth-child(23) > div > div.ant-modal-wrap > div > div:nth-child(2) > div > div > div > div > div > div.mt-5 > div > button.w-full.rounded-lg.py-3.font-semibold.text-base.bg-main1.text-main3");
            if (button) {
                button.dispatchEvent(clickEvent);
                JSON.stringify({ clicked: true, button: button.outerHTML });
            }
        });
        checkTextContent("#__next > div:nth-child(5) > div > div.sc-hLclGa.sc-fEyylQ.kkKarq.cagFIC > div > div.sc-eDnVMP.sc-gKHVLF.sc-ksJisA.jprOhX.UlmxL.llZPKh > div > h2","Confirm Sell")
        var res2 = checkTextContent("#confirm-swap-or-send","Confirm Buy");var res1 = checkTextContent("#swap-button","Buy");var cmmmf = document.querySelector("#confirm-swap-or-send")
        if(cmmmf && falg34 ){
            falg34=false;
            cmmmf.dispatchEvent(clickEvent);
            JSON.stringify({ clicked: true, cmmmf: cmmmf.outerHTML });
            setTimeout(() => {
                falg34=true;
            },30000);
        }
        if(!falg5 && res1){
            if(res2 && falg18){
               falg18=false;
                cmmmf.dispatchEvent(clickEvent);
                JSON.stringify({ clicked: true, cmmmf: cmmmf.outerHTML });
                setInterval(() => {
                    falg14=true;
                },1000)
            }
        }
    },1000)
     setInterval(() => {
         var sz = "body > div:nth-child(1) > div.z-10.block.desktop\\:flex.desktop\\:grid.desktop\\:grid-flow-col.desktop\\:auto-cols-\\[auto_minmax\\(900px\\,_1fr\\)\\] > div.bg-base-bg > div > div > div > div:nth-child(1) > div > div.flex.items-center.w-full.h-full.flex-col-reverse.gap-8.desktop\\:flex-row > div.p-4.desktop\\:p-6.bg-\\[rgba\\(188\\,184\\,250\\,0\\.10\\)\\].max-w-\\[372px\\].w-full.backdrop-blur-xl.border.border-\\[rgba\\(188\\,184\\,250\\,0\\.15\\)\\].rounded-xl.flex-1.flex.flex-col > form > button"
         if(falg25){simulateButtonClick(sz).then((result) => { if (result) {falg25=false;}})}
         var singindi = "body > div:nth-child(1) > div.z-10.block.desktop\\:flex.desktop\\:grid.desktop\\:grid-flow-col.desktop\\:auto-cols-\\[auto_minmax\\(900px\\,_1fr\\)\\] > div.hidden.desktop\\:flex.desktop\\:w-\\[280px\\].fixed.top-\\[80px\\].left-0.min-h-screen > div > aside > div > ul > li:nth-child(2) > ul > li:nth-child(2) > a > div > span"
         if(!falg24){simulateButtonClick(singindi)}
         const threeSelector = "body > div:nth-child(1) > div.z-10.block.desktop\\:flex.desktop\\:grid.desktop\\:grid-flow-col.desktop\\:auto-cols-\\[auto_minmax\\(900px\\,_1fr\\)\\] > div.bg-base-bg > div > div > div > div:nth-child(1) > div:nth-child(2) > div > div > div.gap-10.flex.flex-col.p-6 > button";
         const threeButton = document.querySelector(threeSelector);
         if (threeButton) {
             falg24 = false; // Update falg24 if button is found
         }
         const flipSelector = "body > div:nth-child(1) > div.z-10.block.desktop\\:flex.desktop\\:grid.desktop\\:grid-flow-col.desktop\\:auto-cols-\\[auto_minmax\\(900px\\,_1fr\\)\\] > div.bg-base-bg > div > div > div > div:nth-child(1) > div.w-full.bg-cover.bg-no-repeat.rounded-lg.p-4.desktop\\:p-6.desktop\\:pt-6.pt-12.h-auto.relative > div.flex.items-center.w-full.h-full.flex-col-reverse.gap-8.desktop\\:flex-row > div.p-6.bg-\\[rgba\\(188\\,184\\,250\\,0\\.10\\)\\].w-full.desktop\\:max-w-\\[372px\\].backdrop-blur-xl.border.border-\\[rgba\\(188\\,184\\,250\\,0\\.15\\)\\].rounded-xl.flex-1.flex.flex-col > form > button > span";
         if (falg23) {simulateButtonClick(flipSelector).then((result) => {if (result) {falg23 = false;}});}
        setTimeout(function() {
             var flip = "body > div:nth-child(1) > div.z-10.block.desktop\\:flex.desktop\\:grid.desktop\\:grid-flow-col.desktop\\:auto-cols-\\[auto_minmax\\(900px\\,_1fr\\)\\] > div.bg-base-bg > div > div > div > div:nth-child(1) > div.w-full.bg-cover.bg-no-repeat.rounded-lg.p-4.desktop\\:p-6.desktop\\:pt-6.pt-12.h-auto.relative > div.flex.items-center.w-full.h-full.flex-col-reverse.gap-8.desktop\\:flex-row > div.p-6.bg-\\[rgba\\(188\\,184\\,250\\,0\\.10\\)\\].w-full.desktop\\:max-w-\\[372px\\].backdrop-blur-xl.border.border-\\[rgba\\(188\\,184\\,250\\,0\\.15\\)\\].rounded-xl.flex-1.flex.flex-col > form > button > span"
             simulateButtonClick(flip)
        }, 10000);
         var bulemetamask =document.querySelector("#headlessui-dialog-panel-\\:r3\\: > div.items-center.justify-center.w-full > div.mt-6 > div:nth-child(1) > div > svg > path:nth-child(28)")
         if(bulemetamask && falg22){falg22=false;bulemetamask.dispatchEvent(clickEvent);JSON.stringify({ clicked: true, bulemetamask: bulemetamask.outerHTML });}
         var blurCon = document.querySelector("#connect-desktop > span")
         if(blurCon && falg21){
             falg21=false;
             blurCon.dispatchEvent(clickEvent);
             JSON.stringify({ clicked: true, blurCon: blurCon.outerHTML });
         }
         for (let i = 3; i <= 10; i++) {let buttonXPath = `/html/body/div[${i}]/div/div[2]/div/div[2]/div/div/div/div/div/div[2]/div/button[2]`;clickElementByXPath(buttonXPath);}
         var buy2 = document.querySelector("#swap-page > div > div.sc-eDnVMP.sc-gKHVLF.sc-dkCBEl.gkVgsf.UlmxL.kmCYkK > div > button.sc-cwFklu.ewwrVR")
         var res1 = checkTextContent("#swap-button","Buy")
         if (buy2 && !falg5) {
             if(buy2 && !res1 && falg20){falg20=false;buy2.click()}
         }
         var faout = document.querySelector("#app > div.home__main > div.container__fluid > div.home__form > button > span")
         if(faout){var bColor = window.getComputedStyle(faout).getPropertyValue('background-color');if (faout.style.bColor = 'var(--primary)') {faout.dispatchEvent(clickEvent);JSON.stringify({ clicked: true, faout: faout.outerHTML });}}
         var jion = document.querySelector("body > div.ant-layout.min-h-screen.css-fva5he > main > div > div.flex.justify-center.z-10 > button > span")
         if(falg12){if(jion){falg12=false;jion.dispatchEvent(clickEvent);JSON.stringify({ clicked: true, jion: jion.outerHTML });}}
         var con = document.querySelector("#app > div.home__main > div.home__header > div > div.connect-wallet > button > span")
         if(falg1){if(con){falg1=false;con.dispatchEvent(clickEvent);JSON.stringify({ clicked: true, con: con.outerHTML });}}
         var con2 = document.querySelector("#swap-page > div > button")
         if(falg3){if(con2){falg3=false;con2.dispatchEvent(clickEvent);JSON.stringify({ clicked: true, con2: con2.outerHTML });}}
         var img = "#__next > div:nth-child(5) > div > div.sc-hLclGa.sc-fEyylQ.kkKarq.cagFIC > div > div > div > div > div > div._1a5xov70._1qhetbf1iu._1qhetbf1mx._1qhetbf1nc._1qhetbf1q1._1qhetbf1qg._1qhetbfe._1qhetbf61._1qhetbf6t._6h9tv97 > div:nth-child(1) > div._1a5xov70._1qhetbfih._1qhetbfym._1qhetbf26k._1qhetbf3by._6h9tv92 > div > div > img";simulateButtonClick(img);
         var element = document.querySelector("#swap-page > div > div.sc-eDnVMP.sc-gKHVLF.sc-dkCBEl.gkVgsf.UlmxL.kmCYkK > div > button.sc-cwFklu.kMsMhz")
         var sel = document.querySelector("#swap-page > div > div.sc-eDnVMP.sc-gKHVLF.sc-dkCBEl.gkVgsf.UlmxL.kmCYkK > div > button.sc-cwFklu.ewwrVR")
         if (element && checkTextContent("#swap-button","Insufficient USDT balance")) {
             var backgroundColor = window.getComputedStyle(element).getPropertyValue('background-color');
             if (element.style.backgroundColor = 'var(--colors-success)') {
                 if(falg7){
                     if(sel){
                         falg7=false;
                         sel.dispatchEvent(clickEvent);
                         JSON.stringify({ clicked: true, sel: sel.outerHTML });
                     }
                 }
             }
         }
         var buy = document.querySelector("#swap-button");var cfm = checkTextContent("#confirm-swap-or-send","Confirm Sell");var confim = document.querySelector("#confirm-swap-or-send");
         if(buy){
             if(falg6){buy.dispatchEvent(clickEvent);
                JSON.stringify({ clicked: true, buy: buy.outerHTML });
                 if(cfm){falg6=false;cfm.dispatchEvent(clickEvent);
                JSON.stringify({ clicked: true, cfm: cfm.outerHTML });
                     if(falg5){
                         setInterval(() => {
                             var x = document.querySelector("#__next > div:nth-child(5) > div > div.sc-hLclGa.sc-fEyylQ.kkKarq.cagFIC > div > div.sc-eDnVMP.sc-gKHVLF.sc-ksJisA.jprOhX.UlmxL.llZPKh > button > svg > path");
                             if (x && checkTextContent("#__next > div:nth-child(5) > div > div.sc-hLclGa.sc-fEyylQ.kkKarq.cagFIC > div > div.sc-eDnVMP.sc-gKHVLF.sc-ksJisA.jprOhX.UlmxL.llZPKh > div > h2","Confirm Sell")) {}
                         }, 1000);
                     }setTimeout(function() {falg5=false}, 40000);}
             }
         }
         const cg1 = document.querySelector("#__next > section > ol > li > div > div > div.sc-jrkPcm.iqWDBF > div");
         const cg2 = document.querySelector("#__next > section > ol > li > div > div > div.sc-pqitP.elKUtv");
         const closeSelector = "#__next > div:nth-child(5) > div > div.sc-hLclGa.sc-fEyylQ.kkKarq.cagFIC > div > div.sc-eDnVMP.sc-gKHVLF.sc-ksJisA.jprOhX.UlmxL.llZPKh > button > svg > path";
         if(cg1||cg2){simulateButtonClick(closeSelector);}
         const con3Selector = "body > div > header > div > div > div.hidden.lg\\:flex.flex.space-x-10.items-center > button > span";
         const metaMask3Selector = "body > div:nth-child(21) > div > div.ant-modal-wrap > div > div:nth-child(2) > div > div > div > div > div > div.my-5 > ul > li:nth-child(1)";
         if (falg9) {simulateButtonClick(con3Selector).then((result) => {if (result) {falg9 = false;}});}
         if (falg10) {simulateButtonClick(metaMask3Selector).then((result) => {if (result) {falg10 = false;}});}
         simulateButtonClick("body > div:nth-child(22) > div > div.ant-modal-wrap > div > div:nth-child(2) > div > div > div > div > div > div.my-5 > ul > li:nth-child(2) > button > span.flex.items-center > span",null);
     },3000)
})();
const clickEvent = new MouseEvent('click', {
    bubbles: true,
    cancelable: true,
    view: window
});
function clickElementByXPath(xPath) {var element = document.evaluate(xPath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;if (element) {element.click();}}
function simulateButtonClick(selector, expectedText = null) {
    return new Promise((resolve) => {
        const randomDelay = Math.floor(Math.random() * (1500 - 500 + 1)) + 500;
        const button = document.querySelector(selector);
        if (!button) {
            resolve(false);
            return;
        }
        if (expectedText !== null) {
            const buttonText = button.innerHTML.trim();
            if (buttonText === expectedText) {
                console.log("Button text matches expected text.");
            } else {
                console.log(`Button text does not match. Expected: "${expectedText}", Found: "${buttonText}"`);
                resolve(false);
                return;
            }
        }
        setTimeout(() => {
            button.dispatchEvent(clickEvent);
            JSON.stringify({ clicked: true, button: button.outerHTML });
            resolve(true);
        }, randomDelay);
    });
}
//PL
function waitAndClickElement(xpaths) {
document.querySelector("body > div:nth-child(1) > div > div.chakra-stack.css-4enqzv > div.chakra-stack.css-1igwmid > div > button")
    try {
        var modal = document.querySelector(xpaths);
        if (modal) {
            var target = modal.shadowRoot.querySelector("wui-flex > wui-card > w3m-router").shadowRoot.querySelector("div > w3m-connect-view").shadowRoot.querySelector("wui-flex > w3m-wallet-login-list").shadowRoot.querySelector("wui-flex > w3m-connect-injected-widget").shadowRoot.querySelector("wui-flex > wui-list-wallet").shadowRoot.querySelector("button");
            if (target) {
                target.dispatchEvent(clickEvent);
            } else {
                setTimeout(() => waitAndClickElement(xpaths), 3000);
            }
        } else {
            setTimeout(() => waitAndClickElement(xpaths), 3000);
        }
    } catch (error) {
        setTimeout(() => waitAndClickElement(xpaths), 3000);
    }
}

(function() {
    'use strict';
    var falg1 = true;
    var falg2 = true;
    var falg3 = true;
    var falg4 = true;
    var falg5 = true;
    var falg6 = true;
    var falg7 = true;
    var falg8 = true;
    var falg9 = true;
    var falg10 = true;
    var falg11 = true;
    var falg12 = true;
    var falg13 = true;
    var falg14 = true;
    var falg15 = true;
    var falg16 = true;
    var falg17 = true;
    var falg18 = true;
    var falg19 = true;
    var falg20 = true;
    var falg21 = true;
    var falg22 = true;
    var falg23 = true;
    var falg24 = true;
    var falg25 = true;
    var falg26 = true;
    var falg27 = true;
    var falg28 = true;
    var falg29 = true;
    var falg30 = true;
    var falg31 = true;
    var falg32 = true;
    var falg33 = true;
    var falg34 = true;
     var falg35 = true;
    setInterval(() => {
        if (window.location.href == 'https://app.infinityai.network/'){
            const elements = document.querySelectorAll('div');
            for (let i =0; i < elements.length; i++) {
                const pElement = elements[i].querySelector('p');
                if (pElement && pElement.innerHTML=="UniSat" && falg35) {
                    falg35=false;
                    pElement.click();
                    return;
                }
            }
        }
        if (window.location.href == 'https://testnet.zulunetwork.io/lwazi/' || window.location.href == 'https://testnet.zulunetwork.io/lwazi'){
            setTimeout(function() {
               // location.reload();
            }, 20000);
            sessionStorage.removeItem('swapsessionKey');
            sessionStorage.removeItem('poolsessionKey');
            /**
            var checkDepositKappaLending = document.querySelector("#__nuxt > div > div.pt-20 > div > div > div.flex.flex-col.items-start > div.w-full.space-y-4.lg\\:space-y-8 > div.item.relative.overflow-hidden.rounded-3xl.border.pt-6.lg\\:border-0.lg\\:pt-0.quest-13.border-\\[\\#d3d3d3\\] > div.relative.cursor-pointer.overflow-hidden.rounded-3xl.px-4.py-6.lg\\:pl-28 > div > div.hidden.w-28.items-center.justify-center.lg\\:flex > button > svg > path")
            var checkresultAdamSwap = document.querySelector("#__nuxt > div > div.pt-20 > div > div > div.flex.flex-col.items-start > div.w-full.space-y-4.lg\\:space-y-8 > div.item.relative.overflow-hidden.rounded-3xl.border.pt-6.lg\\:border-0.lg\\:pt-0.quest-9.border-\\[\\#d3d3d3\\] > div.relative.cursor-pointer.overflow-hidden.rounded-3xl.px-4.py-6.lg\\:pl-28 > div > div.hidden.w-28.items-center.justify-center.lg\\:flex > button > svg > path")
            var checkresultSWAP = document.querySelector("#__nuxt > div > div.pt-20 > div > div > div.flex.flex-col.items-start > div.w-full.space-y-4.lg\\:space-y-8 > div.item.relative.overflow-hidden.rounded-3xl.border.pt-6.lg\\:border-0.lg\\:pt-0.quest-8.border-\\[\\#d3d3d3\\] > div.relative.cursor-pointer.overflow-hidden.rounded-3xl.px-4.py-6.lg\\:pl-28 > div > div.hidden.w-28.items-center.justify-center.lg\\:flex > button > svg > path")
            if(checkresultSWAP){
                window.open('https://adamdefi.io/swap', '_self');
            }else if(checkresultAdamSwap){
                //window.open('https://adamdefi.io/pool', '_self');
            }else if(checkDepositKappaLending){
                window.open('https://testnet.kappalending.com/#/market', '_self');
            }
            */
        }
        var conhome = document.querySelector("#__nuxt > div > div.pt-20 > div > div > div.mb-12.md\\:mb-24 > div > div:nth-child(1) > button")
        if(conhome && falg32){
            falg32=false;
            conhome.dispatchEvent(clickEvent);
            JSON.stringify({ clicked: true, conhome: conhome.outerHTML });
        }
        try {
            var element = document.querySelector("body > w3m-modal").shadowRoot.querySelector("wui-flex > wui-card > w3m-router").shadowRoot.querySelector("div > w3m-account-view").shadowRoot.querySelector("w3m-account-default-widget").shadowRoot.querySelector("wui-flex:nth-child(2) > wui-list-item:nth-child(2) > wui-text");
            if (element) {
                element.dispatchEvent(clickEvent);
                JSON.stringify({ clicked: true, element: element.outerHTML });
            }
        } catch (error) {
        }
        var checkin = "#__nuxt > div > div.pt-20 > div > div > div.flex.flex-col.items-start > div.w-full.space-y-4.lg\\:space-y-8 > div.item.relative.overflow-hidden.rounded-3xl.border.pt-6.lg\\:border-0.lg\\:pt-0.quest-2.border-\\[\\#d3d3d3\\] > div.relative.cursor-pointer.overflow-hidden.rounded-3xl.px-4.py-6.lg\\:pl-28 > div > div.hidden.w-28.items-center.justify-center.lg\\:flex > button"
        simulateButtonClick(checkin);
        var addliq = "#__nuxt > div.default-wrap.min-h-screen.pb-24.font-poppins.flex.flex-col.items-stretch > div.main > div > div > div.panel > a"
        simulateButtonClick(addliq);
        var usdzswap = document.querySelector("body > div.fixed.inset-0.flex.justify-center.items-center.px-4.font-poppins.z-50 > div.w-full.h-full.flex.py-6.overflow-auto > div > div > div > div > div.relative.overflow-hidden > div > div.max-h-96.text-sm.overflow-y-auto.content > div:nth-child(4) > div.flex.flex-col > span.text-\\[0\\.875rem\\]")
        if(usdzswap){
            usdzswap.click();
        }
    },1000)
     setInterval(() => {
         var swpacon = document.querySelector("#__nuxt > div.default-wrap.min-h-screen.pb-24.font-poppins.flex.flex-col.items-stretch > div.px-4.flex.items-center.justify-between.z-10.mobile\\:h-24.pc\\:max-w-320.pc\\:mx-auto.pc\\:h-42.pc\\:mb-10.w-full > div.ml-15 > button")
         if(swpacon && falg29 && swpacon.innerHTML ===" Connect Wallet "){
             falg29=false;
             swpacon.dispatchEvent(clickEvent);
             JSON.stringify({ clicked: true, swpacon: swpacon.outerHTML });
         }
         var metamask = document.querySelector("body > div.fixed.inset-0.flex.justify-center.items-center.px-4.font-poppins.z-50 > div.w-full.h-full.flex.py-6.overflow-auto > div > div > div.relative.overflow-hidden > div > div:nth-child(1) > h3")
         if(metamask && falg30){
             falg30=false;
             metamask.dispatchEvent(clickEvent);
             JSON.stringify({ clicked: true, metamask: metamask.outerHTML });
         }
         let lendingsessionKey = sessionStorage.getItem('lendingsessionKey');
         let supply = sessionStorage.getItem('supply');
         if(lendingsessionKey==='1'){
             sessionStorage.setItem('lendingsessionKey','0');
              sessionStorage.setItem('supply','1');
         }
         if (window.location.href == 'https://testnet.zulunetwork.io/lwazi/?code=6S4TVJ' || window.location.href == 'https://testnet.zulunetwork.io/lwazi' || window.location.href == 'https://testnet.zulunetwork.io/lwazi/'){
             let outerElement1 = document.querySelector("body > w3m-modal");
             if (outerElement1) {
                 let shadowRoot1 = outerElement1.shadowRoot;
                 if (shadowRoot1) {
                     let element1 = shadowRoot1.querySelector("wui-flex > wui-card > w3m-router");
                     if (element1) {
                         let shadowRoot2 = element1.shadowRoot;
                         if (shadowRoot2) {
                             let element2 = shadowRoot2.querySelector("div > w3m-networks-view");
                             if (element2) {
                                 let shadowRoot3 = element2.shadowRoot;
                                 if (shadowRoot3) {
                                     let element3 = shadowRoot3.querySelector("wui-grid > wui-card-select");
                                     if (element3) {
                                         let shadowRoot4 = element3.shadowRoot;
                                         if (shadowRoot4) {
                                             let targetElement = shadowRoot4.querySelector("button > wui-text");
                                             if (targetElement) {
                                                 falg12 = false;;
                                                 targetElement.dispatchEvent(clickEvent);
                                                 JSON.stringify({ clicked: true, targetElement: targetElement.outerHTML });
                                             } else {
                                             }
                                         } else {
          
                                         }
                                     } else {

                                     }
                                 } else {

                                 }
                             } else {

                             }
                         } else {

                         }
                     } else {

                     }
                 } else {

                 }
             } else {

             }
             if(!falg9){
                 var join = "#__nuxt > div > div.pt-20 > div > div > div.mb-12.md\\:mb-24 > div > div.relative.flex.flex-wrap.gap-6.border-l-4.border-transparent.pl-8.font-semibold.md\\:gap-12.md\\:pb-12.md\\:pl-12 > div:nth-child(2) > button > span"
                 simulateButtonClick(join);
             }
             var tele = document.querySelector("#__nuxt > div > div.pt-20 > div > div > div.mb-12.md\\:mb-24 > div > div.relative.flex.flex-wrap.items-center.justify-between.gap-x-6.gap-y-2.border-l-4.pb-8.pl-8.font-semibold.md\\:gap-12.md\\:pb-12.md\\:pl-12.border-gray-200 > a")
             if(tele && falg8){
                 falg8=false;
                 tele.dispatchEvent(clickEvent);
                 JSON.stringify({ clicked: true, tele: tele.outerHTML });
             }
             var godc = document.querySelector("#__nuxt > div > div.pt-20 > div > div > div.mb-12.md\\:mb-24 > div > div:nth-child(3) > a")
             if(godc && falg7){
                 falg7=false;
                 godc.dispatchEvent(clickEvent);
                 JSON.stringify({ clicked: true, godc: godc.outerHTML });
             }
             var laiwa = "#__nuxt > div > div.fixed.inset-x-0.top-0.z-20.bg-white\\/50.backdrop-blur-sm > div.relative.mx-auto.flex.h-20.max-w-screen-xl.items-center.px-6.lg\\:h-24 > div.hidden.items-center.gap-8.lg\\:flex > a:nth-child(2)"
             simulateButtonClick(laiwa);
             var conwall = document.querySelector("#__nuxt > div > div.fixed.inset-x-0.top-0.z-20.bg-white\\/50.backdrop-blur-sm > div.relative.mx-auto.flex.h-20.max-w-screen-xl.items-center.px-6.lg\\:h-24 > div.ml-auto.text-xs.md\\:text-sm > div > button > div > div")
             if(conwall && falg1){
                 falg1=false;
                 conwall.dispatchEvent(clickEvent);
                 JSON.stringify({ clicked: true, conwall: conwall.outerHTML });
             }
             var beta = document.querySelector("#__nuxt > div > div.fixed.inset-x-0.top-0.z-20.bg-white\\/50.backdrop-blur-sm > div.relative.mx-auto.flex.h-20.max-w-screen-xl.items-center.px-6.lg\\:h-24 > div.ml-auto.text-xs.md\\:text-sm > div > div > button:nth-child(2) > span")
             if(beta && falg2){
                 falg2=false;
                 beta.dispatchEvent(clickEvent);
                 JSON.stringify({ clicked: true, beta: beta.outerHTML });
             }
             try {
                 var metaMaskimg = document.querySelector("body > w3m-modal").shadowRoot.querySelector("wui-flex > wui-card > w3m-router").shadowRoot.querySelector("div > w3m-connect-view").shadowRoot.querySelector("wui-flex > wui-list-wallet:nth-child(3)").shadowRoot.querySelector("button > wui-wallet-image").shadowRoot.querySelector("wui-flex > wui-image").shadowRoot.querySelector("img");
                 if (metaMaskimg && falg3) {
                     falg3 = false;
                     metaMaskimg.dispatchEvent(clickEvent);
                     setInterval(() => {
                         location.reload();
                     },20000)
                 }
             } catch (error) {
             }
             var login = document.querySelector("#__nuxt > div > div.pt-20 > div > div > div.mb-12.md\\:mb-24 > div > div:nth-child(1) > button > span")
             if(login && falg5){
                 falg5=false;
                 login.dispatchEvent(clickEvent);
                 JSON.stringify({ clicked: true, login: login.outerHTML });
             }
             let outerElement = document.querySelector("body > w3m-modal");
             if (outerElement) {
                 let shadowRoot1 = outerElement.shadowRoot;
                 if (shadowRoot1) {
                     let element1 = shadowRoot1.querySelector("wui-flex > wui-card > w3m-router");
                     if (element1) {
                         let shadowRoot2 = element1.shadowRoot;
                         if (shadowRoot2) {
                             let element2 = shadowRoot2.querySelector("div > w3m-account-view");
                             if (element2) {
                                 let shadowRoot3 = element2.shadowRoot;
                                 if (shadowRoot3) {
                                     let element3 = shadowRoot3.querySelector("w3m-account-default-widget");
                                     if (element3) {
                                         let shadowRoot4 = element3.shadowRoot;
                                         if (shadowRoot4) {
                                             let targetElement = shadowRoot4.querySelector("wui-flex:nth-child(2) > wui-list-item:nth-child(1) > wui-text");
                                             if (targetElement && falg10) {
                                                 falg10=false;
                                                 targetElement.dispatchEvent(clickEvent);
                                                 JSON.stringify({ clicked: true, targetElement: targetElement.outerHTML });
                                             } else {
                                             }
                                         } else {
                                         }
                                     } else {
                                     }
                                 } else {
                                 }
                             } else {
                             }
                         } else {
                         }
                     } else {
                     }
                 } else {
                 }
             } else {
             }

             var sw = document.querySelector("body > w3m-modal")?.shadowRoot?.querySelector("wui-flex > wui-card > w3m-router")?.shadowRoot?.querySelector("div > w3m-unsupported-chain-view")?.shadowRoot?.querySelector("wui-flex > wui-flex:nth-child(2) > wui-list-network")?.shadowRoot?.querySelector("button > wui-text");
             if (sw && falg4) {
                 let body = document.querySelector('body');
                 let currentElement = body.shadowRoot;

                 while (currentElement) {
                     let modal = currentElement.querySelector('w3m-modal');
                     if (modal) {
                         currentElement = modal.shadowRoot;

                         let router = currentElement.querySelector('wui-flex > wui-card > w3m-router');
                         if (router) {
                             currentElement = router.shadowRoot;

                             let unsupportedView = currentElement.querySelector('div > w3m-unsupported-chain-view');
                             if (unsupportedView) {
                                 currentElement = unsupportedView.shadowRoot;

                                 let listNetwork = currentElement.querySelector('wui-flex > wui-flex:nth-child(2) > wui-list-network');
                                 if (listNetwork) {
                                     currentElement = listNetwork.shadowRoot;

                                     let button = currentElement.querySelector('button > wui-text');
                                     if (button) {
                                         falg4 = false;
                                         button.dispatchEvent(clickEvent);
                                         JSON.stringify({ clicked: true, button: button.outerHTML });
                                     }
                                 } else {
                                     break;
                                 }
                             } else {
                                 break;
                             }
                         } else {
                             break;
                         }
                     } else {
                         break;
                     }
                 }
             }
         }
         if (window.location.href == 'https://testnet.kappalending.com/#/market'){
             try{
                 var supresult = document.querySelector("body > div.MuiDialog-root.loading-dialog.MuiModal-root.css-126xj0f > div.MuiDialog-container.MuiDialog-scrollPaper.css-ekeie0 > div > div.MuiDialogContent-root.confirm-tx.css-1ty026z > div")
                 if(supresult.innerHTML === "Transaction broadcast"){
                     sessionStorage.setItem('lendingsessionKey','1');
                 }
             }catch(error){}
             setTimeout(function() {
                location.reload();
            }, 40000);

             var start = document.querySelector("body > div.MuiDialog-root.supply-dialog.MuiModal-root.css-126xj0f > div.MuiDialog-container.MuiDialog-scrollPaper.css-ekeie0 > div > div > div > div:nth-child(2) > div.supply-tab > div.action > button")
             var startinpu =document.querySelector("#\\:r5\\:")
             if(start && startinpu.value.length>3 && falg34){
                 falg34=false;
                 start.dispatchEvent(clickEvent);
                 JSON.stringify({ clicked: true, start: start.outerHTML });
                 setInterval(function() {
                     var starres = document.querySelector("body > div.MuiDialog-root.loading-dialog.MuiModal-root.css-126xj0f > div.MuiDialog-container.MuiDialog-scrollPaper.css-ekeie0 > div > div.MuiDialogContent-root.confirm-tx.css-1ty026z > div")
                     if(starres.innerHTML === "Transaction broadcast"){
                         sessionStorage.removeItem('supply');
                         sessionStorage.removeItem('lendingsessionKey');
                         window.open('https://www.communitygaming.io/quests', '_self');
                     }else{
                         setTimeout(function() {
                             sessionStorage.removeItem('supply');
                             sessionStorage.removeItem('lendingsessionKey');
                             window.open('https://www.communitygaming.io/quests', '_self');
                         }, 20000);
                     }
                 }, 1000);
             }
             try{
                 var kappcon = document.querySelector("#root > div > div.header.header-pc > div > div:nth-child(2) > button")
                 if(kappcon && falg25 && kappcon.innerHTML === "Connect Wallet"){
                     falg25=false;
                     kappcon.dispatchEvent(clickEvent);
                     JSON.stringify({ clicked: true, kappcon: kappcon.outerHTML });
                 }
             }catch(error){}


             try{
                 var ENABLE = document.querySelector("body > div.MuiDialog-root.supply-dialog.MuiModal-root.css-126xj0f > div.MuiDialog-container.MuiDialog-scrollPaper.css-ekeie0 > div > div > div > div:nth-child(1) > div.action > button")
                 if(ENABLE && falg27 && ENABLE.innerHTML === "ENABLE"){
                     falg27=false;
                     ENABLE.dispatchEvent(clickEvent);
                     JSON.stringify({ clicked: true, ENABLE: ENABLE.outerHTML });
                 }
             }catch(error){}


             var kappmetaMask = document.querySelector("body > div:nth-child(7) > div > div > div._9pm4ki5.ju367va.ju367v15.ju367v8r > div > div > div > div > div.iekbcc0.ju367va.ju367v15.ju367v4y._1vwt0cg3 > div.iekbcc0.ju367v6p._1vwt0cg2.ju367v7a.ju367v7v > div:nth-child(2) > div > button")
             if(kappmetaMask && falg26){
                 falg26=false;
                 kappmetaMask.dispatchEvent(clickEvent);
                 JSON.stringify({ clicked: true, kappmetaMask: kappmetaMask.outerHTML });
             }
             var btcbtn = document.querySelector("#kappa-lending > div > div.page-container > div > div.token-row-list > div.token-row.flex.items-center")
             if(btcbtn){
                 btcbtn.dispatchEvent(clickEvent);
                 JSON.stringify({ clicked: true, btcbtn: btcbtn.outerHTML });
             }
         }
         if (document.readyState === "complete") {
             if (window.location.href == 'https://adamdefi.io/pool/add' || window.location.href == 'https://adamdefi.io/pool'){
                 setTimeout(function() {
                     location.reload();
                 }, 60000);
                 //var max = document.querySelector("#__nuxt > div.default-wrap.min-h-screen.pb-24.font-poppins.flex.flex-col.items-stretch > div.main > div > div > div.panel.\\!pt-10 > div.mt-5 > div > div:nth-child(3) > div:nth-child(2) > div:nth-child(2) > div > div.mr-2.text-white.border-\\[\\#5C3BFF\\].cursor-pointer.hover\\:opacity-80.flex.items-center.justify-center.w-11\\.25.h-4\\.5.border-1.text-\\[0\\.5625rem\\].rounded-\\[0\\.3125rem\\]")
                 //if(max){
                    // max.dispatchEvent(clickEvent);
                // }
                 var yue = document.querySelector("#__nuxt > div.default-wrap.min-h-screen.pb-24.font-poppins.flex.flex-col.items-stretch > div.main > div > div > div.panel.\\!pt-10 > div.mt-5 > div > div:nth-child(3) > div.flex.items-center.justify-between.text-xs.text-white > div:nth-child(2) > span")
                 if(yue){
                     if(yue.innerHTML ==="0"){
                         window.open('https://adamdefi.io/swap', '_self');
                     }
                 }
                 var susspool = document.querySelector("body > div.fixed.inset-0.flex.justify-center.items-center.px-4.font-poppins.z-50 > div.w-full.h-full.flex.py-6.overflow-auto > div > div > div.text-black.text-base > div > span")
                 if(susspool && susspool.innerHTML ==="Success"){
                     window.open('https://testnet.kappalending.com/#/market', '_self');
                 }
                 var SelectatokenPool = document.querySelector("#__nuxt > div.default-wrap.min-h-screen.pb-24.font-poppins.flex.flex-col.items-stretch > div.main > div > div > div.panel.\\!pt-10 > div.mt-5 > div > div:nth-child(3) > div:nth-child(2) > div:nth-child(2) > div > div > span")
                 if(SelectatokenPool && falg23){
                     falg23=false;
                     SelectatokenPool.click();
                     JSON.stringify({ clicked: true, SelectatokenPool: SelectatokenPool.outerHTML });
                 }
                 try {
                     var button = document.querySelector("#__nuxt > div.default-wrap.min-h-screen.pb-24.font-poppins.flex.flex-col.items-stretch > div.main > div > div > div.panel.\\!pt-10 > div.mt-5 > div > div.w-full.mt-12 > button");
                     if (button && button.innerHTML === "Approve USDZ") {
                         button.dispatchEvent(clickEvent);
                         JSON.stringify({ clicked: true, button: button.outerHTML });
                     }
                 } catch (error) {

                 }
                 try {
                     var buttonadd = document.querySelector("#__nuxt > div.default-wrap.min-h-screen.pb-24.font-poppins.flex.flex-col.items-stretch > div.main > div > div > div.panel.\\!pt-10 > div.mt-5 > div > div.w-full.mt-12 > button")
                     if (buttonadd && buttonadd.innerHTML === "Add Liquidity" && falg24) {
                         falg24=false
                         buttonadd.dispatchEvent(clickEvent);
                         JSON.stringify({ clicked: true, buttonadd: buttonadd.outerHTML });
                     }
                 } catch (error) {
                 }
             }
             if (window.location.href == 'https://adamdefi.io/swap' || window.location.href == 'https://adamdefi.io/pool/add' || window.location.href == 'https://adamdefi.io/pool'){
                 setTimeout(function() {
                     location.reload();
                 }, 50000);
                 var res = document.querySelector("body > div.fixed.inset-0.flex.justify-center.items-center.px-4.font-poppins.z-50 > div.w-full.h-full.flex.py-6.overflow-auto > div > div > div.text-black.text-base > div > span:nth-child(1)")
                 if(res && res.innerHTML === "Failed"){
                     location.reload();
                 }
             }
             if (window.location.href == 'https://adamdefi.io/swap'){
                 let i = parseInt(sessionStorage.getItem('gopool')) || 0;
                 var suss = document.querySelector("body > div.fixed.inset-0.flex.justify-center.items-center.px-4.font-poppins.z-50 > div.w-full.h-full.flex.py-6.overflow-auto > div > div > div.text-black.text-base > div > span");
                 if (suss && suss.innerHTML === "Success" && falg35) {
                     falg34=false;
                     i++;
                     sessionStorage.setItem('gopool', i.toString());
                     location.reload();
                 }
                 if (i>=4) {
                     sessionStorage.removeItem('gopool');
                     window.open('https://testnet.kappalending.com/#/market', '_self');
                 }
                 var swapbtn = document.querySelector("#__nuxt > div.default-wrap.min-h-screen.pb-24.font-poppins.flex.flex-col.items-stretch > div.main > div > div.panel > div:nth-child(7) > button");
                 if (swapbtn) {
                     var computedStyle = window.getComputedStyle(swapbtn);
                     var background = computedStyle.backgroundColor;
                     if (background = "linear-gradient(83.11deg, #5c3bff 15.75%, #f485f0 113.58%)" && falg22) {
                         falg22=false;
                         swapbtn.dispatchEvent(clickEvent);
                         JSON.stringify({ clicked: true, swapbtn: swapbtn.outerHTML });
                     }
                 }
                 var Selectatoken =document.querySelector("#__nuxt > div.default-wrap.min-h-screen.pb-24.font-poppins.flex.flex-col.items-stretch > div.main > div > div.panel > div:nth-child(4) > div:nth-child(2) > div:nth-child(2) > div > div > span")
                 if(Selectatoken && falg21){
                     falg21=false;
                     Selectatoken.dispatchEvent(clickEvent);
                     JSON.stringify({ clicked: true, Selectatoken: Selectatoken.outerHTML });
                 }
             }
         }
         if (window.location.href == 'https://testnet.zulunetwork.io/lwazi/' || window.location.href == 'https://testnet.zulunetwork.io/lwazi'){
             var swapmetamask = document.querySelector("body > div.fixed.inset-0.flex.justify-center.items-center.px-4.font-poppins.z-50 > div.w-full.h-full.flex.py-6.overflow-auto > div > div > div.relative.overflow-hidden > div > div:nth-child(1) > h3")
             if(swapmetamask && falg20){
                 falg20=false;
                 swapmetamask.dispatchEvent(clickEvent);
                 JSON.stringify({ clicked: true, swapmetamask: swapmetamask.outerHTML });
             }
             var swapcon = document.querySelector("#__nuxt > div.default-wrap.min-h-screen.pb-24.font-poppins.flex.flex-col.items-stretch > div.px-4.flex.items-center.justify-between.z-10.mobile\\:h-24.pc\\:max-w-320.pc\\:mx-auto.pc\\:h-42.pc\\:mb-10.w-full > div.ml-15 > button")
             if(swapcon && falg19){
                 falg19=false;
                 swapcon.dispatchEvent(clickEvent);
                 JSON.stringify({ clicked: true, swapcon: swapcon.outerHTML });
             }
             var conunis = document.querySelector("body > div.fixed.inset-0.z-50.flex.items-center.justify-center.px-4.font-lexend-deca > div.flex.h-full.w-full.overflow-auto.py-6 > div > div > div.flex.flex-col.gap-5.rounded-xl.p-6.pt-3 > button:nth-child(1) > span")
             if(conunis && falg18){
                 falg18=false;
                 conunis.dispatchEvent(clickEvent);
                 JSON.stringify({ clicked: true, conunis: conunis.outerHTML });
             }
             var con2_1 = document.querySelector("#__nuxt > div > div.fixed.inset-x-0.top-0.z-20.bg-white\\/50.backdrop-blur-sm > div.relative.mx-auto.flex.h-20.max-w-screen-xl.items-center.px-6.lg\\:h-24 > div.ml-auto.flex.items-center.gap-2.text-xs.md\\:gap-6.md\\:text-sm > button")
             var conuni = document.querySelector("#__nuxt > div > div.pt-20 > div > div > div.flex.flex-col.items-start > div.w-full.space-y-4.lg\\:space-y-8 > div.item.relative.overflow-hidden.rounded-3xl.border.pt-6.lg\\:border-0.lg\\:pt-0.quest-1.border-pink-500 > div.relative.cursor-pointer.overflow-hidden.rounded-3xl.px-4.py-6.lg\\:pl-28 > div > div.flex-grow.border-pink-500\\/30.lg\\:border-r-2 > h3")
             if(conuni){
                 if(con2_1 && falg17){
                     falg17=false;
                     con2_1.dispatchEvent(clickEvent);
                     JSON.stringify({ clicked: true, con2_1: con2_1.outerHTML });
                 }
             }
             try {
                 var element2 = document.querySelector("body > w3m-modal").shadowRoot.querySelector("wui-flex > wui-card > w3m-router").shadowRoot.querySelector("div > w3m-networks-view").shadowRoot.querySelector("wui-grid > wui-card-select:nth-child(1)").shadowRoot.querySelector("button > wui-text")
                 if(element2 && falg16){
                     falg16=false;
                     element2.dispatchEvent(clickEvent);
                     JSON.stringify({ clicked: true, element2: element2.outerHTML });
                 }

             } catch (error) {
             }
             try {
                 var element1 = document.querySelector("body > w3m-modal").shadowRoot.querySelector("wui-flex > wui-card > w3m-router").shadowRoot.querySelector("div > w3m-account-view").shadowRoot.querySelector("w3m-account-default-widget").shadowRoot.querySelector("wui-flex:nth-child(2) > wui-list-item:nth-child(2) > wui-text");
                 if(element1 && falg15){
                     falg15=false;
                     element1.dispatchEvent(clickEvent);
                     JSON.stringify({ clicked: true, element1: element1.outerHTML });
                 }

             } catch (error) {

             }
             try {
                 var element = document.querySelector("body > w3m-modal").shadowRoot.querySelector("wui-flex > wui-card > w3m-router").shadowRoot.querySelector("div > w3m-connect-view").shadowRoot.querySelector("wui-flex > w3m-wallet-login-list").shadowRoot.querySelector("wui-flex > w3m-connector-list").shadowRoot.querySelector("wui-flex > w3m-connect-announced-widget").shadowRoot.querySelector("wui-flex > wui-list-wallet").shadowRoot.querySelector("button > wui-text");
                 if(element && falg14){
                     element.dispatchEvent(clickEvent);
                     JSON.stringify({ clicked: true, element: element.outerHTML });
                 }
             } catch (error) {

             }
             var coneve = document.querySelector("#__nuxt > div > div.fixed.inset-x-0.top-0.z-20.bg-white\\/50.backdrop-blur-sm > div.relative.mx-auto.flex.h-20.max-w-screen-xl.items-center.px-6.lg\\:h-24 > div.ml-auto.flex.items-center.gap-2.text-xs.md\\:gap-6.md\\:text-sm > button:nth-child(1) > div > div")
             if(coneve && falg13){
                 falg13=false;
                 coneve.dispatchEvent(clickEvent);
                 JSON.stringify({ clicked: true, coneve: coneve.outerHTML });
             }
         }
     },3000)
    // Your code here...
})();

(function() {
    'use strict';
    if (window.location.href == 'https://www.360.cn/') {
        // 生成1到60之间的随机秒数
        const randomSeconds = Math.floor(Math.random() * 60) + 1;

        console.log(`Waiting for ${randomSeconds} seconds before opening the new site...`);

        // 使用setTimeout来延迟执行
        setTimeout(() => {
            window.open('https://swap.hemi.xyz/', '_self');
        }, randomSeconds * 1000); // 将秒转换为毫秒
    }
})();

(function() {
    var suss =true;
    setInterval(() => {
        navigateToNextURL();
        if(window.location.href == 'https://www.communitygaming.io/'){
            var x = "#ModalXPConversationPopup > div > div > button"
            simulateButtonClick(x);
    }
    },3000)
    setInterval(() => {
        if(window.location.href == 'https://miles.plumenetwork.xyz/' || window.location.href == 'https://backpack.app/' || window.location.href.includes('https://portfolio.metamask.io')){
            window.close();
        }
        var su1 = document.querySelector("li > div > div.text-sm.font-semibold")
        var su2= document.querySelector("body > div:nth-child(5) > ol > li > div > div.text-sm.font-semibold")
        var su3 =document.querySelector("body > div:nth-child(5) > ol > li")
        if(su1 || su2 || su3 && suss && i==2){
            suss=false;
            window.open('https://app.elyfi.world/pools/plumetestnet/10', '_self');
        }
        var gonext =document.querySelector("#q-notify > div > div.q-notifications__list.q-notifications__list--top.fixed.column.no-wrap.items-center > div > div > div.q-notification__content.row.items-center.col > div")
        if(gonext && gonext.innerHTML==='$10 gnUSD is required to get 0.2 RST'){
            window.open('https://testnet.musicprotocol.finance/', '_self');
        }
    },1000)
    'use strict'
    let falg = true;
    let falg1 = true;
    let falg2 = true;
    let falg3 = true;
    let falg4 = true;
    var i =0;
    const connectWallet = () => {
        const mainElement = document.querySelector("#q-app > div > header > div.q-toolbar.row.no-wrap.items-center > div.flex.justify-end.items-center.no-wrap > w3m-button");
        if (mainElement && mainElement.shadowRoot) {
            const connectButton = mainElement.shadowRoot.querySelector("w3m-connect-button");
            if (connectButton && connectButton.shadowRoot) {
                const wuiConnectButton = connectButton.shadowRoot.querySelector("wui-connect-button");
                if (wuiConnectButton && wuiConnectButton.textContent.includes('Connect Wallet')) {
                    falg = false;
                    wuiConnectButton.dispatchEvent(clickEvent);
                    JSON.stringify({ clicked: true, wuiConnectButton: wuiConnectButton.outerHTML });
                }
            }
        }
    };

    const navigateToNextURL = () => {
        const currentURL = window.location.href;
        if (currentURL === 'https://plume-testnet.realtyx.co/') {
            setTimeout(function() {
                location.reload();
            }, 60000);
            setTimeout(() => {
                connectWallet();
            }, 5000);
            const getAvatarButton = () => {
                // 选择外层元素
                const afcon = document.querySelector("#q-app > div > header > div.q-toolbar.row.no-wrap.items-center > div.flex.justify-end.items-center.no-wrap > w3m-button");

                if (!afcon) {
                    console.error('w3m-button not found.');
                    return null;
                }
                const accountButton = afcon.shadowRoot.querySelector("w3m-account-button");
                if (!accountButton) {
                    console.error('w3m-account-button not found.');
                    return null;
                }

                const accountButtonShadow = accountButton.shadowRoot.querySelector("wui-account-button");
                if (!accountButtonShadow) {
                    console.error('wui-account-button not found.');
                    return null;
                }
                const button = accountButtonShadow.shadowRoot.querySelector("button > wui-flex > wui-avatar");
                if (!button) {
                    console.error('Button with avatar not found.');
                    return null;
                }
                return button;
            };
            const button = getAvatarButton();
            const dialogElement = document.querySelector("#q-portal--dialog--1 > div > div.q-dialog__inner.flex.no-pointer-events.q-dialog__inner--minimized.q-dialog__inner--standard.fixed-full.flex-center");
            if (dialogElement) {
                const confirmButton = dialogElement.querySelector("div.q-card__actions.justify-center.q-card__actions--horiz.row.dialog-btn > button.btn-cus-primary");
                if (confirmButton) {
                    confirmButton.click();
                    //JSON.stringify({ clicked: true, confirmButton: confirmButton.outerHTML });
                }
            }
            const btnget = document.querySelector("#q-app > div > div > main > div.q-page-content.q-pa-md > div.q-mt-sm > div > div > div > div > div > div:nth-child(3) > div.step-jump.q-ml-md > button");
            if (btnget && falg1 && getAvatarButton()) {
                falg1 = false;
                setTimeout(() => {
                    btnget.dispatchEvent(clickEvent);
                     JSON.stringify({ clicked: true, btnget: btnget.outerHTML });
                }, 5000);
            }
            var v = document.querySelector("#q-app > div > div > main > div.q-page-content.q-pa-md > div.q-mt-sm > div > div > div > div > div > div:nth-child(3) > div.step-jump.q-ml-md > span > img")
            if(v){
                var stack = document.querySelector("#q-app > div > div > main > div.q-page-content.q-pa-md > div.q-mt-sm > div > div > div > div > div > div:nth-child(4) > div.step-jump.q-ml-md > button")
                if(stack && falg2){
                    falg2=false;
                    stack.dispatchEvent(clickEvent);
                    JSON.stringify({ clicked: true, stack: stack.outerHTML });
                }
            }
            var vv = document.querySelector("#q-app > div > div > main > div.q-page-content.q-pa-md > div.q-mt-sm > div > div > div > div > div > div:nth-child(4) > div.step-jump.q-ml-md > span > img")
            if(vv && v){
                window.open('https://testnet.musicprotocol.finance/', '_self');
            }

        }
        else if (currentURL === 'https://testnet.musicprotocol.finance/') {
            setTimeout(function() {
                location.reload();
            }, 60000);
            const button = document.querySelector("body > div.flex.justify-center.items-center.sticky.top-0.w-full.bg-\\[\\#000331\\] > div > button");
            if (button && falg1 && button.innerHTML==='Connect Wallet' ) {
                falg1=false;
                button.dispatchEvent(clickEvent);
                JSON.stringify({ clicked: true, button: button.outerHTML });
            }else{
                const inputs = document.querySelectorAll('input[type="text"], input[type="number"], input[type="email"], input[type="password"]');
                inputs.forEach(input => {
                    if (input.type === 'text' || input.type === 'number' || input.type === 'email' || input.type === 'password') {
                        if(input){
                            const inputValue = parseFloat(input.value);
                            if (inputValue > 0 || !isNaN(inputValue)) {
                                var btnap = document.querySelector("body > main > div > div > div.flex.flex-col.gap-4.p-4.rounded-3xl.border.border-\\[\\#41e2b8\\].w-full.lg\\:max-w-\\[360px\\] > button")
                                if (btnap && btnap.innerHTML==='Buy' && falg4) {
                                    falg4=false;
                                    btnap.dispatchEvent(clickEvent);
                                    JSON.stringify({ clicked: true, btnap: btnap.outerHTML });
                                    i+=2;
                                }
                                if(btnap && falg3 && btnap.innerHTML!='Buy') {
                                    falg3=false;
                                    btnap.dispatchEvent(clickEvent);
                                    JSON.stringify({ clicked: true, btnap: btnap.outerHTML });
                                    i++;
                                }
                            }
                        }
                    }
                })
            }
            var meta = document.querySelector("body > w3m-modal").shadowRoot.querySelector("wui-flex > wui-card > w3m-router").shadowRoot.querySelector("div > w3m-connect-view").shadowRoot.querySelector("wui-flex > wui-flex > w3m-connector-list").shadowRoot.querySelector("wui-flex > w3m-connect-injected-widget").shadowRoot.querySelector("wui-flex > wui-list-wallet:nth-child(1)")
            if (meta && falg2) {
                falg2=false;
                meta.dispatchEvent(clickEvent);
                JSON.stringify({ clicked: true, meta: meta.outerHTML });
            }
        } else if (currentURL === 'https://app.elyfi.world/pools/plumetestnet/10') {
            var metamask = document.querySelector("#__next > div > div.sc-ee0193af-0.iwoLcD > div.sc-6836aeb1-0.exbsJv > div:nth-child(2)")
            if(metamask){
                metamask.dispatchEvent(clickEvent);
                JSON.stringify({ clicked: true, metamask: metamask.outerHTML });
            }
            setTimeout(function() {
                location.reload();
            }, 60000);
            var tj = document.querySelector("#__next > div > header > nav > section > div > div > span")
            if(tj){
                const inputs = document.querySelectorAll('input[type="text"], input[type="number"], input[type="email"], input[type="password"]');
                inputs.forEach(input => {
                    if (input.type === 'text' || input.type === 'number' || input.type === 'email' || input.type === 'password') {
                        if(input){
                            const inputValue = parseFloat(input.value);
                            if (inputValue > 0 || !isNaN(inputValue)) {
                                var ap =document.querySelector("#__next > div > main > div > div > div > div:nth-child(2) > button")
                                if(ap && falg){
                                    falg=false;
                                    ap.click();
                                    ap.dispatchEvent(clickEvent);
                                    JSON.stringify({ clicked: true, ap: ap.outerHTML });
                                    setTimeout(() => {
                                        setTimeout(() => {
                                            window.open('https://app.mysticfinance.xyz/en/lend', '_self');
                                        }, Delay);
                                    }, 10000)
                                }
                            }
                        }
                    }
                })
            }
        } else if (currentURL === 'https://app.mysticfinance.xyz/en/lend') {
            setTimeout(function() {
                location.reload();
            }, 60000);
            var c1 = document.querySelector("body > div.app.lg\\:flex.items-start.justify-stretch > div > header > div > section.lg\\:justify-self-end.flex.items-stretch.justify-center.gap-2.lg\\:flex-row-reverse > div > button")
            var m2 = document.querySelector("body > onboard-v2").shadowRoot.querySelector("section > div > div > div > div > div > div > div.content.flex.flex-column.svelte-1qwmck3 > div.scroll-container.svelte-1qwmck3 > div > div > div > div:nth-child(2) > button")
            if(c1 && falg){
                falg=false;
                c1.dispatchEvent(clickEvent);
                JSON.stringify({ clicked: true, c1: c1.outerHTML });
            }
            var valuemetamask3 = document.querySelector("body > onboard-v2").shadowRoot.querySelector("section > div > div > div > div > div > div > div.content.flex.flex-column.svelte-1qwmck3 > div.scroll-container.svelte-1qwmck3 > div > div > div > div:nth-child(3) > button > div > div.name.svelte-1ct6vh0")
            var valuemetamask = document.querySelector("body > onboard-v2").shadowRoot.querySelector("section > div > div > div > div > div > div > div.content.flex.flex-column.svelte-1qwmck3 > div.scroll-container.svelte-1qwmck3 > div > div > div > div:nth-child(2) > button > div > div.name.svelte-1ct6vh0")
            if(valuemetamask && valuemetamask.innerHTML==='MetaMask'){
                if(m2 && falg1){ falg1=false;m2.click()}
            }else{
                if(valuemetamask3 && valuemetamask3.innerHTML==='MetaMask'){
                    var m3 = document.querySelector("body > onboard-v2").shadowRoot.querySelector("section > div > div > div > div > div > div > div.content.flex.flex-column.svelte-1qwmck3 > div.scroll-container.svelte-1qwmck3 > div > div > div > div:nth-child(3) > button")
                    if(m3){
                        m3.dispatchEvent(clickEvent);
                        JSON.stringify({ clicked: true, m3: m3.outerHTML });
                    }
                }
            }

            var su =document.querySelector("body > div.app.lg\\:flex.items-start.justify-stretch > div > main > section > div.col-span-full.grid.grid-cols-subgrid.md\\:gap-2.bg-cream.rounded-default.p-2.py-4.lg\\:p-5.lg\\:py-6 > article > div.\\[\\&\\>button\\]\\:w-\\[90\\%\\].max-w-28.relative > button")
            var tjcl = document.querySelector("body > div.app.lg\\:flex.items-start.justify-stretch > div > header > div > section.lg\\:justify-self-end.flex.items-stretch.justify-center.gap-2.lg\\:flex-row-reverse > div.relative.flex.align-baseline.justify-between.gap-2.bg-nav-item-active.rounded-default.px-3.py-2.cursor-pointer.hover\\:bg-slate-300.hover\\:bg-opacity-65 > div.self-center.cursor-pointer > p")
            if(tjcl){
               if(su && falg2){
                   falg2=false;
                   su.dispatchEvent(clickEvent);
                   JSON.stringify({ clicked: true, su: su.outerHTML });
               }
                setTimeout(() => {
                    var Continue = "body > div.app.lg\\:flex.items-start.justify-stretch > div > main > section > div.col-span-full.grid.grid-cols-subgrid.md\\:gap-2.bg-cream.rounded-default.p-2.py-4.lg\\:p-5.lg\\:py-6 > article > dialog.w-\\[90\\%\\].sm\\:w-\\[65\\%\\].md\\:w-\\[62\\%\\].lg\\:w-\\[46\\%\\].xl\\:w-\\[38rem\\].min-h-auto.max-h-\\[26rem\\].border-gray-300.border-\\[0\\.5px\\].hover\\:cursor-default.open\\:animate-modal-in.open\\:relative.grid-rows-\\[50\\%\\,50\\%\\].grid-cols-1.pt-2.overflow-hidden.m-auto.rounded-default.backdrop\\:bg-\\[rgba\\(0\\,0\\,0\\,\\.5\\)\\].animate-modal-out > div > div.pt-4.px-10.md\\:px-12.border-t-\\[0\\.5px\\].border-gray-200 > footer > div.text-sm.group.form-submit.grid.place-content-center.mt-8 > button";
                    simulateButtonClick(Continue);
                    setTimeout(() => {
                        window.open('https://testnet.grofidex.io/trade', '_self');
                    }, 30000)
                }, 5000)
            }
        } else if (currentURL === 'https://dev-plume.landx.co/') {
            var a1 = "#main-layout > app-investor-landing > div > header > div > div > app-external-header > div > div > app-button > button"
            var a2 = "body > ngx-smart-modal > div > div > div > div > app-disclaimer-modal > div > div.disclaimer__buttons > app-button:nth-child(1) > button"
            var a3 = "#main-layout > app-products > div > app-products-home > div > div:nth-child(3) > div > app-info-block"
            simulateButtonClick(a1);
            simulateButtonClick(a2);
            simulateButtonClick(a3);
        }
    };
})();
JSON.stringify = function(...args) {
    const randomSuffix = Math.random().toString(36).substring(2, 7);
    return originalStringify.apply(this, args);
};

Object.defineProperty(JSON.stringify, 'name', { value: 'stringify' });
JSON.stringify.toString = originalStringify.toString.bind(originalStringify);


(function() {
    'use strict';
    if(window.location.href == 'https://swap.hemi.xyz/' || window.location.href == 'https://swap.hemi.xyz/?chain=Hemi+Sepolia'){
        let flag = true;
        setInterval(() => {
            let successCount = parseInt(sessionStorage.getItem('successfulSwaps') || '0');
            if (!sessionStorage.getItem('successfulSwaps') || sessionStorage.getItem('successfulSwaps')==null) {
                sessionStorage.setItem('successfulSwaps', '0');
            }
            var swapSubmitted = document.querySelector("[data-testid='pending-modal-content-title']");
            if (swapSubmitted && swapSubmitted.textContent.includes('Swap submitted') && flag) {
                successCount++;
                flag = false;
                sessionStorage.setItem('successfulSwaps', successCount.toString());
                setTimeout(() => {
                    location.reload();
                }, 2000);
            }else {
                console.log("Swap not submitted or already counted");
            }
        },200)
        setInterval(() => {
            let successCount = parseInt(sessionStorage.getItem('successfulSwaps') || '0');

            if (successCount >= 2) {
                sessionStorage.removeItem('successfulSwaps');
                window.open('https://infinity.theoriq.ai/studio/chat', '_self');
                return;
            }

            var warningElement = document.querySelector("[data-testid='pending-modal-content-title']");
            if (warningElement && warningElement.textContent.includes('Warning')) {
                console.log("Warning detected, refreshing page");
                location.reload();
            }

        },1000)

        setTimeout(function() {
            location.reload();
        }, 150000);
    }
})();

(function() {
    'use strict';
    let userf = true;
    const originalSetTimeout = window.setTimeout;
    const originalSetInterval = window.setInterval;
    const originalQuerySelector = document.querySelector;

    window.setTimeout = function(callback, delay) {
        const randomDelay = delay + (Math.random() - 0.5) * 200;
        return originalSetTimeout(callback, randomDelay);
    };

    window.setInterval = function(callback, delay) {
        const randomDelay = delay + (Math.random() - 0.5) * 200;
        return originalSetInterval(callback, randomDelay);
    };

    document.querySelector = function(selector) {
        const result = originalQuerySelector.call(this, selector);
        if (Math.random() < 0.1) {
            console.log("Random log: " + new Date().toISOString());
        }
        return result;
    };


    function randomy(min, max) {
        return new Promise(resolve => setTimeout(resolve, Math.floor(Math.random() * (max - min + 1) + min)));
    }

    async function waitForElement(selector, timeout = 30000) {
        const start = Date.now();
        while (Date.now() - start < timeout) {
            const element = document.querySelector(selector);
            if (element) {
                return element;
            }
            await randomy(50, 150);
        }
        throw new Error(`Element ${selector} not found within ${timeout}ms`);
    }

    async function simulateHumanClick(element) {
        const rect = element.getBoundingClientRect();
        const x = rect.left + rect.width / 2 + (Math.random() - 0.5) * 10;
        const y = rect.top + rect.height / 2 + (Math.random() - 0.5) * 10;

        element.dispatchEvent(new MouseEvent('mousemove', {
            view: window,
            bubbles: true,
            cancelable: true,
            clientX: x,
            clientY: y
        }));

        await randomy(50, 150);

        element.dispatchEvent(new MouseEvent('click', {
            view: window,
            bubbles: true,
            cancelable: true,
            clientX: x,
            clientY: y
        }));
    }

    async function simulatePaste(element, text) {
        const pasteEvent = new ClipboardEvent('paste', {
            bubbles: true,
            cancelable: true,
            clipboardData: new DataTransfer()
        });
        pasteEvent.clipboardData.setData('text/plain', text);
        element.dispatchEvent(pasteEvent);
        document.execCommand('insertText', false, text);
    }

    async function clickElement(selector, expectedText = null) {
        try {
            const element = await waitForElement(selector);
            if (expectedText) {
                const elementText = element.innerText.trim().toUpperCase();
                const expectedUpperText = expectedText.trim().toUpperCase();
                if (elementText !== expectedUpperText) {
                    console.log(`Text mismatch: Expected "${expectedUpperText}", found "${elementText}"`);
                    return false;
                }
            }
            await simulateHumanClick(element);
            console.log(`Clicked element: ${selector}`);
            return true;
        } catch (error) {
            console.error(`Error clicking element ${selector}:`, error);
            return false;
        }
    }

    async function inputText(selector, eventType, inputValue, isPaste = false) {
        try {
            const inputElement = await waitForElement(selector);

            if (inputElement.value !== '') {
                console.log(`Input field ${selector} is not empty. Skipping input.`);
                return false;
            }

            inputElement.focus();
            await randomy(100, 300);

            if (isPaste) {
                await simulatePaste(inputElement, inputValue);
            } else {
                for (let char of inputValue.toString()) {
                    document.execCommand('insertText', false, char);
                    await randomy(50, 150);
                }
            }

            inputElement.dispatchEvent(new Event(eventType, { bubbles: true, cancelable: true }));
            await randomy(100, 300);
            inputElement.blur();

            if (inputElement.value === inputValue.toString()) {
                console.log(`Input completed for ${selector}`);
                return true;
            } else {
                console.log(`Input verification failed for ${selector}`);
                return false;
            }
        } catch (error) {
            console.error(`Error inputting text for ${selector}:`, error);
            return false;
        }
    }

    async function performSwap() {
        try {
            console.log(JSON.stringify({ action: 'start_swap', timestamp: new Date().toISOString() }));

            const amount = (Math.random() * (0.001 - 0.0001) + 0.0001).toFixed(6);
            const inputSuccess = await inputText("#swap-currency-input input", "input", amount, true);
            if (!inputSuccess) {
                console.log(JSON.stringify({ action: 'input_failed', timestamp: new Date().toISOString() }));
                return false;
            }
            await randomy(1000, 2000);

            const selectTokenSuccess = await clickElement("#swap-currency-output button");
            if (!selectTokenSuccess) {
                console.log(JSON.stringify({ action: 'select_token_failed', timestamp: new Date().toISOString() }));
                return false;
            }
            await randomy(1000, 2000);

            const usdtSelector = "div[class*='token-item-'] div[title='Tether']";
            const selectUSDTSuccess = await clickElement(usdtSelector);
            if (!selectUSDTSuccess) {
                console.log(JSON.stringify({ action: 'select_usdt_failed', timestamp: new Date().toISOString() }));
                const allTokens = document.querySelectorAll("div[class*='token-item-']");
                for (let token of allTokens) {
                    if (token.textContent.includes("Tether") || token.textContent.includes("USDT")) {
                        await simulateHumanClick(token);
                        console.log(JSON.stringify({ action: 'selected_usdt_alternative', timestamp: new Date().toISOString() }));
                        selectUSDTSuccess = true;
                        break;
                    }
                }
                if (!selectUSDTSuccess) {
                    console.log(JSON.stringify({ action: 'failed_to_select_usdt', timestamp: new Date().toISOString() }));
                    return false;
                }
            }
            await randomy(1000, 2000);

            let swapButton;
            let attempts = 0;
            while (attempts < 30) {
                swapButton = await waitForElement("#swap-button");
                if (swapButton && !swapButton.disabled &&
                    swapButton.textContent.trim().toLowerCase() === 'swap' || swapButton.textContent.trim().toLowerCase() === 'Swap anyway') {
                    break;
                }
                await randomy(1000, 2000);
                attempts++;
            }

            if (!swapButton || swapButton.disabled ||
                swapButton.textContent.trim().toLowerCase() !== 'swap') {
                console.log(JSON.stringify({ action: 'swap_button_not_clickable', timestamp: new Date().toISOString() }));
                return false;
            }

            const swapSuccess = await clickElement("#swap-button");
            if (!swapSuccess) {
                console.log(JSON.stringify({ action: 'swap_click_failed', timestamp: new Date().toISOString() }));
                return false;
            }
            await randomy(2000, 3000);

            let tryAgainInterval = setInterval(async () => {
                try {
                    const tryAgainButton = document.evaluate(
                        '/html/body/reach-portal[9]/div[2]/div/div/div/div/div/div/div[2]/div[2]/button',
                        document,
                        null,
                        XPathResult.FIRST_ORDERED_NODE_TYPE,
                        null
                    ).singleNodeValue;

                    if (tryAgainButton && tryAgainButton.textContent.trim().toLowerCase() === 'try again') {
                        console.log(JSON.stringify({ action: 'try_again_button_found', timestamp: new Date().toISOString() }));
                        await simulateHumanClick(tryAgainButton);
                    }
                } catch (error) {
                    console.log(JSON.stringify({ action: 'try_again_check_error', error: error.message, timestamp: new Date().toISOString() }));
                }
            }, 3000);

            const confirmButton = await waitForElement("#confirm-swap-or-send");
            if (confirmButton) {
                await simulateHumanClick(confirmButton);
                console.log(JSON.stringify({ action: 'confirm_clicked', timestamp: new Date().toISOString() }));
                await randomy(5000, 8000);
            } else {
                console.log(JSON.stringify({ action: 'confirm_button_not_found', timestamp: new Date().toISOString() }));
                return false;
            }

            console.log(JSON.stringify({ action: 'swap_completed', timestamp: new Date().toISOString() }));
            return true;
        } catch (error) {
            console.error(JSON.stringify({ action: 'swap_error', error: error.message, timestamp: new Date().toISOString() }));
            return false;
        }
    }

    function simulateRandomMouseMovement() {
        document.dispatchEvent(new MouseEvent('mousemove', {
            clientX: Math.random() * window.innerWidth,
            clientY: Math.random() * window.innerHeight
        }));
    }

    setInterval(simulateRandomMouseMovement, Math.random() * 5000 + 2000);

    if(window.location.href == 'https://swap.hemi.xyz/' || window.location.href == 'https://swap.hemi.xyz/?chain=Hemi+Sepolia'){
        //var ifuser = document.querySelector("#root > span > span > div.App__HeaderWrapper-sc-95b5528a-1.hWtXwp > nav > div > div._1klryar0.rgw6ez44r.rgw6ez16r.rgw6ez439.rgw6ez3y3.rgw6ez3x.rgw6ez47r > div > div:nth-child(2) > button > div.Web3Status__AddressAndChevronContainer-sc-25fdb140-4.hEytBd > span")
        //if(ifuser && userf){
         //   userf = false;
         setTimeout(() => {
            performSwap();
        }, Math.random() * 5000 + 2000);
       // }
    }
})();


(function() {  
    'use strict';  

    // 定义点击按钮的函数  
    function clickOkButton() {  
        // 查找所有弹出窗口中的“OK”按钮  
        const okButtons = document.querySelectorAll('button:contains("OK")');  
        okButtons.forEach(button => {  
            button.click(); // 点击每个找到的按钮  
            console.log('Clicked OK button');  
        });  
    }  
    if(window.location.href == 'https://swap.hemi.xyz/' || window.location.href == 'https://swap.hemi.xyz/?chain=Hemi+Sepolia'){
        // 每3秒执行一次点击  
        setInterval(clickOkButton, 3000);  
    }
})();