🗡️ Mobile Legends [ Web Event BOT ] MLBB Sora Battle Emote & Avatar Borders

me5050

Leecher
צילום מסך 2025-12-23 021843.webp

Semi automatic bot - Help in grinding.

how to use:
insert this code inside the F12 Dev Tool --> console -> copy the code and press enter.

To use the auto buy need to be in the catcher store page.
For selling all the item in "My Bag" you need to be inside My Bag and press "SELL ALL".


enjoy.

if you need more information about this event click here

JavaScript:
(function() {
    // 1. Cleanup
    if (document.getElementById('cloud-bot-gui')) document.getElementById('cloud-bot-gui').remove();

    // 2. Variables
    let isRunning = false;
    let isBuying = false;
    let isSelling = false;
    let botInterval = null;
    let buyInterval = null;
    let buyCounter = 0;
    let buyTarget = 0;

    // 3. GUI
    const gui = document.createElement('div');
    gui.id = 'cloud-bot-gui';
    gui.style.cssText = `
        position: fixed; top: 50px; left: 20px; width: 220px;
        background-color: rgba(5, 5, 10, 0.95); color: white;
        padding: 15px; border-radius: 8px; border: 2px solid #ff0000;
        font-family: Arial, sans-serif; z-index: 10000000;
        box-shadow: 0 0 15px rgba(255, 0, 0, 0.4);
        display: flex; flex-direction: column; gap: 10px;
    `;

    gui.innerHTML = `<div style="text-align:center; color:#ff0000; font-weight:bold;">☁️ BOT MLBB )</div>`;

    const statusBox = document.createElement('div');
    statusBox.innerText = "Status: Idle";
    statusBox.style.cssText = "font-size: 12px; color: #aaa; text-align: center;";
    gui.appendChild(statusBox);

    // --- SELL SECTION ---
    const sellDiv = document.createElement('div');
    sellDiv.style.cssText = "border-top: 1px solid #444; padding-top: 5px; display:flex; gap:5px;";
    
    const btnSellAll = document.createElement('button');
    btnSellAll.innerText = "💰 SELL ALL";
    btnSellAll.style.cssText = "flex:1; background:#6f42c1; color:white; border:none; padding:8px; font-weight:bold; cursor:pointer; border-radius:4px;";
    btnSellAll.onclick = startSelling;
    sellDiv.appendChild(btnSellAll);

    const btnStopSell = document.createElement('button');
    btnStopSell.innerText = "⏹";
    btnStopSell.style.cssText = "width:30px; background:#dc3545; color:white; border:none; padding:8px; cursor:pointer; border-radius:4px;";
    btnStopSell.onclick = stopSelling;
    sellDiv.appendChild(btnStopSell);
    gui.appendChild(sellDiv);

    // --- SHOP SECTION ---
    const shopDiv = document.createElement('div');
    shopDiv.style.cssText = "border-top: 1px solid #444; border-bottom: 1px solid #444; padding: 10px 0; display:flex; flex-direction:column; gap:5px;";
    
    const qtyRow = document.createElement('div');
    qtyRow.style.display = "flex";
    qtyRow.style.justifyContent = "space-between";
    qtyRow.style.alignItems = "center";
    qtyRow.innerHTML = `<span style="font-size:12px;">Buy Amount:</span>`;
    
    const inputQty = document.createElement('input');
    inputQty.type = "number";
    inputQty.value = 50;
    inputQty.style.cssText = "width:50px; text-align:center; background:#222; color:white; border:1px solid #555;";
    qtyRow.appendChild(inputQty);
    shopDiv.appendChild(qtyRow);

    const shopBtnRow = document.createElement('div');
    shopBtnRow.style.display = "flex";
    shopBtnRow.style.gap = "5px";

    const btnBuy = document.createElement('button');
    btnBuy.innerText = "🛒 Buy";
    btnBuy.style.cssText = "flex: 1; background:#ffc107; color:black; border:none; padding:5px; font-weight:bold; cursor:pointer; border-radius: 4px;";
    btnBuy.onclick = startBuying;
    shopBtnRow.appendChild(btnBuy);

    const btnStopBuy = document.createElement('button');
    btnStopBuy.innerText = "⏹";
    btnStopBuy.style.cssText = "width: 30px; background:#dc3545; color:white; border:none; padding:5px; font-weight:bold; cursor:pointer; border-radius: 4px;";
    btnStopBuy.onclick = stopBuying;
    shopBtnRow.appendChild(btnStopBuy);

    shopDiv.appendChild(shopBtnRow);
    gui.appendChild(shopDiv);

    // --- GAME CONTROL ---
    const btnRow = document.createElement('div');
    btnRow.style.display = "flex";
    btnRow.style.gap = "5px";

    const btnStart = document.createElement('button');
    btnStart.innerText = "▶ START GAME";
    btnStart.style.cssText = "flex:1; background:#28a745; color:white; border:none; padding:10px; border-radius:5px; cursor:pointer; font-weight:bold;";
    btnStart.onclick = startBot;

    const btnStop = document.createElement('button');
    btnStop.innerText = "⏹STOP";
    btnStop.style.cssText = "flex:1; background:#dc3545; color:white; border:none; padding:10px; border-radius:5px; cursor:pointer; font-weight:bold;";
    btnStop.onclick = stopBot;

    btnRow.appendChild(btnStart);
    btnRow.appendChild(btnStop);
    gui.appendChild(btnRow);

    document.body.appendChild(gui);

    // --- FUNCTIONS ---

    function updateStatus(text, color = "white") {
        statusBox.innerText = text;
        statusBox.style.color = color;
    }

    function aggressiveClick(el) {
        if (!el) return;
        let originalBorder = el.style.border;
        el.style.border = "3px solid #ff00ff";
        setTimeout(() => el.style.border = originalBorder, 150);
        const opts = {bubbles: true, cancelable: true, view: window};
        el.dispatchEvent(new MouseEvent('mousedown', opts));
        el.dispatchEvent(new MouseEvent('mouseup', opts));
        el.dispatchEvent(new MouseEvent('click', opts));
    }

    function findByText(str, tag = "*") {
        let xpath = `//${tag}[contains(text(), '${str}')]`;
        let res = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
        return res.singleNodeValue;
    }

    // --- SELLING ---
    async function startSelling() {
        if (isSelling) return;
        isSelling = true;
        updateStatus("Selling Items...", "#6f42c1");
        let items = Array.from(document.querySelectorAll('div[class*="item"][style*="opacity: 1"]'));
        if (items.length === 0) {
            updateStatus("Nothing to sell!", "red");
            isSelling = false;
            return;
        }
        updateStatus(`Found ${items.length} items...`, "cyan");
        for (let i = 0; i < items.length; i++) {
            if (!isSelling) break;
            let item = items[i];
            if (item.style.opacity === "0.5") continue;
            aggressiveClick(item);
            updateStatus(`Item ${i + 1}: Selected`, "yellow");
            await new Promise(r => setTimeout(r, 600));
            let mainSellBtn = findByText("Sell", "span");
            if (!mainSellBtn) {
                 let res = document.evaluate(`//button[contains(., 'Sell')]`, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
                 mainSellBtn = res.singleNodeValue;
            }
            if (mainSellBtn && mainSellBtn.offsetParent) {
                aggressiveClick(mainSellBtn);
                updateStatus(`Item ${i + 1}: Selling...`, "orange");
                await new Promise(r => setTimeout(r, 1000));
                let popupSellBtn = findByText("Sell", "div");
                if (!popupSellBtn || !popupSellBtn.offsetParent) {
                    let allSells = document.evaluate(`(//*[text()='Sell'])[last()]`, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
                    popupSellBtn = allSells.singleNodeValue;
                }
                if (popupSellBtn && popupSellBtn.offsetParent) {
                    aggressiveClick(popupSellBtn);
                    updateStatus(`Item ${i + 1}: Confirmed!`, "green");
                    await new Promise(r => setTimeout(r, 1000));
                }
            }
        }
        if (isSelling) {
            updateStatus("ALL SOLD!", "green");
            isSelling = false;
        }
    }

    function stopSelling() {
        isSelling = false;
        updateStatus("Selling Stopped.", "red");
    }

    // --- BUYING (800ms) ---
    function startBuying() {
        if (isBuying) return;
        buyTarget = parseInt(inputQty.value) || 50;
        buyCounter = 0;
        isBuying = true;
        updateStatus("Buying Mode...", "yellow");
        buyInterval = setInterval(() => {
            if (buyCounter >= buyTarget) {
                stopBuying();
                updateStatus("Purchase Complete.", "green");
                return;
            }
            let xpathPrice = `//span[text()='10']`;
            let resPrice = document.evaluate(xpathPrice, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
            let priceTextEl = resPrice.singleNodeValue;
            let priceBtn = priceTextEl ? priceTextEl.closest('button') : null;
            if (!priceBtn) priceBtn = priceTextEl;
            if (priceBtn && priceBtn.offsetParent) {
                aggressiveClick(priceBtn);
                buyCounter++;
                updateStatus(`Buying: ${buyCounter}/${buyTarget}`, "yellow");
            } else {
                updateStatus("Open the Shop!", "orange");
            }
        }, 800);
    }

    function stopBuying() {
        isBuying = false;
        if (buyInterval) clearInterval(buyInterval);
        updateStatus("Buying Stopped.", "white");
    }

    // --- GAME LOOP ---
    function checkLimit() {
        let limitMsg = findByText("reached the cloud capture limit");
        if (limitMsg) {
            stopBot(); stopSelling(); stopBuying();
            alert("⚠️ LIMIT REACHED!");
            return true;
        }
        return false;
    }

    function botLoop() {
        if (!isRunning) return;
        if (checkLimit()) return;

        // --- NEW LOGIC : Smart Filtering ---
        let xpath = `//span[contains(text(), 'Purchase Catcher')]`;
        let snapshot = document.evaluate(xpath, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
        
        for (let i = 0; i < snapshot.snapshotLength; i++) {
            let btn = snapshot.snapshotItem(i);
            if (btn && btn.offsetParent && !isBuying) {
                
                // 1. Check for the problematic class (the button you sent)
                let parentBtn = btn.closest('button');
                if (parentBtn && parentBtn.className.includes("select-catch-cloud-net-buy-btn")) {
                    // Ignore this specific button!
                    continue;
                }

                let rect = btn.getBoundingClientRect();
                let screenHeight = window.innerHeight;

                // 2. Ignore Top Banner (Top 150px)
                if (rect.top < 150) continue;

                // 3. Ignore Bottom Buttons (Bottom 150px)
                // This will filter out buttons at the bottom of the screen
                if (rect.top > (screenHeight - 150)) continue;

                // 4. If we are here -> It's the Real Popup (Middle of screen)
                console.log("Real Popup detected at Y:", rect.top);
                btn.style.border = "5px solid red";
                stopBot();
                updateStatus("OUT OF CATCHERS", "red");
                alert("Bot is stoping now, out of catchers,\n-- pick an amount and press BUY button\n- after done return to home screen and start the bot.");
                return;
            }
        }

        // Close Popups
        let congratsText = findByText("Congratulations!");
        if (congratsText && congratsText.offsetParent) {
            updateStatus("Closing Popup...", "orange");
            let allCloseButtons = document.querySelectorAll('img[alt="close"]');
            allCloseButtons.forEach(btn => {
                if (btn.offsetParent) aggressiveClick(btn);
            });
            return;
        }

        // Start Capture
        let startBtn = findByText("Start Capture");
        if (startBtn && startBtn.offsetParent) {
            updateStatus("Starting...", "#00d2ff");
            let firstItem = document.querySelector('div[class*="net-items"] > div') ||
                            document.querySelector('div[class*="item"][class*="type1"]');
            if (firstItem) aggressiveClick(firstItem);
            setTimeout(() => { if(isRunning) aggressiveClick(startBtn); }, 300);
            return;
        }

        // Collect Reward
        let openBtn = findByText("Tap to open");
        if (openBtn && openBtn.offsetParent) {
            updateStatus("Collecting $$", "#28a745");
            aggressiveClick(openBtn);
            return;
        }

        // Add Cloud Catcher
        let addBtn = document.getElementById("home_catch_cloud_add_text");
        if (!addBtn) addBtn = findByText("Tap to Add");

        if (addBtn && addBtn.offsetParent) {
            updateStatus("Adding Cloud...", "yellow");
            aggressiveClick(addBtn);
        } else {
            updateStatus("Scanning...", "#aaa");
        }
    }

    // --- MAIN ---
    function startBot() {
        if (isRunning) return;
        isRunning = true;
        updateStatus("Game Running...", "#28a745");
        btnStart.style.opacity = "0.5";
        btnStop.style.opacity = "1";
        botInterval = setInterval(botLoop, 400);
    }

    function stopBot() {
        isRunning = false;
        updateStatus("Game Stopped.", "red");
        btnStart.style.opacity = "1";
        btnStop.style.opacity = "0.5";
        if (botInterval) clearInterval(botInterval);
    }

})();
 

About this Thread

  • 8
    Replies
  • 719
    Views
  • 8
    Participants
Last reply from:
Pi Poy

Trending Topics

Online now

Members online
1,011
Guests online
1,984
Total visitors
2,995

Forum statistics

Threads
2,268,641
Posts
28,923,228
Members
1,243,003
Latest member
dardnd
Back
Top