Talkomatic Tooltips

Advanced talkomatic thingies

当前为 2025-06-23 提交的版本,查看 最新版本

// ==UserScript==
// @name         Talkomatic Tooltips
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Advanced talkomatic thingies
// @match        https://classic.talkomatic.co/room.html?roomId=*
// @match        https://dev.talkomatic.co/room.html?roomId=*
// @grant        none
// @run-at       document-start
// @license      MIT
// ==/UserScript==

function startAntiAfkLoop(){console.log("Initalize Anti AFK loop..."),"undefined"!=typeof socket?(console.log("Run the AFK script..."),setInterval((()=>{socket.emit("anti-afk",{author:"Made by Boo screen of def"})}),5e3)):console.warn("Failure to start Anti AFK script, Uh oh")}!function(){"use strict";function e(e="16px",t="10px"){let n=document.getElementById("socketStatusLabel");n||(n=document.createElement("div"),n.id="socketStatusLabel",n.style.position="fixed",n.style.left="10px",n.style.zIndex="9999",n.style.fontStyle="italic",n.style.fontFamily="Arial, sans-serif",n.style.color="white",n.innerHTML='🔌Socket status: <span id="socketStatusValue" style="color:red;">disconnected</span>',document.body.appendChild(n)),n.style.fontSize=e,n.style.bottom=t}function t(){const t=document.querySelector('label[for="bg-upload-button"]');if(t){e("16px",`${(t.offsetHeight?t.offsetHeight+6:28)+8}px`)}else e("16px","10px")}function n(){const e=document.getElementById("socketStatusValue");e&&"object"==typeof socket&&(e.textContent=socket.connected?"connected":"disconnected",e.style.color=socket.connected?"limegreen":"red")}function o(){document.querySelectorAll(".chat-input-wrapper").forEach((e=>{const t=e.querySelector(".chat-input"),n=e.closest(".chat-row"),o=n?.dataset.userId||"unknown";let a=e.querySelector(".info-bar");a||(a=document.createElement("div"),a.className="info-bar",e.appendChild(a)),Object.assign(a.style,{position:"absolute",bottom:"4px",left:"50%",transform:"translateX(-50%)",display:"flex",alignItems:"center",gap:"8px",fontSize:"14px",fontFamily:"monospace",color:"white",background:"rgba(0, 0, 0, 0.6)",padding:"4px 8px",borderRadius:"6px",zIndex:"5",textShadow:"black 0 0 3px, black 0 0 6px"});let l=a.querySelector(".char-counter-label");if(!l){l=document.createElement("span"),l.className="char-counter-label";const e=document.createElement("span");e.className="length-span",l.appendChild(e),l.append(" |"),a.appendChild(l)}const c=l.querySelector(".length-span");let s=t?.textContent?.length||0;t?.querySelectorAll("img[alt]")?.forEach((e=>s+=e.alt.length)),c.textContent=`${s} / ${MAX_MESSAGE_LENGTH}`,c.style.color=s>MAX_MESSAGE_LENGTH-1?"#ffabab":"#ffffff";let i=a.querySelector(".user-id-box");if(!i){i=document.createElement("span"),i.className="user-id-box",i.style.display="flex",i.style.alignItems="center",i.style.gap="4px";const e=document.createElement("span");e.className="user-id-label",e.textContent=`ID: ${o}`;const t=document.createElement("button");t.textContent="📋Copy",t.title="Copy User ID",Object.assign(t.style,{fontSize:"12px",padding:"2px 6px",background:"rgb(34,34,34)",color:"white",border:"1px solid orange",borderRadius:"4px",cursor:"pointer"}),t.onclick=()=>{navigator.clipboard.writeText(o).then((()=>{t.textContent="✅Copied",setTimeout((()=>t.textContent="📋Copy"),1e3)}))},i.appendChild(e),i.appendChild(t),a.appendChild(i)}}))}window.addEventListener("load",(()=>{t(),n(),setInterval(n,100),setInterval(t,5e3),setInterval(o,50)}))}(),function(){"use strict";const e=window.setInterval,t=[];function n(){const e=document.querySelector("#dateTime");if(!e)return;const t=e.querySelector(".date"),n=e.querySelector(".time");t&&(t.textContent=function(){const e=new Date,t=e.getDate(),n=(o=t)>=11&&o<=13?"th":["st","nd","rd"][o%10-1]||"th";var o;return`📅${e.toLocaleDateString(void 0,{weekday:"long"})} ${t}${n} ${e.toLocaleDateString(void 0,{month:"long"})} ${e.getFullYear()}📅`}()),n&&(n.textContent=function(){const e=new Date,t=e=>String(e).padStart(2,"0");return`⌚${t(e.getHours())}:${t(e.getMinutes())}:${t(e.getSeconds())} / ${e.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0}).toLowerCase()}⌚`}())}window.setInterval=function(n,o,...a){const l=n.toString();if(l.includes("toLocaleTimeString")||l.includes("updateDateTime"))return console.log("🛑 Blocked original updateDateTime interval"),-1;const c=e(n,o,...a);return t.push({id:c,fnText:l}),c},window.addEventListener("DOMContentLoaded",(()=>{n(),startAntiAfkLoop(),setInterval(n,1e3)}))}();