Greasy Fork

Greasy Fork is available in English.

雀魂麻将脚本

用于雀魂麻将的简易脚本

当前为 2021-03-21 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        雀魂麻将脚本
// @description 用于雀魂麻将的简易脚本
// @namespace   game.maj-soul.com
// @match       *://game.maj-soul.com/1/
// @icon        https://game.maj-soul.com/1/favicon.ico
// @grant       none
// @version     1.0
// @author      bin
// ==/UserScript==

/**
 * @param {any}object
 * @param {string|number}field
 * @param {Function}callback
 */
const hook = (object, field, callback) => {
  if (object == null || field == null || callback == null) {
    return console.log(`参数不能为空`);
  }
  let orgin = object[field];
  object[field] = function (...args) {
    callback(...args);
    orgin.call(this, ...args);
  };
};
const runner = () => {
  { //使用steam服务器
    hook(app.NetAgent, "init", () => {
      console.log("加入steam服务器");
      GameMgr.config_data.ip[0].region_urls.unshift("http://47.114.218.120:4201/api/v0/recommend_list");
    });
  } {

  }
};


new Promise((res) => {
  let interval = setInterval(() => {
    if (window.game === undefined) {
      return;
    }
    clearInterval(interval);
    console.log("游戏已加载");
    res();
  }, 1000);
}).then(() => runner());