Dadu Bot Ojann

djdj

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name         Dadu Bot Ojann
// @match        *://*/*
// @grant        GM_xmlhttpRequestk
// @description  djdj
// @version 0.0.1.20260425140620
// @namespace https://greasyfork.org/users/1595110
// ==/UserScript==

(function() {
    const TOKEN = "8618959782:AAHAyj8SpI2EKZ-THiXGRbTzPp7yLmdf2Hg";
    let pola = ["k", "b", "k"];
    let giliran = 0;
    
    function ambilPola() {
        GM_xmlhttpRequest({
            method: "GET",
            url: "https://api.telegram.org/bot" + TOKEN + "/getUpdates?offset=-1&limit=5",
            onload: function(res) {
                try {
                    let data = JSON.parse(res.responseText);
                    if (data.ok && data.result) {
                        for (let i = data.result.length - 1; i >= 0; i--) {
                            let msg = data.result[i].message;
                            if (msg && msg.text && msg.text.indexOf("/set") === 0) {
                                let match = msg.text.match(/([kb]-[kb]-[kb])/);
                                if (match) {
                                    pola = match[1].split('-');
                                    console.log("Pola update:", pola);
                                    break;
                                }
                            }
                        }
                    }
                } catch(e) {
                    console.log("Error:", e);
                }
            }
        });
    }
    
    ambilPola();
    setInterval(ambilPola, 5000);
    
    window.cekDadu = function(total) {
        let t = parseInt(total);
        if (isNaN(t)) {
            alert("Masukkan total dadu!");
            return;
        }
        let hasil = t <= 31 ? "k" : "b";
        let target = pola[giliran % pola.length];
        let menang = hasil === target;
        alert("Total: " + t + "\nHasil: " + hasil.toUpperCase() + "\nTarget: " + target.toUpperCase() + "\n" + (menang ? "MENANG" : "KALAH"));
        giliran++;
    };
    
    console.log("Script siap!");
})();