您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
chatv4test
当前为
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.gf.qytechs.cn/scripts/539361/1607355/chatv4.js
Tabs.Chat = { tabOrder: 900, tabLabel: 'Chat', tabDisabled: false, myDiv: null, chatDiv: null, userListDiv: null, inputDiv: null, currentChatType: 'global', init: function (div) { var t = Tabs.Chat; t.myDiv = div; t.createMainDiv(); t.hookGameChat(); t.updateUserList(); }, createMainDiv: function () { var t = Tabs.Chat; var m = '<DIV class=divHeader align=center>' + tx('CHAT ROOM') + '</div>'; m += '<div id="pbChatRoom" style="display:flex; height:500px; border:1px solid #888;">'; m += '<div id="pbUserList" style="width:150px; border-right:1px solid #888; overflow-y:auto;"></div>'; m += '<div style="flex-grow:1; display:flex; flex-direction:column;">'; m += '<div id="pbChatContent" style="flex-grow:1; overflow-y:auto; padding:10px;"></div>'; m += '<div id="pbChatInput" style="border-top:1px solid #888; padding:10px;"></div>'; m += '</div>'; m += '</div>'; t.myDiv.innerHTML = m; t.chatDiv = ById('pbChatContent'); t.userListDiv = ById('pbUserList'); t.inputDiv = ById('pbChatInput'); t.cloneGameChatInput(); }, hookGameChat: function () { var t = Tabs.Chat; var gameChatContainer = document.querySelector('#mod_comm_list1'); if (gameChatContainer) { var observer = new MutationObserver(function (mutations) { t.updateChat(); }); observer.observe(gameChatContainer, { childList: true, subtree: true }); t.updateChat(); } else { console.error('Could not find game chat container'); } }, updateChat: function () { var t = Tabs.Chat; var gameChatContainer = document.querySelector('#mod_comm_list1'); if (gameChatContainer && t.chatDiv) { t.chatDiv.innerHTML = gameChatContainer.innerHTML; t.chatDiv.scrollTop = t.chatDiv.scrollHeight; } }, cloneGameChatInput: function () { var t = Tabs.Chat; var gameChatInput = document.querySelector('#mod_comm_input'); if (gameChatInput) { var inputClone = gameChatInput.cloneNode(true); t.inputDiv.appendChild(inputClone); var chatTextArea = t.inputDiv.querySelector('textarea'); var sendButton = t.inputDiv.querySelector('button'); if (chatTextArea && sendButton) { chatTextArea.style.width = '100%'; sendButton.style.width = '100%'; sendButton.style.marginTop = '5px'; chatTextArea.addEventListener('keypress', function (e) { if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); t.sendChat(); } }); sendButton.addEventListener('click', function () { t.sendChat(); }); } } else { console.error('Could not find game chat input'); } }, sendChat: function () { var t = Tabs.Chat; var chatTextArea = t.inputDiv.querySelector('textarea'); var gameChatTextArea = document.querySelector('#mod_comm_input textarea'); var gameSendButton = document.querySelector('#mod_comm_input button'); if (chatTextArea && gameChatTextArea && gameSendButton) { var message = chatTextArea.value.trim(); if (message !== '') { gameChatTextArea.value = message; gameSendButton.click(); chatTextArea.value = ''; } } else { console.error('Could not find necessary elements to send chat'); } }, updateUserList: function () { var t = Tabs.Chat; // This is a placeholder function. You'll need to implement the actual user list retrieval // based on how your game manages online users. var onlineUsers = ['User1', 'User2', 'User3']; // Replace with actual online users var userListHTML = '<div class="divHeader">Online Users</div>'; onlineUsers.forEach(function (user) { userListHTML += '<div class="chatUser">' + user + '</div>'; }); t.userListDiv.innerHTML = userListHTML; // Update the user list periodically setTimeout(t.updateUserList, 60000); // Update every minute } };
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址