// ==UserScript== // @name 巴哈姆特公會、首頁自動簽到 // @namespace https://home.gamer.com.tw/moontai0724 // @version 2.0 // @description 巴哈姆特公會、首頁自動簽到 by.moontai0724 // @author moontai0724 // @match https://www.gamer.com.tw/* // @match https://guild.gamer.com.tw/* // @grant GM_xmlhttpRequest // @supportURL https://home.gamer.com.tw/creationDetail.php?sn=3852242 // @downloadURL none // ==/UserScript== (function () { 'use strict'; /* (Chrome) 如果要開啟自動簽到,請在「設定 -> 起始畫面」中新增 https://www.gamer.com.tw/index2.php?ad=N#check 意思為在開啟瀏覽器時,都會打開 https://www.gamer.com.tw/index2.php?ad=N#check 當打開 https://www.gamer.com.tw/index2.php?ad=N#check 的時候,自動簽到就會開始。 */ // 是否自動簽到公會?如不需要自動簽到公會,請將下方 signguild 變數 true 改為 false var signguild = true; // 作者的話:本人僅於 Chrome 上測試,照理說應能通用,但如有錯誤,將不提供其他瀏覽器的完全支援與改動。 // (如果有錯誤還是可以回報,也許某天會改動。) // ---------------------------------------------------------------------------------------------------- // 程式開始 if (BAHAID) { if (location.hash == "#check") { window.alert = function (str) { return; }; } if (location.hostname == "www.gamer.com.tw" && location.hash == "#check") { Signin.start(this); if (signguild === true) window.open("https://guild.gamer.com.tw/#check"); } else if (location.hostname == "guild.gamer.com.tw" && location.hash == "#check" && signguild === true) { jQuery.ajax({ url: "/ajax/topBar_AJAX.php?type=guild", method: "get", cache: false }).then(function (e) { $("#topBarMsg_guild").attr("className", "TOP-msg"); e ? $("#topBarMsg_guild").html('公會社團