// ==UserScript== // @name TW-Collections // @namespace https://greasyfork.org/users/2196 // @description TW-Collections - see history // @include https://*.the-west.*/game.php* // @exclude https://classic.the-west.net* // @author Dun (updated by Tom Robert) // @version 1.4.6.5 // @history 1.4.6.5 Bugfix, TW v2.97 // @history 1.4.6.4 Bugfixes by Tom Robert, TW v2.80 // @history 1.4.6.3 rev. TW 2.29 // @history 1.4.6.2 rev. TW 2.26 // @history 1.4.6.1 rev. TW 2.24 // @history 1.4.6 add Ro translation // @history 1.4.5 correcting a bug on current market bid // @history 1.4.4 Correct bugs & update 2.23 & add upgradeables search in inventory // @history 1.4.3 Correct refresh bug // @history 1.4.2 update for TW 2.21 // @history 1.4.1 correct bugs and add include for beta // @history 1.4.0.2 remove personnal frienset from sets list // @history 1.4.0 add Set Window and crafting items icons // @history 1.3.9 correct for es translation // @history 1.3.8 miscelaneous changes - update link to pastebin (thanks to Tom Robert ) // @history 1.3.7 correct bug for double item wearing - reactivate update // @history 1.3.6 correct translations links // @history 1.3.5 correct bugs save & trader icons // @history 1.3.4 correct bugs save settings // @history 1.3.3.9 correct bugs for 2.1, deactivate update since userscript is dead // @history 1.3.3.8 update TW version 2.1 // @history 1.3.3.7 maj for 2.09 // @history 1.3.3.6 correcting tips in mobile trader // @history 1.3.3.5 add vertical scrollbar in set & collection selectboxs // @history 1.3.3.4 maj 2.08 & optimisation chargement items de collections // @history 1.3.3.3 Fix ended bids // @history 1.3.3.2 correct End bids on collector list, add setting for deactivate menu mouse hover // @history 1.3.3 Mod. listcolector: recherche dans le marché add direct link to market / mobile trader, add filters // @history 1.3.2.1 Fix inventory bug // @history 1.3.2 fix for the the mobile trader link, add the new TW items of the achieved collections, add pictures on collections list // @history 1.3.1.3 fix for the shop display // @history 1.3.1.2 corrections // @history 1.3.1.1 corrections // @history 1.3.1 correction pour le nouveau marchand ambulant + patch TWDB new // @history 1.3.0 correction trad en + ajout lien forum // @history 1.2.9 correction trad en et logout sans confirmation + ajout trad Slovak // @history 1.2.7 correction trad en et logout sans confirmation // @history 1.2.7 ajout filtres inventaires, correction // @history 1.2.7 modification du systeme de langue et de l'updater, simplification suppression rapport, etc... // @history 1.2.6.1 correction affichage TW api // @history 1.2.6 correction lang et changement de nom // @history 1.2.5 corrections ... or not :) // @history 1.2.4 Création d'une barre d'outils dans l'inventaire (recettes, sets, consommables,doublons) // @history 1.2.3 ajout d'un bouton doublon dans l'inventaire et correction bug lang // @history 1.2.2 passage 2.0.6 // @history 1.2.1 passage 2.0.5 // @history 1.2.0 correction bugs maj + Traduction italienne (grazie tw81) // @history 1.1.9 correction attente TWDB.... // @nocompat Chrome // @grant none // @downloadURL none // ==/UserScript== (function (e) { var t = document.createElement("script"); t.type = "application/javascript"; t.textContent = "(" + e + ")();"; document.body.appendChild(t); t.parentNode.removeChild(t); }) (function () { TWT = { DEBUG: false, LANG: {}, info: { name: 'TW-Collections', lang: 'en', version: '1.4.6.5', min_gameversion: '2.0', max_gameversion: Game.version.toString(), idscript: '1670', website: 'https://greasyfork.org/scripts/7258' }, languages: [{ short_name: 'fr', name: 'Francais', translator: 'Dun', version: '1.4.0' }, { short_name: 'en', name: 'English', translator: 'Dun', version: '1.4.0' } ], images: { cup: "images/icons/achv_points.png", logout: "data:image/jpg;base64,/9j/4AAQSkZJRgABAgIAJQAlAAD/wAARCAAZADIDAREAAhEBAxEB/9sAhAAGBAUGBQQGBgUGBwcGCAoRCwoJCQoVDxAMERkWGhoYFhgXGx8oIRsdJR4XGCIvIyUpKiwtLBshMTQwKzQoKywrAQcHBwoJChQLCxQrHBgcHCsrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKyv/xAGiAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgsQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4S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fNG0aq0kRZgU6NCyOAOP4jyew45MUxHJtsIb/kWZbwPlEF9t1PLRQxUJhWCKPvKKmY9zxKxk95OVAABJYk64jk3O7nMg3RJtFOktDgugWxG3jzty5p9yeVmEgOmKfcvsvzVfCJ/lGbOfUfie5O3tBmFROszVSc+V06s3Hx7KRyrA8gr+CCNNTz9PuN33IcBlym3xVTU94vVdcKX7qDxyeGadpI2dQB1ZkZXK8AgvwfkHTT+HsyxRcmSpUWeqdIY9/vSAGDqOb9/PrXoO82DYxJFBf5rYGqFk7xOsjRtFIVA7o6FXRuPUlWHK/B5HxrB2/aDF83ySltuZVtzutGKtpoqGuuLyQRuSf8AM+sgHYhVkDhQfUDTTRnZwu5hLpLTjhK1XeqbiUT19P8ATz+/zzqobJYLVZLelut1KEiT9Ofkk/kk/knTTTV4gxF0urFo8Gv/2Q==" }, menu_callback: { goHome: "TaskQueue.add(new TaskWalk(Character.homeTown.town_id,'town'))", goToDaily1: 'Map.center(1920, 2176);', goToDaily2: 'Map.center(28288,16768);', ownSaloon: 'SaloonWindow.open(Character.homeTown.town_id);', openMarket: 'MarketWindow.open(Character.homeTown.town_id);', mobileTrader: "west.window.shop.open().showCategory('trader');", forum: "ForumWindow.open();", listNeeded: 'TWT.WindowCollection.open();', openOptions: "TWT.Options.open('setting')" }, css: { style: "position:relative;top:0px;left:0px;width:12px;height:12px;padding:0px;border:0px;margin:0px;", styleT: "position:absolute;top:4px;left:3px;width:15px;height:15px;padding:0px;border:0px;margin:0px;", styleN: "position:absolute;top:120px;left:25px;padding:0px;border:0px;margin:0px;", styleDB: "position:absolute;top:0px;left:0px;padding:0px;border:0px;margin:0px;" }, langPatchs: { cs: { link: "7260", texte: "Czech - čeština", author: "Dr.Keeper" }, es: { link: "7313", texte: "Spanish - Español", author: "pepe100" }, de: { link: "1672", texte: "German - Deutsch", author: "Hanya & Tom Robert" }, it: { link: "1675", texte: "Italian - Italiano", author: "tw81" }, hu: { link: "7261", texte: "Hungarian - Magyar", author: "Zoltan80" }, sl: { link: "7259", texte: "Slovak - Slovenčina", author: "Surge" }, pl: { link: "1674", texte: "Polish - Polski", author: "Dun from Darius II mod" }, pt: { link: "7312", texte: "Portuguese - Português", author: "VSaantiago" }, ru: { link: "7271", texte: "Russian - Pу́сский", author: "Anch665" }, ro: { link: "9037", texte: "Romanian - Română", author: "Peta" } }, langs: { fr: { description: "
').append($.trim(valGroup[0]))); divMain.append(bigTR); $.each(valGroup[1], function (ind3, val) { var tr = $(' |
');
var span = $("");
var img = $("' + TWT.LANG.collection.filters + '', ' ');
cbox.append(this.cbBid.getMainDiv(), ' ', ' ');
cbox.append(this.cbCurBid.getMainDiv(), ' '); return cbox; }, open: function () { if (!TWT.MetaCol.ready) { TWT.MetaCol.init(); this.interval = setInterval(function () { if (TWT.MetaCol.ready) clearInterval(this.interval); }, 200); } this.Window = wman.open('WindowCollection', TWT.LANG.collection.listText).setMiniTitle(TWT.LANG.collection.listText); this.Window.addTab(TWT.LANG.collection.colTabTitle, "TabCols", this.openCols); this.Window.addTab(TWT.LANG.collection.setTabTitle, "TabSets", this.openSets); if (window == 'sets') { this.openSets(); } else { this.openCols(); } }, openSets: function () { TWT.WindowCollection.Window.activateTab('TabSets').$("div.tw2gui_window_content_pane").empty(); TWT.WindowCollection.Window.setTitle(TWT.LANG.collection.listSetText); var rightPane = $(' ').css({
'height': '100%',
'left': '199px',
'position': 'absolute',
'top': '15px',
'width': '450px'
});
var leftPane = $(' ').css({
'position': 'absolute',
'top': '15px',
'height': '100%',
'width': '190px'
});
var divide = $(' ');
divide.css({
'top': '0px',
'height': '375px'
});
$(' ').append(leftPane).append(divide).append(rightPane).appendTo('.WindowCollection .tw2gui_window_content_pane');
TWT.WindowCollection.Window.showLoader();
TWT.MetaCol.getMarketEC();
var showbox = $('');
this.scrollbar = new west.gui.Scrollpane();
this.scrollbar.scrollToTop();
$(this.scrollbar.getMainDiv()).css({
'height': '320px',
'top': '5px'
});
this.scrollbar.appendContent($(''));
showbox.append(this.scrollbar.getMainDiv());
var th = $(' ');
th.css({
'text-align': 'center',
'font-weight': 'bolder'
});
$('#rightPane').append(th);
$('#rightPane').append(showbox);
$('#leftPane').append(TWT.WindowCollection.getAllAnchors(TWT.MetaCol.setCol, TWT.MetaCol.groupSet));
var divMain = TWT.WindowCollection.getDiv(TWT.MetaCol.setCol);
$('#showbox').html(divMain);
TWT.WindowCollection.Window.hideLoader();
},
openCols: function () {
TWT.WindowCollection.Window.activateTab('TabCols').$("div.tw2gui_window_content_pane").empty();
TWT.WindowCollection.Window.setTitle(TWT.LANG.collection.listText);
var rightPane = $(' ').css({
'height': '100%',
'left': '199px',
'position': 'absolute',
'top': '15px',
'width': '450px'
});
var leftPane = $(' ').css({
'position': 'absolute',
'top': '15px',
'height': '380px',
'width': '190px'
});
var divide = $(' ');
divide.css({
'top': '0px',
'height': '375px'
});
$(' ').append(leftPane).append(divide).append(rightPane).appendTo('.WindowCollection .tw2gui_window_content_pane');
TWT.WindowCollection.Window.showLoader();
TWT.MetaCol.getMarketEC();
var showbox = $('');
this.scrollbar = new west.gui.Scrollpane();
this.scrollbar.scrollToTop();
$(this.scrollbar.getMainDiv()).css({
'height': '320px',
'top': '5px'
});
this.scrollbar.appendContent($(''));
showbox.append(this.scrollbar.getMainDiv());
var th = $(' ');
th.css({
'text-align': 'center',
'font-weight': 'bolder'
});
$('#leftPane').append(TWT.WindowCollection.getAllAnchors());
$('#leftPane').append(TWT.WindowCollection.getFiltres());
/* $('') .append(this.getAllAnchors())) ;*/
$('#rightPane').append(th);
$('#rightPane').append(showbox);
var divMain = TWT.WindowCollection.getDiv(TWT.MetaCol.groupSorted);
$('#showbox').html(divMain);
TWT.WindowCollection.Window.hideLoader();
}
},
Injecteur: {
divsnif: [],
methodes: [],
winTabInjected: [],
init: function (id, name, callback) {
if (!isDefined(this.methodes[id])) {
this.methodes[id] = {
attached: false,
id: id,
name: name,
callback: callback,
original: eval(name)
};
}
},
addWinTabListen: function (who, callback, tab) {
if (!isDefined(TWT.Injecteur.winTabInjected[who + '_' + tab])) {
TWT.Injecteur.winTabInjected[who] = {
who: who,
tab: tab,
callback: callback
};
}
},
startListen: function () {
EventHandler.listen('WINDOW_OPENED', function (e) {
if (isDefined(TWT.Injecteur.winTabInjected[e])) {
var inj = TWT.Injecteur.winTabInjected[e];
TWT.Injecteur.detecteWin(inj.who, inj.callback, inj.tab);
}
});
},
detecteWin: function (who, callback, tab) {
var u = wman.getById(who);
if (isDefined(u)) {
u.addEventListener(TWE('WINDOW_CLOSE'), function (e) {
u.removeEventListener(TWE('WINDOW_TAB_CLICK'), callback(u));
u.removeEventListener(TWE('WINDOW_CLOSE'), callback);
}, u, who);
if (isDefined(tab)) {
u.addEventListener(TWE('WINDOW_TAB_CLICK'), function (e) {
if (u.currentActiveTabId == tab) {
callback(u);
}
}, u, who);
} else {
callback(u);
}
}
},
detecteWinOff: function (who) {
TWT.Injecteur.winTabInjected[who] = null;
},
divsniffer: function (who, callback) {
if (isDefined(TWT.Injecteur.divsnif[who])) {
return false;
} else {
$('#windows').on('DOMNodeInserted', '.' + who, function (e) {
try {
var opendiv = e.currentTarget;
if (opendiv.attributes['class'].nodeValue.indexOf(who) > -1) {
var divBuy = $('div[class="' + who + '"]').contents();
callback($(opendiv));
}
} catch (e) {
ErrorLog.log(e);
}
});
TWT.Injecteur.divsnif[who] = 'true';
}
},
divsnifferoff: function (who) {
$('#windows').off('DOMNodeInserted', '.' + who);
TWT.Injecteur.divsnif[who] = undefined;
},
inject: function (id) {
try {
if (isDefined(this.methodes[id]) && !this.methodes[id].attached) {
this.methodes[id].attached = true;
return this.methodes[id].callback();
}
} catch (e) {
ErrorLog.log(e, 'Erreur injection ' + id);
this.restore(id);
}
},
restore: function (id) {
try {
this.methodes[id].attached = false;
eval("(function ($) {" + this.methodes[id].name + '=' + this.methodes[id].original + "})($);");
return this.methodes[id].original;
} catch (e) {
ErrorLog.log(e, 'Erreur retauration ' + id);
}
},
injectedMethods: {
injectItemTrader: function () {
west.game.shop.item.view.prototype.injectTWTips = function (item) {
if (TWT.MetaCol.dirty) {
TWT.CollectionsHandler.refresh();
}
var obj = this.getModel();
var name = $.trim(obj.getName());
var divMain = " ";
/* itemTraderFunction.bind(this)();*/
item.find(".TWTSuccess").remove();
if (TWT.MetaCol.shouldBuy(name)) {
var titre = TWT.MetaCol.getBuyItems(name, true);
divMain = ' " + sell + TWT.LANG.Doublons.sellGain + " ");
}
},
searchSpeciales: function (what) {
$('#inventory_search', Inventory.DOM).val(what);
var res = Bag.search(what);
Inventory.showSearchResult(res || []);
return res;
},
getDetSearchBox: function () {
if (isDefined(west.storage.ItemSetManager)) {
var selSets = new west.gui.Selectbox();
selSets.setWidth(200);
$(selSets.elContent).css({
"max-height": "270px",
"width": "250px",
"overflow-y": 'auto'
});
TWT.selAdded = [];
selSets.addItem('all', TWT.LANG.collection.allOpt);
selSets.addItem('current', TWT.LANG.Doublons.current);
selSets.addItem('upgradeable', TWT.LANG.Doublons.upgradeable);
selSets.addItem('nosets', TWT.LANG.Doublons.noset);
selSets.addItem('sellable', TWT.LANG.Doublons.sellable);
selSets.addItem('auctionable', TWT.LANG.Doublons.auctionable);
selSets.addListener(function (e) {
switch (e) {
case 'all':
$('#inventory_search', Inventory.DOM).val("");
break;
default:
break;
}
TWT.Inventaire.searchDoublons(e);
return true;
});
return selSets;
}
return selSets;
},
getSetNamesBox: function (setsCache) {
if (isDefined(west.storage.ItemSetManager)) {
var selSets = new west.gui.Selectbox();
selSets.setWidth(200);
$(selSets.elContent).css({
"max-height": "270px",
"width": "250px",
"overflow-y": 'auto'
});
TWT.selAdded = [];
selSets.addItem('setitems', TWT.LANG.collection.allOpt);
$.each(setsCache, function (ind2, item) {
var itemsSet = west.storage.ItemSetManager.get(item.obj.set);
if (!isDefined(TWT.selAdded[itemsSet.name])) {
TWT.selAdded[itemsSet.name] = true;
selSets.addItem(itemsSet.name, itemsSet.name);
}
});
selSets.addListener(function (e) {
TWT.Inventaire.searchSpeciales(e);
return true;
});
return selSets;
}
return selSets;
},
addCheckBoxBag: function (div) {
if ($('#bagFilterIsCollect', Inventory.DOM).length == 0) {
var setsCache = Bag.search('setitems');
setsCache.sort(function (a, b) {
var x = west.storage.ItemSetManager.get(a.obj.set).name;
var y = west.storage.ItemSetManager.get(b.obj.set).name;
if (typeof x === 'string' && typeof x === 'string') {
return x.localeCompare(y);
}
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
});
var selBox = TWT.Inventaire.getSetNamesBox(setsCache);
var spanD = $('');
if (TWT.Settings.isChecked('inventory.doublons')) {
var insertedCB = $("').append(" ![]() ![]() ![]() ![]() Suppression en cours..... Page ' + that.progress_page + '/' + MessagesWindow.Report.pageCount + ' '); $.ajax({ url: 'game.php?window=reports&action=get_reports&h=' + Player.h, type: 'POST', data: { 'folder': MessagesWindow.Report.currentFolder, 'page': that.progress_page }, dataType: 'json', async: false, success: function (data_return) { for (var j = 0; j < data_return.reports.length; j++) { that.reports_id.push(data_return.reports[j].report_id); } that.progress_page += 1; } }); } $.ajax({ url: 'game.php?window=reports&action=delete_reports&h=' + Player.h, type: 'POST', data: { 'deleted': 'false', 'reports': TWT.AllReportsDelete.reports_id.join(", ") }, dataType: 'json', async: false, success: function (data_return) { if (data_return.error) that.status_close = false; } }); MessagesWindow.showTab('report'); } }, getDunMp: function () { if (Game.worldName == 'Monde 1' || Game.worldName == 'Monde 3' || Game.worldName == 'Alamogordo' || Game.worldName == 'Death Valley') { return ""; } else { if (Game.worldName == 'World 1') { return ""; } return ""; } }, api: function () { var TWApi = TheWestApi.register('TW_Collections', 'TW Collections', TWT.info.min_gameversion, TWT.info.max_gameversion, 'Dun (updated by Tom Robert - v' + TWT.info.version, TWT.info.website); var set_button = new west.gui.Button(TWT.LANG.Options.tab.setting, function () { TWT.Options.open('setting'); }, this, this, "Open the Settings page"); var more_button = new west.gui.Button(TWT.LANG.Options.checkbox_text.miscellaneous.options.lang, function () { TWT.Options.open('translate'); }, this, this, "Open the Translation tips page"); TWApi.setGui($("" + TWT.LANG.description + " ").append(set_button.getMainDiv()).append(more_button.getMainDiv()).after(TWT.getDunMp()));
}
};
ScriptUpdater = {
id: null,
version: null,
scriptId: null,
scriptCurrentVersion: null,
scriptUpdUrl: "https://pastebin.com/raw.php?i=W4fYvHcM",
scriptCallbackFunction: null,
scriptStorage: null,
initialize: function (scriptId, scriptCurrentVersion, scriptCallbackFunction, scriptUseNotice, scriptForceNotice) {
ScriptUpdater.scriptId = scriptId;
ScriptUpdater.scriptCurrentVersion = scriptCurrentVersion;
if (ScriptUpdater.scriptStorage == null) {
ScriptUpdater.scriptStorage = new Storage("local", "ScriptUpdater." + scriptId);
}
},
setValue: function (key, value) {
if (ScriptUpdater.scriptStorage == null) {
ScriptUpdater.scriptStorage = new Storage("local", "ScriptUpdater." + scriptId);
}
ScriptUpdater.scriptStorage.setItem(key, value);
},
getValue: function (key, defaultValue) {
if (ScriptUpdater.scriptStorage != null) {
return ScriptUpdater.scriptStorage.getItem(key, defaultValue);
} else {
return defaultValue;
}
},
checkLanguages: function () {
try {
var strLang = "";
$.each(TWT.languages, function (ind, language) {
if (isDefined(language.script)) {
if (TWT.isGreasyLang(language)) {
if (language.version < ScriptUpdater.scrnv[language.script]) {
strLang += '' + language.name + ''; } } } }); if (strLang.length > 0) { ScriptUpdater.scrnv.isAJ = false; var parent = new west.gui.Dialog(TWT.LANG.Options.update.title, " " + TWT.LANG.Options.update.updlangmaj + " News :' + "Debug d'affichage des mises a jour" }; } var gocheck = function () { ScriptUpdater.scrnv.isAJ = false; if (ScriptUpdater.scriptCurrentVersion < ScriptUpdater.scrnv[ScriptUpdater.scriptId]) { var strNew = ScriptUpdater.scrnv.news || ''; var parent = new west.gui.Dialog(TWT.LANG.Options.update.title, " " + TWT.LANG.Options.update.updscript + " " + strNew + " |