0

Alrighty, so I have a simple enough tampermonkey script, It modifys the data of the game just by using buttons. Although when I tried to click the other buttons on the webpage none of them worked. The webpage in question is: Here. But as soon as I disable my script it works perfectly fine? Tampermonkey script below:

// ==UserScript==
// @name         New Userscript
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://mtsl.dk/csgo/
// @icon         https://www.google.com/s2/favicons?domain=freefrontend.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function duplicateinv(){
    };

    var btn1 = document.querySelector("#menu > div:nth-child(2) > button");
    if (btn1){
        btn1.addEventListener("click", duplicateinv(), false);
    }
    var elem = document.createElement('div')
    elem.innerHTML = '<div id="menu"><style>#menu{background-color: #fec5bb; color: #3A7CA5; border: 0px solid red; border-radius: 5px; margin: 10px; padding: 5px; position:fixed; bottom:0px; width:300px; height:120px;}</style> <div>Inventory Editor:<button>Edit Inventory</button></div><div>Autoclicker: <button>Auto Click</button></div></div>'
    document.body.innerHTML += elem.innerHTML
})();
Thornily
  • 386
  • 1
  • 9

0 Answers0