// ==UserScript==
// @name TW Gold Jobs Finder (More Languages)
// @namespace TomRobert
// @author Macabre2077 (updated by Tom Robert)
// @description Shows a list of all silver and gold jobs!
// @include https://*.the-west.*/game.php*
// @version 1.15
// @grant none
// @downloadURL none
// ==/UserScript==
// translation: Did97(Russian), tw81(Italian), Jakovlev(Hungarian), realfan2002(Romanian), Vebuus/Bartosz86(Polish), Ilja Iljic(Czech), pepe100(Spanish), Tom Robert(German & French), Elly Siranno(Portuguese), ruud99(Dutch), Kigka(Greek)
(function (fn) {
var script = document.createElement('script');
script.setAttribute('type', 'application/javascript');
script.textContent = '(' + fn + ')();';
document.body.appendChild(script);
document.body.removeChild(script);
})(function () {
GJ = {
version: '1.15',
name: 'Gold Jobs Finder',
author: 'Macabre2077 (updated by Tom Robert)',
minGame: '2.05',
maxGame: Game.version.toString(),
website: '//greasyfork.org/scripts/7226',
updateUrl: '//tomrobert.safe-ws.de/sUp.js',
toLoad: 0,
loaded: 0,
xMax: 181,
yMax: 79,
blockMaxLength: 300,
dataLoaded: false,
silverJobBbColor: '#708090',
goldJobBbColor: '#AB9930',
preferences: {
jobName: '',
showSilver: true,
showGold: true,
sortByName: 0,
sortByDistance: 1
},
hiddenImageOpacity: 0.35,
shownImageOpacity: 1,
bestJobTime: 0,
langs: {
en: {
language: 'English',
ApiGui: 'This script adds a button on the right side, where you can load all the silver and gold jobs.
So they can be easily found on the map.',
save: 'Save',
saveMessage: 'Successfully saved',
chooseLang: 'Choose language',
contact: 'Contact',
jobName: 'Job name',
distanceTime: 'Travel time',
showJob: 'Show',
title: 'Gold And Silver Jobs',
loading: 'Loading...',
exportButtonTitle: 'Export',
generatedByBb: 'Generated by',
goback: 'Go back',
bbCode: 'BB code',
enqueue: 'Enqueue',
openWindowTitle: 'Open window',
refreshTitle: 'Refresh',
feedbackTitle: 'Send feedback',
feedbackWindowTitle: 'Feedback',
feedbackDescription: 'If you have encountered any bugs or have ideas how to improve this script, describe them.. in English, German or French please..',
},
ru: {
language: 'Russian (русский)',
ApiGui: 'Этот скрипт добавляет кнопку справа, с помощью которой Вы можете посмотреть все серебрянные и золотые работы.
Это поможет найти их на карте.',
save: 'Экономить',
saveMessage: 'Сохранить успешно',
chooseLang: 'Сменить язык',
contact: 'Контакты',
jobName: 'Работа',
distanceTime: 'Расстояние',
showJob: 'Показать',
title: 'Золотые и серебряные работы',
loading: 'Загрузка...',
exportButtonTitle: 'Экспорт',
generatedByBb: 'Получено с помощью',
goback: 'Назад',
bbCode: 'BB-код',
enqueue: 'Начать',
openWindowTitle: 'Открыть окно',
refreshTitle: 'Обновить данные',
feedbackTitle: 'Обратная связь',
feedbackWindowTitle: 'Обратная связь',
feedbackDescription: 'Если Вы нашли баг, или у Вас есть идеи по улучшению скрипта, свяжитесь со мной',
},
it: {
language: 'Italian (italiano)',
ApiGui: 'This script adds a button on the right side, where you can load all the silver and gold jobs.
So they can be easily found on the map.',
save: 'Save',
saveMessage: 'Salva con successo',
chooseLang: 'Cambia lingua',
contact: 'Contatto',
jobName: 'Nome lavoro',
distanceTime: 'Tempo di viaggio',
showJob: 'Mostra',
title: 'Lavoro Oro e Argento',
loading: 'Caricamento in corso ... Ci vorrà un po \'',
exportButtonTitle: 'Esportazione',
generatedByBb: 'Generato da',
goback: 'Di ritorno',
bbCode: 'BB code',
enqueue: 'Inizia',
openWindowTitle: 'Aperto',
refreshTitle: 'Aggiornare dati',
feedbackTitle: 'Invia feedback',
feedbackWindowTitle: 'Feedback',
feedbackDescription: 'Se avete riscontrato qualche bug o avete idee su come migliorare questo script, vi prego di descriverle .. in inglese, tedesco o francese per favore.',
},
hu: {
language: 'Hungarian (magyar)',
ApiGui: 'This script adds a button on the right side, where you can load all the silver and gold jobs.
So they can be easily found on the map.',
save: 'Save',
saveMessage: 'Successfully saved',
chooseLang: 'Choose language',
contact: 'Érintkezés',
jobName: 'Munka neve',
distanceTime: 'Menetidő',
showJob: 'Mutatás',
title: 'Arany és ezüst munkák',
loading: 'Kis türelmet, töltés alatt...',
exportButtonTitle: 'Export',
generatedByBb: 'által létrehozva[/i]',
goback: 'Vissza',
bbCode: 'BB kód',
enqueue: 'Kezdés',
openWindowTitle: 'Megnyitás',
refreshTitle: 'Frissítés',
feedbackTitle: 'Visszajelzés küldése',
feedbackWindowTitle: 'Visszajelzés',
feedbackDescription: 'Ha találkoztál hibákkal (bug), vagy javaslatod lenne a szkript bővítéséhez írd le őket. Értek angolul, németül és franciául.',
},
ro: {
language: 'Romanian (român)',
ApiGui: 'This script adds a button on the right side, where you can load all the silver and gold jobs.
So they can be easily found on the map.',
save: 'Save',
saveMessage: 'Successfully saved',
chooseLang: 'Choose language',
contact: 'Contact',
jobName: 'Denumirea muncii',
distanceTime: 'Distanţa',
showJob: 'Arată',
title: 'Munci aurii şi argintii',
loading: 'Se încarcă... Poate dura ceva timp!',
exportButtonTitle: 'Export',
generatedByBb: 'Generat cu',
goback: 'Înapoi',
bbCode: 'BB code',
enqueue: 'Start',
openWindowTitle: 'Deschide',
refreshTitle: 'Reîmprospăta',
feedbackTitle: 'Trimite feedback',
feedbackWindowTitle: 'Feedback',
feedbackDescription: 'If you have encountered any bugs or have ideas how to improve this script, describe them.. in English, German or French please..',
},
pl: {
language: 'Polish (polski)',
ApiGui: 'This script adds a button on the right side, where you can load all the silver and gold jobs.
So they can be easily found on the map.',
save: 'Zapisz',
saveMessage: 'Zapisz powodzeniem',
chooseLang: 'Wybierz język',
contact: 'Kontakt',
jobName: 'Nazwa pracy',
distanceTime: 'Dystans',
showJob: 'Pokaż',
title: 'Złote i srebrne prace',
loading: 'Ładowanie... To zajmie moment',
exportButtonTitle: 'Eksport',
generatedByBb: 'Stworzone przez',
goback: 'Cofnij',
bbCode: 'BB code',
enqueue: 'Startuj',
openWindowTitle: 'Otwórz',
refreshTitle: 'Odświeżanie danych',
feedbackTitle: 'Wystawienie opinii',
feedbackWindowTitle: 'Opinie',
feedbackDescription: 'Jeżeli znalazłeś błąd, lub masz pomysł jak można udoskonalić skrypt - napisz do mnie. Proszę o kontakt w języku angielskim, niemieckim bądź francuskim.',
},
cs: {
language: 'Czech (čeština)',
ApiGui: 'This script adds a button on the right side, where you can load all the silver and gold jobs.
So they can be easily found on the map.',
save: 'Save',
saveMessage: 'Successfully saved',
chooseLang: 'Choose language',
contact: 'Kontakt',
jobName: 'Práce',
distanceTime: 'Vzdálenost',
showJob: 'Ukaž',
title: 'Zlaté a stříbrné práce',
loading: 'Nahrávám...',
exportButtonTitle: 'Export',
generatedByBb: 'Generated by',
goback: 'Zpět',
bbCode: 'BB code',
enqueue: 'Zadat',
openWindowTitle: 'Otevřít okno',
refreshTitle: 'Obnovit',
feedbackTitle: 'Pošli zpětnou vazbu',
feedbackWindowTitle: 'Feedback',
feedbackDescription: 'Pokud jste nalezli bug nebo máte nápad na zlepšení skriptu, napište je..v angličtině, němčině nebo francouzštině prosím..',
},
es: {
language: 'Spanish (español)',
ApiGui: 'This script adds a button on the right side, where you can load all the silver and gold jobs.
So they can be easily found on the map.',
save: 'Guardar',
saveMessage: 'Guardar correctamente',
chooseLang: 'Elige idioma',
contact: 'Contacto',
jobName: 'Nombre Trabajo',
distanceTime: 'Tiempo viaje',
showJob: 'Mostrar',
title: 'Trabajos con Bonus Oro y Plata',
loading: 'Cargando...',
exportButtonTitle: 'Exportación',
generatedByBb: 'Generado por',
goback: 'De regreso',
bbCode: 'BB code',
enqueue: 'Poner en cola',
openWindowTitle: 'Abrir ventana',
refreshTitle: 'Refrescar',
feedbackTitle: 'Enviar comentarios',
feedbackWindowTitle: 'Comentarios',
feedbackDescription: 'Si ha encontrado algún error o tiene ideas de cómo mejorar este script, descríbalos.. por favor en inglés, alemán o francés..',
},
de: {
language: 'German (Deutsch)',
ApiGui: 'Das Script fügt am rechten Rand einen Button hinzu, wo man alle Gold- und Silber-Arbeiten laden kann.
So findet man sie ganz einfach auf der Karte.',
save: 'Speichern',
saveMessage: 'Speichern erfolgreich',
chooseLang: 'Sprache ändern',
contact: 'Kontakt',
jobName: 'Arbeit',
distanceTime: 'Distanz',
showJob: 'Zeigen',
title: 'Gold und Silber Arbeiten',
loading: 'Laden...',
exportButtonTitle: 'Exportieren',
generatedByBb: 'Gefunden mit',
goback: 'Zurück',
bbCode: 'BB Code',
enqueue: 'Einstellen',
openWindowTitle: 'Fenster öffnen',
refreshTitle: 'Aktualisieren',
feedbackTitle: 'Feedback',
feedbackWindowTitle: 'Feedback',
feedbackDescription: 'Falls du auf Fehler gestossen bist oder Ideen hast, wie man das Script verbessern könnte, kannst du mich kontaktieren.',
},
fr: {
language: 'French (français)',
ApiGui: 'Avec ce script, tu peux voir une liste de tous les travaux argentés et dorés.
Comme ça il est très facile de trouve les travaux de bonus sur le Mini-map.',
save: 'Sauver',
saveMessage: 'Enregistré avec succès',
chooseLang: 'Choisissez la langue',
contact: 'Contact',
jobName: 'Travail',
distanceTime: 'Distance',
showJob: 'Montre',
title: 'Travaux argentés et dorés',
loading: 'Chargement en cours...',
exportButtonTitle: 'Exportation',
generatedByBb: 'Trouvé avec',
goback: 'De retour',
bbCode: 'BB code',
enqueue: 'Commencer',
openWindowTitle: 'Ouvrir la fenêtre',
refreshTitle: 'Rafraîchir',
feedbackTitle: 'Contact',
feedbackWindowTitle: 'Contact',
feedbackDescription: 'Si tu as trouvé un bug ou si tu as des idées pour améliorer le script, contactez-moi.',
},
pt: {
language: 'Portuguese (português)',
ApiGui: 'Este Script faz uma busca automãtica e em tempo real de todos os Trabalhos com Bônus Ouro ou Prata em todo o Mundo.',
save: 'Salvar',
saveMessage: 'Economize com sucesso',
chooseLang: 'Escolhe idioma',
contact: 'Contato com Autor',
jobName: 'Nome do Job',
distanceTime: 'Distância',
showJob: 'Show',
title: 'Gold And Silver Jobs',
loading: 'Procurando Jobs Ouro/Prata',
exportButtonTitle: 'Exportar',
generatedByBb: 'Generated by',
goback: 'Go back',
bbCode: 'BB code',
enqueue: 'Iniciar Job',
openWindowTitle: 'Procurar Jobs',
refreshTitle: 'Atualizar Lista',
feedbackTitle: 'Suporte',
feedbackWindowTitle: 'Feedback',
feedbackDescription: 'Aqui vc encontra os meios de comunicação com o supporte do Script, pode reportar um erro, fazer uma crítica ou dar sugestões',
},
nl: {
language: 'Dutch (Nederlands)',
ApiGui: 'Dit script voegt een knop aan de rechterkant toe in het scherm. Deze button laadt alle zilveren en gouden werkzaamheden.
Zodat ze gemakkelijk gevonden kunnen worden op de kaart.',
save: 'Besparen',
saveMessage: 'Sparen succes',
chooseLang: 'Kies een taal',
contact: 'Contact',
jobName: 'Werkzaamheid',
distanceTime: 'Afstand',
showJob: 'Toon',
title: 'Gouden en zilveren arbeiden',
loading: 'Laden...',
exportButtonTitle: 'Exporteren',
generatedByBb: 'Gemaakt door',
goback: 'Terug',
bbCode: 'BB code',
enqueue: 'Starten',
openWindowTitle: 'Scherm openen',
refreshTitle: 'Herladen',
feedbackTitle: 'Feedback',
feedbackWindowTitle: 'Feedback',
feedbackDescription: 'Als je bugs tegenkomt of ideeën hebt om dit script te verbeteren, omschrijf ze in Engels, Duits of Frans aub.',
},
el: {
language: 'Greek (ελληνικά)',
ApiGui: 'This script adds a button on the right side, where you can load all the silver and gold jobs.
So they can be easily found on the map.',
save: 'Save',
saveMessage: 'Successfully saved',
chooseLang: 'Choose language',
contact: 'Contact',
jobName: 'Όνομα Δουλειάς',
distanceTime: 'Απόσταση',
showJob: 'Εμφάνιση',
title: 'Χρυσές και Ασημένιες δουλειές',
loading: 'Φόρτωση...',
exportButtonTitle: 'Share',
generatedByBb: 'Generated by',
goback: 'Go back',
bbCode: 'BB κώδικας',
enqueue: 'Περπατήστε',
openWindowTitle: 'Άνοιγμα παραθύρου',
refreshTitle: 'Refresh',
feedbackTitle: 'Στείλτε feedback',
feedbackWindowTitle: 'Feedback',
feedbackDescription: 'Αν έχετε αντιμετωπίσει τυχόν σφάλματα ή έχετε ιδέες για τη βελτίωση αυτού του script, ενημερώστε με..'
},
},
updateLang: function () {
var lg = GJ.langs;
GJ.lang = lg[localStorage.getItem('scriptsLang')] ? localStorage.getItem('scriptsLang') : lg[Game.locale.substr(0, 2)] ? Game.locale.substr(0, 2) : 'en';
GJlang = lg[GJ.lang];
},
};
GJ.updateLang();
GJ.parseWholeMap = function (tiles, onLoad) {
this.loaded = 0;
var x,
y;
var arr = [];
var currentBlock = 0;
var currentBlockLength = 0;
for (x in tiles) {
for (y in tiles[x]) {
if (isNaN(x) || isNaN(y)) {
continue;
}
if (currentBlockLength === 0) {
arr[currentBlock] = [
];
}
arr[currentBlock].push([parseInt(x),
parseInt(y)]);
if (++currentBlockLength == this.blockMaxLength) {
currentBlock++;
currentBlockLength = 0;
}
}
}
var i,
to = arr.length;
this.toLoad = to;
for (i = 0; i < to; i++) {
GameMap.Data.Loader.load(arr[i], function () {
GJ.loaded++;
if (GJ.loaded == GJ.toLoad) {
onLoad();
}
});
}
};
GJ.getJobIcon = function (jobId, x, y, shortname, gold) {
var t = gold ? 'gold' : 'silver';
return '