MyKirito Auto Click

mykirito.com 的自動操作,不包含任何界面調整。

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         MyKirito Auto Click
// @namespace    https://github.com/jakeuj/MyKirito
// @version      1.2
// @description  mykirito.com 的自動操作,不包含任何界面調整。
// @author       [email protected]
// @match        https://mykirito.com/
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    // [使用者自定義參數] 樓層獎勵是否已啟用: true=已啟用樓層獎勵, false=未啟用樓層獎勵
    var floorBonusEnalbe = true;
    // [使用者自定義參數] 行動: 1=狩獵兔肉, 2=自主訓練, 3=外出野餐, 4=汁妹, 5=做善事, 6=坐下休息, 7=釣魚, 8=修行1小時, 9=修行2小時, 10=修行4小時, 11=修行8小時
    var action = 11;

    // 自動確認修行彈窗
    var realConfirm=window.confirm;
    window.confirm=function(){
        window.confirm=realConfirm;
        return true;
    };

    // 依據樓層獎勵是否已啟用定位行動所在Div
    var actionDivIndex = 3;
    if(floorBonusEnalbe){
        actionDivIndex = 4;
    }

    //自動行動並領取樓層獎勵
    setInterval(function(){
        // 行動
        var xPathRes = document.evaluate ('/html/body/div[1]/div/div[1]/div['+actionDivIndex+']/button['+action+']', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
        xPathRes.singleNodeValue.click();
        // 樓層獎勵
        if(floorBonusEnalbe){
            xPathRes = document.evaluate ('/html/body/div[1]/div/div[1]/div[3]/button', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
            xPathRes.singleNodeValue.click();
        }
    }, 10000);
})();