Botzone_LevelUpper

Botzone挂机升级小工具

当前为 2020-09-26 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Botzone_LevelUpper
  3. // @namespace https://wr786.github.io/
  4. // @version 0.0.4
  5. // @description Botzone挂机升级小工具
  6. // @author wr786
  7. // @match *://www.botzone.org.cn/mybots
  8. // @grant none
  9. // @run-at document-start
  10. // ==/UserScript==
  11.  
  12. function getElementsByClass(Parent,Class){
  13. var Result = [];
  14. var Node = Parent.getElementsByTagName("*");
  15. for(var i=0; i<Node.length; i++){
  16. if(Node[i].className == Class){
  17. Result.push(Node[i]);
  18. }
  19. }
  20. return Result;
  21. }
  22.  
  23. function gain_exp() {
  24. $("#txtDescription_bot").val("Botzone_levelUpper");
  25. $("#btnInheritVersion").click();
  26. $("#frmCreateBot").submit();
  27. } // 每次能获得10EXP
  28.  
  29. function Botzone_levelUpper() {
  30. var itv = window.setInterval(gain_exp, 3000);
  31. }
  32.  
  33. function add_button() {
  34. var html ="<input type=\"button\" value=\"LevelUpper\" onclick=\"Botzone_levelUpper();\" style=\"background: #1f1e33; color: #FFFFFF\">";
  35. document.getElementById("btnCreateFormClose").outerHTML = html;
  36. }
  37.  
  38. var _itv;
  39.  
  40. function check_status() {
  41. var form = document.getElementById('panCreate');
  42. if(form) {
  43. if(form.firstElementChild.innerText.indexOf("给Bot增加版本") != -1) {
  44. add_button();
  45. _itv = window.clearInterval(_itv);
  46. }
  47. }
  48. } // 判断是否生成按钮
  49.  
  50. (function() {
  51. _itv = window.setInterval(check_status, 1000);
  52. })();