Sleazy Fork is available in English.

某游戏论坛自动回帖

帮助自动回帖,单手开车更方便

  1. // ==UserScript==
  2. // @name 某游戏论坛自动回帖
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.8
  5. // @description 帮助自动回帖,单手开车更方便
  6. // @author lpq
  7. // @match https://live.homesacg2.com/*
  8. // @match https://bbs.2046acg.com/*
  9. // @match https://bbs.acgyouxi.xyz/*
  10. // @grant none
  11. // @require https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. var $ = jQuery.noConflict();
  16.  
  17. $("#nv_forum").append('<<div class="focus plugin" id="ip_notice"><div class="bm"><div class="bm_c"><p class="ptn cl"><a href="javascript:()" id="viewImg" class="xi2 y one-pan-link-mark">一键查看游戏预览图</a></p></div></div></div>');
  18. $(".plugin").css("width","130px");$(".plugin .bm").css("background","#f8ba31");
  19. $("#viewImg").click(function(){
  20. $("a[href]").each(function(){
  21. var href=$(this).attr("href");
  22. if(href.indexOf(".jpg")!=-1||href.indexOf(".gif")!=-1){
  23. window.open($(this).attr("href"))
  24. }
  25. })
  26. $(this).remove();
  27. })
  28. //判断是否回复过
  29. var locked=$(".locked").text()!=""?true:false;
  30. //如果没有回复
  31. if(locked){
  32. //模拟回复
  33. $("[name=message]").val("看了LZ的帖子,我只想说一句很好很强大!");
  34. $("#fastpostsubmit").click();
  35. setTimeout(function(){ scrollTo(0,0); }, 1500);
  36. }else{
  37. //自动跳转到第一页
  38. var href=location.href;
  39. if(href.indexOf("forum.php")!=-1){
  40. function GetQueryString(name)
  41. {
  42. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  43. var r = window.location.search.substr(1).match(reg);
  44. if (r != null) {
  45. return unescape(r[2]);
  46. }
  47. return null;
  48. };
  49. var doMain=href.substring(0,href.indexOf("forum.php"));
  50. var tid=GetQueryString("tid");
  51. IF(tid!=null)
  52. location.href=doMain+"thread-"+tid+"-1-1.html";
  53. }else if(href.indexOf("thread")!=-1){
  54. var detailPage=href.substring(href.indexOf("thread")+7);
  55. var beforePage=href.substring(0,href.indexOf("thread"));
  56. var params=detailPage.split("-");
  57. var currentPage=params[1];
  58. if(currentPage!=1){
  59. location.href=beforePage+"thread-"+params[0]+"-1-1.html";
  60. }
  61. }
  62. }
  63. })();