From 4930e5111bb9b991a402addf13ffafa24354193e Mon Sep 17 00:00:00 2001 From: Mute Date: Thu, 11 Aug 2022 00:56:40 +0000 Subject: [PATCH] Update 'mbchc-local.user.js' --- mbchc-local.user.js | 70 +++++++++++++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 24 deletions(-) diff --git a/mbchc-local.user.js b/mbchc-local.user.js index 7233d6e..815f075 100644 --- a/mbchc-local.user.js +++ b/mbchc-local.user.js @@ -17,7 +17,7 @@ // Bondage Club Mod Development Kit (1.0.2) // For more info see: https://github.com/Jomshir98/bondage-club-mod-sdk /** @type {ModSDKGlobalAPI} */ // eslint-disable-next-line -var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ERROR:\n"+o);const e=new Error(o);throw console.error(e),e}const t=new TextEncoder;function n(o){return!!o&&"object"==typeof o&&!Array.isArray(o)}function r(o){const e=new Set;return o.filter((o=>!e.has(o)&&e.add(o)))}const a=new Map,i=new Set;function d(o){i.has(o)||(i.add(o),console.warn(o))}function c(o,e){if(0===e.size)return o;let t=o.toString().replaceAll("\r\n","\n");for(const[n,r]of e.entries())t.includes(n)||d(`ModSDK: Patching ${o.name}: Patch ${n} not applied`),t=t.replaceAll(n,r);return(0,eval)(`(${t})`)}function s(o){const e=[],t=new Map,n=new Set;for(const r of u.values()){const a=r.patching.get(o.name);if(a){e.push(...a.hooks);for(const[e,i]of a.patches.entries())t.has(e)&&t.get(e)!==i&&d(`ModSDK: Mod '${r.name}' is patching function ${o.name} with same pattern that is already applied by different mod, but with different pattern:\nPattern:\n${e}\nPatch1:\n${t.get(e)||""}\nPatch2:\n${i}`),t.set(e,i),n.add(r.name)}}return e.sort(((o,e)=>e.priority-o.priority)),{hooks:e,patches:t,patchesSources:n,final:c(o.original,t)}}function l(o,e=!1){let r=a.get(o);if(r)e&&(r.precomputed=s(r));else{let e=window;const i=o.split(".");for(let t=0;t>>1:o>>>1;e=e>>>8^o}return((-1^e)>>>0).toString(16).padStart(8,"0").toUpperCase()}(d.toString().replaceAll("\r\n","\n")),l={name:o,original:d,originalHash:c};r=Object.assign(Object.assign({},l),{precomputed:s(l)}),a.set(o,r),e[i[i.length-1]]=function(o){return function(...e){const t=o.precomputed,n=t.hooks,r=t.final;let a=0;const i=d=>{var c,s,l,f;if(ao.mod))),patchedByMods:Array.from(t.precomputed.patchesSources)});return o}const u=new Map;function h(o){u.get(o.name)!==o&&e(`Failed to unload mod '${o.name}': Not registered`),u.delete(o.name),o.loaded=!1}function g(o,t,r){"string"==typeof o&&o||e("Failed to register mod: Expected non-empty name string, got "+typeof o),"string"!=typeof t&&e(`Failed to register mod '${o}': Expected version string, got ${typeof t}`),r=!0===r;const a=u.get(o);a&&(a.allowReplace&&r||e(`Refusing to load mod '${o}': it is already loaded and doesn't allow being replaced.\nWas the mod loaded multiple times?`),h(a));const i=t=>{"string"==typeof t&&t||e(`Mod '${o}' failed to patch a function: Expected function name string, got ${typeof t}`);let n=c.patching.get(t);return n||(n={hooks:[],patches:new Map},c.patching.set(t,n)),n},d={unload:()=>h(c),hookFunction:(t,n,r)=>{c.loaded||e(`Mod '${c.name}' attempted to call SDK function after being unloaded`);const a=i(t);"number"!=typeof n&&e(`Mod '${o}' failed to hook function '${t}': Expected priority number, got ${typeof n}`),"function"!=typeof r&&e(`Mod '${o}' failed to hook function '${t}': Expected hook function, got ${typeof r}`);const d={mod:c.name,priority:n,hook:r};return a.hooks.push(d),f(),()=>{const o=a.hooks.indexOf(d);o>=0&&(a.hooks.splice(o,1),f())}},patchFunction:(t,r)=>{c.loaded||e(`Mod '${c.name}' attempted to call SDK function after being unloaded`);const a=i(t);n(r)||e(`Mod '${o}' failed to patch function '${t}': Expected patches object, got ${typeof r}`);for(const[n,i]of Object.entries(r))"string"==typeof i?a.patches.set(n,i):null===i?a.patches.delete(n):e(`Mod '${o}' failed to patch function '${t}': Invalid format of patch '${n}'`);f()},removePatches:o=>{c.loaded||e(`Mod '${c.name}' attempted to call SDK function after being unloaded`);i(o).patches.clear(),f()},callOriginal:(t,n,r)=>(c.loaded||e(`Mod '${c.name}' attempted to call SDK function after being unloaded`),"string"==typeof t&&t||e(`Mod '${o}' failed to call a function: Expected function name string, got ${typeof t}`),Array.isArray(n)||e(`Mod '${o}' failed to call a function: Expected args array, got ${typeof n}`),function(o,e,t=window){return l(o).original.apply(t,e)}(t,n,r)),getOriginalHash:t=>("string"==typeof t&&t||e(`Mod '${o}' failed to get hash: Expected function name string, got ${typeof t}`),l(t).originalHash)},c={name:o,version:t,allowReplace:r,api:d,loaded:!0,patching:new Map};return u.set(o,c),Object.freeze(d)}function m(){const o=[];for(const e of u.values())o.push({name:e.name,version:e.version});return o}let w;const y=void 0===window.bcModSdk?window.bcModSdk=function(){const e={version:o,apiVersion:1,registerMod:g,getModsInfo:m,getPatchingInfo:p,errorReporterHooks:Object.seal({hookEnter:null,hookChainExit:null})};return w=e,Object.freeze(e)}():(n(window.bcModSdk)||e("Failed to init Mod SDK: Name already in use"),1!==window.bcModSdk.apiVersion&&e(`Failed to init Mod SDK: Different version already loaded ('1.0.2' vs '${window.bcModSdk.version}')`),window.bcModSdk.version!==o&&alert(`Mod SDK warning: Loading different but compatible versions ('1.0.2' vs '${window.bcModSdk.version}')\nOne of mods you are using is using an old version of SDK. It will work for now but please inform author to update`),window.bcModSdk);return"undefined"!=typeof exports&&(Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=y),y}(); +(function(){"use strict";const o="1.0.2";function e(o){alert("Mod ERROR:\n"+o);const e=new Error(o);throw console.error(e),e}const t=new TextEncoder;function n(o){return!!o&&"object"==typeof o&&!Array.isArray(o)}function r(o){const e=new Set;return o.filter((o=>!e.has(o)&&e.add(o)))}const a=new Map,i=new Set;function d(o){i.has(o)||(i.add(o),console.warn(o))}function c(o,e){if(0===e.size)return o;let t=o.toString().replaceAll("\r\n","\n");for(const[n,r]of e.entries())t.includes(n)||d(`ModSDK: Patching ${o.name}: Patch ${n} not applied`),t=t.replaceAll(n,r);return(0,eval)(`(${t})`)}function s(o){const e=[],t=new Map,n=new Set;for(const r of u.values()){const a=r.patching.get(o.name);if(a){e.push(...a.hooks);for(const[e,i]of a.patches.entries())t.has(e)&&t.get(e)!==i&&d(`ModSDK: Mod '${r.name}' is patching function ${o.name} with same pattern that is already applied by different mod, but with different pattern:\nPattern:\n${e}\nPatch1:\n${t.get(e)||""}\nPatch2:\n${i}`),t.set(e,i),n.add(r.name)}}return e.sort(((o,e)=>e.priority-o.priority)),{hooks:e,patches:t,patchesSources:n,final:c(o.original,t)}}function l(o,e=!1){let r=a.get(o);if(r)e&&(r.precomputed=s(r));else{let e=window;const i=o.split(".");for(let t=0;t>>1:o>>>1;e=e>>>8^o}return((-1^e)>>>0).toString(16).padStart(8,"0").toUpperCase()}(d.toString().replaceAll("\r\n","\n")),l={name:o,original:d,originalHash:c};r=Object.assign(Object.assign({},l),{precomputed:s(l)}),a.set(o,r),e[i[i.length-1]]=function(o){return function(...e){const t=o.precomputed,n=t.hooks,r=t.final;let a=0;const i=d=>{var c,s,l,f;if(ao.mod))),patchedByMods:Array.from(t.precomputed.patchesSources)});return o}const u=new Map;function h(o){u.get(o.name)!==o&&e(`Failed to unload mod '${o.name}': Not registered`),u.delete(o.name),o.loaded=!1}function g(o,t,r){"string"==typeof o&&o||e("Failed to register mod: Expected non-empty name string, got "+typeof o),"string"!=typeof t&&e(`Failed to register mod '${o}': Expected version string, got ${typeof t}`),r=!0===r;const a=u.get(o);a&&(a.allowReplace&&r||e(`Refusing to load mod '${o}': it is already loaded and doesn't allow being replaced.\nWas the mod loaded multiple times?`),h(a));const i=t=>{"string"==typeof t&&t||e(`Mod '${o}' failed to patch a function: Expected function name string, got ${typeof t}`);let n=c.patching.get(t);return n||(n={hooks:[],patches:new Map},c.patching.set(t,n)),n},d={unload:()=>h(c),hookFunction:(t,n,r)=>{c.loaded||e(`Mod '${c.name}' attempted to call SDK function after being unloaded`);const a=i(t);"number"!=typeof n&&e(`Mod '${o}' failed to hook function '${t}': Expected priority number, got ${typeof n}`),"function"!=typeof r&&e(`Mod '${o}' failed to hook function '${t}': Expected hook function, got ${typeof r}`);const d={mod:c.name,priority:n,hook:r};return a.hooks.push(d),f(),()=>{const o=a.hooks.indexOf(d);o>=0&&(a.hooks.splice(o,1),f())}},patchFunction:(t,r)=>{c.loaded||e(`Mod '${c.name}' attempted to call SDK function after being unloaded`);const a=i(t);n(r)||e(`Mod '${o}' failed to patch function '${t}': Expected patches object, got ${typeof r}`);for(const[n,i]of Object.entries(r))"string"==typeof i?a.patches.set(n,i):null===i?a.patches.delete(n):e(`Mod '${o}' failed to patch function '${t}': Invalid format of patch '${n}'`);f()},removePatches:o=>{c.loaded||e(`Mod '${c.name}' attempted to call SDK function after being unloaded`);i(o).patches.clear(),f()},callOriginal:(t,n,r)=>(c.loaded||e(`Mod '${c.name}' attempted to call SDK function after being unloaded`),"string"==typeof t&&t||e(`Mod '${o}' failed to call a function: Expected function name string, got ${typeof t}`),Array.isArray(n)||e(`Mod '${o}' failed to call a function: Expected args array, got ${typeof n}`),function(o,e,t=window){return l(o).original.apply(t,e)}(t,n,r)),getOriginalHash:t=>("string"==typeof t&&t||e(`Mod '${o}' failed to get hash: Expected function name string, got ${typeof t}`),l(t).originalHash)},c={name:o,version:t,allowReplace:r,api:d,loaded:!0,patching:new Map};return u.set(o,c),Object.freeze(d)}function m(){const o=[];for(const e of u.values())o.push({name:e.name,version:e.version});return o}let w;const y=void 0===window.bcModSdk?window.bcModSdk=function(){const e={version:o,apiVersion:1,registerMod:g,getModsInfo:m,getPatchingInfo:p,errorReporterHooks:Object.seal({hookEnter:null,hookChainExit:null})};return w=e,Object.freeze(e)}():(n(window.bcModSdk)||e("Failed to init Mod SDK: Name already in use"),1!==window.bcModSdk.apiVersion&&e(`Failed to init Mod SDK: Different version already loaded ('1.0.2' vs '${window.bcModSdk.version}')`),window.bcModSdk.version!==o&&alert(`Mod SDK warning: Loading different but compatible versions ('1.0.2' vs '${window.bcModSdk.version}')\nOne of mods you are using is using an old version of SDK. It will work for now but please inform author to update`),window.bcModSdk);return"undefined"!=typeof exports&&(Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=y),y})(); (function() { "use strict"; @@ -34,13 +34,13 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER LAST_HACKED: null, HISTORY_MODE: false, RE_TITLE: /^[a-zA-Z]+$/, - RE_PREF_ACTIVITY_ME: /^@/, - RE_PREF_ACTIVITY: /^@@/, + RE_PREF_ACTIVITY_ME: /^@/, +// RE_PREF_ACTIVITY_ME_APO: /^@'/, + RE_PREF_ACTIVITY: /^@@/, RE_ACT_CIDS: /^<(\d+)?:(\d+)?>/, RE_TZ: /(?:GMT|UTC)([+-]\d\d?)/i, RE_ALL_LEFT: /^<+$/, RE_ALL_RIGHT: /^>+$/, - RE_CARET: /^\^/, RE_SPACES: /\s{2,}/g, RE_LAST_WORD: /(^|\s)([^\s]*)$/, RE_LAST_LETTER: /[\w]$/, @@ -157,6 +157,10 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER "ItemEars": ["ear", "ears", "earlobe", "earlobes"], "ItemHead": ["head", "face", "hair", "eyes", "forehead"], }, + BCE_TESTER_PATCHES: [ + [/^\^('s)?( )?/g, "^SourceCharacter$1\\s+"], + [/([^\\])\$/g, "$1\\.?$$"], + ], SUBCOMMANDS_MBCHC: { "versions": {desc: "show the mod versions across the room", cb: mbchc => mbchc.inform(mbchc.gather_versions().map(c => `
${c.name} (${c.cid}): ${c.version}
`).join(""))}, "autohack": {desc: "toggle the autohack feature", cb: mbchc => mbchc.inform(`Autohack is now ${(mbchc.AUTOHACK_ENABLED = !mbchc.AUTOHACK_ENABLED) ? "enabled" : "disabled"}`)}, @@ -213,6 +217,7 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER if (options.dot && result.match(this.RE_LAST_LETTER)) result = `${result}.` return(result) }, + tokenise: function(text) { return text.replace(this.RE_SPACES, " ").split(" ") }, inform: function(html, timeout = 60000) { window.ChatRoomSendLocal(`
${html}
`, timeout) }, report: function(x) { this.inform(`Error: ${x.toString()}`) @@ -262,6 +267,13 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER if (found.length > 1) throw `target "${input}": multiple matches (${found.map(c => `${c.cid}|${c.Name}|${c.Nickname || c.Name}`).join(",")})` return(found[0]) }, + char2targets: function(char) { + let [result, cid] = [new Set(), char.cid.toString()] + result.add(cid).add(`=${cid}`) + this.tokenise(char.Name).forEach(t => {result.add(t); result.add(`@${t}`)}) + if (char.Nickname) this.tokenise(char.Nickname).forEach(t => {result.add(t); result.add(`@${t}`)}) + return result + }, donate_data: function(target) { let char = this.target2char(target) if (char.IsPlayer()) throw "target must not be you" @@ -273,6 +285,7 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER window.ChatRoomMessage({Sender: window.Player.cid, Type: "Action", Content: `You've bought data for $${cost} and sent it to ${char.dn}.`, Dictionary: [{Tag: "MISSING PLAYER DIALOG: ", Text: ""}]}) }, run_activity: function(char, ag, action) { try { + if (!window.ActivityAllowed()) throw "activities disabled in this room" if (!window.ServerChatRoomGetAllowItem(window.Player, char)) throw "no permissions" char.FocusGroup = this.ensure("invalid AssetGroup", () => window.AssetGroupGet(char.AssetFamily, ag)) let activity = this.ensure("invalid activity", () => window.ActivityAllowedForGroup(char, char.FocusGroup.Name, true).find(a => a.Name === action)) @@ -283,6 +296,12 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER } finally { char.FocusGroup = null } }, + replace_me: function(match, offset, string) { + let text = string.slice(1) + let suffix = " " + if (text.startsWith("'") || text.startsWith(" ")) suffix = "" + return `${window.MBCHC.PREF_ACTIVITY}<${window.Player.cid}:>SourceCharacter${suffix}` + }, cid2dict: function(type, cid) { return({Tag: `${type}Character`, MemberNumber: cid, Text: this.cid2char(cid).dn}) }, send_activity: function(msg) { let dict = [{Tag: "MISSING PLAYER DIALOG: ", Text: ""}] @@ -343,7 +362,7 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER let result = { Type: "Action", Event: trigger.Event, - Matchers: trigger.Matchers.map(m => ({Tester: new RegExp(m.Tester.source.replace(this.RE_CARET, "^SourceCharacter\\s+"), "u")})) + Matchers: trigger.Matchers.map(m => ({Tester: new RegExp(this.BCE_TESTER_PATCHES.reduce((ax,[f,r]) => ax.replaceAll(f,r), m.Tester.source), "u")})) } return(result) }, @@ -354,7 +373,7 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER /* (["anim", "pose"]).forEach(tag => {let cmd = window.Commands.find(c => tag === c.Tag); if (cmd) cmd.AutoComplete = this[`complete_bce_${tag}`]}) */ // this line explodes, don't ask me why let cmd = window.Commands.find(c => "anim" === c.Tag) if (cmd) cmd.AutoComplete = this.complete_bce_anim - cmd = window.Commands.find(c => "pose" === c.Tag) + cmd = window.Commands.find(c => "pose" === c.Tag) if (cmd) cmd.AutoComplete = this.complete_bce_pose }, gather_versions: function() { return(window.ChatRoomCharacter.filter(c => c.MBCHC).map(c => ({name: c.dn, cid: c.cid, version: c.MBCHC.VERSION}))) }, @@ -443,23 +462,23 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER comp_hint_visible: function() {return(this.COMP_HINT.parentElement && "flex" === this.COMP_HINT.style.display)}, complete_hint_hide: function(options) {if (!this.comp_hint_visible()) return; this.COMP_HINT.style.display = "none"; window.ChatRoomResize(false)}, complete_target: function(token, me2 = true, check_perms = false) { - let locase = token.toLocaleLowerCase() - let found = {} + let [locase, found] = [token.toLocaleLowerCase(), new Set()] for (let c of window.ChatRoomCharacter) { - let [n, nn, cid] = [c.Name.toLocaleLowerCase(), (c.Nickname || c.Name).toLocaleLowerCase(), c.cid.toString()] - if (!c.IsPlayer() || me2) [n, nn, cid, `@${n}`, `@${nn}`, `=${cid}`].forEach(s => {if (s.startsWith(locase) && (!check_perms || window.ServerChatRoomGetAllowItem(window.Player, c))) found[s] = true}) + if ((c.IsPlayer() && !me2) || (check_perms && !window.ServerChatRoomGetAllowItem(window.Player, c))) continue + this.char2targets(c).forEach(s => {if (s.toLocaleLowerCase().startsWith(locase)) found.add(s)}) } - this.complete(Object.keys(found)) + this.complete(Array.from(found)) }, complete_common: function() { let input = document.getElementById("InputChat").value - return([this, input, input.replace(this.RE_SPACES, " ").split(" ")]) + return([this, input, this.tokenise(input)]) }, complete_mbchc: function(args, locase, cmdline) { const [mbchc, input, tokens] = window.MBCHC.complete_common(); // `this` is command object if (tokens.length < 1) return if (tokens.length < 2) return(mbchc.complete([`${mbchc.CommandsKey}${this.Tag}`])) - if (tokens.length < 3) return(mbchc.complete(Object.keys(mbchc.SUBCOMMANDS_MBCHC).filter(c => c.startsWith(tokens[1])))) // complete subcommand name - let sub = mbchc.SUBCOMMANDS_MBCHC[tokens[1]] + let subname = tokens[1].toLocaleLowerCase() + if (tokens.length < 3) return(mbchc.complete(Object.keys(mbchc.SUBCOMMANDS_MBCHC).filter(c => c.startsWith(subname)))) // complete subcommand name + let sub = mbchc.SUBCOMMANDS_MBCHC[subname] if (sub && sub.args) { let argname = Object.keys(sub.args)[tokens.length - 3] if ("TARGET" === argname) return(mbchc.complete_target(tokens[tokens.length - 1], false)) @@ -476,25 +495,26 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER if (tokens.length < 1) return if (tokens.length < 2) return(mbchc.complete([`${mbchc.CommandsKey}${this.Tag}`])) // now, we *could* run a filter to exclude impossible activities, but it isn't very useful, and also seems like a lot of CPU to iterate over every action on every zone of every char in the room - if (tokens.length < 3) return(mbchc.complete(Object.keys(mbchc.DO_DATA.verbs).filter(c => c.startsWith(tokens[1])))) // complete verb - let verb = tokens[1].toLocaleLowerCase() - let ags = mbchc.DO_DATA.verbs[verb] - if (!ags) return + let low = tokens[1].toLocaleLowerCase() + if (tokens.length < 3) return(mbchc.complete(Object.keys(mbchc.DO_DATA.verbs).filter(c => c.startsWith(low)))) // complete verb + let ags = mbchc.DO_DATA.verbs[low] + if (!ags) return(mbchc.bell()) + low = tokens[2].toLocaleLowerCase() if (tokens.length < 4) { // complete zone or target if (Object.keys(ags).length < 2) return(mbchc.complete_do_target(ags[Object.keys(ags)[0]], tokens[2])) // zone implied, complete target - let zones = Object.entries(mbchc.DO_DATA.zones).filter(([zone, ag]) => zone.startsWith(tokens[2]) && ags[ag]).map(([zone,ag]) => zone) + let zones = Object.entries(mbchc.DO_DATA.zones).filter(([zone, ag]) => zone.startsWith(low) && ags[ag]).map(([zone,ag]) => zone) return(mbchc.complete(zones)) } if (tokens.length < 5) { // complete target where it belongs if (Object.keys(ags).length < 2) return // zone implied, target already given - let zone = tokens[2].toLocaleLowerCase() - return(mbchc.complete_do_target(ags[mbchc.DO_DATA.zones[zone]], tokens[3])) + return(mbchc.complete_do_target(ags[mbchc.DO_DATA.zones[low]], tokens[3])) } + mbchc.bell() }, complete_bce_anim: function(args, locase, cmdline) { const [mbchc, input, tokens] = window.MBCHC.complete_common(); // `this` is command object if (tokens.length < 1) return if (tokens.length < 2) return(mbchc.complete([`${mbchc.CommandsKey}${this.Tag}`])) - if (tokens.length > 2) return + if (tokens.length > 2) return(mbchc.bell()) let anim = tokens[1].toLocaleLowerCase() return(mbchc.complete(Object.keys(window.bce_EventExpressions).filter(a => a.toLocaleLowerCase().startsWith(anim)))) }, @@ -600,7 +620,9 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER let input = window.ElementValue("InputChat") if (!input.startsWith("@@@") && input.startsWith("@")) { input = input.replace(window.MBCHC.RE_PREF_ACTIVITY, window.MBCHC.PREF_ACTIVITY) - input = input.replace(window.MBCHC.RE_PREF_ACTIVITY_ME, `${window.MBCHC.PREF_ACTIVITY}<${window.Player.cid}:>SourceCharacter `) +// input = input.replace(window.MBCHC.RE_PREF_ACTIVITY_ME_APO, `${window.MBCHC.PREF_ACTIVITY}<${window.Player.cid}:>SourceCharacter'`) +// input = input.replace(window.MBCHC.RE_PREF_ACTIVITY_ME, `${window.MBCHC.PREF_ACTIVITY}<${window.Player.cid}:>SourceCharacter `) + input = input.replace(window.MBCHC.RE_PREF_ACTIVITY_ME, window.MBCHC.replace_me) window.ElementValue("InputChat", input) } let result = next(nextargs) @@ -649,7 +671,7 @@ var bcModSdk=function(){"use strict";const o="1.0.2";function e(o){alert("Mod ER }) window.MBCHC.sdk.hookFunction("DocumentKeyDown", 0, (nextargs, next) => { let [event] = nextargs - if ("InputChat" === document.activeElement.id) return(next(nextargs)) + if ("InputChat" === document.activeElement.id || "bce-message-input" === document.activeElement.id) return(next(nextargs)) if ("inline" === document.getElementById("InputChat")?.style.display) window.ElementFocus("InputChat") return(next(nextargs)) })