add info about a new stat tracking website - TWHelp

This commit is contained in:
Dawid Wysokiński 2021-01-01 18:03:36 +01:00
parent 210a70b56c
commit b169968105
34 changed files with 712 additions and 100 deletions

View File

@ -293,9 +293,9 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/bonusBarbarianVillageFinder.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/bonusBarbarianVillageFinder.js
// @version 0.4.3
// @version 0.4.4
// @description Bonus barbarian village finder
// @author Kichiyaki http://dawid-wysokinski.pl/
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*screen=map*
// @grant none
// ==/UserScript==

View File

@ -163,9 +163,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/commandRenamer.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/commandRenamer.js
// @version 0.2.0
// @version 0.2.1
// @description Command renamer
// @author Kichiyaki http://dawid-wysokinski.pl/
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*mode=incomings*
// @grant none
// ==/UserScript==

View File

@ -2949,7 +2949,8 @@ const translations = {
aotd: 'Agresor dnia',
dotd: 'Obrońca dnia',
sotd: 'Pomocnik dnia',
gpotd: 'Mocarstwo dnia'
gpotd: 'Mocarstwo dnia',
devNote: 'Informacja od autora - Właśnie uruchomiłem nową stronę ze statystykami, nie zapomnij jej sprawdzić :).'
},
en_DK: {
title: 'Daily achievements - probable players',
@ -2957,7 +2958,8 @@ const translations = {
aotd: 'Attacker of the day',
dotd: 'Defender of the day',
sotd: 'Supporter of the day',
gpotd: 'Great power of the day'
gpotd: 'Great power of the day',
devNote: "Information from the author - I've just launched a new stat tracking website, don't forget to check it out :)."
}
};
@ -3057,6 +3059,20 @@ exports.default = void 0;
var _default = () => window.location.host.split('.')[0];
exports.default = _default;
},{}],"J1Ly":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _default = function _default() {
let server = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
return server.substr(0, 2);
};
exports.default = _default;
},{}],"ZbyX":[function(require,module,exports) {
"use strict";
@ -3082,6 +3098,60 @@ const inUTC = function inUTC() {
};
exports.inUTC = inUTC;
},{}],"gvXE":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.buildVillageURL = exports.buildTribeURL = exports.buildPlayerURL = exports.buildURLToProfile = exports.buildURLToServerPage = exports.BASE_URL = void 0;
const BASE_URL = 'tribalwarshelp.com';
exports.BASE_URL = BASE_URL;
const buildURLToServerPage = function buildURLToServerPage() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
return "https://".concat(version, ".").concat(BASE_URL, "/server/").concat(server);
};
exports.buildURLToServerPage = buildURLToServerPage;
const buildURLToProfile = function buildURLToProfile() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
let entity = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
return "".concat(buildURLToServerPage(version, server), "/").concat(entity, "/").concat(id);
};
exports.buildURLToProfile = buildURLToProfile;
const buildPlayerURL = function buildPlayerURL() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
return buildURLToProfile(version, server, id, 'player');
};
exports.buildPlayerURL = buildPlayerURL;
const buildTribeURL = function buildTribeURL() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
return buildURLToProfile(version, server, id, 'tribe');
};
exports.buildTribeURL = buildTribeURL;
const buildVillageURL = function buildVillageURL() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
return buildURLToProfile(version, server, id, 'village');
};
exports.buildVillageURL = buildVillageURL;
},{}],"Jg9g":[function(require,module,exports) {
"use strict";
@ -3097,8 +3167,12 @@ var _tribalwars = require("./utils/tribalwars");
var _getCurrentServer = _interopRequireDefault(require("./utils/getCurrentServer"));
var _getServerVersionCode = _interopRequireDefault(require("./utils/getServerVersionCode"));
var _date = require("./utils/date");
var _twhelp = require("./utils/twhelp");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
@ -3112,9 +3186,9 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/dailyAchievements.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/dailyAchievements.js
// @version 0.4.2
// @version 0.4.3
// @description Daily achievements
// @author Kichiyaki http://dawid-wysokinski.pl/
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*screen=info_player&mode=awards*
// @grant none
// ==/UserScript==
@ -3165,7 +3239,7 @@ const render = (_ref) => {
dailyPlayerStatsOrderedByScoreSup,
dailyPlayerStatsOrderedByVillages
} = _ref;
const html = "\n <div class=\"award-group-head\">".concat(translations.title, "</div>\n <div class=\"award-group-content\" style=\"text-align: center;\">\n <div style=\"padding: 10px;\">\n <h3 style=\"color: red;\"><strong>").concat(translations.warning, "</strong></h3>\n <p><strong>").concat(translations.aotd, "</strong></p>\n ").concat(dailyPlayerStatsOrderedByScoreAtt.items.map((item, index) => "<span>".concat(index + 1, ". <a href=\"").concat((0, _tribalwars.formatPlayerURL)(item.player.id), "\">").concat(item.player.name, " - ").concat(item.scoreAtt.toLocaleString(), "</a></span>")).join('<br>'), "\n </div>\n <hr>\n <div style=\"padding: 10px;\">\n <p><strong>").concat(translations.dotd, "</strong></p>\n ").concat(dailyPlayerStatsOrderedByScoreDef.items.map((item, index) => "<span>".concat(index + 1, ". <a href=\"").concat((0, _tribalwars.formatPlayerURL)(item.player.id), "\">").concat(item.player.name, " - ").concat(item.scoreDef.toLocaleString(), "</a></span>")).join('<br>'), "\n </div>\n <hr>\n <div style=\"padding: 10px;\">\n <p><strong>").concat(translations.sotd, "</strong></p>\n ").concat(dailyPlayerStatsOrderedByScoreSup.items.map((item, index) => "<span>".concat(index + 1, ". <a href=\"").concat((0, _tribalwars.formatPlayerURL)(item.player.id), "\">").concat(item.player.name, " - ").concat(item.scoreSup.toLocaleString(), "</a></span>")).join('<br>'), "\n </div>\n <hr>\n <div style=\"padding: 10px;\">\n <p><strong>").concat(translations.gpotd, "</strong></p>\n ").concat(dailyPlayerStatsOrderedByVillages.items.map((item, index) => "<span>".concat(index + 1, ". <a href=\"").concat((0, _tribalwars.formatPlayerURL)(item.player.id), "\">").concat(item.player.name, " - ").concat(item.villages.toLocaleString(), "</a></span>")).join('<br>'), "\n </div>\n </div>\n <div class=\"award-group-foot\"></div>\n ");
const html = "\n <div class=\"award-group-head\">".concat(translations.title, "</div>\n <div class=\"award-group-content\" style=\"text-align: center;\">\n <div style=\"padding: 10px;\">\n <h1 style=\"margin-bottom: 0px;\"><a href=\"").concat((0, _twhelp.buildURLToServerPage)((0, _getServerVersionCode.default)(SERVER), SERVER), "\">TWHelp</a></h1>\n <h3 style=\"margin-bottom: 10px; margin-top: 0;\">").concat(translations.devNote, "</h3>\n <h3 style=\"color: red;\"><strong>").concat(translations.warning, "</strong></h3>\n <p><strong>").concat(translations.aotd, "</strong></p>\n ").concat(dailyPlayerStatsOrderedByScoreAtt.items.map((item, index) => "<span>".concat(index + 1, ". <a href=\"").concat((0, _tribalwars.formatPlayerURL)(item.player.id), "\">").concat(item.player.name, " - ").concat(item.scoreAtt.toLocaleString(), "</a></span>")).join('<br>'), "\n </div>\n <hr>\n <div style=\"padding: 10px;\">\n <p><strong>").concat(translations.dotd, "</strong></p>\n ").concat(dailyPlayerStatsOrderedByScoreDef.items.map((item, index) => "<span>".concat(index + 1, ". <a href=\"").concat((0, _tribalwars.formatPlayerURL)(item.player.id), "\">").concat(item.player.name, " - ").concat(item.scoreDef.toLocaleString(), "</a></span>")).join('<br>'), "\n </div>\n <hr>\n <div style=\"padding: 10px;\">\n <p><strong>").concat(translations.sotd, "</strong></p>\n ").concat(dailyPlayerStatsOrderedByScoreSup.items.map((item, index) => "<span>".concat(index + 1, ". <a href=\"").concat((0, _tribalwars.formatPlayerURL)(item.player.id), "\">").concat(item.player.name, " - ").concat(item.scoreSup.toLocaleString(), "</a></span>")).join('<br>'), "\n </div>\n <hr>\n <div style=\"padding: 10px;\">\n <p><strong>").concat(translations.gpotd, "</strong></p>\n ").concat(dailyPlayerStatsOrderedByVillages.items.map((item, index) => "<span>".concat(index + 1, ". <a href=\"").concat((0, _tribalwars.formatPlayerURL)(item.player.id), "\">").concat(item.player.name, " - ").concat(item.villages.toLocaleString(), "</a></span>")).join('<br>'), "\n </div>\n </div>\n <div class=\"award-group-foot\"></div>\n ");
if (!container) {
container = document.createElement('div');
@ -3193,4 +3267,4 @@ const render = (_ref) => {
console.log('dailyAchievements', error);
}
})();
},{"date-fns/format":"OZJZ","./libs/requestCreator":"Ph2E","./i18n/dailyAchievments":"rX6I","./utils/localStorage":"KWxH","./utils/tribalwars":"fHHP","./utils/getCurrentServer":"DMkL","./utils/date":"ZbyX"}]},{},["Jg9g"], null)
},{"date-fns/format":"OZJZ","./libs/requestCreator":"Ph2E","./i18n/dailyAchievments":"rX6I","./utils/localStorage":"KWxH","./utils/tribalwars":"fHHP","./utils/getCurrentServer":"DMkL","./utils/getServerVersionCode":"J1Ly","./utils/date":"ZbyX","./utils/twhelp":"gvXE"}]},{},["Jg9g"], null)

View File

@ -675,9 +675,9 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedMapPopup.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedMapPopup.js
// @version 0.6.3
// @version 0.6.4
// @description Extended map popup
// @author Kichiyaki http://dawid-wysokinski.pl/
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*screen=map*
// @grant none
// ==/UserScript==

View File

@ -276,6 +276,7 @@ const translations = {
exportedVillages: 'Wyeksportowane wioski',
tribeChanges: 'Zmiany plemion',
action: {
linkToTWHelp: 'Akta gracza - TWHelp - nowa strona ze statystykami i narzędziami',
showTribeChanges: 'Pokaż zmiany plemion',
showEnnoblements: 'Pokaż przejęcia',
exportVillages: 'Wyeksportuj wioski',
@ -305,6 +306,7 @@ const translations = {
exportedVillages: 'Exported villages',
tribeChanges: 'Tribe changes',
action: {
linkToTWHelp: 'User file (external link) - TWHelp - A new stat tracking website.',
showTribeChanges: 'Show tribe changes',
showEnnoblements: 'Show ennoblements',
exportVillages: 'Export villages',
@ -1037,6 +1039,20 @@ exports.default = void 0;
var _default = () => window.location.host.split('.')[0];
exports.default = _default;
},{}],"J1Ly":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _default = function _default() {
let server = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
return server.substr(0, 2);
};
exports.default = _default;
},{}],"Syko":[function(require,module,exports) {
"use strict";
@ -1053,6 +1069,60 @@ const formatPlayerURL = function formatPlayerURL() {
};
exports.formatPlayerURL = formatPlayerURL;
},{}],"gvXE":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.buildVillageURL = exports.buildTribeURL = exports.buildPlayerURL = exports.buildURLToProfile = exports.buildURLToServerPage = exports.BASE_URL = void 0;
const BASE_URL = 'tribalwarshelp.com';
exports.BASE_URL = BASE_URL;
const buildURLToServerPage = function buildURLToServerPage() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
return "https://".concat(version, ".").concat(BASE_URL, "/server/").concat(server);
};
exports.buildURLToServerPage = buildURLToServerPage;
const buildURLToProfile = function buildURLToProfile() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
let entity = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
return "".concat(buildURLToServerPage(version, server), "/").concat(entity, "/").concat(id);
};
exports.buildURLToProfile = buildURLToProfile;
const buildPlayerURL = function buildPlayerURL() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
return buildURLToProfile(version, server, id, 'player');
};
exports.buildPlayerURL = buildPlayerURL;
const buildTribeURL = function buildTribeURL() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
return buildURLToProfile(version, server, id, 'tribe');
};
exports.buildTribeURL = buildTribeURL;
const buildVillageURL = function buildVillageURL() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
return buildURLToProfile(version, server, id, 'village');
};
exports.buildVillageURL = buildVillageURL;
},{}],"KWxH":[function(require,module,exports) {
"use strict";
@ -1105,12 +1175,16 @@ var _getIDFromURL = _interopRequireDefault(require("./utils/getIDFromURL"));
var _getCurrentServer = _interopRequireDefault(require("./utils/getCurrentServer"));
var _getServerVersionCode = _interopRequireDefault(require("./utils/getServerVersionCode"));
var _formatDate = _interopRequireDefault(require("./utils/formatDate"));
var _twstats = require("./utils/twstats");
var _tribalwars = require("./utils/tribalwars");
var _twhelp = require("./utils/twhelp");
var _localStorage = require("./utils/localStorage");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@ -1124,9 +1198,9 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
// @namespace https://github.com/tribalwarshelp/scripts
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedPlayerProfile.js
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedPlayerProfile.js
// @version 1.1.5
// @version 1.1.6
// @description Extended player profile
// @author Kichiyaki http://dawid-wysokinski.pl/
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*screen=info_player*
// @grant none
// @run-at document-end
@ -1476,6 +1550,10 @@ const wrapAction = action => {
};
const renderActions = () => {
const linkToTWHelp = document.createElement('a');
linkToTWHelp.href = (0, _twhelp.buildPlayerURL)((0, _getServerVersionCode.default)(SERVER), SERVER, PLAYER_ID);
linkToTWHelp.innerHTML = translations.action.linkToTWHelp;
actionContainer.appendChild(wrapAction(linkToTWHelp));
const showTribeChanges = document.createElement('a');
showTribeChanges.href = '#';
(0, _pagination.setPage)(showTribeChanges, '1');
@ -1519,4 +1597,4 @@ const renderActions = () => {
console.log('extended player profile', error);
}
})();
},{"./libs/InADayParser":"dSAr","./libs/requestCreator":"Ph2E","./i18n/extendedPlayerProfile":"I8dv","./common/renderTodaysStats":"yrCm","./utils/showPopup":"chDM","./common/showEnnoblementsPopup":"vNT1","./common/showHistoryPopup":"kEDU","./utils/hyphensToCamelCase":"GxsT","./utils/pagination":"fCHX","./utils/getIDFromURL":"tQUs","./utils/getCurrentServer":"DMkL","./utils/formatDate":"V6Mf","./utils/twstats":"Syko","./utils/tribalwars":"fHHP","./utils/localStorage":"KWxH"}]},{},["yRop"], null)
},{"./libs/InADayParser":"dSAr","./libs/requestCreator":"Ph2E","./i18n/extendedPlayerProfile":"I8dv","./common/renderTodaysStats":"yrCm","./utils/showPopup":"chDM","./common/showEnnoblementsPopup":"vNT1","./common/showHistoryPopup":"kEDU","./utils/hyphensToCamelCase":"GxsT","./utils/pagination":"fCHX","./utils/getIDFromURL":"tQUs","./utils/getCurrentServer":"DMkL","./utils/getServerVersionCode":"J1Ly","./utils/formatDate":"V6Mf","./utils/twstats":"Syko","./utils/tribalwars":"fHHP","./utils/twhelp":"gvXE","./utils/localStorage":"KWxH"}]},{},["yRop"], null)

View File

@ -928,6 +928,7 @@ const translations = {
dailyGrowth: 'Dzienny przyrost',
playerLinks: 'Linki',
action: {
linkToTWHelp: 'Akta plemienia - TWHelp - nowa strona ze statystykami i narzędziami',
showTribeChanges: 'Pokaż zmiany plemion',
showEnnoblements: 'Pokaż przejęcia',
showMembersGrowth: 'Pokaż rozwój graczy',
@ -964,6 +965,7 @@ const translations = {
dailyGrowth: 'Daily growth',
playerLinks: 'Player links',
action: {
linkToTWHelp: 'Tribal file (external link) - TWHelp - A new stat tracking website.',
showTribeChanges: 'Show tribe changes',
showEnnoblements: 'Show ennoblements',
showMembersGrowth: 'Show members growth',
@ -1683,6 +1685,20 @@ const setItem = (key, payload) => {
};
exports.setItem = setItem;
},{}],"J1Ly":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _default = function _default() {
let server = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
return server.substr(0, 2);
};
exports.default = _default;
},{}],"Syko":[function(require,module,exports) {
"use strict";
@ -1698,6 +1714,60 @@ const formatPlayerURL = function formatPlayerURL() {
};
exports.formatPlayerURL = formatPlayerURL;
},{}],"gvXE":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.buildVillageURL = exports.buildTribeURL = exports.buildPlayerURL = exports.buildURLToProfile = exports.buildURLToServerPage = exports.BASE_URL = void 0;
const BASE_URL = 'tribalwarshelp.com';
exports.BASE_URL = BASE_URL;
const buildURLToServerPage = function buildURLToServerPage() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
return "https://".concat(version, ".").concat(BASE_URL, "/server/").concat(server);
};
exports.buildURLToServerPage = buildURLToServerPage;
const buildURLToProfile = function buildURLToProfile() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
let entity = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
return "".concat(buildURLToServerPage(version, server), "/").concat(entity, "/").concat(id);
};
exports.buildURLToProfile = buildURLToProfile;
const buildPlayerURL = function buildPlayerURL() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
return buildURLToProfile(version, server, id, 'player');
};
exports.buildPlayerURL = buildPlayerURL;
const buildTribeURL = function buildTribeURL() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
return buildURLToProfile(version, server, id, 'tribe');
};
exports.buildTribeURL = buildTribeURL;
const buildVillageURL = function buildVillageURL() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
return buildURLToProfile(version, server, id, 'village');
};
exports.buildVillageURL = buildVillageURL;
},{}],"r4nF":[function(require,module,exports) {
"use strict";
@ -1727,8 +1797,12 @@ var _localStorage = require("./utils/localStorage");
var _formatDate = _interopRequireDefault(require("./utils/formatDate"));
var _getServerVersionCode = _interopRequireDefault(require("./utils/getServerVersionCode"));
var _twstats = require("./utils/twstats");
var _twhelp = require("./utils/twhelp");
var _tribalwars = require("./utils/tribalwars");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@ -1744,14 +1818,15 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedTribeProfile.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedTribeProfile.js
// @version 1.0.9
// @version 1.1.0
// @description Extended tribe profile
// @author Kichiyaki http://dawid-wysokinski.pl/
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*screen=info_ally*
// @grant none
// @run-at document-end
// ==/UserScript==
const SERVER = (0, _getCurrentServer.default)();
const VERSION = (0, _getServerVersionCode.default)(SERVER);
const TRIBE_ID = (0, _getIDFromURL.default)(window.location.search);
const LOCAL_STORAGE_KEY = 'kichiyaki_extended_tribe_profile' + TRIBE_ID;
const TRIBE_QUERY = "\n query tribe($server: String!, $id: Int!, $dailyTribeStatsSort: [String!], $dailyTribeStatsLimit: Int, $playerSort: [String!], $playerFilter: PlayerFilter!, $dailyTribeStatsFilter: DailyTribeStatsFilter!) {\n tribe(server: $server, id: $id) {\n id\n bestRank\n bestRankAt\n mostPoints\n mostPointsAt\n mostVillages\n mostVillagesAt\n createdAt\n dominance\n }\n dailyTribeStats(server: $server, limit: $dailyTribeStatsLimit, sort: $dailyTribeStatsSort, filter: $dailyTribeStatsFilter) {\n items {\n rank\n rankAtt\n rankDef\n rankTotal\n points\n scoreAtt\n scoreAtt\n scoreDef\n scoreTotal\n villages\n members\n }\n }\n players(server: $server, sort: $playerSort, filter: $playerFilter) {\n items {\n id\n rankAtt\n rankDef\n rankSup\n rankTotal\n scoreAtt\n scoreAtt\n scoreDef\n scoreSup\n scoreTotal\n dailyGrowth\n }\n }\n }\n";
@ -1765,7 +1840,7 @@ const TRIBE_CHANGES_QUERY = "\n query tribeChanges($server: String!, $limit:
const TRIBE_CHANGES_PAGINATION_CONTAINER_ID = 'tribeChangesPagination';
const TRIBE_CHANGES_PER_PAGE = 15;
const profileInfoTBody = document.querySelector('#content_value > table:nth-child(3) > tbody > tr > td:nth-child(1) > table > tbody');
const actionsContainer = profileInfoTBody;
const actionContainer = profileInfoTBody;
const otherElementsContainer = document.querySelector('#content_value > table:nth-child(3) > tbody > tr > td:nth-child(2)');
const membersContainer = document.querySelector('#content_value > table.vis > tbody');
const translations = (0, _extendedTribeProfile.default)();
@ -1866,7 +1941,13 @@ const extendMembersData = players => {
const player = players.items.find(p => p.id === playerID);
if (player) {
[[player.scoreAtt, player.rankAtt], [player.scoreDef, player.rankDef], [player.scoreSup, player.rankSup], [player.scoreTotal, player.rankTotal], player.dailyGrowth, [(0, _twstats.formatPlayerURL)(SERVER, player.id), 'TWStats']].forEach((data, index) => {
[[player.scoreAtt, player.rankAtt], [player.scoreDef, player.rankDef], [player.scoreSup, player.rankSup], [player.scoreTotal, player.rankTotal], player.dailyGrowth, [{
link: (0, _twhelp.buildPlayerURL)(VERSION, SERVER, player.id),
label: 'TWHelp'
}, {
link: (0, _twstats.formatPlayerURL)(SERVER, player.id),
label: 'TWStats'
}]].forEach((data, index) => {
let td = tr.children[5 + index];
if (!td) {
@ -1877,8 +1958,14 @@ const extendMembersData = players => {
if (Array.isArray(data)) {
if (typeof data[0] === 'number') {
td.innerHTML = "".concat(data[0].toLocaleString(), " (<strong>").concat(data[1], "</strong>)");
} else if ((0, _isURL.default)(data[0])) {
td.innerHTML = "<a target=\"_blank\" rel=\"noopener noreferrer\" href=\"".concat(data[0], "\">").concat(data[1], "</a>");
} else if (data[0].link) {
td.innerHTML = data.map((_ref2) => {
let {
link,
label
} = _ref2;
return "<a target=\"_blank\" rel=\"noopener noreferrer\" href=\"".concat(link, "\">").concat(label, "</a>");
}).join('<br>');
}
} else if (typeof data === 'number') {
td.innerHTML = data.toLocaleString();
@ -1888,12 +1975,12 @@ const extendMembersData = players => {
});
};
const render = (_ref2) => {
const render = (_ref3) => {
let {
tribe,
dailyTribeStats,
players
} = _ref2;
} = _ref3;
[{
title: translations.createdAt + ':',
data: (0, _formatDate.default)(tribe.createdAt),
@ -2273,39 +2360,43 @@ const wrapAction = action => {
};
const renderActions = () => {
const linkToTWHelp = document.createElement('a');
linkToTWHelp.href = (0, _twhelp.buildTribeURL)(VERSION, SERVER, TRIBE_ID);
linkToTWHelp.innerHTML = translations.action.linkToTWHelp;
actionContainer.appendChild(wrapAction(linkToTWHelp));
const showEnnoblements = document.createElement('a');
showEnnoblements.href = '#';
(0, _pagination.setPage)(showEnnoblements, '1');
showEnnoblements.innerHTML = translations.action.showEnnoblements;
showEnnoblements.addEventListener('click', handleShowTribeEnnoblementsClick);
actionsContainer.appendChild(wrapAction(showEnnoblements));
actionContainer.appendChild(wrapAction(showEnnoblements));
const showHistory = document.createElement('a');
showHistory.href = '#';
(0, _pagination.setPage)(showHistory, '1');
showHistory.innerHTML = translations.action.showHistory;
showHistory.addEventListener('click', handleShowTribeHistoryClick);
actionsContainer.appendChild(wrapAction(showHistory));
actionContainer.appendChild(wrapAction(showHistory));
const showTribeChanges = document.createElement('a');
showTribeChanges.href = '#';
(0, _pagination.setPage)(showTribeChanges, '1');
showTribeChanges.innerHTML = translations.action.showTribeChanges;
showTribeChanges.addEventListener('click', handleShowTribeChangesClick);
actionsContainer.appendChild(wrapAction(showTribeChanges));
actionContainer.appendChild(wrapAction(showTribeChanges));
const showMembersGrowth = document.createElement('a');
showMembersGrowth.href = '#';
showMembersGrowth.innerHTML = translations.action.showMembersGrowth;
showMembersGrowth.addEventListener('click', handleShowMembersGrowthClick);
actionsContainer.appendChild(wrapAction(showMembersGrowth));
actionContainer.appendChild(wrapAction(showMembersGrowth));
const generateMailingList = document.createElement('a');
generateMailingList.href = '#';
generateMailingList.innerHTML = translations.action.generateMailingList;
generateMailingList.addEventListener('click', handleGenerateMailingListClick);
actionsContainer.appendChild(wrapAction(generateMailingList));
actionContainer.appendChild(wrapAction(generateMailingList));
const exportVillages = document.createElement('a');
exportVillages.href = '#';
exportVillages.innerHTML = translations.action.exportVillages;
exportVillages.addEventListener('click', handleExportTribeVillagesClick);
actionsContainer.appendChild(wrapAction(exportVillages));
actionContainer.appendChild(wrapAction(exportVillages));
};
(async function () {
@ -2327,4 +2418,4 @@ const renderActions = () => {
console.log('extended tribe profile', error);
}
})();
},{"validator/lib/isURL":"XMVV","date-fns/differenceInDays":"mdVI","./i18n/extendedTribeProfile":"iFDG","./libs/requestCreator":"Ph2E","./utils/pagination":"fCHX","./common/renderTodaysStats":"yrCm","./common/showEnnoblementsPopup":"vNT1","./common/showHistoryPopup":"kEDU","./utils/showPopup":"chDM","./utils/getIDFromURL":"tQUs","./utils/getCurrentServer":"DMkL","./utils/localStorage":"KWxH","./utils/formatDate":"V6Mf","./utils/twstats":"Syko","./utils/tribalwars":"fHHP"}]},{},["r4nF"], null)
},{"validator/lib/isURL":"XMVV","date-fns/differenceInDays":"mdVI","./i18n/extendedTribeProfile":"iFDG","./libs/requestCreator":"Ph2E","./utils/pagination":"fCHX","./common/renderTodaysStats":"yrCm","./common/showEnnoblementsPopup":"vNT1","./common/showHistoryPopup":"kEDU","./utils/showPopup":"chDM","./utils/getIDFromURL":"tQUs","./utils/getCurrentServer":"DMkL","./utils/localStorage":"KWxH","./utils/formatDate":"V6Mf","./utils/getServerVersionCode":"J1Ly","./utils/twstats":"Syko","./utils/twhelp":"gvXE","./utils/tribalwars":"fHHP"}]},{},["r4nF"], null)

View File

@ -176,6 +176,7 @@ const translations = {
ennobledAt: 'Podbita o',
never: 'Nigdy',
action: {
linkToTWHelp: 'Akta wioski - TWHelp - nowa strona ze statystykami i narzędziami',
showEnnoblements: 'Pokaż przejęcia',
countIncomingSupport: 'Policz nadchodzące wsparcie'
}
@ -190,6 +191,7 @@ const translations = {
never: 'Never',
ennobledAt: 'Ennobled at',
action: {
linkToTWHelp: 'Village file (external link) - TWHelp - A new stat tracking website.',
showEnnoblements: 'Show ennoblements',
countIncomingSupport: 'Count incoming support'
}
@ -627,7 +629,75 @@ var _default = (ennobledAt, speed) => {
};
exports.default = _default;
},{"date-fns/differenceInMinutes":"oGJj"}],"tKRp":[function(require,module,exports) {
},{"date-fns/differenceInMinutes":"oGJj"}],"J1Ly":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _default = function _default() {
let server = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
return server.substr(0, 2);
};
exports.default = _default;
},{}],"gvXE":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.buildVillageURL = exports.buildTribeURL = exports.buildPlayerURL = exports.buildURLToProfile = exports.buildURLToServerPage = exports.BASE_URL = void 0;
const BASE_URL = 'tribalwarshelp.com';
exports.BASE_URL = BASE_URL;
const buildURLToServerPage = function buildURLToServerPage() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
return "https://".concat(version, ".").concat(BASE_URL, "/server/").concat(server);
};
exports.buildURLToServerPage = buildURLToServerPage;
const buildURLToProfile = function buildURLToProfile() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
let entity = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
return "".concat(buildURLToServerPage(version, server), "/").concat(entity, "/").concat(id);
};
exports.buildURLToProfile = buildURLToProfile;
const buildPlayerURL = function buildPlayerURL() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
return buildURLToProfile(version, server, id, 'player');
};
exports.buildPlayerURL = buildPlayerURL;
const buildTribeURL = function buildTribeURL() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
return buildURLToProfile(version, server, id, 'tribe');
};
exports.buildTribeURL = buildTribeURL;
const buildVillageURL = function buildVillageURL() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
return buildURLToProfile(version, server, id, 'village');
};
exports.buildVillageURL = buildVillageURL;
},{}],"tKRp":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
@ -789,6 +859,10 @@ var _localStorage = require("./utils/localStorage");
var _countLoyalty = _interopRequireDefault(require("./utils/countLoyalty"));
var _getServerVersionCode = _interopRequireDefault(require("./utils/getServerVersionCode"));
var _twhelp = require("./utils/twhelp");
var _showEnnoblementsPopup = _interopRequireDefault(require("./common/showEnnoblementsPopup"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@ -804,9 +878,9 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedVillageProfile.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedVillageProfile.js
// @version 0.7.2
// @version 0.7.3
// @description Extended village profile
// @author Kichiyaki http://dawid-wysokinski.pl/
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*screen=info_village*
// @grant none
// @run-at document-end
@ -1004,6 +1078,10 @@ const wrapAction = action => {
};
const renderActions = () => {
const linkToTWHelp = document.createElement('a');
linkToTWHelp.href = (0, _twhelp.buildVillageURL)((0, _getServerVersionCode.default)(SERVER), SERVER, VILLAGE_ID);
linkToTWHelp.innerHTML = translations.action.linkToTWHelp;
actionContainer.appendChild(wrapAction(linkToTWHelp));
const showEnnoblementsPopup = document.createElement('a');
showEnnoblementsPopup.href = '#';
(0, _pagination.setPage)(showEnnoblementsPopup, '1');
@ -1100,4 +1178,4 @@ const renderAdditionalInfo = function renderAdditionalInfo() {
console.log('extended village profile', error);
}
})();
},{"./libs/requestCreator":"Ph2E","./i18n/extendedVillageProfile":"LNef","./utils/pagination":"fCHX","./utils/getCurrentServer":"DMkL","./utils/getIDFromURL":"tQUs","./utils/buildUnitImgURL":"KX6P","./utils/formatDate":"V6Mf","./utils/wait":"oUdd","./utils/localStorage":"KWxH","./utils/countLoyalty":"ATOB","./common/showEnnoblementsPopup":"vNT1"}]},{},["UdfQ"], null)
},{"./libs/requestCreator":"Ph2E","./i18n/extendedVillageProfile":"LNef","./utils/pagination":"fCHX","./utils/getCurrentServer":"DMkL","./utils/getIDFromURL":"tQUs","./utils/buildUnitImgURL":"KX6P","./utils/formatDate":"V6Mf","./utils/wait":"oUdd","./utils/localStorage":"KWxH","./utils/countLoyalty":"ATOB","./utils/getServerVersionCode":"J1Ly","./utils/twhelp":"gvXE","./common/showEnnoblementsPopup":"vNT1"}]},{},["UdfQ"], null)

View File

@ -266,9 +266,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/inADayTribeRankingGenerator.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/inADayTribeRankingGenerator.js
// @version 0.2.0
// @version 0.2.1
// @description 'In A Day' tribe ranking generator
// @author Kichiyaki http://dawid-wysokinski.pl/
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*screen=ranking*mode=in_a_day*
// @grant none
// @run-at document-end

View File

@ -317,6 +317,74 @@ const setItem = (key, payload) => {
};
exports.setItem = setItem;
},{}],"gvXE":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.buildVillageURL = exports.buildTribeURL = exports.buildPlayerURL = exports.buildURLToProfile = exports.buildURLToServerPage = exports.BASE_URL = void 0;
const BASE_URL = 'tribalwarshelp.com';
exports.BASE_URL = BASE_URL;
const buildURLToServerPage = function buildURLToServerPage() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
return "https://".concat(version, ".").concat(BASE_URL, "/server/").concat(server);
};
exports.buildURLToServerPage = buildURLToServerPage;
const buildURLToProfile = function buildURLToProfile() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
let entity = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
return "".concat(buildURLToServerPage(version, server), "/").concat(entity, "/").concat(id);
};
exports.buildURLToProfile = buildURLToProfile;
const buildPlayerURL = function buildPlayerURL() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
return buildURLToProfile(version, server, id, 'player');
};
exports.buildPlayerURL = buildPlayerURL;
const buildTribeURL = function buildTribeURL() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
return buildURLToProfile(version, server, id, 'tribe');
};
exports.buildTribeURL = buildTribeURL;
const buildVillageURL = function buildVillageURL() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
return buildURLToProfile(version, server, id, 'village');
};
exports.buildVillageURL = buildVillageURL;
},{}],"J1Ly":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _default = function _default() {
let server = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
return server.substr(0, 2);
};
exports.default = _default;
},{}],"FxgK":[function(require,module,exports) {
"use strict";
@ -335,7 +403,8 @@ const translations = {
date: 'Data',
filters: 'Filtry',
apply: 'Zastosuj',
ennoblements: 'Przejęcia'
ennoblements: 'Przejęcia',
devNote: 'Informacja od autora - Właśnie uruchomiłem nową stronę ze statystykami, nie zapomnij jej sprawdzić :).'
},
en_DK: {
showLatestEnnoblements: 'Show latest ennoblements',
@ -347,7 +416,8 @@ const translations = {
filters: 'Filters',
date: 'Date',
apply: 'Apply',
ennoblements: 'Ennoblements'
ennoblements: 'Ennoblements',
devNote: "Information from the author - I've just launched a new stat tracking website, don't forget to check it out :)."
}
};
@ -369,6 +439,10 @@ var _tribalwars = require("./utils/tribalwars");
var _localStorage = require("./utils/localStorage");
var _twhelp = require("./utils/twhelp");
var _getServerVersionCode = _interopRequireDefault(require("./utils/getServerVersionCode"));
var _latestEnnoblements = _interopRequireDefault(require("./i18n/latestEnnoblements"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@ -384,9 +458,9 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/latestEnnoblements.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/latestEnnoblements.js
// @version 1.0.5
// @version 1.0.6
// @description Show the latest ennoblements
// @author Kichiyaki http://dawid-wysokinski.pl/
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*
// @grant none
// @run-at document-end
@ -514,7 +588,7 @@ const renderLatestEnnoblements = function renderLatestEnnoblements() {
const prepared = _objectSpread(_objectSpread({}, DEFAULT_FILTER), filters);
const html = "\n <form style=\"margin-bottom: 15px\" id=\"".concat(FILTER_FORM_ID, "\">\n <h3 style=\"margin-bottom: 5px\">").concat(translations.filters, "</h3>\n <input type=\"text\" placeholder=\"").concat(translations.newOwner, "\" value=\"").concat(prepared.newOwner, "\" />\n <input type=\"text\" placeholder=\"").concat(translations.newOwnerTribe, "\" value=\"").concat(prepared.newOwnerTribe, "\" />\n <input type=\"text\" placeholder=\"").concat(translations.oldOwner, "\" value=\"").concat(prepared.oldOwner, "\" />\n <input type=\"text\" placeholder=\"").concat(translations.oldOwnerTribe, "\" value=\"").concat(prepared.oldOwnerTribe, "\" />\n <div>\n <button type=\"submit\">").concat(translations.apply, "</button>\n </div>\n </form>\n <table class=\"vis\" id=\"").concat(TABLE_ID, "\" style=\"width: 100%\">\n <thead>\n <tr>\n <th>").concat(translations.village, "</th>\n <th>").concat(translations.newOwner, "</th>\n <th>").concat(translations.oldOwner, "</th>\n <th>").concat(translations.date, "</th>\n </tr>\n </thead>\n <tbody>\n ").concat(formatEnnoblementRows(filterEnnoblements(ennoblements, prepared)).join(''), "\n </tbody>\n </table>\n ");
const html = "\n <form style=\"margin-bottom: 15px\" id=\"".concat(FILTER_FORM_ID, "\">\n <h1 style=\"margin-bottom: 0px; text-align: center;\"><a href=\"").concat((0, _twhelp.buildURLToServerPage)((0, _getServerVersionCode.default)(SERVER), SERVER), "\">TWHelp</a></h1>\n <h3 style=\"margin-bottom: 10px; margin-top: 0;\">").concat(translations.devNote, "</h3>\n <h3 style=\"margin-bottom: 5px\">").concat(translations.filters, "</h3>\n <input type=\"text\" placeholder=\"").concat(translations.newOwner, "\" value=\"").concat(prepared.newOwner, "\" />\n <input type=\"text\" placeholder=\"").concat(translations.newOwnerTribe, "\" value=\"").concat(prepared.newOwnerTribe, "\" />\n <input type=\"text\" placeholder=\"").concat(translations.oldOwner, "\" value=\"").concat(prepared.oldOwner, "\" />\n <input type=\"text\" placeholder=\"").concat(translations.oldOwnerTribe, "\" value=\"").concat(prepared.oldOwnerTribe, "\" />\n <div>\n <button type=\"submit\">").concat(translations.apply, "</button>\n </div>\n </form>\n <table class=\"vis\" id=\"").concat(TABLE_ID, "\" style=\"width: 100%\">\n <thead>\n <tr>\n <th>").concat(translations.village, "</th>\n <th>").concat(translations.newOwner, "</th>\n <th>").concat(translations.oldOwner, "</th>\n <th>").concat(translations.date, "</th>\n </tr>\n </thead>\n <tbody>\n ").concat(formatEnnoblementRows(filterEnnoblements(ennoblements, prepared)).join(''), "\n </tbody>\n </table>\n ");
(0, _showPopup.default)({
e: {
clientY: 60
@ -562,4 +636,4 @@ const renderButton = () => {
(function () {
renderButton();
})();
},{"./libs/requestCreator":"Ph2E","./utils/showPopup":"chDM","./utils/getCurrentServer":"DMkL","./utils/formatDate":"V6Mf","./utils/tribalwars":"fHHP","./utils/localStorage":"KWxH","./i18n/latestEnnoblements":"FxgK"}]},{},["hkfB"], null)
},{"./libs/requestCreator":"Ph2E","./utils/showPopup":"chDM","./utils/getCurrentServer":"DMkL","./utils/formatDate":"V6Mf","./utils/tribalwars":"fHHP","./utils/localStorage":"KWxH","./utils/twhelp":"gvXE","./utils/getServerVersionCode":"J1Ly","./i18n/latestEnnoblements":"FxgK"}]},{},["hkfB"], null)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -179,7 +179,8 @@ const translations = {
to: 'Do',
warStatsGenerator: 'Generator statystyk wojennych',
generateWarStats: 'Wygeneruj statystyki wojenne',
addTribe: 'Dodaj plemię'
addTribe: 'Dodaj plemię',
devNote: 'Informacja od autora - Właśnie uruchomiłem nową stronę ze statystykami, nie zapomnij jej sprawdzić :).'
},
en_DK: {
conquers: 'Conquers',
@ -194,7 +195,8 @@ const translations = {
to: 'To',
warStatsGenerator: 'War stats generator',
generateWarStats: 'Generate war stats',
addTribe: 'Add tribe'
addTribe: 'Add tribe',
devNote: "Information from the author - I've just launched a new stat tracking website, don't forget to check it out :)."
}
};
@ -212,6 +214,74 @@ exports.default = void 0;
var _default = () => window.location.host.split('.')[0];
exports.default = _default;
},{}],"J1Ly":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _default = function _default() {
let server = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
return server.substr(0, 2);
};
exports.default = _default;
},{}],"gvXE":[function(require,module,exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.buildVillageURL = exports.buildTribeURL = exports.buildPlayerURL = exports.buildURLToProfile = exports.buildURLToServerPage = exports.BASE_URL = void 0;
const BASE_URL = 'tribalwarshelp.com';
exports.BASE_URL = BASE_URL;
const buildURLToServerPage = function buildURLToServerPage() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
return "https://".concat(version, ".").concat(BASE_URL, "/server/").concat(server);
};
exports.buildURLToServerPage = buildURLToServerPage;
const buildURLToProfile = function buildURLToProfile() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
let entity = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
return "".concat(buildURLToServerPage(version, server), "/").concat(entity, "/").concat(id);
};
exports.buildURLToProfile = buildURLToProfile;
const buildPlayerURL = function buildPlayerURL() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
return buildURLToProfile(version, server, id, 'player');
};
exports.buildPlayerURL = buildPlayerURL;
const buildTribeURL = function buildTribeURL() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
return buildURLToProfile(version, server, id, 'tribe');
};
exports.buildTribeURL = buildTribeURL;
const buildVillageURL = function buildVillageURL() {
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
let server = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
return buildURLToProfile(version, server, id, 'village');
};
exports.buildVillageURL = buildVillageURL;
},{}],"chDM":[function(require,module,exports) {
"use strict";
@ -266,6 +336,10 @@ var _warStatsGenerator = _interopRequireDefault(require("./i18n/warStatsGenerato
var _getCurrentServer = _interopRequireDefault(require("./utils/getCurrentServer"));
var _getServerVersionCode = _interopRequireDefault(require("./utils/getServerVersionCode"));
var _twhelp = require("./utils/twhelp");
var _showPopup = _interopRequireWildcard(require("./utils/showPopup"));
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
@ -279,9 +353,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/warStatsGenerator.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/warStatsGenerator.js
// @version 0.3.0
// @version 0.3.1
// @description War stats generator
// @author Kichiyaki http://dawid-wysokinski.pl/
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*screen=ranking*mode=wars*
// @grant none
// @run-at document-end
@ -398,7 +472,7 @@ const handleFormSubmit = async e => {
};
const showWarStatsForm = e => {
const html = "\n <form>\n <div id=\"".concat(RESULT_CONTAINER_ID, "\">\n </div>\n <div style=\"margin-bottom: 10px;\">\n <div id=\"").concat(FROM_INPUT_ID, "\">\n <label>").concat(translations.from, ": </label>\n <input type=\"date\" required />\n <input type=\"time\" required />\n </div>\n <div id=\"").concat(TO_INPUT_ID, "\">\n <label>").concat(translations.to, ": </label>\n <input type=\"date\" required />\n <input type=\"time\" required />\n </div>\n </div>\n <div style=\"display: flex; justify-content: space-between; margin-bottom: 10px; min-width: 800px;\">\n <div>\n <h3>").concat(translations.sideOne, "</h3>\n <div id=\"").concat(SIDE_ONE_INPUT_CONTAINER_ID, "\">\n </div>\n <button id=\"").concat(SIDE_ONE_BUTTON_ID, "\" class=\"btn\" type=\"button\">").concat(translations.addTribe, "</button>\n </div>\n <div style=\"margin: 0 5px;\"></div>\n <div>\n <h3>").concat(translations.sideTwo, "</h3>\n <div id=\"").concat(SIDE_TWO_INPUT_CONTAINER_ID, "\">\n </div>\n <button id=\"").concat(SIDE_TWO_BUTTON_ID, "\" class=\"btn\" type=\"button\">").concat(translations.addTribe, "</button>\n </div>\n </div>\n <div style=\"text-align: center;\">\n <button class=\"btn\" type=\"submit\">").concat(translations.generateWarStats, "</button>\n </div>\n </form>\n ");
const html = "\n <form>\n <h1 style=\"margin-bottom: 0px; text-align: center;\"><a href=\"".concat((0, _twhelp.buildURLToServerPage)((0, _getServerVersionCode.default)(SERVER), SERVER), "\">TWHelp</a></h1>\n <h3 style=\"margin-bottom: 10px; margin-top: 0;\">").concat(translations.devNote, "</h3>\n <div id=\"").concat(RESULT_CONTAINER_ID, "\">\n </div>\n <div style=\"margin-bottom: 10px;\">\n <div id=\"").concat(FROM_INPUT_ID, "\">\n <label>").concat(translations.from, ": </label>\n <input type=\"date\" required />\n <input type=\"time\" required />\n </div>\n <div id=\"").concat(TO_INPUT_ID, "\">\n <label>").concat(translations.to, ": </label>\n <input type=\"date\" required />\n <input type=\"time\" required />\n </div>\n </div>\n <div style=\"display: flex; justify-content: space-between; margin-bottom: 10px; min-width: 800px;\">\n <div>\n <h3>").concat(translations.sideOne, "</h3>\n <div id=\"").concat(SIDE_ONE_INPUT_CONTAINER_ID, "\">\n </div>\n <button id=\"").concat(SIDE_ONE_BUTTON_ID, "\" class=\"btn\" type=\"button\">").concat(translations.addTribe, "</button>\n </div>\n <div style=\"margin: 0 5px;\"></div>\n <div>\n <h3>").concat(translations.sideTwo, "</h3>\n <div id=\"").concat(SIDE_TWO_INPUT_CONTAINER_ID, "\">\n </div>\n <button id=\"").concat(SIDE_TWO_BUTTON_ID, "\" class=\"btn\" type=\"button\">").concat(translations.addTribe, "</button>\n </div>\n </div>\n <div style=\"text-align: center;\">\n <button class=\"btn\" type=\"submit\">").concat(translations.generateWarStats, "</button>\n </div>\n </form>\n ");
(0, _showPopup.default)({
title: translations.warStatsGenerator,
id: 'warStats',
@ -426,4 +500,4 @@ const renderUI = () => {
console.log('war stats', error);
}
})();
},{"./libs/requestCreator":"Ph2E","./i18n/warStatsGenerator":"vPH5","./utils/getCurrentServer":"DMkL","./utils/showPopup":"chDM"}]},{},["H9GS"], null)
},{"./libs/requestCreator":"Ph2E","./i18n/warStatsGenerator":"vPH5","./utils/getCurrentServer":"DMkL","./utils/getServerVersionCode":"J1Ly","./utils/twhelp":"gvXE","./utils/showPopup":"chDM"}]},{},["H9GS"], null)

View File

@ -9,9 +9,9 @@ import { calcDistanceBetweenTwoPoints } from './utils/math';
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/bonusBarbarianVillageFinder.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/bonusBarbarianVillageFinder.js
// @version 0.4.3
// @version 0.4.4
// @description Bonus barbarian village finder
// @author Kichiyaki http://dawid-wysokinski.pl/
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*screen=map*
// @grant none
// ==/UserScript==

View File

@ -6,9 +6,9 @@ import wait from './utils/wait';
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/commandRenamer.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/commandRenamer.js
// @version 0.2.0
// @version 0.2.1
// @description Command renamer
// @author Kichiyaki http://dawid-wysokinski.pl/
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*mode=incomings*
// @grant none
// ==/UserScript==

View File

@ -4,16 +4,18 @@ import getTranslations from './i18n/dailyAchievments';
import { setItem, getItem } from './utils/localStorage';
import { formatPlayerURL } from './utils/tribalwars';
import getCurrentServer from './utils/getCurrentServer';
import getServerVersionCode from './utils/getServerVersionCode';
import { inTZ } from './utils/date';
import { buildURLToServerPage } from './utils/twhelp';
// ==UserScript==
// @name Daily achievements
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/dailyAchievements.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/dailyAchievements.js
// @version 0.4.2
// @version 0.4.3
// @description Daily achievements
// @author Kichiyaki http://dawid-wysokinski.pl/
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*screen=info_player&mode=awards*
// @grant none
// ==/UserScript==
@ -118,6 +120,13 @@ const render = ({
<div class="award-group-head">${translations.title}</div>
<div class="award-group-content" style="text-align: center;">
<div style="padding: 10px;">
<h1 style="margin-bottom: 0px;"><a href="${buildURLToServerPage(
getServerVersionCode(SERVER),
SERVER
)}">TWHelp</a></h1>
<h3 style="margin-bottom: 10px; margin-top: 0;">${
translations.devNote
}</h3>
<h3 style="color: red;"><strong>${
translations.warning
}</strong></h3>

View File

@ -14,9 +14,9 @@ import countLoyalty from './utils/countLoyalty';
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedMapPopup.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedMapPopup.js
// @version 0.6.3
// @version 0.6.4
// @description Extended map popup
// @author Kichiyaki http://dawid-wysokinski.pl/
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*screen=map*
// @grant none
// ==/UserScript==

View File

@ -14,9 +14,11 @@ import {
} from './utils/pagination';
import getIDFromURL from './utils/getIDFromURL';
import getCurrentServer from './utils/getCurrentServer';
import getServerVersionCode from './utils/getServerVersionCode';
import formatDate from './utils/formatDate';
import { formatPlayerURL } from './utils/twstats';
import { formatTribeURL } from './utils/tribalwars';
import { buildPlayerURL } from './utils/twhelp';
import { setItem, getItem } from './utils/localStorage';
// ==UserScript==
@ -24,9 +26,9 @@ import { setItem, getItem } from './utils/localStorage';
// @namespace https://github.com/tribalwarshelp/scripts
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedPlayerProfile.js
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedPlayerProfile.js
// @version 1.1.5
// @version 1.1.6
// @description Extended player profile
// @author Kichiyaki http://dawid-wysokinski.pl/
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*screen=info_player*
// @grant none
// @run-at document-end
@ -661,6 +663,15 @@ const wrapAction = (action) => {
};
const renderActions = () => {
const linkToTWHelp = document.createElement('a');
linkToTWHelp.href = buildPlayerURL(
getServerVersionCode(SERVER),
SERVER,
PLAYER_ID
);
linkToTWHelp.innerHTML = translations.action.linkToTWHelp;
actionContainer.appendChild(wrapAction(linkToTWHelp));
const showTribeChanges = document.createElement('a');
showTribeChanges.href = '#';
setPage(showTribeChanges, '1');

View File

@ -16,7 +16,9 @@ import getIDFromURL from './utils/getIDFromURL';
import getCurrentServer from './utils/getCurrentServer';
import { setItem, getItem } from './utils/localStorage';
import formatDate from './utils/formatDate';
import getServerVersionCode from './utils/getServerVersionCode';
import { formatPlayerURL } from './utils/twstats';
import { buildPlayerURL, buildTribeURL } from './utils/twhelp';
import { formatPlayerURL as formatPlayerURLTribalWars } from './utils/tribalwars';
// ==UserScript==
@ -24,15 +26,16 @@ import { formatPlayerURL as formatPlayerURLTribalWars } from './utils/tribalwars
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedTribeProfile.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedTribeProfile.js
// @version 1.0.9
// @version 1.1.0
// @description Extended tribe profile
// @author Kichiyaki http://dawid-wysokinski.pl/
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*screen=info_ally*
// @grant none
// @run-at document-end
// ==/UserScript==
const SERVER = getCurrentServer();
const VERSION = getServerVersionCode(SERVER);
const TRIBE_ID = getIDFromURL(window.location.search);
const LOCAL_STORAGE_KEY = 'kichiyaki_extended_tribe_profile' + TRIBE_ID;
const TRIBE_QUERY = `
@ -196,7 +199,7 @@ const TRIBE_CHANGES_PER_PAGE = 15;
const profileInfoTBody = document.querySelector(
'#content_value > table:nth-child(3) > tbody > tr > td:nth-child(1) > table > tbody'
);
const actionsContainer = profileInfoTBody;
const actionContainer = profileInfoTBody;
const otherElementsContainer = document.querySelector(
'#content_value > table:nth-child(3) > tbody > tr > td:nth-child(2)'
);
@ -300,7 +303,10 @@ const extendMembersData = (players) => {
[player.scoreSup, player.rankSup],
[player.scoreTotal, player.rankTotal],
player.dailyGrowth,
[formatPlayerURL(SERVER, player.id), 'TWStats'],
[
{ link: buildPlayerURL(VERSION, SERVER, player.id), label: 'TWHelp' },
{ link: formatPlayerURL(SERVER, player.id), label: 'TWStats' },
],
].forEach((data, index) => {
let td = tr.children[5 + index];
if (!td) {
@ -312,8 +318,13 @@ const extendMembersData = (players) => {
td.innerHTML = `${data[0].toLocaleString()} (<strong>${
data[1]
}</strong>)`;
} else if (isURL(data[0])) {
td.innerHTML = `<a target="_blank" rel="noopener noreferrer" href="${data[0]}">${data[1]}</a>`;
} else if (data[0].link) {
td.innerHTML = data
.map(
({ link, label }) =>
`<a target="_blank" rel="noopener noreferrer" href="${link}">${label}</a>`
)
.join('<br>');
}
} else if (typeof data === 'number') {
td.innerHTML = data.toLocaleString();
@ -839,44 +850,49 @@ const wrapAction = (action) => {
};
const renderActions = () => {
const linkToTWHelp = document.createElement('a');
linkToTWHelp.href = buildTribeURL(VERSION, SERVER, TRIBE_ID);
linkToTWHelp.innerHTML = translations.action.linkToTWHelp;
actionContainer.appendChild(wrapAction(linkToTWHelp));
const showEnnoblements = document.createElement('a');
showEnnoblements.href = '#';
setPage(showEnnoblements, '1');
showEnnoblements.innerHTML = translations.action.showEnnoblements;
showEnnoblements.addEventListener('click', handleShowTribeEnnoblementsClick);
actionsContainer.appendChild(wrapAction(showEnnoblements));
actionContainer.appendChild(wrapAction(showEnnoblements));
const showHistory = document.createElement('a');
showHistory.href = '#';
setPage(showHistory, '1');
showHistory.innerHTML = translations.action.showHistory;
showHistory.addEventListener('click', handleShowTribeHistoryClick);
actionsContainer.appendChild(wrapAction(showHistory));
actionContainer.appendChild(wrapAction(showHistory));
const showTribeChanges = document.createElement('a');
showTribeChanges.href = '#';
setPage(showTribeChanges, '1');
showTribeChanges.innerHTML = translations.action.showTribeChanges;
showTribeChanges.addEventListener('click', handleShowTribeChangesClick);
actionsContainer.appendChild(wrapAction(showTribeChanges));
actionContainer.appendChild(wrapAction(showTribeChanges));
const showMembersGrowth = document.createElement('a');
showMembersGrowth.href = '#';
showMembersGrowth.innerHTML = translations.action.showMembersGrowth;
showMembersGrowth.addEventListener('click', handleShowMembersGrowthClick);
actionsContainer.appendChild(wrapAction(showMembersGrowth));
actionContainer.appendChild(wrapAction(showMembersGrowth));
const generateMailingList = document.createElement('a');
generateMailingList.href = '#';
generateMailingList.innerHTML = translations.action.generateMailingList;
generateMailingList.addEventListener('click', handleGenerateMailingListClick);
actionsContainer.appendChild(wrapAction(generateMailingList));
actionContainer.appendChild(wrapAction(generateMailingList));
const exportVillages = document.createElement('a');
exportVillages.href = '#';
exportVillages.innerHTML = translations.action.exportVillages;
exportVillages.addEventListener('click', handleExportTribeVillagesClick);
actionsContainer.appendChild(wrapAction(exportVillages));
actionContainer.appendChild(wrapAction(exportVillages));
};
(async function () {

View File

@ -8,6 +8,8 @@ import formatDate from './utils/formatDate';
import wait from './utils/wait';
import { setItem, getItem } from './utils/localStorage';
import countLoyalty from './utils/countLoyalty';
import getServerVersionCode from './utils/getServerVersionCode';
import { buildVillageURL } from './utils/twhelp';
import showEnnoblementsPopup from './common/showEnnoblementsPopup';
// ==UserScript==
@ -15,9 +17,9 @@ import showEnnoblementsPopup from './common/showEnnoblementsPopup';
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedVillageProfile.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedVillageProfile.js
// @version 0.7.2
// @version 0.7.3
// @description Extended village profile
// @author Kichiyaki http://dawid-wysokinski.pl/
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*screen=info_village*
// @grant none
// @run-at document-end
@ -336,6 +338,15 @@ const wrapAction = (action) => {
};
const renderActions = () => {
const linkToTWHelp = document.createElement('a');
linkToTWHelp.href = buildVillageURL(
getServerVersionCode(SERVER),
SERVER,
VILLAGE_ID
);
linkToTWHelp.innerHTML = translations.action.linkToTWHelp;
actionContainer.appendChild(wrapAction(linkToTWHelp));
const showEnnoblementsPopup = document.createElement('a');
showEnnoblementsPopup.href = '#';
setPage(showEnnoblementsPopup, '1');

View File

@ -7,6 +7,8 @@ const translations = {
dotd: 'Obrońca dnia',
sotd: 'Pomocnik dnia',
gpotd: 'Mocarstwo dnia',
devNote:
'Informacja od autora - Właśnie uruchomiłem nową stronę ze statystykami, nie zapomnij jej sprawdzić :).',
},
en_DK: {
title: 'Daily achievements - probable players',
@ -15,6 +17,7 @@ const translations = {
dotd: 'Defender of the day',
sotd: 'Supporter of the day',
gpotd: 'Great power of the day',
devNote: `Information from the author - I've just launched a new stat tracking website, don't forget to check it out :).`,
},
};

View File

@ -22,6 +22,8 @@ const translations = {
exportedVillages: 'Wyeksportowane wioski',
tribeChanges: 'Zmiany plemion',
action: {
linkToTWHelp:
'Akta gracza - TWHelp - nowa strona ze statystykami i narzędziami',
showTribeChanges: 'Pokaż zmiany plemion',
showEnnoblements: 'Pokaż przejęcia',
exportVillages: 'Wyeksportuj wioski',
@ -30,6 +32,7 @@ const translations = {
},
en_DK: {
date: 'Date',
newTribe: 'New tribe',
oldTribe: 'Old tribe',
joinedAt: 'Joined at',
@ -51,6 +54,8 @@ const translations = {
exportedVillages: 'Exported villages',
tribeChanges: 'Tribe changes',
action: {
linkToTWHelp:
'User file (external link) - TWHelp - A new stat tracking website.',
showTribeChanges: 'Show tribe changes',
showEnnoblements: 'Show ennoblements',
exportVillages: 'Export villages',

View File

@ -27,6 +27,8 @@ const translations = {
dailyGrowth: 'Dzienny przyrost',
playerLinks: 'Linki',
action: {
linkToTWHelp:
'Akta plemienia - TWHelp - nowa strona ze statystykami i narzędziami',
showTribeChanges: 'Pokaż zmiany plemion',
showEnnoblements: 'Pokaż przejęcia',
showMembersGrowth: 'Pokaż rozwój graczy',
@ -63,6 +65,8 @@ const translations = {
dailyGrowth: 'Daily growth',
playerLinks: 'Player links',
action: {
linkToTWHelp:
'Tribal file (external link) - TWHelp - A new stat tracking website.',
showTribeChanges: 'Show tribe changes',
showEnnoblements: 'Show ennoblements',
showMembersGrowth: 'Show members growth',

View File

@ -9,6 +9,8 @@ const translations = {
ennobledAt: 'Podbita o',
never: 'Nigdy',
action: {
linkToTWHelp:
'Akta wioski - TWHelp - nowa strona ze statystykami i narzędziami',
showEnnoblements: 'Pokaż przejęcia',
countIncomingSupport: 'Policz nadchodzące wsparcie',
},
@ -23,6 +25,8 @@ const translations = {
never: 'Never',
ennobledAt: 'Ennobled at',
action: {
linkToTWHelp:
'Village file (external link) - TWHelp - A new stat tracking website.',
showEnnoblements: 'Show ennoblements',
countIncomingSupport: 'Count incoming support',
},

View File

@ -10,6 +10,8 @@ const translations = {
filters: 'Filtry',
apply: 'Zastosuj',
ennoblements: 'Przejęcia',
devNote:
'Informacja od autora - Właśnie uruchomiłem nową stronę ze statystykami, nie zapomnij jej sprawdzić :).',
},
en_DK: {
showLatestEnnoblements: 'Show latest ennoblements',
@ -22,6 +24,7 @@ const translations = {
date: 'Date',
apply: 'Apply',
ennoblements: 'Ennoblements',
devNote: `Information from the author - I've just launched a new stat tracking website, don't forget to check it out :).`,
},
};

View File

@ -13,6 +13,8 @@ const translations = {
warStatsGenerator: 'Generator statystyk wojennych',
generateWarStats: 'Wygeneruj statystyki wojenne',
addTribe: 'Dodaj plemię',
devNote:
'Informacja od autora - Właśnie uruchomiłem nową stronę ze statystykami, nie zapomnij jej sprawdzić :).',
},
en_DK: {
conquers: 'Conquers',
@ -28,6 +30,7 @@ const translations = {
warStatsGenerator: 'War stats generator',
generateWarStats: 'Generate war stats',
addTribe: 'Add tribe',
devNote: `Information from the author - I've just launched a new stat tracking website, don't forget to check it out :).`,
},
};

View File

@ -7,9 +7,9 @@ import wait from './utils/wait';
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/inADayTribeRankingGenerator.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/inADayTribeRankingGenerator.js
// @version 0.2.0
// @version 0.2.1
// @description 'In A Day' tribe ranking generator
// @author Kichiyaki http://dawid-wysokinski.pl/
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*screen=ranking*mode=in_a_day*
// @grant none
// @run-at document-end

View File

@ -9,6 +9,8 @@ import {
formatVillageName,
} from './utils/tribalwars';
import { setItem, getItem } from './utils/localStorage';
import { buildURLToServerPage } from './utils/twhelp';
import getServerVersionCode from './utils/getServerVersionCode';
import loadTranslations from './i18n/latestEnnoblements';
// ==UserScript==
@ -16,9 +18,9 @@ import loadTranslations from './i18n/latestEnnoblements';
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/latestEnnoblements.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/latestEnnoblements.js
// @version 1.0.5
// @version 1.0.6
// @description Show the latest ennoblements
// @author Kichiyaki http://dawid-wysokinski.pl/
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*
// @grant none
// @run-at document-end
@ -200,6 +202,13 @@ const renderLatestEnnoblements = (ennoblements = [], filters = {}) => {
};
const html = `
<form style="margin-bottom: 15px" id="${FILTER_FORM_ID}">
<h1 style="margin-bottom: 0px; text-align: center;"><a href="${buildURLToServerPage(
getServerVersionCode(SERVER),
SERVER
)}">TWHelp</a></h1>
<h3 style="margin-bottom: 10px; margin-top: 0;">${
translations.devNote
}</h3>
<h3 style="margin-bottom: 5px">${translations.filters}</h3>
<input type="text" placeholder="${translations.newOwner}" value="${
prepared.newOwner

26
src/utils/twhelp.js Normal file
View File

@ -0,0 +1,26 @@
export const BASE_URL = 'tribalwarshelp.com';
export const buildURLToServerPage = (version = '', server = '') => {
return `https://${version}.${BASE_URL}/server/${server}`;
};
export const buildURLToProfile = (
version = '',
server = '',
id = 0,
entity = ''
) => {
return `${buildURLToServerPage(version, server)}/${entity}/${id}`;
};
export const buildPlayerURL = (version = '', server = '', id = 0) => {
return buildURLToProfile(version, server, id, 'player');
};
export const buildTribeURL = (version = '', server = '', id = 0) => {
return buildURLToProfile(version, server, id, 'tribe');
};
export const buildVillageURL = (version = '', server = '', id = 0) => {
return buildURLToProfile(version, server, id, 'village');
};

View File

@ -1,6 +1,8 @@
import requestCreator from './libs/requestCreator';
import getTranslations from './i18n/warStatsGenerator';
import getServer from './utils/getCurrentServer';
import getServerVersionCode from './utils/getServerVersionCode';
import { buildURLToServerPage } from './utils/twhelp';
import showPopup, { POPUP_SELECTOR } from './utils/showPopup';
// ==UserScript==
@ -8,9 +10,9 @@ import showPopup, { POPUP_SELECTOR } from './utils/showPopup';
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/warStatsGenerator.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/warStatsGenerator.js
// @version 0.3.0
// @version 0.3.1
// @description War stats generator
// @author Kichiyaki http://dawid-wysokinski.pl/
// @author Kichiyaki https://dawid-wysokinski.pl/
// @match *://*/game.php*screen=ranking*mode=wars*
// @grant none
// @run-at document-end
@ -180,6 +182,13 @@ const handleFormSubmit = async (e) => {
const showWarStatsForm = (e) => {
const html = `
<form>
<h1 style="margin-bottom: 0px; text-align: center;"><a href="${buildURLToServerPage(
getServerVersionCode(SERVER),
SERVER
)}">TWHelp</a></h1>
<h3 style="margin-bottom: 10px; margin-top: 0;">${
translations.devNote
}</h3>
<div id="${RESULT_CONTAINER_ID}">
</div>
<div style="margin-bottom: 10px;">
@ -199,18 +208,24 @@ const showWarStatsForm = (e) => {
<h3>${translations.sideOne}</h3>
<div id="${SIDE_ONE_INPUT_CONTAINER_ID}">
</div>
<button id="${SIDE_ONE_BUTTON_ID}" class="btn" type="button">${translations.addTribe}</button>
<button id="${SIDE_ONE_BUTTON_ID}" class="btn" type="button">${
translations.addTribe
}</button>
</div>
<div style="margin: 0 5px;"></div>
<div>
<h3>${translations.sideTwo}</h3>
<div id="${SIDE_TWO_INPUT_CONTAINER_ID}">
</div>
<button id="${SIDE_TWO_BUTTON_ID}" class="btn" type="button">${translations.addTribe}</button>
<button id="${SIDE_TWO_BUTTON_ID}" class="btn" type="button">${
translations.addTribe
}</button>
</div>
</div>
<div style="text-align: center;">
<button class="btn" type="submit">${translations.generateWarStats}</button>
<button class="btn" type="submit">${
translations.generateWarStats
}</button>
</div>
</form>
`;