TrixBox

Embeds the TrixBox chat for territorial.io and FXclient.

11.11.2025 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         TrixBox
// @namespace    http://tampermonkey.net/
// @version      0.0.1
// @description  Embeds the TrixBox chat for territorial.io and FXclient.
// @author       Painsel
// @match        https://territorial.io/*
// @match        https://fxclient.github.io/FXclient/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // 1. Append the main chat library to the <head> of the page.
    const chatLibraryScript = document.createElement('script');
    chatLibraryScript.src = 'https://iframe.chat/scripts/main.min.js';
    document.head.appendChild(chatLibraryScript);

    // 2. Create and append the chatbox iframe to the <body>.
    const chatIframe = document.createElement('iframe');
    chatIframe.src = 'https://iframe.chat/embed?chat=15234533';
    chatIframe.id = 'chattable';

    // Basic styling to make the chatbox a floating element in the corner.
    // You can adjust these values as needed.
    chatIframe.style.position = 'fixed';
    chatIframe.style.bottom = '15px';
    chatIframe.style.right = '15px';
    chatIframe.style.width = '350px';
    chatIframe.style.height = '500px';
    chatIframe.style.border = '1px solid #cccccc';
    chatIframe.style.borderRadius = '8px';
    chatIframe.style.boxShadow = '0 2px 10px rgba(0,0,0,0.2)';
    chatIframe.style.zIndex = '99999'; // High z-index to appear over other elements

    document.body.appendChild(chatIframe);

    // 3. Initialize the chat once the main library has loaded.
    // This ensures that the 'chattable' object is available before we try to use it.
    chatLibraryScript.onload = function() {
        const initializationScript = document.createElement('script');
        // Since no chattable.css file was provided, we call initialize without parameters.
        initializationScript.textContent = 'chattable.initialize({});';
        document.body.appendChild(initializationScript);
    };
})();