// ==UserScript== // @name WTFHELP // @namespace http://tampermonkey.net/ // @version 1.0.1 // @description 一个WTFgame辅助脚本引擎 // @author EC // @match https://game.elfive.cn:91/wtfgame/ // @match http://154.211.15.42:9191/wtfgame/ // @match http://160.202.232.88:43943/ // @icon https://www.google.com/s2/favicons?sz=64&domain=elfive.cn // @icon https://www.google.com/s2/favicons?sz=64&domain=154.211.15.42 // @icon https://www.google.com/s2/favicons?sz=64&domain=160.202.232.88 // @grant none // ==/UserScript== (function() { var hook = window.WebSocket; var ws,a="",e="[]",c="flase"; window.WebSocket = function(protocols) { //非必要情况下勿改 ws = new hook(protocols); var hooksend = ws.send; ws.send = function(data){ hooksend.call(ws, data); }; ws.addEventListener('message', function(event) { return }); ws.addEventListener('open', function(event) { return }); ws.addEventListener('close', function(event) { document.write("断开连接") }); return ws; }; let box = document.createElement('div'); box.id = "1"; box.style.left="0px" box.style.top="0px" box.style.position="fixed" box.style['z-index']="999999" //html定义按钮 x间距30 box.innerHTML =` ` box.onclick=function(event){ if(event.target.id=="001"){ //输出换房指令 var a=prompt("输入房间号") send(`{"k":"msg","v":{"msg":"/room ${a}"}}`); }else if(event.target.id=="002"){ //发warp包 在elfive不生效 send(`{"k":"move","v":{"t":"warp"}}`); } } document.body.appendChild(box); //核心代码 function send(message) { let data = btoa(message) ws.send(data) } //等着三叶更新吧qwq })();