Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajax({
- url: 'https://raw.githubusercontent.com/Slupik/TribalWars/master/SlupioScriptSettings/maincode.js',
- success: function (response) {
- eval(response);
- }
- });
- if (!('contains' in String.prototype)) {
- String.prototype.contains = function (str, startIndex) {
- return -1 !== String.prototype.indexOf.call(this, str, startIndex);
- };
- };
- if (!('getHexEncode' in String.prototype)) {
- String.prototype.getHexEncode = function () {
- var hex, i;
- var result = "";
- for (i = 0; i < this.length; i++) {
- hex = this.charCodeAt(i).toString(16);
- result += ("000" + hex).slice(-4);
- }
- return result;
- }
- };
- if (!('getHexDecode' in String.prototype)) {
- String.prototype.getHexDecode = function () {
- var j;
- var hexes = this.match(/.{1,4}/g) || [];
- var back = "";
- for (j = 0; j < hexes.length; j++) {
- back += String.fromCharCode(parseInt(hexes[j], 16));
- }
- return back;
- }
- };
- if (!('replaceAll' in String.prototype)) {
- String.prototype.replaceAll = function (token, newToken, ignoreCase) {
- var _token;
- var str = this + "";
- var i = -1;
- if (typeof token === "string") {
- if (ignoreCase) {
- _token = token.toLowerCase();
- while ((
- i = str.toLowerCase().indexOf(
- _token, i >= 0 ? i + newToken.length : 0
- )
- ) !== -1
- ) {
- str = str.substring(0, i) +
- newToken +
- str.substring(i + token.length);
- }
- } else {
- return this.split(token).join(newToken);
- }
- }
- return str;
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment