UNPKG

ggejs

Version:

A powerful JavaScript library for interacting with the server of Goodgame Empire: Four Kingdoms

16 lines (15 loc) 503 B
const {execute: collectTax} = require('../../commands/collectTax'); module.exports.name = "txs"; /** * @param {Socket} socket * @param {number} errorCode * @param {Object} params */ module.exports.execute = function (socket, errorCode, params) { if (socket["inTaxTimeout"]) return; socket["inTaxTimeout"] = true; setTimeout(function () { socket["inTaxTimeout"] = false; collectTax(socket); }, (params.txi.TX.RT + Math.random() * 10) * 1000, socket); }