Bahamut Auto Verification Code

巴哈姆特自動填寫回文驗證碼。

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name	Bahamut Auto Verification Code
// @description	巴哈姆特自動填寫回文驗證碼。
// @include	http://forum.gamer.com.tw/C.php*
// @include	http://forum.gamer.com.tw/post1.php*
// @include     https://user.gamer.com.tw/login.php
// @match	http://forum.gamer.com.tw/C.php*
// @match	http://forum.gamer.com.tw/post1.php*
// @match       https://user.gamer.com.tw/login.php
// @homepageURL	http://userscripts.org/scripts/show/141665
// @author	nsps5606
// @version	1.0.6
// @date	2012-10-06
// @namespace https://greasyfork.org/users/7425
// ==/UserScript==

(function () {

  var htm = document.body.innerHTML;
  var url = document.URL;

  if(new RegExp("forum.gamer.com.tw/C.php").test(url))
  {
    var start = htm.lastIndexOf("\u767C\u6587\u9A57\u8B49\u78BC\uFF1A");
    if(start != -1)
    {
      var pw = htm.substring(start+12, start+16);
      var pwd2 = document.getElementsByName("pwd2")[0].value = pw;
    }
  }
  else if(new RegExp("forum.gamer.com.tw/post1.php").test(url))
  {
    var start = htm.lastIndexOf("BH-tcolor4");
    if(start != -1)
    {
      var pw = htm.substring(start+20, start+24);
      var pwd2 = document.getElementsByName("pwd2")[0].value = pw;
    }
  }
  else if(new RegExp("user.gamer.com.tw/login.php").test(url))
  {
    document.getElementsByName("autoLogin")[0].checked = true;
  }
  

})();