bw-fix-battle

http://www.bloodyworld.com

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name           bw-fix-battle
// @description    http://www.bloodyworld.com
// @include http://www.bloodyworld.com/*
// @exclude http://www.bloodyworld.com/xfn/*
// @exclude http://www.bloodyworld.com/xfn2/*
// @version 0.0.1.20150604004031
// @namespace https://greasyfork.org/users/12000
// ==/UserScript==



  window.opera.defineMagicVariable(
	'TotalDEF',
	function(x) {
	  bDEF = document.getElementsByName('shit[]');
	  tot = 0;
	  for (i=0; i<bDEF.length; i++) {
		  if (bDEF[i].checked)
			  tot ++;
	  }
	  return tot;
	},
	null
  );

  window.opera.defineMagicFunction(
	'AddShitDEF',
	function(x) {
	  if  (TotalDEF<=MaxTotalDEF) { return 1; }
	  else
	  {
		alert('Maximum '+MaxTotalDEF+' defend points');
		return 0;
	  }
	}
  );

  window.opera.defineMagicVariable(
	'TotalATK',
	function(x) {
	  tot = 0;
	  bATK = document.getElementsByName('fire');
	  for (i=0; i<bATK.length; i++) {
		  if (bATK[i].checked)
			  tot ++;
	  }
	  bATK = document.getElementsByName('fire[]');
	  for (i=0; i<bATK.length; i++) {
		  if (bATK[i].checked)
			  tot ++;
	  }
	  return tot;
	},
	null
  );

  window.opera.defineMagicFunction(
	'AddShitATK',
	function(x) {
	  if  (TotalATK<=MaxTotalATK) { return 1; }
	  else
	  {
		alert('Maximum '+MaxTotalATK+' attack points');
		return 0;
	  }
	}
  );