Fake bot Change Villa

Change villa every iteration

Pada tanggal 21 Januari 2025. Lihat %(latest_version_link).

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Fake bot Change Villa
// @version      1.35
// @description  Change villa every iteration
// @include      https://*/game.php*screen=place*
// @namespace https://greasyfork.org/users/1388863
// ==/UserScript==

(function() {
    'use strict';

    // Create UI container
    const container = document.createElement('div');
    container.style.position = 'fixed';
    container.style.bottom = '20px';
    container.style.right = '20px';
    container.style.backgroundColor = '#333';
    container.style.color = '#fff';
    container.style.padding = '10px';
    container.style.borderRadius = '5px';
    container.style.zIndex = '10000';
    container.style.boxShadow = '0 4px 8px rgba(0, 0, 0, 0.2)';
    container.style.display = 'flex';
    container.style.flexDirection = 'column';
    container.style.gap = '10px';
    document.body.appendChild(container);

    // Remaining loops display
    const loopCounterDisplay = document.createElement('div');
    loopCounterDisplay.style.fontSize = '16px';
    loopCounterDisplay.style.textAlign = 'center';
    loopCounterDisplay.textContent = 'Remaining Loops: 0';
    container.appendChild(loopCounterDisplay);

    // Start/Stop button
    const startStopButton = document.createElement('button');
    startStopButton.textContent = 'Start';
    startStopButton.style.padding = '5px';
    startStopButton.style.fontSize = '16px';
    startStopButton.style.backgroundColor = '#4CAF50';
    startStopButton.style.color = '#fff';
    startStopButton.style.border = 'none';
    startStopButton.style.borderRadius = '3px';
    startStopButton.style.cursor = 'pointer';
    startStopButton.style.width = '100%';
    container.appendChild(startStopButton);

    // Set Loops button
    const loopButton = document.createElement('button');
    loopButton.textContent = 'Set Loops';
    loopButton.style.padding = '5px';
    loopButton.style.fontSize = '16px';
    loopButton.style.backgroundColor = '#FF9800';
    loopButton.style.color = '#fff';
    loopButton.style.border = 'none';
    loopButton.style.borderRadius = '3px';
    loopButton.style.cursor = 'pointer';
    loopButton.style.width = '100%';
    container.appendChild(loopButton);

    // Retrieve the last state from localStorage
    let isRunning = localStorage.getItem('botState') === 'running';
    let remainingLoops = parseFloat(localStorage.getItem('remainingLoops')) || 0;

    // Set initial button and loop counter state
    startStopButton.textContent = isRunning ? 'Stop' : 'Start';
    loopCounterDisplay.textContent = `Remaining Loops: ${remainingLoops}`;

    // Start the bot if it was running
    if (isRunning) {
        startBot();
    }

    // Start/Stop button event
    startStopButton.addEventListener('click', () => {
        if (isRunning) {
            stopBot();
        } else {
            startBot();
        }
    });

    // Loop button event
    loopButton.addEventListener('click', () => {
        const loopsInput = parseInt(prompt("Enter the number of loops to run:", remainingLoops), 10);
        if (!isNaN(loopsInput) && loopsInput > 0) {
            remainingLoops = loopsInput;
            localStorage.setItem('remainingLoops', remainingLoops);
            loopCounterDisplay.textContent = `Remaining Loops: ${remainingLoops}`;
            console.log(`Set loops to: ${remainingLoops}`);
        }
    });

    function startBot() {
        isRunning = true;
        localStorage.setItem('botState', 'running');
        startStopButton.textContent = 'Stop';
        startStopButton.style.backgroundColor = '#FF0000';
        console.log("Bot started");
        loopCounterDisplay.textContent = `Remaining Loops: ${remainingLoops}`;
        runBotLoop();
    }

    function stopBot() {
        isRunning = false;
        localStorage.setItem('botState', 'stopped');
        startStopButton.textContent = 'Start';
        startStopButton.style.backgroundColor = '#4CAF50';
        console.log("Bot stopped");
    }

    function runBotLoop() {
        if (remainingLoops > 0) {
            console.log("Executing loop...");
            remainingLoops--;
            localStorage.setItem('remainingLoops', remainingLoops);
            loopCounterDisplay.textContent = `Remaining Loops: ${remainingLoops}`;
            if (remainingLoops > 0) {
                setTimeout(runBotLoop, 2000); // Example delay
            } else {
                stopBot();
            }
        }
    }
})();