|
1 | 1 | // ==UserScript== |
2 | 2 | // @name 智友邦论坛增强 |
3 | | -// @version 1.1.0 |
| 3 | +// @version 1.1.1 |
4 | 4 | // @author X.I.U |
5 | | -// @description 自动签到、自动回复、自动无缝翻页、清理置顶帖子、清理帖子标题〖XXX〗【XXX】文字 |
| 5 | +// @description 自动签到、自动回复、自动无缝翻页、清理置顶帖子、清理帖子标题〖XXX〗【XXX】文字 |
6 | 6 | // @icon http://bbs.zhiyoo.net/favicon.ico |
7 | 7 | // @match *://bbs.zhiyoo.net/* |
8 | 8 | // @grant GM_xmlhttpRequest |
|
55 | 55 | registerMenuCommand(); // 重新注册脚本菜单 |
56 | 56 | }; |
57 | 57 |
|
| 58 | + |
| 59 | + // 随机回复帖子的内容 |
| 60 | + var replyList = [ |
| 61 | + "感谢楼主分享的内容!", |
| 62 | + "感谢分享!给你点赞!", |
| 63 | + "感谢分享!论坛因你更精彩!", |
| 64 | + "看看隐藏内容是什么!谢谢!", |
| 65 | + "先下载看看好不好用!", |
| 66 | + "楼主一生平安!好人一生平安!", |
| 67 | + "搞机上智友提问下资源!", |
| 68 | + "马克!智友邦你搞机!", |
| 69 | + "你说的观点我也很支持!", |
| 70 | + "楼主太棒了!我先下为敬!", |
| 71 | + "给楼主点赞,希望继续分享!", |
| 72 | + "感谢智友帮论坛,感谢LZ热心分享!", |
| 73 | + "感谢楼主分享优质内容,希望继续努力!", |
| 74 | + "下载试用一下,如果用着不错就给楼主顶贴!", |
| 75 | + "这么好的东西!感谢楼主分享!感谢智友帮论坛!", |
| 76 | + "希望楼主继续分享更多好用的东西!谢谢!", |
| 77 | + "看到楼主这么努力分享,我只能顶个贴感谢一下了!", |
| 78 | + "好东西,拿走了,临走顶个贴感谢一下楼主!", |
| 79 | + "这就非常给力了!感谢分享!", |
| 80 | + "厉害了!先收藏,再回复!谢谢!" |
| 81 | + ]; |
| 82 | + |
58 | 83 | // 帖子数量,避免重复清理帖子列表中帖子标题开头的〖XXX〗【XXX】文字,用于提高效率 |
59 | 84 | var postNum = 0; |
60 | 85 |
|
|
161 | 186 | function autoReply(){ |
162 | 187 | if (loginStatus){ |
163 | 188 | // 存在隐藏内容,自动回复 |
164 | | - if (document.getElementsByClassName("locked").length > 0){ |
165 | | - document.querySelector('#saya_fastreply_div div').click(); |
166 | | - setTimeout(`document.getElementById('fastpostsubmit').click()`, 200); |
167 | | - setTimeout(`window.scrollTo(0,99999999)`, 1000); |
| 189 | + if (document.getElementsByClassName("showhide").length == 0){ |
| 190 | + writeReply(); |
| 191 | + // 如果使用了我的智友帮美化脚本,则定位至底部,反之定位至顶部 |
| 192 | + if (document.getElementById("fastpostmessage").offsetParent == null){ |
| 193 | + console.log('111111') |
| 194 | + setTimeout(`window.scrollTo(0,99999999)`, 1000); |
| 195 | + }else{ |
| 196 | + console.log('222222') |
| 197 | + setTimeout(`window.scrollTo(0,0)`, 1000); |
| 198 | + } |
| 199 | + } |
| 200 | + } |
| 201 | + } |
| 202 | + |
| 203 | + |
| 204 | + // 写入自动回复内容 |
| 205 | + function writeReply(){ |
| 206 | + var textarea = document.getElementById("fastpostmessage"); |
| 207 | + if (textarea){ |
| 208 | + // 随机写入回复内容 |
| 209 | + textarea.value = textarea.value + replyList[Math.floor((Math.random()*replyList.length))] + replyList[Math.floor((Math.random()*replyList.length))]; |
| 210 | + console.log(`${textarea.value}`) |
| 211 | + var fastpostsubmit = document.getElementById("fastpostsubmit"); |
| 212 | + if (fastpostsubmit){ |
| 213 | + setTimeout(`fastpostsubmit.click()`, 200); |
168 | 214 | } |
169 | 215 | } |
170 | 216 | } |
|
176 | 222 | // 如果已显示隐藏内容,则定位到隐藏内容区域 |
177 | 223 | // 如果没有发现已显示隐藏内容,就不定位了 |
178 | 224 | if (document.getElementsByClassName("showhide").length > 0){ |
179 | | - setTimeout(`window.scrollTo(0,99999999)`, 1000); |
| 225 | + // 如果使用了我的智友帮美化脚本,则定位至底部,反之定位至顶部 |
| 226 | + if (document.getElementById("fastpostmessage").offsetParent == null){ |
| 227 | + setTimeout(`window.scrollTo(0,99999999)`, 1000); |
| 228 | + } |
180 | 229 | //setTimeout(`location.hash='#footer'`, 1000); |
181 | | - console.log(`${$(".showhide").scrollTop()}`); |
| 230 | + //console.log(`${$(".showhide").scrollTop()}`); |
182 | 231 | } |
183 | 232 | } |
184 | 233 | } |
|
0 commit comments