BBS bot

auto-replay the hidden posts ,for discuz & phpwind7/8

  1. // ==UserScript==
  2. // @name BBS bot
  3. // @version 0.7.2
  4. // @description auto-replay the hidden posts ,for discuz & phpwind7/8
  5. // @description 自动回复隐藏贴,支持 discuz & phpwind7/8
  6. // @namespace http://userscripts.org/users/tumuyan
  7. // @include *read*tid*
  8. // @include *thread*
  9. // @include *forum*fid*
  10. // @include *viewthread*tid*
  11. // @include http://bbs.*
  12. // @exclude *google*
  13. // @exclude *sis*/forum/thread*
  14. // @auther tumuyan
  15. // @icon http://s3.amazonaws.com/uso_ss/icon/152745/large.PNG
  16. // ==/UserScript==
  17.  
  18. // bbsbot正在改造中...
  19.  
  20. // 这是一个测试的版本,第一次打开一个论坛的隐藏贴时,脚本会询问是否在本论坛开启自动回复功能;
  21.  
  22.  
  23. quotes = new Array
  24. quotes[1] = '很棒~~ 楼主大爱!!'
  25. quotes[2] = '好厉害! 支持+10086'
  26. quotes[3] = '泪流满面!原来这样的…'
  27. quotes[4] = 'Mark一下,回头再学习'
  28. quotes[5] = '楼主辛苦了 真是好人啊'
  29. quotes[6] = '向楼主学习 我要加油了'
  30. quotes[7] = '楼主写的真棒~~~~'
  31. quotes[8] = '楼主真乃神人也!'
  32. quotes[9] = '这个很不错 支持一下'
  33. quotes[10] = "虽不明,但觉厉..."
  34. quotes[11] = "感谢分享,貌似不错"
  35. quotes[0] = '顶楼主,希望楼主发更多好帖...';
  36. var rand=parseInt(Math.random()*10);
  37. var auto_reply = quotes[rand]
  38.  
  39. var bbsbot;
  40. try {bbsbot = localStorage["bbsbot"]} catch (err) {}
  41.  
  42. function step1(button_submit) {
  43.  
  44. if (bbsbot==2)
  45. {
  46. button_submit.click()
  47. }
  48. else
  49. {
  50. if (bbsbot==1)
  51. {}
  52. else
  53. {
  54. var r=confirm("此论坛要自动回复隐藏贴的功能麽?")
  55. if (r==true)
  56. {
  57. try {localStorage["bbsbot"] = 2;} catch (err) {}
  58. }
  59. else
  60. {
  61. try {localStorage["bbsbot"] = 1;} catch (err) {}
  62. }
  63.  
  64. }
  65. }
  66.  
  67. }
  68.  
  69. var html = document.documentElement.innerHTML
  70. var pattern = /<script .{0,60}>replyreload.{0,30}<\/script>/
  71. var find = html.match(pattern);
  72. if(find)
  73. {
  74. var input_area = document.getElementById('fastpostmessage');
  75. var button_submit = document.getElementById('fastpostsubmit');
  76. if(input_area && button_submit)
  77. {
  78. input_area.innerHTML =auto_reply ;
  79. step1(button_submit)
  80. }
  81. }
  82. else
  83. {
  84. var pattern = /<blockquote .{0,120}>.{0,60}隐藏.{0,20}回复.{0,40}<\/blockquote>/;
  85. if (html.match(pattern))
  86. var pw =1
  87. else
  88. var pw = document.getElementById('hidden_1_tpc') + document.getElementById('hidden_2_tpc') + document.getElementById('hidden_3_tpc') + document.getElementById('hidden_4_tpc')
  89. if(pw)
  90. {
  91. var input_area = document.getElementById('textarea');
  92. var button_submit = document.getElementsByName('Submit')[0];
  93. if(input_area && button_submit)
  94. { input_area.innerHTML=auto_reply ; step1(button_submit);}
  95. }
  96. }