|
大家好啊,萌新今天给大家带一波自己编写的猜画猴油脚本
和谐已封,猜画当立(x)
主要功能:
1.修复由于标题过长或过短导致猜画点开后图片不显示的问题。
2.增加了一个猜画回答之后,仍能显示猜画作者的功能(再也不怕找不着“过于友善”的题是谁出的了2333)
对比图例:
使用前:
使用后:
首先这个脚本需要安装猴油扩展才能运行,安装方法深暗幽狼大佬已经发过了,我就直接引用大大的帖子好了。
@Name 拜name,保佑帖子能过qwq
以下是脚本代码,添加新的脚本,复制粘贴进去就行啦~
- // ==UserScript==
- // @name 猜画修复
- // @namespace http://tampermonkey.net/
- // @version 0.2
- // @description 修复你画我猜显示bug,并且显示已猜画作的uid
- // @author 某乖leo
- // @match https://www.gamemale.com/plugin.php?id=viewui_draw*
- // @exclude https://www.gamemale.com/plugin.php?id=viewui_draw&mod=log
- // @exclude https://www.gamemale.com/plugin.php?id=viewui_draw&mod=rank
- // @exclude https://www.gamemale.com/plugin.php?id=viewui_draw&mod=list&ac=draw
- // @icon https://www.google.com/s2/favicons?sz=64&domain=gamemale.com
- // @supportURL https://www.gamemale.com/thread-110665-1-1.html
- // @grant GM_addStyle
- // ==/UserScript==
- (function() {
- 'use strict';
- GM_addStyle("#fwin_viewui_draw_guess .bd .flb em.tt {min-width: 200px;max-width: 570px;}");
- var tempShowWindow = showWindow;
- showWindow = function(k, url, mode, cache, menuv){
- tempShowWindow(k, url, mode, cache, menuv);
- setTimeout(showUid, 1000);
- };
- var url = window.location.href;
- if (url.match(/opendrawid/)){
- setTimeout(showUid, 2500);
- }
- var retryCount = 0;
- function showUid(){
- var title = jq("#fctrl_viewui_draw_guess .tt").text();
- if (!title){
- if (++retryCount >= 10){
- return;
- }
- setTimeout(showUid, 1000);
- return;
- }
- retryCount = 0;
- if (title.substring(0,5) == '[已完结]'){
- var uidResult = jq("#fwin_viewui_draw_guess script").text().match(/"(\d+)"\){showmessage\("error","您是绘画创作者,现仅可发布吐槽哦/);
- if (uidResult){
- var uid = uidResult[1];
- Mjq.get('https://www.gamemale.com/plugin.php?id=wodexunzhang:showxunzhang&formhash=' + $('scbar_form').formhash.value + '&action=yzuid&uid=' + uid + '&inajax=1&ajaxtarget=username')
- .success(function(a,b,response){
- var nameResult = response.responseText.match(RegExp('html" target="_blank">(.{0,50})</a><input'));
- if (nameResult){
- jq("#joinlist .itm.system").after('<div class="itm system"><span>[系统提醒]:</span>该画作作者是:<a href="https://www.gamemale.com/?'
- + uid + '">' + nameResult[1] + '</a></div>');
- }
- else{
- jq("#joinlist .itm.system").after('<div class="itm system"><span>[系统提醒]:</span>该画作作者的uid是:<a href="https://www.gamemale.com/?'
- + uid + '">' + uid + '</a></div>');
- }
- document.getElementById('joinlist').scrollTop = document.getElementById('joinlist').scrollHeight;
- }).fail(function(){
- jq("#joinlist .itm.system").after('<div class="itm system"><span>[系统提醒]:</span>该画作作者的uid是:<a href="https://www.gamemale.com/?'
- + uid + '">' + uid + '</a></div>');
- document.getElementById('joinlist').scrollTop = document.getElementById('joinlist').scrollHeight;
- });
- }
- }
- }
- })();
复制代码
0.2版:
更换取得用户的api,这样不用留下访问他人空间的痕迹,感谢优老师的建议~
|
求追随,求染黑,大家技运双全,猜画连对~
(免费评分不要钱~天天刷新随便送~)
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
评分
-
查看全部评分
|