Botzone_LevelUpper

Botzone挂机升级小工具

目前為 2020-09-26 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Botzone_LevelUpper
// @namespace    https://wr786.github.io/
// @version      0.0.2
// @description  Botzone挂机升级小工具
// @author       wr786
// @match        *://@.botzone.org.cn/mybots*
// @grant        none
// @run-at document-start
// ==/UserScript==

function getElementsByClass(Parent,Class){
    var Result = [];
    var Node = Parent.getElementsByTagName("*");
    for(var i=0; i<Node.length; i++){
        if(Node[i].className == Class){
            Result.push(Node[i]);
        }
    }
    return Result;
}

function gain_exp() {
    $("#txtDescription_bot").val("Botzone_levelUpper");
    $("#btnInheritVersion").click();
    $("#frmCreateBot").submit();
}	// 每次能获得10EXP

function Botzone_levelUpper() {
	var itv = window.setInterval(gain_exp, 3000);
}

function add_button() {
	var html ="<input type=\"button\" value=\"LevelUpper\" onclick=\"Botzone_levelUpper();\" style=\"background: #1f1e33; color: #FFFFFF\">";
	document.getElementById("btnCreateFormClose").outerHTML = html;
}

var _itv;

function check_status() {
	var form = document.getElementById('panCreate');
	if(form) {
		if(form.firstElementChild.innerText.indexOf("给Bot增加版本") != -1) {
			add_button();
			_itv = window.clearInterval(_itv);
		}
	}
}	// 判断是否生成按钮

(function() {
	_itv = window.setInterval(check_status, 1000);
})();