// ==UserScript== // @name 虎牙直播挖宝 // @namespace http://tampermonkey.net/ // @version 0.1.3 // @description 虎牙直播自动挖宝 // @author 睿智的河水 // @match *://*.huya.com/* // @grant none // @downloadURL https://update.greasyfork.icu/scripts/388939/%E8%99%8E%E7%89%99%E7%9B%B4%E6%92%AD%E6%8C%96%E5%AE%9D.user.js // @updateURL https://update.greasyfork.icu/scripts/388939/%E8%99%8E%E7%89%99%E7%9B%B4%E6%92%AD%E6%8C%96%E5%AE%9D.meta.js // ==/UserScript== (function () { 'use strict' const $ = window.$ const styleData = ` .chat-room__gift { position: relative; width: 100%; height: 100%; overflow: hidden; } .room-chat-tool-gift { display: inline-block; width: 24px; height: 24px; margin-top: -2px; background: url("https://huyaimg.msstatic.com/cdnimage/actprop/20293_1__45_1547818438.jpg") center no-repeat; background-size: contain; filter: grayscale(1); opacity: .65; } .room-chat-tool-gift:hover { opacity: 1; } #gift-main { position: relative; height: 100%; display: flex; flex-direction: column; } #gift-list { height: 100%; overflow: auto; scroll-behavior: smooth; } #gift-list li { font-size: 12px; padding: 6px 0; margin: 0 10px; border-bottom: 1px solid #eee; } #gift-list li > div { display: block; margin: 3px 0px; } #gift-list li .time { color: #aaa; } #gift-list li .host { padding-left: 18px; margin-left: 3px; color: #f80; background: url(https://a.msstatic.com/huya/main3/assets/img/room/bussType_icon_c974b.png) left center no-repeat; } #gift-list li .info { color: #444; } #gift-list li .info i { font-style: normal; color: #3c9cfe; } #gift-list li .status { color: #999; } #gift-list li .winner { color: #d35757; } #gift-status { display: flex; align-items: baseline; font-size: 13px; padding: 6px; margin: 0 6px 6px; background: #f5f5f5; border: 1px solid #eee; border-radius: 3px; } #gift-status .time { color: #aaa; margin-right: 6px; } #gift-status .info { color: #999; } #gift-status .info i { font-style: normal; color: #f80; } ` function localGet (key) { return JSON.parse(localStorage.getItem(key)) } function localSet (key, val) { return localStorage.setItem(key, JSON.stringify(val)) } function localRemove (key) { return localStorage.removeItem(key) } function updateGift (el, html, save = false) { const $giftEl = $('.chat-room__gift') let $giftMain = $('#gift-main') if (!$giftMain.length) { $giftMain = $('
') const $clearEl = $('清除历史数据
') $clearEl.on('click', () => { $('#gift-list').html('') localRemove('giftHistory') }) $giftMain.append($('