// ==UserScript== // @name 奶牛复制助手 // @namespace http://tampermonkey.net/ // @version 1.3 // @description 银河奶牛放置复制助手,安装后页面会出现一个悬浮按钮,点击可以复制常用短语,然后粘贴到聊天栏中。这些短语可以自行修改。 // @author XiaoR // @match https://www.milkywayidle.com/* // @grant GM_setValue // @grant GM_getValue // @license MIT // @downloadURL https://update.greasyfork.icu/scripts/529591/%E5%A5%B6%E7%89%9B%E5%A4%8D%E5%88%B6%E5%8A%A9%E6%89%8B.user.js // @updateURL https://update.greasyfork.icu/scripts/529591/%E5%A5%B6%E7%89%9B%E5%A4%8D%E5%88%B6%E5%8A%A9%E6%89%8B.meta.js // ==/UserScript== (function () { 'use strict'; const defaultPhrases = ['分解糖(0-10)→苹果(10-20)→橙子(20-35)→竹子/紫茶叶(35-50)→桃子/月亮茶(50-65)→红茶叶(65-80)', '重组海洋精华(炼金1级)→丛林精华(10-23级)→哥布林精华(23-45级)→眼球精华(45-53级)→熊熊精华(53-65级)', '0-35级:鳄鱼背心 35-60级:治疗之书 60-70级:哥布林防御者 70级+ 元素之书', '牛牛新人攻略https://test-ctmd6jnzo6t9.feishu.cn/docx/KG9ddER6Eo2uPoxJFkicsvbEnCe', '社交-推荐 可以看邀请链接', '银河牛牛放置QQ群号:一群(已满) 482088950,二群 1033341911 。进群发送“牛牛手册”获得大佬手写的多篇攻略!两个群只用加一个哦,机器人是两边都有的。', '【银河奶牛放置】欢迎来到中文频道!您可以加QQ群482088950,在群内输入“牛牛手册”获取游戏插件、攻略以及各种自助服务', '公会没有任何加成,暂时也没有计划增加公会增益,目前仅供聊天和冲排行榜', '法师35级前没有副手', '背部装备只有后期才有', '🔥《银河牛牛放置》震撼公测!爆率玄学堪比老板画饼,强化失败自动播放《大悲咒》助你顿悟!点击就送【996福报】,群号482088950,群内基佬南娘过多,需要帮助请发送牛牛手册', '新手不用纠结玩什么,职业强度都是你挂机一年后才能体会到的东西。到时候都变天了,喜欢玩什么玩什么。', '牛牛新手路线图https://pic1.imgdb.cn/item/67d0325a066befcec6e358fd.png', '战斗装备得有4000M左右,收益才能和生活持平。', '技能是释放顺序是从左到右,0cd的要放在右边', '先看游戏指南,再看牛牛手册,然后加群沉淀一个月以上,再来问战斗怎么玩。新手前期不推荐战斗。有任务就换或者删了', '初始100牛铃买队列+离线时间,其他看个人需求: 懒得上线的买离线时间 需要市场挂单的买挂单上限 需要多种动作的开队列 懒得手动换装的买配装槽 要围任务的买任务槽 喜欢外观的买图标名称颜色头像装扮', '火车是某位热心群友(ID:Crazytrain),使用快报命令呼唤“火车报价单”,报价单的价格相对公允,依照报价单在牛牛市场发布买单/卖单,等待市场其他玩家达成交易。' ]; // 初始化配置 let config = { phrases: GM_getValue('phrases', defaultPhrases), position: GM_getValue('position', { x: 30, y: 30 }) }; // 创建UI样式 const createStyles = () => { const style = document.createElement('style'); style.textContent = ` /* 新增按钮效果 */ .mwc-save-btn { background: #4f46e5; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); } .mwc-save-btn:hover { background: #4338ca !important; transform: translateY(-1px); } .mwc-save-btn:active { transform: translateY(1px) scale(0.98); } .mwc-cancel-btn { background: #f3f4f6; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); } .mwc-cancel-btn:hover { background: #e5e7eb !important; transform: translateY(-1px); } .mwc-cancel-btn:active { transform: translateY(1px) scale(0.98); } .mwc-reset-btn { background: #ef4444 !important; /* 添加基础红色 */ transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); } .mwc-reset-btn:hover { background: #dc2626 !important; transform: translateY(-1px); } .mwc-reset-btn:active { background: #b91c1c !important; transform: translateY(1px) scale(0.98); } .mwc-container { position: fixed; z-index: 99999; transform: translate(-50%, -50%); } .mwc-menu { position: absolute; left: 60px; top: 0; background: rgba(255,255,255,0.95); border-radius: 12px; padding: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); backdrop-filter: blur(8px); min-width: 240px; max-height: 60vh; overflow-y: auto; display: none; } .mwc-menu-item { padding: 6px 8px; border-radius: 4px; cursor: pointer; transition: all 0.2s; color: #374151; font-size: 12px; display: flex; align-items: center; gap: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; } /* 交替背景色 */ .mwc-menu-item:nth-child(even) { background: #f1f5f9; } .mwc-menu-item:hover { background: rgba(99,102,241,0.1) !important; /* 保持悬停效果 */ transform: translateX(4px); } .mwc-main-btn { width: 48px; height: 48px; border-radius: 24px; background: linear-gradient(135deg, #6366f1, #8b5cf6); border: none; box-shadow: 0 4px 12px rgba(0,0,0,0.2); cursor: move; transition: all 0.3s; display: flex; align-items: center; justify-content: center; color: white; font-size: 24px; transition: all 0.3s, background 0.5s ease; } .mwc-main-btn:hover { transform: scale(1.1); box-shadow: 0 6px 16px rgba(0,0,0,0.3); } .mwc-config { background: white; padding: 15px; /* 减小内边距 */ border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.1); position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 100000; display: none; width: 400px; max-height: 70vh; overflow-y: auto; } .mwc-config-item { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; } .mwc-config-input { flex: 1; padding: 8px; border: 1px solid #e5e7eb; border-radius: 8px; } .mwc-add-btn { width: 100%; padding: 8px; background: #f3f4f6; border: 1px dashed #d1d5db; border-radius: 8px; cursor: pointer; color: #6b7280; margin-bottom: 16px; } .mwc-add-btn:hover { background: #e5e7eb; } .mwc-delete-btn { color: #ef4444; cursor: pointer; padding: 4px; border-radius: 4px; } .mwc-delete-btn:hover { background: #fee2e2; } .mwc-toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, #10b981, #059669); color: white; padding: 12px 24px; border-radius: 8px; display: none; animation: slideIn 0.3s; } #mwc-phrases-container { max-height: 50vh; /* 短语列表容器高度限制 */ overflow-y: auto; /* 添加嵌套滚动条 */ margin-bottom: 10px; padding-right: 8px; /* 防止滚动条遮挡内容 */ } @keyframes slideIn { from { bottom: -50px } to { bottom: 20px } } `; document.head.appendChild(style); }; // 创建配置面板 const createConfigPanel = (menu) => { const panel = document.createElement('div'); panel.className = 'mwc-config'; panel.addEventListener('click', e => e.stopPropagation()); panel.innerHTML = `