Options for arithmetic.zetamac.com

Set options for the game arithmetic.zetamac.com

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला 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         Options for arithmetic.zetamac.com
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Set options for the game arithmetic.zetamac.com
// @author       Anakojm
// @match        http*://arithmetic.zetamac.com/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=zetamac.com
// @grant        none
// @license      GPL
// ==/UserScript==

(function() {
    'use strict';
//--------------------------------------------------------------------
// These are the defaults, modify them to your liking
    let addition=true
    let additionLeftMin=2
    let additionLeftMax=100
    let additionRightMin=2
    let additionRightMax=100
    let substraction=true
    let multiplication=true
    let multiplicationLeftMin=2
    let multiplicationLeftMax=12
    let multiplicationRightMin=2
    let multiplicationRightMax=100
    let division=true
    let time=120
//--------------------------------------------------------------------

    document.getElementsByName("add").item(0).checked=addition;
    document.getElementById("add_left_min").value=additionLeftMin;
    document.getElementById("add_left_max").value=additionLeftMax;
    document.getElementById("add_right_min").value=additionRightMin;
    document.getElementById("add_right_max").value=additionRightMax;

    document.getElementsByName("sub").item(0).checked=substraction;

    document.getElementsByName("mul").item(0).checked=multiplication;
    document.getElementById("mul_left_min").value=multiplicationLeftMin;
    document.getElementById("mul_left_max").value=multiplicationLeftMax;
    document.getElementById("mul_right_min").value=multiplicationRightMin;
    document.getElementById("mul_right_max").value=multiplicationRightMax;

    document.getElementsByName("div").item(0).checked=division;
    // Compatibility with https://greasyfork.org/en/scripts/447512-custom-time-for-arithmetic-zetamac-com
    if (document.querySelector("div#welcome form.game-options p input")){
    document.getElementsByName("duration").item(0).value=time;
    } else{
    document.getElementsByTagName("option").item(0).remove();
    document.getElementsByTagName("option").item(0).remove();
    document.getElementsByTagName("option").item(1).remove();
    document.getElementsByTagName("option").item(1).remove();
    document.getElementsByTagName("option").item(0).value=time;
    document.getElementsByTagName("option").item(0).text=time+" seconds";
    }
})();