Botzone_LevelUpper

Botzone挂机升级小工具

  1. // ==UserScript==
  2. // @name Botzone_LevelUpper
  3. // @namespace https://wr786.github.io/
  4. // @version 0.0.6
  5. // @description Botzone挂机升级小工具
  6. // @author wr786
  7. // @match *://www.botzone.org.cn/*
  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\" id=\"blu\" value=\"LevelUpper\" onclick=\"this.value=\'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. var btn = document.getElementById('blu');
  45. if(btn) {
  46. if(btn.value == "LevelUpper已启动") {
  47. alert("LevelUpper已启动, 请等待…");
  48. Botzone_LevelUpper();
  49. _itv = window.clearInterval(_itv);
  50. }
  51. } else {
  52. add_button();
  53. }
  54. }
  55. }
  56. } // 判断是否生成按钮
  57.  
  58. (function() {
  59. _itv = window.setInterval(check_status, 1000);
  60. })();