Collab-VM Turnstile JS Extension

makes it so xtoys can see if you actually take a turn on collabvm via hacky webhook stuff. Special thanks to Elijahr. MODIFY THE USERSCRIPT TO CONTAIN YOUR PRIVATE WEBHOOK ID BEFORE USING

Tính đến 03-10-2024. Xem phiên bản mới nhất.

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

Bạn sẽ cần cài đặt một tiện ích mở rộng như Tampermonkey hoặc Violentmonkey để cài đặt kịch bản này.

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.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

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.

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

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

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

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

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

// ==UserScript==
// @name         Collab-VM Turnstile JS Extension
// @namespace    http://tampermonkey.net/
// @version      1
// @description  makes it so xtoys can see if you actually take a turn on collabvm via hacky webhook stuff. Special thanks to Elijahr. MODIFY THE USERSCRIPT TO CONTAIN YOUR PRIVATE WEBHOOK ID BEFORE USING
// @author       Wulf715, ElijahR.dev
// @match        https://computernewb.com/collab-vm/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=computernewb.com
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';
    let mo = new MutationObserver((mutationList, observer) => {
        for (const mutation of mutationList) if (mutation.type === "attributes" && mutation.attributeName === "style") {
            console.log("VM was opened or closed (probably lol)");
            let vm = window.collabvm.getVM();
            if (vm === null) return;
            window.hasTurn = false;
            vm.on('turn', () => {
                window.hasTurn = (vm.users.find(u => u.username === vm.username).turn === 0);
                if (window.hasTurn === true) {
                    fetch('https://webhook.xtoys.app/YourWebhookHere?action=startYouObeseFuck');
                }
                if (window.hasTurn === false) {
                    fetch('https://webhook.xtoys.app/YourWebhookHere?action=stop');
                }
            });
        }
    });
    mo.observe(document.getElementById("vmview"), {attributes: true});

})();