Talkomatic Camera

You can show you camera (Made By AI)

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

// ==UserScript==
// @name         Talkomatic Camera
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  You can show you camera (Made By AI)
// @author       Boo scren of def
// @match        https://classic.talkomatic.co/room.html*
// @grant        none
// @license      Open source anyone can edited it lol
// ==/UserScript==
console.log('🍈Talkomatic Camera by Boo screen Of def loaded.');const you='...';(function(){'use strict';const uid=you,dots=[1,8,2,16,4,32,64,128],getChar=b=>String.fromCharCode(0x2800+b),ctx=document.createElement('canvas').getContext('2d'),video=Object.assign(document.createElement('video'),{autoplay:!0,playsInline:!0,style:'display:none'});document.body.append(video,ctx.canvas);const f={state:!0};setInterval(()=>f.state=!f.state,250);let r=!1,i=null;const b=document.createElement('button');Object.assign(b.style,{position:'fixed',bottom:'10px',right:'10px',zIndex:9999,fontSize:'14px',padding:'6px 14px',background:'#222',color:'#fff',border:'1px solid orange',borderRadius:'4px',cursor:'pointer'});b.textContent='🟢 Start Camera';b.onclick=()=>{r=!r,r?(console.log(),b.textContent='💫 Loading Camera Feed...',navigator.mediaDevices.getUserMedia({video:{width:270,height:140}}).then(s=>{video.srcObject=video.srcObject||s,b.textContent='🔴Stop Camera',i=setInterval(()=>{const u=document.querySelectorAll('.chat-row').length,w=u>=5?237:270,h=u>=5?111:140;ctx.canvas.width=w,ctx.canvas.height=h;if(video.readyState<2)return;ctx.drawImage(video,0,0,w,h);const d=ctx.getImageData(0,0,w,h).data,g=new Float32Array(w*h);for(let j=0;j<w*h;j++){const R=d[4*j],G=d[4*j+1],B=d[4*j+2];g[j]=.3*R+.59*G+.11*B}for(let y=0;y<h;y++)for(let x=0;x<w;x++){const j=y*w+x,o=g[j],n=o<128?0:255,e=o-n;g[j]=n,x+1<w&&(g[j+1]+=e*7/16),x>0&&y+1<h&&(g[j+w-1]+=e*3/16),y+1<h&&(g[j+w]+=e*5/16),x+1<w&&y+1<h&&(g[j+w+1]+=e*1/16)}let out='';for(let y=0;y<h;y+=4){for(let x=0;x<w;x+=2){let bits=0;for(let dy=0;dy<4;dy++)for(let dx=0;dx<2;dx++){const px=x+dx,py=y+dy;if(px<w&&py<h&&g[py*w+px]>127)bits|=dots[dy*2+dx]}out+=bits?getChar(bits):'⠀'}out+='\n'}const m=`${f.state?'🔴':'⭕'}|| Live Camera, Zoom out to 25% (Not work on mobile devices...)\n`+out,input=document.querySelector(`.chat-row[data-user-id="${uid}"] .chat-input`);if(input){if('textContent'in input)input.textContent=m;if('value'in input)input.value=m;input.dispatchEvent(new Event('input'));typeof updateSentMessage=='function'&&updateSentMessage()}typeof socket!='undefined'&&socket.emit&&(console.log(),socket.emit('text',{text:m}))},100)}).catch(e=>console.warn('[⚠️] Camera error:',e))):(console.log(),clearInterval(i),i=null,video.srcObject&&(video.srcObject.getTracks().forEach(t=>t.stop()),video.srcObject=null),console.log(),(()=>{const input=document.querySelector(`.chat-row[data-user-id="${uid}"] .chat-input`);if(input){if('textContent'in input)input.textContent='';if('value'in input)input.value='';input.dispatchEvent(new Event('input'));typeof updateSentMessage=='function'&&updateSentMessage()}})(),b.textContent='🟢 Start Camera')};window.addEventListener('load',()=>document.body.append(b));})();
                                                               //          /\ put your user id here or it
                                                               //             wont work! you can get your
                                                               //             user id by running the
                                                               //             following command in the
                                                               //             talkomatic browser console:
                                                               //             console.log('Your ID is',document.activeElement.closest('.chat-row')?.dataset?.userId);

QingJ © 2025

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