Commodore Clicker Exploit

An exploit that will add useful features!

2021-03-29 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Commodore Clicker Exploit
// @namespace    https://waa.ai/spinpy
// @version      1.3
// @description  An exploit that will add useful features!
// @author       Spinfal
// @match        http://c64clicker.com/
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const spin = document.createElement('p'); // if you steal my code and change it, youre a big poopie head and no one likes you.
    spin.innerHTML = '<br><img src="https://www.google.com/s2/favicons?domain=www.spinfal.ga" draggable="false"> Exploit made by <a href="https://waa.ai/spinpy" target="_blank">Spin, aka Spinfal <3</a>';
    document.getElementsByClassName('foot')[0].appendChild(spin);

    function setPrice() {
        if (localStorage.getItem('c64click.units.0.currPrice') === '16' || localStorage.getItem('ran') === null) {
            for (let i=0; i < 9; i++) {
                console.log(`${i} set to 0`);
                localStorage.setItem(`c64click.units.${i}.currPrice`, 0);
            }
            localStorage.setItem('ran', true);
            window.location.reload();
        }
    }
    setPrice();

    function loadButtons() {
        const mod = document.createElement('li'); // change pixel amount
        mod.innerHTML = '<img src="https://www.google.com/s2/favicons?domain=www.spinfal.ga" draggable="false"> Change pixel count';
        mod.setAttribute('onclick', "let amount = prompt('new amount'); if (isNaN(parseInt(amount))) { alert('that wasnt a number!'); } else { localStorage.setItem('c64click.bank', parseInt(amount)); localStorage.setItem('c64click.produced', parseInt(amount)); window.location.reload(); }");
        mod.setAttribute('id', 'option2');
        mod.setAttribute('class', 'active');
        document.getElementsByTagName('ul')[3].append(mod);

        const cps = document.createElement('li'); // change cps amount
        cps.innerHTML = '<img src="https://www.google.com/s2/favicons?domain=www.spinfal.ga" draggable="false"> Change cps count';
        cps.setAttribute('onclick', "let amount = prompt('new amount'); if (isNaN(parseInt(amount))) { alert('that wasnt a number!'); } else { localStorage.setItem('c64click.cps', parseInt(amount)); window.location.reload(); }");
        cps.setAttribute('id', 'option3');
        cps.setAttribute('class', 'active');
        document.getElementsByTagName('ul')[3].append(cps);

        const power = document.createElement('li'); // change click power
        power.innerHTML = '<img src="https://www.google.com/s2/favicons?domain=www.spinfal.ga" draggable="false"> Change click power';
        power.setAttribute('onclick', "let amount = prompt('new amount'); if (isNaN(parseInt(amount))) { alert('that wasnt a number!'); } else { localStorage.setItem('c64click.clickPower', parseInt(amount)); window.location.reload(); }");
        power.setAttribute('id', 'option4');
        power.setAttribute('class', 'active');
        document.getElementsByTagName('ul')[3].append(power);
    }
    setTimeout(function() { loadButtons(); }, 300);

    setTimeout(function() { document.getElementById('reset').addEventListener('click', setPrice()); }, 6000); // hard reset detection - doesnt seem to work
})();