// ==UserScript==
// @name Merge++
// @namespace http://tampermonkey.net/
// @version last
// @description Best and only free Farm Merge Valley script
// @author vk.com/downcasted
// @match *://*.discordsays.com/*
// @icon https://files.catbox.moe/d5dxaj.png
// @license GPL
// @grant none
// ==/UserScript==
console.log("Script loaded, probably!");
XMLHttpRequest.prototype.realSend = XMLHttpRequest.prototype.send
XMLHttpRequest.prototype.send = function(data) {
this.addEventListener('readystatechange', function() {
console.log(this.responseURL)
if (this.responseURL.includes("lucky_merge_config.json")) { // always lucky merge
Object.defineProperty(this, "responseText", {writable: true})
this.responseText = '{"CHANCE":100}';
} else if(this.responseURL.includes("crate_regeneration_config")) { // infinite crates
Object.defineProperty(this, "responseText", {writable: true})
this.responseText = '{"MAX_AMOUNT":100,"AMOUNT_PER_INTERVAL":40,"SPAWN_INTERVAL":1}'
} else if(this.responseURL.includes("energy_regeneration_config.json")) { // infinite energy
this.responseText = '{"MAX_AMOUNT":100,"AMOUNT_PER_INTERVAL":100,"SPAWN_INTERVAL":1}'
} else if(this.responseURL.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") { // Makes real money items cost gems
itemrec["payment"] = {"type": "inventory", "key": "gems", "amount": 0}
} else { // Makes everything free
itemrec["payment"]["amount"] = 0
};
if (itemrec["renewable"]) { // insta free gems / energy /crates
itemrec["renewable"]["duration"] = 0
};
if (itemrec["id"] == "gems_extra_small") { // Replaces the gem offer under the free one with a crate
const rarities = [
"bronze",
"silver",
"gold",
]
const crates = []
for (let i = 0; i < 3; i++) {
crates.push(`reward_crate_${rarities[i]}`)
crates.push(`reward_crate_key_${rarities[i]}`)
crates.push(`reward_crate_key_${rarities[i]}`)
}
itemrec["image"] = "bg_marketplace_fb_blackfriday03"
itemrec["reward"] = {
"type":"object",
"data": crates
}
} else if (itemrec["id"] == "crates_001") { // Replace huge gem offer with halloween shit
itemrec["image"] = "bg_marketplace_halloween01"
itemrec["reward"] = {
"type": "object",
"data": [
"decorative_halloween_blackcat",
"decorative_halloween_cauldron",
"decorative_halloween_ghosts",
"decorative_halloween_grandfatherclock",
"decorative_halloween_grave01",
"decorative_halloween_grave02",
"decorative_halloween_graveyard",
"decorative_halloween_hauntedhouse",
"decorative_halloween_pumpkinpatchbig",
"decorative_halloween_pumpkins01",
"decorative_halloween_pumpkins02",
"decorative_halloween_pumpkins03",
"decorative_halloween_pumpkins04",
"decorative_halloween_skeletonbench",
"decorative_halloween_skeletoncarousel",
"decorative_halloween_skeletonpicnic",
"decorative_halloween_skullaltar",
"decorative_halloween_treeface",
"decorative_halloween_well"
]
}
} else if (itemrec["id"] == "crates_003") {
itemrec["image"] = "bg_marketplace_christmas02"
itemrec["reward"] = {
"type": "object",
"data": [
"decorative_christmas_candygate",
"decorative_christmas_elfmail",
"decorative_christmas_elfteddy",
"decorative_christmas_elftrain",
"decorative_christmas_fireplace",
"decorative_christmas_gift01",
"decorative_christmas_gift02",
"decorative_christmas_gift03",
"decorative_christmas_gingerbell",
"decorative_christmas_gingerbreadhouse",
"decorative_christmas_gingerbreadhousesmall",
"decorative_christmas_gingerbreadsnow",
"decorative_christmas_nutcracker",
"decorative_christmas_santagift",
"decorative_christmas_santamail",
"decorative_christmas_sleigh",
"decorative_christmas_snowcaroling",
"decorative_christmas_snowdinner",
"decorative_christmas_snowfight",
"decorative_christmas_snowgifting",
"decorative_christmas_snowglobe",
"decorative_christmas_snowjello",
"decorative_christmas_snowlantern",
"decorative_christmas_snowreindeer",
"decorative_christmas_snowtelescope",
"decorative_christmas_treebig",
]
}
} else if (itemrec["id"] == "crates_004") {
itemrec["reward"] = {
"type": "object",
"data": [
"decorative_barn",
"decorative_birdshouse",
"decorative_chickencoop",
"decorative_doghouse",
"decorative_farmhouse",
"decorative_feedingtrough",
"decorative_flowerpots",
"decorative_fountain",
"decorative_haywagon",
"decorative_lamppost",
"decorative_milktank",
"decorative_picknicktable",
"decorative_shed",
"decorative_silo",
"decorative_stoneflowerpot",
"decorative_toilet",
"decorative_watertower",
"decorative_well",
"decorative_windmill",
"flower_1",
"flower_2",
"flower_3",
"flower_5",
"flower_4",
"flower_6",
"flower_7",
"flower_8",
"flower_9",
"flower_10",
"greenhouse"
]
}
} else if(itemrec["id"] == "gems_small") {
const tools = []
for (let i = 0; i < 10; i++) {
tools.push(`tool_${i+1}`)
tools.push(`tool_${i+1}`)
tools.push(`tool_${i+1}`)
}
itemrec["reward"] = {
"type": "object",
"data": tools
}
} else if(itemrec["id"] == "gems_large") {
const gems = []
for (let i = 0; i < 100; i++) {
gems.push("gem_6")
}
itemrec["reward"] = {
"type": "object",
"data": gems
}
} else if(itemrec["id"] == "energy_003") {
itemrec["image"] = "bg_marketplace_gems02"
itemrec["reward"] = {
"type": "inventory",
"data": {
"key": "gems",
"amount": 1000
}
}
} else if(itemrec["id"] == "energy_004") {
itemrec["reward"]["data"]["amount"] = 100
} else if(itemrec["id"] == "energy_001") {
itemrec["reward"] = {
"type": "inventory",
"data": {
"key": "coins",
"amount": 10000
}
}
}
};
this.responseText = JSON.stringify(shop)
} else if(this.responseURL.includes("localization.json")) {
Object.defineProperty(this, "responseText", {writable: true});
const local = JSON.parse(this.response);
local["market_place_popup_header"]["en_US"] = "✦ xin's shop ✦";
local["crates"]["en_US"] = "Decorations";
local["marketplace_crates_banner"]["en_US"] = "EVERY HALLOWEEN DECO"
local["energy"]["en_US"] = "Resources"
local["marketplace_energy_banner"]["en_US"] = "10000 COINS"
local["gems"]["en_US"] = "Misc / Chests"
local["marketplace_gems_banner"]["en_US"] = "100 LEVEL 6 GEMS"
this.responseText = JSON.stringify(local)
}
});
this.realSend(data)
};