妖火自动捡肉吃

zh-cn

  1. // ==UserScript==
  2. // @name 妖火自动捡肉吃
  3. // @namespace https://blog.zgcwkj.cn/archives/81.html
  4. // @version 1.9.0.6.13.15.01
  5. // @description zh-cn
  6. // @author zgcwkj
  7. // @license MIT
  8. // @match *://yaohuo.me/bbs*
  9. // @match *://yaohw.com/bbs*
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. var title = document.title;
  15. // console.log(title);
  16. var trge = /_.+?_妖火网/;
  17. var html = document.body.innerHTML;
  18. html = html.replace(" ", "").replace("\r", "").replace("\n", "");
  19. // console.log(html);
  20. if (title.indexOf("密码") == -1) {
  21. if (title.indexOf("查看回复") != -1) {//查看回复
  22. console.log("吃完了关闭");
  23. window.close();
  24. } else if (title.indexOf("查看") != -1) {//查看
  25. console.log("查看啥");
  26. } else if (trge.test(title)) {//回复帖子
  27. if (html.match(/(?<=.+\()余0(?=\).+)/) == null) {//还有剩的
  28. var toHtml_textarea = document.getElementsByTagName("textarea");
  29. // console.log(toHtml_textarea);
  30. if (toHtml_textarea.length == 0) {//已经结束的帖子
  31. console.log("已经结束了");
  32. window.close();
  33. } else {
  34. if (html.indexOf("礼金") != -1) {
  35. var content = "吃一口";
  36. var indexType = true;
  37. if (!indexType) {
  38. //==>寻找妖友的回复进行伪造
  39. var regC = /(?<=回<\/a>]<a href=".+?<\/a>:).+?(?=\()/g;
  40. var toRegC = html.match(regC);
  41. // console.log(toReg);
  42. content = toRegC[Math.ceil(Math.random() * (toRegC.length - 1))]
  43. //==>寻找妖友的回复进行伪造
  44. } else {
  45. var strs = [
  46. "就想吃个肉,不能水回复啊!感谢楼主的肉!!!",
  47. "Thanks for the meat of the landlord!!!",
  48. "肉肉肉",
  49. "这肉真给力",
  50. "就想吃个肉!",
  51. "肉啊,我来了",
  52. "肉的滋味真好",
  53. "爱老C,更爱肉",
  54. "不水,吃肉吃肉",
  55. "我爱楼主,更爱肉",
  56. "安静,我吃个肉先",
  57. "哈哈,香香的肉儿",
  58. "吃肉,离不开楼主了",
  59. "吃肉,小心被老C发现",
  60. "我不是萝莉控,是肉控啊!",
  61. "逛妖火不可能不吃肉的啦!",
  62. "吃肉,也得小心被老C吊打",
  63. "想吃肉,突然想起了能开花吗",
  64. "楼主,我能表白吗?向你的肉!",
  65. ]
  66. content = strs[Math.ceil(Math.random() * (strs.length - 1))];
  67. }
  68. //console.log(content);
  69. toHtml_textarea[0].value = content;
  70. var toHtml_input = document.getElementsByTagName("input");
  71. // console.log(toHtml_input);
  72. for (var iii = toHtml_input.length - 1; iii > 0; iii--) {
  73. if (toHtml_input[iii].value == "快速回复") {
  74. toHtml_input[iii].click();
  75. }
  76. }
  77. } else {
  78. console.log("普通的贴子");
  79. }
  80. }
  81. } else {//已经吃完了就关闭
  82. console.log("吃完了");
  83. window.close();
  84. }
  85. } else {
  86. var reg = /<img src="\/NetImages\/li.gif" alt="礼".+?<\/a>/g;
  87. var toReg = html.match(reg);
  88. // console.log(toReg);
  89. if (toReg != null) {
  90. for (var i = 0; i < toReg.length; i++) {
  91. var url = toReg[i].match(/(?<=<a href=").+?(?=">.+?<\/a>)/);
  92. // console.log(url);
  93. window.open(url);
  94. }
  95. }
  96. setTimeout(function () {//降低频率
  97. nextPage();
  98. }, '1000');
  99. function nextPage() {//单击下一页按钮
  100. var toHtml_a = document.getElementsByTagName("a");
  101. for (var ii = 0; ii < toHtml_a.length; ii++) {
  102. if (toHtml_a[ii].innerText == "下一页") {
  103. toHtml_a[ii].click();
  104. }
  105. }
  106. }
  107. }
  108. } else {
  109. console.log("输入密码");
  110. }
  111. })();