OWoT online and offline

Tells if someone goes online or offline (if they have this script).

目前为 2023-01-19 提交的版本。查看 最新版本

// ==UserScript==
// @name         OWoT online and offline
// @namespace    http://tampermonkey.net/
// @version      1
// @description  Tells if someone goes online or offline (if they have this script).
// @author       e_g.
// @match        https://ourworldoftext.com/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// ==/UserScript==

w.broadcastReceive(true);
w.on('cmd', function(e){
    if(e.data.startsWith('online')){
        addChat(0, 0, 0, e.username, e.username + " is online!");
    }
    else if(e.data.startsWith('offline')){
        addChat(0, 0, 0, e.username, e.username + " is now offline.");
    };
});

setTimeout(function(){
    w.broadcastCommand('online', true);
}, 1000);

window.addEventListener('beforeunload', function(){
    w.broadcastCommand('offline', true)
});

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址