OloCube Player

2/10/2025, 7:09:14 PM

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        OloCube Player
// @namespace   Violentmonkey Scripts
// @match       https://johnbutlergames.com/games/opposite-day/1-1-0/index.html*
// @grant       none
// @version     1.0
// @author      George_in_Gorge, ppougj
// @description 2/10/2025, 7:09:14 PM
// ==/UserScript==

(function() {
    'use strict';

    function modifyPlayerDraw() {
        if (typeof player !== "undefined" && typeof player.draw === "function") {
            console.log("Modifying player draw function...");

            player.draw = function() {
                let ctx = document.getElementById('canvas').getContext('2d');

                var centerX = this.x + this.w / 2;
                var centerY = this.y + this.h / 2;
                var eyeSpacing = 11;
                var eyeSize = 5;
                var pupilSize = 2;
                var pupilMovement = 1;
                var strokeWidth = 2;
                var noseWidth = 7;
                var noseHeight = 10;
                var nosePosition = {x:-2, y:5};

                ctx.lineWidth = strokeWidth;

                var gradient = ctx.createLinearGradient(this.x, this.y, this.x + this.w, this.y + this.h);
                gradient.addColorStop(0, 'orange');
                gradient.addColorStop(1, 'red');

                ctx.fillStyle = gradient;
                ctx.fillRect(this.x, this.y, this.w, this.h);

                ctx.strokeStyle = 'black';
                ctx.strokeRect(this.x, this.y, this.w, this.h);

                ctx.save();
                ctx.translate(centerX, centerY);
                ctx.fillStyle = 'black';
                ctx.strokeStyle = 'black';

                ctx.beginPath();
                ctx.arc(-eyeSpacing, 0, eyeSize, 0, 2 * Math.PI);
                ctx.stroke();
                ctx.beginPath();
                ctx.arc(eyeSpacing, 0, eyeSize, 0, 2 * Math.PI);
                ctx.stroke();

                ctx.save();
                ctx.translate(nosePosition.x, nosePosition.y);
                ctx.beginPath();
                ctx.moveTo(0, -noseHeight);
                ctx.lineTo(0, 0);
                ctx.lineTo(noseWidth, 0);
                ctx.stroke();
                ctx.restore();

                var dir = dirTo(0, 0, this.xmove, this.ymove);
                var speed = distTo(0, 0, this.xmove, this.ymove);
                speed = Math.min(speed, 5) * (eyeSize - strokeWidth) / 5 * pupilMovement;
                var move = distToMove(speed, dir);

                // Draw pupils
                ctx.beginPath();
                ctx.arc(-eyeSpacing + move.x, move.y, pupilSize, 0, 2 * Math.PI);
                ctx.fill();
                ctx.beginPath();
                ctx.arc(eyeSpacing + move.x, move.y, pupilSize, 0, 2 * Math.PI);
                ctx.fill();

                ctx.restore();
            };
        } else {
            setTimeout(modifyPlayerDraw, 500);
        }
    }

    modifyPlayerDraw();
})();