add readme.md and scrreenshots
This commit is contained in:
parent
a0fcf84b7e
commit
eb6ded9f6d
|
@ -117,201 +117,7 @@ parcelRequire = (function (modules, cache, entry, globalName) {
|
|||
}
|
||||
|
||||
return newRequire;
|
||||
})({"VYL5":[function(require,module,exports) {
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = toInteger;
|
||||
|
||||
function toInteger(dirtyNumber) {
|
||||
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
|
||||
return NaN;
|
||||
}
|
||||
|
||||
var number = Number(dirtyNumber);
|
||||
|
||||
if (isNaN(number)) {
|
||||
return number;
|
||||
}
|
||||
|
||||
return number < 0 ? Math.ceil(number) : Math.floor(number);
|
||||
}
|
||||
},{}],"kK6Q":[function(require,module,exports) {
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = requiredArgs;
|
||||
|
||||
function requiredArgs(required, args) {
|
||||
if (args.length < required) {
|
||||
throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
|
||||
}
|
||||
}
|
||||
},{}],"KYJg":[function(require,module,exports) {
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = toDate;
|
||||
|
||||
var _index = _interopRequireDefault(require("../_lib/requiredArgs/index.js"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* @name toDate
|
||||
* @category Common Helpers
|
||||
* @summary Convert the given argument to an instance of Date.
|
||||
*
|
||||
* @description
|
||||
* Convert the given argument to an instance of Date.
|
||||
*
|
||||
* If the argument is an instance of Date, the function returns its clone.
|
||||
*
|
||||
* If the argument is a number, it is treated as a timestamp.
|
||||
*
|
||||
* If the argument is none of the above, the function returns Invalid Date.
|
||||
*
|
||||
* **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
|
||||
*
|
||||
* @param {Date|Number} argument - the value to convert
|
||||
* @returns {Date} the parsed date in the local time zone
|
||||
* @throws {TypeError} 1 argument required
|
||||
*
|
||||
* @example
|
||||
* // Clone the date:
|
||||
* const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
|
||||
* //=> Tue Feb 11 2014 11:30:30
|
||||
*
|
||||
* @example
|
||||
* // Convert the timestamp to date:
|
||||
* const result = toDate(1392098430000)
|
||||
* //=> Tue Feb 11 2014 11:30:30
|
||||
*/
|
||||
function toDate(argument) {
|
||||
(0, _index.default)(1, arguments);
|
||||
var argStr = Object.prototype.toString.call(argument); // Clone the date
|
||||
|
||||
if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {
|
||||
// Prevent the date to lose the milliseconds when passed to new Date() in IE10
|
||||
return new Date(argument.getTime());
|
||||
} else if (typeof argument === 'number' || argStr === '[object Number]') {
|
||||
return new Date(argument);
|
||||
} else {
|
||||
if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"); // eslint-disable-next-line no-console
|
||||
|
||||
console.warn(new Error().stack);
|
||||
}
|
||||
|
||||
return new Date(NaN);
|
||||
}
|
||||
}
|
||||
},{"../_lib/requiredArgs/index.js":"kK6Q"}],"lQIY":[function(require,module,exports) {
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = addDays;
|
||||
|
||||
var _index = _interopRequireDefault(require("../_lib/toInteger/index.js"));
|
||||
|
||||
var _index2 = _interopRequireDefault(require("../toDate/index.js"));
|
||||
|
||||
var _index3 = _interopRequireDefault(require("../_lib/requiredArgs/index.js"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* @name addDays
|
||||
* @category Day Helpers
|
||||
* @summary Add the specified number of days to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of days to the given date.
|
||||
*
|
||||
* ### v2.0.0 breaking changes:
|
||||
*
|
||||
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
||||
*
|
||||
* @param {Date|Number} date - the date to be changed
|
||||
* @param {Number} amount - the amount of days to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
|
||||
* @returns {Date} the new date with the days added
|
||||
* @throws {TypeError} 2 arguments required
|
||||
*
|
||||
* @example
|
||||
* // Add 10 days to 1 September 2014:
|
||||
* var result = addDays(new Date(2014, 8, 1), 10)
|
||||
* //=> Thu Sep 11 2014 00:00:00
|
||||
*/
|
||||
function addDays(dirtyDate, dirtyAmount) {
|
||||
(0, _index3.default)(2, arguments);
|
||||
var date = (0, _index2.default)(dirtyDate);
|
||||
var amount = (0, _index.default)(dirtyAmount);
|
||||
|
||||
if (isNaN(amount)) {
|
||||
return new Date(NaN);
|
||||
}
|
||||
|
||||
if (!amount) {
|
||||
// If 0 days, no-op to avoid changing times in the hour before end of DST
|
||||
return date;
|
||||
}
|
||||
|
||||
date.setDate(date.getDate() + amount);
|
||||
return date;
|
||||
}
|
||||
},{"../_lib/toInteger/index.js":"VYL5","../toDate/index.js":"KYJg","../_lib/requiredArgs/index.js":"kK6Q"}],"mRRL":[function(require,module,exports) {
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = subDays;
|
||||
|
||||
var _index = _interopRequireDefault(require("../_lib/toInteger/index.js"));
|
||||
|
||||
var _index2 = _interopRequireDefault(require("../addDays/index.js"));
|
||||
|
||||
var _index3 = _interopRequireDefault(require("../_lib/requiredArgs/index.js"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* @name subDays
|
||||
* @category Day Helpers
|
||||
* @summary Subtract the specified number of days from the given date.
|
||||
*
|
||||
* @description
|
||||
* Subtract the specified number of days from the given date.
|
||||
*
|
||||
* ### v2.0.0 breaking changes:
|
||||
*
|
||||
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
||||
*
|
||||
* @param {Date|Number} date - the date to be changed
|
||||
* @param {Number} amount - the amount of days to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
|
||||
* @returns {Date} the new date with the days subtracted
|
||||
* @throws {TypeError} 2 arguments required
|
||||
*
|
||||
* @example
|
||||
* // Subtract 10 days from 1 September 2014:
|
||||
* var result = subDays(new Date(2014, 8, 1), 10)
|
||||
* //=> Fri Aug 22 2014 00:00:00
|
||||
*/
|
||||
function subDays(dirtyDate, dirtyAmount) {
|
||||
(0, _index3.default)(2, arguments);
|
||||
var amount = (0, _index.default)(dirtyAmount);
|
||||
return (0, _index2.default)(dirtyDate, -amount);
|
||||
}
|
||||
},{"../_lib/toInteger/index.js":"VYL5","../addDays/index.js":"lQIY","../_lib/requiredArgs/index.js":"kK6Q"}],"Ph2E":[function(require,module,exports) {
|
||||
})({"Ph2E":[function(require,module,exports) {
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
|
@ -772,7 +578,201 @@ var _default = function _default(e, ennoblements) {
|
|||
};
|
||||
|
||||
exports.default = _default;
|
||||
},{"./pagination":"fCHX","./renderPopup":"P4rL","./formatDate":"V6Mf","./tribalwars":"fHHP"}],"gJkK":[function(require,module,exports) {
|
||||
},{"./pagination":"fCHX","./renderPopup":"P4rL","./formatDate":"V6Mf","./tribalwars":"fHHP"}],"VYL5":[function(require,module,exports) {
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = toInteger;
|
||||
|
||||
function toInteger(dirtyNumber) {
|
||||
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
|
||||
return NaN;
|
||||
}
|
||||
|
||||
var number = Number(dirtyNumber);
|
||||
|
||||
if (isNaN(number)) {
|
||||
return number;
|
||||
}
|
||||
|
||||
return number < 0 ? Math.ceil(number) : Math.floor(number);
|
||||
}
|
||||
},{}],"kK6Q":[function(require,module,exports) {
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = requiredArgs;
|
||||
|
||||
function requiredArgs(required, args) {
|
||||
if (args.length < required) {
|
||||
throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
|
||||
}
|
||||
}
|
||||
},{}],"KYJg":[function(require,module,exports) {
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = toDate;
|
||||
|
||||
var _index = _interopRequireDefault(require("../_lib/requiredArgs/index.js"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* @name toDate
|
||||
* @category Common Helpers
|
||||
* @summary Convert the given argument to an instance of Date.
|
||||
*
|
||||
* @description
|
||||
* Convert the given argument to an instance of Date.
|
||||
*
|
||||
* If the argument is an instance of Date, the function returns its clone.
|
||||
*
|
||||
* If the argument is a number, it is treated as a timestamp.
|
||||
*
|
||||
* If the argument is none of the above, the function returns Invalid Date.
|
||||
*
|
||||
* **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
|
||||
*
|
||||
* @param {Date|Number} argument - the value to convert
|
||||
* @returns {Date} the parsed date in the local time zone
|
||||
* @throws {TypeError} 1 argument required
|
||||
*
|
||||
* @example
|
||||
* // Clone the date:
|
||||
* const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
|
||||
* //=> Tue Feb 11 2014 11:30:30
|
||||
*
|
||||
* @example
|
||||
* // Convert the timestamp to date:
|
||||
* const result = toDate(1392098430000)
|
||||
* //=> Tue Feb 11 2014 11:30:30
|
||||
*/
|
||||
function toDate(argument) {
|
||||
(0, _index.default)(1, arguments);
|
||||
var argStr = Object.prototype.toString.call(argument); // Clone the date
|
||||
|
||||
if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {
|
||||
// Prevent the date to lose the milliseconds when passed to new Date() in IE10
|
||||
return new Date(argument.getTime());
|
||||
} else if (typeof argument === 'number' || argStr === '[object Number]') {
|
||||
return new Date(argument);
|
||||
} else {
|
||||
if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"); // eslint-disable-next-line no-console
|
||||
|
||||
console.warn(new Error().stack);
|
||||
}
|
||||
|
||||
return new Date(NaN);
|
||||
}
|
||||
}
|
||||
},{"../_lib/requiredArgs/index.js":"kK6Q"}],"lQIY":[function(require,module,exports) {
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = addDays;
|
||||
|
||||
var _index = _interopRequireDefault(require("../_lib/toInteger/index.js"));
|
||||
|
||||
var _index2 = _interopRequireDefault(require("../toDate/index.js"));
|
||||
|
||||
var _index3 = _interopRequireDefault(require("../_lib/requiredArgs/index.js"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* @name addDays
|
||||
* @category Day Helpers
|
||||
* @summary Add the specified number of days to the given date.
|
||||
*
|
||||
* @description
|
||||
* Add the specified number of days to the given date.
|
||||
*
|
||||
* ### v2.0.0 breaking changes:
|
||||
*
|
||||
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
||||
*
|
||||
* @param {Date|Number} date - the date to be changed
|
||||
* @param {Number} amount - the amount of days to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
|
||||
* @returns {Date} the new date with the days added
|
||||
* @throws {TypeError} 2 arguments required
|
||||
*
|
||||
* @example
|
||||
* // Add 10 days to 1 September 2014:
|
||||
* var result = addDays(new Date(2014, 8, 1), 10)
|
||||
* //=> Thu Sep 11 2014 00:00:00
|
||||
*/
|
||||
function addDays(dirtyDate, dirtyAmount) {
|
||||
(0, _index3.default)(2, arguments);
|
||||
var date = (0, _index2.default)(dirtyDate);
|
||||
var amount = (0, _index.default)(dirtyAmount);
|
||||
|
||||
if (isNaN(amount)) {
|
||||
return new Date(NaN);
|
||||
}
|
||||
|
||||
if (!amount) {
|
||||
// If 0 days, no-op to avoid changing times in the hour before end of DST
|
||||
return date;
|
||||
}
|
||||
|
||||
date.setDate(date.getDate() + amount);
|
||||
return date;
|
||||
}
|
||||
},{"../_lib/toInteger/index.js":"VYL5","../toDate/index.js":"KYJg","../_lib/requiredArgs/index.js":"kK6Q"}],"mRRL":[function(require,module,exports) {
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = subDays;
|
||||
|
||||
var _index = _interopRequireDefault(require("../_lib/toInteger/index.js"));
|
||||
|
||||
var _index2 = _interopRequireDefault(require("../addDays/index.js"));
|
||||
|
||||
var _index3 = _interopRequireDefault(require("../_lib/requiredArgs/index.js"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* @name subDays
|
||||
* @category Day Helpers
|
||||
* @summary Subtract the specified number of days from the given date.
|
||||
*
|
||||
* @description
|
||||
* Subtract the specified number of days from the given date.
|
||||
*
|
||||
* ### v2.0.0 breaking changes:
|
||||
*
|
||||
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
||||
*
|
||||
* @param {Date|Number} date - the date to be changed
|
||||
* @param {Number} amount - the amount of days to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
|
||||
* @returns {Date} the new date with the days subtracted
|
||||
* @throws {TypeError} 2 arguments required
|
||||
*
|
||||
* @example
|
||||
* // Subtract 10 days from 1 September 2014:
|
||||
* var result = subDays(new Date(2014, 8, 1), 10)
|
||||
* //=> Fri Aug 22 2014 00:00:00
|
||||
*/
|
||||
function subDays(dirtyDate, dirtyAmount) {
|
||||
(0, _index3.default)(2, arguments);
|
||||
var amount = (0, _index.default)(dirtyAmount);
|
||||
return (0, _index2.default)(dirtyDate, -amount);
|
||||
}
|
||||
},{"../_lib/toInteger/index.js":"VYL5","../addDays/index.js":"lQIY","../_lib/requiredArgs/index.js":"kK6Q"}],"gJkK":[function(require,module,exports) {
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
|
@ -897,8 +897,6 @@ exports.setItem = setItem;
|
|||
},{}],"yRop":[function(require,module,exports) {
|
||||
"use strict";
|
||||
|
||||
var _subDays = _interopRequireDefault(require("date-fns/subDays"));
|
||||
|
||||
var _requestCreator = _interopRequireDefault(require("./libs/requestCreator"));
|
||||
|
||||
var _renderTodaysStats = _interopRequireDefault(require("./utils/renderTodaysStats"));
|
||||
|
@ -1316,4 +1314,4 @@ const renderActions = () => {
|
|||
console.log('extended player profile', error);
|
||||
}
|
||||
})();
|
||||
},{"date-fns/subDays":"mRRL","./libs/requestCreator":"Ph2E","./utils/renderTodaysStats":"dPMc","./utils/renderPopup":"P4rL","./utils/renderEnnoblements":"vhoq","./utils/renderHistoryPopup":"gJkK","./utils/pagination":"fCHX","./utils/getIDFromURL":"tQUs","./utils/getCurrentServer":"DMkL","./utils/formatDate":"V6Mf","./utils/twstats":"Syko","./utils/tribalwars":"fHHP","./utils/localStorage":"KWxH"}]},{},["yRop"], null)
|
||||
},{"./libs/requestCreator":"Ph2E","./utils/renderTodaysStats":"dPMc","./utils/renderPopup":"P4rL","./utils/renderEnnoblements":"vhoq","./utils/renderHistoryPopup":"gJkK","./utils/pagination":"fCHX","./utils/getIDFromURL":"tQUs","./utils/getCurrentServer":"DMkL","./utils/formatDate":"V6Mf","./utils/twstats":"Syko","./utils/tribalwars":"fHHP","./utils/localStorage":"KWxH"}]},{},["yRop"], null)
|
|
@ -0,0 +1,68 @@
|
|||
# Scripts for the browser game tribal wars.
|
||||
|
||||
## Installation
|
||||
|
||||
1. Add [Tampermonkey](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo) to your browser.
|
||||
2. Select a script that you wish to use, and copy the code.
|
||||
3. Open Tampermonkey in your browser and click the Add Script tab (icon with a plus symbol)
|
||||
4. Paste the code, hit save (shortcut: CTRL + s).
|
||||
5. The script should be visible in the game.
|
||||
|
||||
## Scripts
|
||||
|
||||
### 1. Latest ennoblements
|
||||
|
||||
[Code](https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/latestEnnoblements.js)
|
||||
|
||||
This script shows you the latest ennoblements from your server. It's working in real-time.
|
||||
|
||||
![Screenshot](/screenshots/latestEnnoblements.png?raw=true)
|
||||
|
||||
### 2. Extended player profile
|
||||
|
||||
[Code](https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedPlayerProfile.js)
|
||||
|
||||
This script adds a lot of useful actions and pieces of information to the player profile.
|
||||
|
||||
- Daily growth
|
||||
- Best rank
|
||||
- Join date
|
||||
- Most points
|
||||
- Most villages
|
||||
- Player's other worlds
|
||||
- Player's other names
|
||||
- Today's stat changes
|
||||
- 'In a day' best scores
|
||||
- Tribe changes
|
||||
- Player history
|
||||
- Player ennoblements
|
||||
|
||||
![Screenshot](/screenshots/extendedPlayerProfile.png?raw=true)
|
||||
|
||||
### 3. Extended tribe profile
|
||||
|
||||
[Code](https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedTribeProfile.js)
|
||||
|
||||
This script adds a lot of useful actions and pieces of information to the tribe profile.
|
||||
|
||||
- Dominance
|
||||
- Best rank
|
||||
- Create date
|
||||
- Most points
|
||||
- Most villages
|
||||
- Today's stat changes
|
||||
- Tribe changes
|
||||
- Tribe history
|
||||
- Tribe ennoblements
|
||||
- Members growth
|
||||
- OD, ODA, ODD, ODS ranks and scores to tribe members
|
||||
|
||||
![Screenshot](/screenshots/extendedTribeProfile.png?raw=true)
|
||||
|
||||
### 4. Extended village profile
|
||||
|
||||
[Code](https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedVillageProfile.js)
|
||||
|
||||
This script adds 'Show ennoblements' action.
|
||||
|
||||
![Screenshot](/screenshots/extendedVillageProfile.png?raw=true)
|
Binary file not shown.
After Width: | Height: | Size: 220 KiB |
Binary file not shown.
After Width: | Height: | Size: 248 KiB |
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
Binary file not shown.
After Width: | Height: | Size: 98 KiB |
|
@ -1,4 +1,3 @@
|
|||
import subDays from 'date-fns/subDays';
|
||||
import requestCreator from './libs/requestCreator';
|
||||
import renderTodaysStats from './utils/renderTodaysStats';
|
||||
import renderPopup from './utils/renderPopup';
|
||||
|
|
Reference in New Issue