Merge++

Best and only free Farm Merge Valley script

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Merge++
// @namespace    http://tampermonkey.net/
// @version      2.16
// @description  Best and only free Farm Merge Valley script
// @author       vk.com/downcasted
// @match        *://*.discordsays.com/*
// @match        https://farm-merge-valley.game-files.crazygames.com/farm-merge-valley/*
// @icon         https://files.catbox.moe/d5dxaj.png
// @discord      https://discord.gg/PtF4maDP9D
// @license      GPL
// @grant        none
// ==/UserScript==

XMLHttpRequest.prototype.realSend = XMLHttpRequest.prototype.send
XMLHttpRequest.prototype.send = function(data) {
    this.addEventListener('readystatechange', function() {
        const url = this.responseURL
        if (url.includes("lucky_merge_config")) { // always lucky merge
            Object.defineProperty(this, "responseText", {writable: true})
            this.responseText = '{"CHANCE":100}';
        } else if(url.includes("crate_regeneration_config")) { // infinite crates
            Object.defineProperty(this, "responseText", {writable: true})
            this.responseText = '{"MAX_AMOUNT":100,"AMOUNT_PER_INTERVAL":100,"SPAWN_INTERVAL":1}'
        } else if(url.includes("energy_regeneration_config.json")) { // infinite energy
            this.responseText = '{"MAX_AMOUNT":100,"AMOUNT_PER_INTERVAL":100,"SPAWN_INTERVAL":1}'
        } else if (url.includes("marketplace_items_config")) { // Free shop
            Object.defineProperty(this, "responseText", {writable: true})
            const shop = JSON.parse(this.response)
            for (const item in shop['items']) {
                let itemrec = shop["items"][item]
                if (itemrec["payment"]["type"] == "iap") {
                    itemrec["payment"] = {"type": "inventory", "key": "gems", "amount": 0}
                } else {
                    itemrec["payment"]["amount"] = 0
                };
              if (itemrec["id"] == "energy_80") { // Replace 2nd energy offer with coins
                itemrec["reward"]["data"]["key"] = "coins"
                itemrec["reward"]["data"]["amount"] = 1200
              }
              else if (itemrec["id"] == "gems_3500") {
                itemrec["image"] = "bg_marketplace_fb_blackfriday03"
                itemrec["reward"]["data"]["key"] = "gems"
                itemrec["reward"]["data"]["amount"] = 3500
              }
            }
            this.responseText = JSON.stringify(shop)
        } else if(this.responseURL.includes("blueprints/base_")) {
            Object.defineProperty(this, "responseText", {writable: true})
            const components = JSON.parse(this.response)
            components["components"]["shovelable"] = {};
            this.responseText = JSON.stringify(components)
        };
    });
    this.realSend(data)
};