Bahamut Auto Verification Code

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

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==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;
  }
  

})();