Skip to content

Commit 5ba683b

Browse files
committed
update
1 parent 6887870 commit 5ba683b

6 files changed

Lines changed: 157 additions & 51 deletions

3dm-Enhanced.user.js

Lines changed: 102 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// ==UserScript==
22
// @name 3DM论坛增强
3-
// @version 1.0.0
3+
// @version 1.0.1
44
// @author X.I.U
5-
// @description 自动无缝翻页
5+
// @description 自动回复、自动无缝翻页、清理置顶帖子
66
// @match *://bbs.3dmgame.com/*
77
// @icon https://bbs.3dmgame.com/favicon.ico
88
// @grant GM_xmlhttpRequest
@@ -12,6 +12,20 @@
1212
// ==/UserScript==
1313

1414
(function() {
15+
// 随机回复帖子的内容
16+
var replyList = [
17+
"感谢楼主分享!",
18+
"感谢分享,给你点赞!",
19+
"感谢分享,论坛因你更精彩!",
20+
"看看隐藏内容是什么!",
21+
"下载看看好不好用!",
22+
"好人一生平安!"
23+
];
24+
25+
// 检查是否登陆
26+
var loginStatus = false;
27+
checkLogin();
28+
1529
// 默认 ID 为 0
1630
var curSite = {SiteTypeID: 0};
1731

@@ -47,25 +61,50 @@
4761
GUIDE: DBSite.guide.SiteTypeID // 导读帖子列表
4862
};
4963

64+
// 下一页URL
65+
curSite.pageUrl = "";
66+
5067
// URL 匹配正则表达式
51-
var patt_forum = /\/forum-\d+-\d+\.html/,
52-
patt_forum_2 = /mod\=forumdisplay/,
53-
patt_thread = /\/thread-\d+-\d+\-\d+.html/,
68+
var patt_thread = /\/thread-\d+-\d+\-\d+.html/,
5469
patt_thread_2 = /mod\=viewthread/,
55-
patt_guide = /mod\=guide\&view\=(hot|digest)/
70+
patt_forum = /\/forum-\d+-\d+\.html/,
71+
patt_forum_2 = /mod\=forumdisplay/,
72+
patt_guide = /mod\=guide\&view\=(hot|digest)/,
73+
patt_reply = /mod\=post&action\=reply/
5674

5775
// URL 判断
5876
if (patt_thread.test(location.pathname) || patt_thread_2.test(location.search)){
77+
// 帖子内
5978
curSite = DBSite.thread;
79+
backReply(); // 先判断是否刚刚在回复帖子,如果是则返回第一页
80+
autoReply(); // 如果有隐藏内容,则自动点击回复
81+
pageLoading(); // 自动翻页
6082
}else if (patt_forum.test(location.pathname) || patt_forum_2.test(location.search)){
83+
// 各板块帖子列表
6184
curSite = DBSite.forum;
85+
cleanTop(); // 清理置顶帖子
86+
pageLoading(); // 自动翻页
6287
}else if (patt_guide.test(location.search)){
88+
// 导读帖子列表
6389
curSite = DBSite.guide;
90+
pageLoading(); // 自动翻页
91+
}else if (patt_reply.test(location.search)){
92+
// 帖子回复页面
93+
writeReply(); // 写入自动回复内容
6494
}
65-
curSite.pageUrl = ""; // 下一页URL
6695

6796

68-
pageLoading(); // 自动翻页
97+
// 判断是否登陆
98+
function checkLogin(){
99+
var checklogin = document.querySelectorAll('.wp.h_menu p a');
100+
if (checklogin){
101+
for (var value of checklogin) {
102+
if (value.innerHTML == "退出"){
103+
loginStatus = true;
104+
}
105+
}
106+
}
107+
}
69108

70109

71110
// 自动翻页
@@ -91,6 +130,61 @@
91130
}
92131

93132

133+
// 自动点击回复
134+
function autoReply(){
135+
if (loginStatus == true){
136+
// 存在隐藏内容,则点击回复按钮
137+
var autoreply = document.querySelector('.locked a');
138+
if (autoreply){
139+
autoreply.click();
140+
}
141+
}
142+
143+
}
144+
145+
146+
// 写入回复内容
147+
function writeReply(){
148+
if (loginStatus == true){
149+
document.getElementById('e_iframe').contentWindow.document.querySelector('body').innerHTML = replyList[Math.floor((Math.random()*replyList.length))];
150+
document.getElementById('postsubmit').click();
151+
}
152+
153+
}
154+
155+
156+
// 回复后返回帖子第一页
157+
function backReply(){
158+
if (loginStatus == true){
159+
// 判断前一个页面是否是回复帖子页面
160+
if (document.referrer){
161+
if (patt_reply.test(document.referrer)){
162+
// 判断上一页按钮是否存在,如果存在则代表不是帖子第一页
163+
if (document.querySelector('.prev')){
164+
// 寻找第一页按钮并点击
165+
var firstPage = document.querySelector('.pg a');
166+
if (firstPage.innerHTML == "1 ..."){
167+
firstPage.click();
168+
}
169+
}else{
170+
// 如果不存在,说明是帖子第一页,则返回顶部
171+
window.scrollTo('0','0');
172+
}
173+
}
174+
}
175+
}
176+
}
177+
178+
179+
// 清理置顶帖子
180+
function cleanTop(){
181+
var showhide = document.querySelectorAll("a.showhide.y");
182+
if (showhide.length > 0){
183+
showhide.forEach(el=>el.click());
184+
}
185+
}
186+
187+
94188
// 滚动条事件
95189
function windowScroll(fn1) {
96190
var beforeScrollTop = document.documentElement.scrollTop,

52pojie-Beautification.user.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name 吾爱破解论坛美化
3-
// @version 1.0.1
3+
// @version 1.0.2
44
// @author X.I.U
55
// @description 精简多余内容
66
// @match *://www.52pojie.cn/*
@@ -13,12 +13,10 @@
1313
(function() {
1414
var style_Add = document.createElement('style');
1515
style_Add.innerHTML = `
16-
a[href="connect.php?mod=config"], #toptb, #navmenu, #nv_ph, #nv, #pt .y, #chart, #online, #ft, .bm.lk, .dnch_eo_pt, .dnch_eo_pr, .dnch_eo_f, .bml, ul.xl.xl2.o.cl, dl.pil.cl, td.plc.plm .sign, .dnch_eo_pb, .dnch_eo_pt, .pls .side-star, .pls .side-group, .res-footer-note, .comiis_nav, .scbar_hot_td, .md_ctrl, .pls.favatar .xg1 {
16+
a[href="connect.php?mod=config"], #toptb, #navmenu, #nv_ph, #nv, #pt .y, #chart, #online, #ft, .bm.lk, .dnch_eo_pt, .dnch_eo_pr, .dnch_eo_f, ul.xl.xl2.o.cl, dl.pil.cl, td.plc.plm .sign, .dnch_eo_pb, .dnch_eo_pt, .pls .side-star, .pls .side-group, .res-footer-note, .comiis_nav, .scbar_hot_td, .md_ctrl, .pls.favatar .xg1 {
1717
display:none !important;
1818
}
19-
/*.wp {
20-
width:70%;
21-
}*/
19+
2220
@media (max-width:650px) {
2321
#postlist .favatar.pls .avatar img {
2422
margin:0 0 2px;

GithubEnhanced-High-Speed-Download.user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// @name Github 增强 - 高速下载
33
// @version 1.1.3
44
// @author X.I.U
5-
// @description 为 Github 的 Clone、Release、Raw、Code(ZIP) 添加高速下载
5+
// @description 高速下载 Clone、Release、Raw、Code(ZIP)
66
// @match https://github.com/*/*
77
// @match https://github.com/*/*/releases
88
// @match https://github.com/*/*/releases/*

README.md

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,19 @@
88

99
## 使用说明
1010

11-
> 点击 **「安装」** 是备用的 Github 链接,点击 **脚本名称** 前往 _GreasyFork_ 查看详细介绍。
12-
13-
* **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** [Steam 创意工坊大图修复](https://greasyfork.org/scripts/397666)
14-
****
15-
* **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/ZhihuEnhanced-Widescreen.user.js)** [知乎增强 - 宽屏显示](https://greasyfork.org/scripts/412212)
16-
* **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/ZhihuEnhanced-CollapsedAnswer.user.js)** [知乎增强 - 一键收起长篇回答](https://greasyfork.org/scripts/412205)
17-
* **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/ZhihuEnhanced-HD-Pictures.user.js)** [知乎增强 - 默认显示高清原图](https://greasyfork.org/scripts/412217)
18-
* **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/ZhihuEnhanced-Time.user.js)** [知乎增强 - 置顶显示发布/编辑时间](https://greasyfork.org/scripts/412216)
19-
****
20-
* **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** [3DM论坛增强 - 自动无缝翻页](https://greasyfork.org/scripts/412890)
21-
****
22-
* **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** [吾爱破解论坛美化 - 精简多余内容](https://greasyfork.org/scripts/412681)
23-
* **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** [吾爱破解论坛增强 - 自动签到、自动无缝翻页](https://greasyfork.org/scripts/412680)
24-
****
25-
* **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** [智友邦论坛美化 - 精简多余内容、宽屏显示](https://greasyfork.org/scripts/412361)
26-
* **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** [智友邦论坛增强 - 自动签到、自动回复、自动无缝翻页、清理置顶帖子](https://greasyfork.org/scripts/412362)
27-
****
28-
* **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** [Github 增强 - 高速下载 \[Clone、Release、Raw、Code(ZIP)\]](https://greasyfork.org/scripts/412245)
11+
| 脚本名称 | 脚本功能 | 安装 | 备用安装 |
12+
| :---- | :---- | :----: | :----: |
13+
| **知乎增强** | 宽屏显示 | **[「安装」](https://greasyfork.org/scripts/412212)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/ZhihuEnhanced-Widescreen.user.js)** |
14+
| **知乎增强** | 一键收起长篇回答 | **[「安装」](https://greasyfork.org/scripts/412205)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/ZhihuEnhanced-CollapsedAnswer.user.js)** |
15+
| **知乎增强** | 默认显示高清原图 | **[「安装」](https://greasyfork.org/scripts/412217)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/ZhihuEnhanced-HD-Pictures.user.js)** |
16+
| **知乎增强** | 置顶显示发布/编辑时间 | **[「安装」](https://greasyfork.org/scripts/412216)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/ZhihuEnhanced-Time.user.js)** |
17+
| **Github 增强** | 高速下载 \[Clone、Release、Raw、Code(ZIP)\] | **[「安装」](https://greasyfork.org/scripts/412245)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/GithubEnhanced-High-Speed-Download.user.js)** |
18+
| **3DM论坛增强** | 自动回复、自动无缝翻页、清理置顶帖子 | **[「安装」](https://greasyfork.org/scripts/412890)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/3dm-Enhanced.user.js)** |
19+
| **智友邦论坛美化** | 精简多余内容、宽屏显示 | **[「安装」](https://greasyfork.org/scripts/412361)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Beautification.user.js)** |
20+
| **智友邦论坛增强** | 自动签到、自动回复、自动无缝翻页、清理置顶帖子 | **[「安装」](https://greasyfork.org/scripts/412362)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/Zhiyoo-Enhanced.user.js)** |
21+
| **吾爱破解论坛美化** | 精简多余内容 | **[「安装」](https://greasyfork.org/scripts/412681)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Beautification.user.js)** |
22+
| **吾爱破解论坛增强** | 自动签到、自动无缝翻页 | **[「安装」](https://greasyfork.org/scripts/412680)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/52pojie-Enhanced.user.js)** |
23+
| **Steam 创意工坊大图修复** | 修复 Steam 创意工坊预览大图无法显示的问题 | **[「安装」](https://greasyfork.org/scripts/397666)** | **[「安装」](https://cdn.jsdelivr.net/gh/XIU2/UserScript@master/SteamWorkshopImageRepair.user.js)** |
2924

3025
****
3126

SteamWorkshopImageRepair.user.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// @version 1.0.0
66
// @author X.I.U
77
// @description Fixed Steam Workshop image not showing
8-
// @description:zh-CN 修复 Steam 创意工坊预览大图无法显示的问题
9-
// @description:zh-TW 修復 Steam 創意工坊預覽大圖無法顯示的問題
8+
// @description:zh-CN 修复 Steam 创意工坊预览大图无法显示的问题
9+
// @description:zh-TW 修復 Steam 創意工坊預覽大圖無法顯示的問題
1010
// @include *://steamcommunity.com/sharedfiles/filedetails/*
1111
// @include *://steamcommunity.com/workshop/filedetails/*
1212
// @icon https://store.steampowered.com/favicon.ico

Zhiyoo-Enhanced.user.js

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// ==UserScript==
22
// @name 智友邦论坛增强
3-
// @version 1.0.4
3+
// @version 1.0.5
44
// @author X.I.U
5-
// @description 自动签到、自动回复、自动无缝翻页、自动清理置顶帖子等
5+
// @description 自动签到、自动回复、自动无缝翻页、清理置顶帖子
66
// @icon http://bbs.zhiyoo.net/favicon.ico
77
// @match *://bbs.zhiyoo.net/*
88
// @grant GM_xmlhttpRequest
@@ -15,6 +15,10 @@
1515
// 签到后跳转的URL
1616
var qiandao_Redirect_URL = `http://bbs.zhiyoo.net/forum.php?mod=forumdisplay&fid=42&filter=author&orderby=dateline`;
1717

18+
// 检查是否登陆
19+
var loginStatus = false;
20+
checkLogin();
21+
1822
// 默认 ID 为 0
1923
var curSite = {SiteTypeID: 0};
2024

@@ -70,6 +74,15 @@
7074
}
7175

7276

77+
// 判断是否登陆
78+
function checkLogin(){
79+
var checklogin = document.querySelector('.Quater_user.logined');
80+
if (checklogin){
81+
loginStatus = true;
82+
}
83+
}
84+
85+
7386
// 自动翻页
7487
function pageLoading() {
7588
if (curSite.SiteTypeID > 0){
@@ -88,33 +101,39 @@
88101

89102
// 自动签到
90103
function qiandao(){
91-
if(document.getElementById("yl"))
92-
{
93-
document.querySelector('#yl').click();
94-
document.querySelector('.tr3.tac div a').click();
104+
if (loginStatus == true){
105+
if(document.getElementById("yl"))
106+
{
107+
document.querySelector('#yl').click();
108+
document.querySelector('.tr3.tac div a').click();
109+
}
110+
setTimeout(location.href=qiandao_Redirect_URL, 2000); // 跳转到指定URL
95111
}
96-
setTimeout(location.href=qiandao_Redirect_URL, 2000); // 跳转到指定URL
97112
}
98113

99114

100115
// 自动回复
101116
function autoReply(){
102-
// 存在隐藏内容,自动回复
103-
if (document.getElementsByClassName("locked").length > 0){
104-
document.querySelector('#saya_fastreply_div div').click();
105-
setTimeout(`document.getElementById('fastpostsubmit').click()`, 200);
106-
setTimeout(`window.scrollTo(0,99999999)`, 1000);
117+
if (loginStatus == true){
118+
// 存在隐藏内容,自动回复
119+
if (document.getElementsByClassName("locked").length > 0){
120+
document.querySelector('#saya_fastreply_div div').click();
121+
setTimeout(`document.getElementById('fastpostsubmit').click()`, 200);
122+
setTimeout(`window.scrollTo(0,99999999)`, 1000);
123+
}
107124
}
108125
}
109126

110127

111128
// 定位到隐藏内容区域
112129
function showHide(){
113-
// 如果已显示隐藏内容,则定位到隐藏内容区域
114-
// 如果没有发现已显示隐藏内容,就不定位了
115-
if (document.getElementsByClassName("showhide").length > 0){
116-
setTimeout(`window.scrollTo(0,99999999)`, 1000);
117-
//setTimeout(`location.hash='#footer'`, 1000);
130+
if (loginStatus == true){
131+
// 如果已显示隐藏内容,则定位到隐藏内容区域
132+
// 如果没有发现已显示隐藏内容,就不定位了
133+
if (document.getElementsByClassName("showhide").length > 0){
134+
setTimeout(`window.scrollTo(0,99999999)`, 1000);
135+
//setTimeout(`location.hash='#footer'`, 1000);
136+
}
118137
}
119138
}
120139

0 commit comments

Comments
 (0)