巴蜀OJ自动发信机+自动删信机

自动向指定用户发送n条消息,1秒250条。自动删除当前页码上的所有信息,瞬间删完。自动删除所有信息,几秒删完。

  1. // ==UserScript==
  2. // @name 巴蜀OJ自动发信机+自动删信机
  3. // @name:en Auto mail sender + deleter for BSOJ
  4. // @namespace https://gf.qytechs.cn/users/1265383
  5. // @version 3.8
  6. // @description 自动向指定用户发送n条消息,1秒250条。自动删除当前页码上的所有信息,瞬间删完。自动删除所有信息,几秒删完。
  7. // @description:en Automatically send n messages to the specified user, 250 message every second.Automatically deletes all information on the current page number in an instant.Automatically deletes all information quickly.
  8. // @author 123asdf123(luogu 576074)
  9. // @match https://oj.bashu.com.cn/*/mail.*
  10. // @icon https://oj.bashu.com.cn/favicon.ico
  11. // @license GPL3.0+SATA
  12. // @grant none
  13. // ==/UserScript==
  14. var autosendb=document.createElement("span"),delb=document.createElement("span"),clearb=document.createElement("span"),automail=document.createElement("div"),now;
  15. function insertAfter(newElement, targetElement) {
  16. let parent = targetElement.parentNode;
  17. if (parent.lastChild == targetElement) {
  18. parent.appendChild(newElement);
  19. } else {
  20. parent.insertBefore(newElement, targetElement.nextSibling);
  21. }
  22. }
  23. function tot(){
  24. document.body.children[0].innerHTML="<center><h1>"+now+" sent.</h1></center>"
  25. }
  26. function send(user,title,content){
  27. document.getElementById("sendnew").click();
  28. document.getElementById("to_input").value=user;
  29. document.getElementById("title_input").value=title;
  30. document.getElementById("detail_input").value=content;
  31. let d=$('#send_form').serialize();
  32. while(document.body.children.length){
  33. document.body.children[0].remove();
  34. }
  35. window.document.body.appendChild(document.createElement("div"))
  36. now=0;
  37. while(localStorage["auto-send-remain"]!=0){
  38. localStorage["auto-send-remain"]--;
  39. $.ajax({
  40. type:"POST",
  41. url:"ajax_mailfunc.php?op=send",
  42. data:d,
  43. success:function(data){console.log(data);now++},
  44. });
  45. }
  46. setInterval(tot,20);
  47. }
  48. function sendmessage(){
  49. localStorage["auto-send-remain"]=parseInt(prompt("Times?","1"));
  50. if(isNaN(localStorage["auto-send-remain"])){
  51. localStorage["auto-send-remain"]=0;
  52. return;
  53. }
  54. localStorage["auto-send-user"]=document.getElementById("to_input").value;
  55. localStorage["auto-send-title"]=document.getElementById("title_input").value;
  56. localStorage["auto-send-content"]=document.getElementById("detail_input").value;
  57. location.reload();
  58. }
  59. function delmessage(){
  60. let need=document.querySelectorAll(".mail-item");
  61. for(let i=0;i<need.length;i++){
  62. // console.log(need[i].id);
  63. $.ajax('ajax_mailfunc.php?op=delete&mail_id='+need[i].id.substr(4));
  64. }
  65. return need.length;
  66. }
  67. function del(){
  68. delmessage();
  69. location.reload();
  70. }
  71. function clearmessage(){
  72. let x=confirm("Are you sure?");
  73. if(x==true){
  74. localStorage["auto-clear"]=1;
  75. location.reload();
  76. }
  77. }
  78. (function() {
  79. 'use strict';
  80. autosendb.innerHTML="Auto-Send";
  81. autosendb.className="btn btn-info";
  82. autosendb.onclick=sendmessage;
  83. delb.innerHTML="<i class=\"icon-trash\"></i> Delete all messages on this page";
  84. delb.className="btn btn-small";
  85. delb.setAttribute("style","margin:5px");
  86. delb.onclick=del;
  87. clearb.innerHTML="<i class=\"icon-warning-sign\"></i> Clear all";
  88. clearb.className="btn btn-small";
  89. clearb.setAttribute("style","margin:5px");
  90. clearb.onclick=clearmessage;
  91. document.getElementById("sendnew").parentNode.appendChild(autosendb);
  92. document.getElementById("sendnew").parentNode.appendChild(delb);
  93. document.getElementById("sendnew").parentNode.appendChild(clearb);
  94. insertAfter(autosendb,document.getElementById("MailModal").children[2].children[0]);
  95. document.getElementById("MailModal").parentNode.appendChild(automail);
  96. if(localStorage["auto-send-done"]==1){
  97. localStorage["auto-send-done"]=0;
  98. var done=document.createElement("div");
  99. done.innerHTML="Done.";
  100. done.className="alert alert-success center alert-popup";
  101. document.body.appendChild(done);
  102. }
  103. if(localStorage.getItem("auto-clear")==null){
  104. localStorage["auto-clear"]=0;
  105. }
  106. if(localStorage["auto-clear"]==1){
  107. if(delmessage()==0){
  108. localStorage["auto-clear"]=0;
  109. }
  110. location.reload();
  111. }
  112. if(localStorage.getItem("auto-send-remain")==null){
  113. localStorage["auto-send-remain"]=0;
  114. }
  115. if(localStorage["auto-send-remain"]!=0){
  116. send(localStorage["auto-send-user"],localStorage["auto-send-title"],localStorage["auto-send-content"]);
  117. localStorage["auto-send-done"]=1;
  118. //location.reload();
  119. }
  120. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址