Files
ST-Amily2-Chat-Optimisation/index.js
2025-08-05 10:37:15 +08:00

2 lines
6.9 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const _0x468cf9=_0x2f50;(function(_0x569b1a,_0x3e506d){const _0x2dd1f6=_0x2f50,_0x29dd81=_0x569b1a();while(!![]){try{const _0x132153=-parseInt(_0x2dd1f6(0x16a))/0x1*(-parseInt(_0x2dd1f6(0x184))/0x2)+parseInt(_0x2dd1f6(0x191))/0x3*(-parseInt(_0x2dd1f6(0x180))/0x4)+parseInt(_0x2dd1f6(0x195))/0x5*(parseInt(_0x2dd1f6(0x17f))/0x6)+parseInt(_0x2dd1f6(0x182))/0x7*(parseInt(_0x2dd1f6(0x198))/0x8)+parseInt(_0x2dd1f6(0x19e))/0x9+parseInt(_0x2dd1f6(0x192))/0xa+parseInt(_0x2dd1f6(0x168))/0xb*(-parseInt(_0x2dd1f6(0x186))/0xc);if(_0x132153===_0x3e506d)break;else _0x29dd81['push'](_0x29dd81['shift']());}catch(_0x2dcd60){_0x29dd81['push'](_0x29dd81['shift']());}}}(_0x29b1,0xa8e85));import{createDrawer}from'./ui/drawer.js';import'./MiZheSi/index.js';import'./PreOptimizationViewer/index.js';function _0x2f50(_0x444ab3,_0x9b6c5a){const _0x29b135=_0x29b1();return _0x2f50=function(_0x2f5082,_0x2d79c6){_0x2f5082=_0x2f5082-0x162;let _0x45f3b2=_0x29b135[_0x2f5082];return _0x45f3b2;},_0x2f50(_0x444ab3,_0x9b6c5a);}import{registerSlashCommands}from'./core/commands.js';import{onMessageReceived,onChatChanged}from'./core/events.js';import{eventSource,event_types}from'/script.js';import{checkForUpdates,fetchMessageBoardContent}from'./core/api.js';function _0x29b1(){const _0x506351=['addEventListener','[Amily2号-帝国枢密院]\x20SillyTavern宫殿主体已确认开国大典正式开始','[Amily2号-开国大典]\x20步骤一为宫殿披上华服...','CHAT_CHANGED','!!!【开国大典失败】在执行系列法令时发生严重错误:','【Amily2号-内务府】已成功获取并展示来自陛下的最新圣谕。','6795899xIKimu','assign','51844JkJGgk','[Amily2号]\x20部署失败等待\x20','amily2EventsRegistered','[Amily2号-帝国枢密院]\x20帝国基本法已确认档案室已与国库对接完毕。','getElementById','style.css','ST-Amily2-Chat-Optimisation','scripts/extensions/third-party/','split','createElement','MESSAGE_RECEIVED','head','\x20超时。','[Amily2号-开国大典]\x20步骤二皇家仪仗队就位...','amily2-style-','[Amily2号-帝国枢密院]\x20开始执行开国大典...','[Amily2-全局卫队]\x20捕获到严重错误:','【Amily2号】帝国已就绪现派遣外交官为陛下探查外界新情报...','error','log','【Amily2号-情报部】捷报!发现新版本:\x20','6FamVgl','51228WVYIbz','show','21DqtWpG','#amily2_message_content','10pIuzyj','link','36XgBXKl','max','html','version','未知错误','【Amily2号-情报部】一切安好,帝国已是最新版本。情报已转交内务府备案。','[Amily2号-皇家制衣局]\x20已为帝国披上华服:\x20','message','【Amily2号】帝国秩序已完美建立。Amily2号的府邸已恭候陛下的莅临。','now','stack','318Tbiamv','13150790CLGxxG','?v=','map','3700385kCkAKg','#amily2_message_board','#sys-settings-button','2646704vWRvvs','。情报已转交内务府。','length','includes','historiography.css','/assets/','5363316lSKCWD','stylesheet','[Amily2号-开国大典]\x20步骤四部署帝国哨兵网络...'];_0x29b1=function(){return _0x506351;};return _0x29b1();}import{setUpdateInfo,applyUpdateIndicator}from'./ui/state.js';import{pluginVersion,extensionName,defaultSettings}from'./utils/settings.js';import{extension_settings}from'/scripts/extensions.js';function compareVersions(_0x2a5813,_0x3fcd4b){const _0x4ae9aa=_0x2f50,_0x4fdc34=_0x2a5813['split']('.')[_0x4ae9aa(0x194)](Number),_0x5dcbcc=_0x3fcd4b[_0x4ae9aa(0x172)]('.')[_0x4ae9aa(0x194)](Number),_0x84df92=Math[_0x4ae9aa(0x187)](_0x4fdc34['length'],_0x5dcbcc[_0x4ae9aa(0x19a)]);for(let _0x352cbf=0x0;_0x352cbf<_0x84df92;_0x352cbf++){const _0x251ca1=_0x4fdc34[_0x352cbf]||0x0,_0x3cc9c=_0x5dcbcc[_0x352cbf]||0x0;if(_0x251ca1>_0x3cc9c)return!![];if(_0x251ca1<_0x3cc9c)return![];}return![];}async function handleUpdateCheck(){const _0x20fa09=_0x2f50;console['log'](_0x20fa09(0x17b));const _0x118dba=await checkForUpdates();if(_0x118dba&&_0x118dba[_0x20fa09(0x189)]){const _0x41efa8=compareVersions(_0x118dba['version'],pluginVersion);_0x41efa8?console[_0x20fa09(0x17d)](_0x20fa09(0x17e)+_0x118dba[_0x20fa09(0x189)]+_0x20fa09(0x199)):console[_0x20fa09(0x17d)](_0x20fa09(0x18b)),setUpdateInfo(_0x41efa8,_0x118dba),applyUpdateIndicator();}}async function handleMessageBoard(){const _0x174804=_0x2f50,_0x3b1572=await fetchMessageBoardContent();if(_0x3b1572&&_0x3b1572[_0x174804(0x18d)]){const _0x2380be=$(_0x174804(0x196)),_0x48b58b=$(_0x174804(0x183));_0x48b58b[_0x174804(0x188)](_0x3b1572[_0x174804(0x18d)]),_0x2380be[_0x174804(0x181)](),console[_0x174804(0x17d)](_0x174804(0x167));}}function loadPluginStyles(){const _0x3627b5=_0x2f50,_0x40962a=_0x20fe68=>{const _0x14851e=_0x2f50,_0x175309=_0x14851e(0x178)+_0x20fe68[_0x14851e(0x172)]('.')[0x0];if(document[_0x14851e(0x16e)](_0x175309))return;const _0x546500=_0x14851e(0x171)+extensionName+_0x14851e(0x19d)+_0x20fe68+_0x14851e(0x193)+Date[_0x14851e(0x18f)](),_0x271c65=document[_0x14851e(0x173)](_0x14851e(0x185));_0x271c65['id']=_0x175309,_0x271c65['rel']=_0x14851e(0x19f),_0x271c65['type']='text/css',_0x271c65['href']=_0x546500,document[_0x14851e(0x175)]['appendChild'](_0x271c65),console[_0x14851e(0x17d)](_0x14851e(0x18c)+_0x20fe68);};_0x40962a(_0x3627b5(0x16f)),_0x40962a(_0x3627b5(0x19c)),_0x40962a('hanlinyuan.css');}window[_0x468cf9(0x162)](_0x468cf9(0x17c),_0x54be14=>{const _0x558869=_0x468cf9,_0x58e6c7=_0x54be14[_0x558869(0x17c)]?.[_0x558869(0x190)]||'';_0x58e6c7[_0x558869(0x19b)](_0x558869(0x170))&&(console[_0x558869(0x17c)](_0x558869(0x17a),_0x54be14[_0x558869(0x17c)]),toastr[_0x558869(0x17c)]('Amily2插件错误:\x20'+(_0x54be14[_0x558869(0x17c)]?.['message']||_0x558869(0x18a)),'严重错误',{'timeOut':0x2710}));}),jQuery(async()=>{const _0x13e630=_0x468cf9;console[_0x13e630(0x17d)](_0x13e630(0x179));!extension_settings[extensionName]&&(extension_settings[extensionName]={});Object[_0x13e630(0x169)](extension_settings[extensionName],{...defaultSettings,...extension_settings[extensionName]}),console[_0x13e630(0x17d)](_0x13e630(0x16d));let _0x3d2239=0x0;const _0x13a9b4=0x64,_0x38b793=0x64,_0x171dc6=_0x13e630(0x197),_0xdeb7a2=setInterval(async()=>{const _0x58f135=_0x13e630;if($(_0x171dc6)[_0x58f135(0x19a)]>0x0){clearInterval(_0xdeb7a2),console[_0x58f135(0x17d)](_0x58f135(0x163));try{console[_0x58f135(0x17d)](_0x58f135(0x164)),loadPluginStyles(),console['log'](_0x58f135(0x177)),await registerSlashCommands(),console[_0x58f135(0x17d)]('[Amily2号-开国大典]\x20步骤三开始召唤府邸...'),createDrawer(),console['log'](_0x58f135(0x1a0)),!window[_0x58f135(0x16c)]&&(eventSource['on'](event_types[_0x58f135(0x174)],onMessageReceived),eventSource['on'](event_types['IMPERSONATE_READY'],onMessageReceived),eventSource['on'](event_types[_0x58f135(0x165)],onChatChanged),window[_0x58f135(0x16c)]=!![]),console[_0x58f135(0x17d)](_0x58f135(0x18e)),handleUpdateCheck(),handleMessageBoard();}catch(_0x29192d){console[_0x58f135(0x17c)](_0x58f135(0x166),_0x29192d);}}else _0x3d2239++,_0x3d2239>=_0x13a9b4&&(clearInterval(_0xdeb7a2),console[_0x58f135(0x17c)](_0x58f135(0x16b)+_0x171dc6+_0x58f135(0x176)));},_0x38b793);});