Greasy Fork is available in English.

TheWest-Notifier

Plays a notification sound, when specified events are triggered in the browser game The West!

// ==UserScript==
// @name TheWest-Notifier
// @namespace TWNotifier_M77
// @author Meuchelfix77 (updated by Tom Robert)
// @description Plays a notification sound, when specified events are triggered in the browser game The West!
// @include https://*.the-west.*/game.php*
// @exclude https://classic.the-west.net*
// @version 1.023
// @icon http://twm.pf-control.de/TWNotifier/favicon.ico
// @grant none
// ==/UserScript==
(function (fn) {
  var script = document.createElement('script');
  script.setAttribute('type', 'text/javascript');
  script.textContent = '(' + fn.toString() + ')();';
  (document.head || document.body || document.documentElement).appendChild(script);
  script.parentNode.removeChild(script);
})(function () {
  TWN = {
    version: '1.023',
    name: 'TheWest-Notifier',
    author: 'Meuchelfix77 (updated by Tom Robert)',
    website: 'https://greasyfork.org/scripts/16917',
    LANGUAGE: (localStorage.getItem('scriptsLang') || Game.locale.substr(0, 2)),
    init: function () {
      switch (TWN.LANGUAGE) {
      default:
        TWN.lang = {
          translator: 'Meuchelfix77',
          notifications: 'Notifications',
          confirmationTitle: 'Confirmation',
          confirmation: 'Are you sure to remove this notification?',
          types: {
            messages: 'Messages',
            reports: 'Reports',
            townforum: 'Townforum',
            friends: 'Friends',
            wayFinished: 'Way finished',
            noQueue: 'Empty job queue',
            newItem: 'New item',
            nickInChat: 'Nickname in chat',
          },
          sounds: {
            bum: 'Bum',
            chime: 'Chime',
            coin: 'Coin',
            coin2: 'Coin 2',
            icq: 'ICQ',
            qip: 'QIP',
            tinkle: 'Tinkle',
            trumpet: 'Trumpet',
            vk: 'VK',
            custom: 'Custom',
          },
          event: 'Event',
          info: 'Information',
          remove: 'Remove this notification',
          listen: 'Listen to this sound',
          sound: 'Sound',
          soundFile: 'Sound file',
          soundInfo: 'Warning! Not all files can be played in your browser.',
          desc: {
            messages: 'Telegram received:',
            reports: 'Report received of type:',
            townforum: 'New forum post in:',
            friends: 'Friend(s) online:',
            wayFinished: 'Way finished:',
            noQueue: 'Empty job queue:',
            newItem: 'New item in inventory:',
            nickInChat: 'Nickname typed in chat:',
          },
          reportTypes: {
            all: 'All',
            work: 'Work',
            duels: 'Duels',
            achvmnt: 'Achievements',
            fort: 'Fort battles',
            other: 'Other',
          },
          add: 'Add notification',
          wayFinishedInfo: 'Triggers when you have finished your way and reached your destination.',
          reportInfo: '<b>Warning!</b> This will cause problems with the blinking messages button on the bottom screen.<br>Selecting <i>All</i> will solve these problems.',
          noQueueInfo: 'Triggers when there are no more job assignments in you job queue.',
          messagesInfo: 'Triggers when you receive a telegram.',
          friendListInfo: 'Seperate multiple friends with a semicolon (;)',
          townforumInfo: 'Triggers when somebody writes a post in the forum<span id="selectedForum"></span>.',
          newItemInfo: 'Triggers when you find, buy or get a new item.',
          nickInChatInfo: 'Triggers when your name was typed in the chat. Seperate more nicks with a semicolon (;)',
          install: 'Install',
          cancel: 'Cancel',
          update: 'Update',
          updateAvailable: 'A new version of the script is available',
        };
        break;
      case ('de'):
        TWN.lang = {
          translator: 'Meuchelfix77',
          notifications: 'Benachrichtigungen',
          confirmationTitle: 'Bestätigung',
          confirmation: 'Willst du diese Benachrichtigung wirklich löschen?',
          types: {
            messages: 'Telegramme',
            reports: 'Berichte',
            townforum: 'Stadtforum',
            friends: 'Freunde',
            wayFinished: 'Weg beendet',
            noQueue: 'Keine Arbeitsaufträge',
            newItem: 'Neues Item',
            nickInChat: 'Spielername im Chat',
          },
          sounds: {
            bum: 'Bum',
            chime: 'Glockenspiel',
            coin: 'Münze',
            coin2: 'Münze 2',
            icq: 'ICQ',
            qip: 'QIP',
            tinkle: 'Glitzer',
            trumpet: 'Trompete',
            vk: 'VK',
            custom: 'Eigene',
          },
          event: 'Ereignis',
          remove: 'Diese Benachrichtigung löschen',
          listen: 'Anhören',
          sound: 'Ton',
          soundFile: 'Audio-Datei',
          soundInfo: 'Achtung! Nicht alle Dateien werden von deinem Browser unterstützt.',
          desc: {
            messages: 'Telegramm erhalten:',
            reports: 'Bericht erhalten vom Typ:',
            townforum: 'Neuer Foren-Beitrag in:',
            friends: 'Freund(e) online:',
            wayFinished: 'Weg beendet:',
            noQueue: 'Keine weiteren Aufträge:',
            newItem: 'Neues Item im Inventar:',
            nickInChat: 'Name im Chat erwähnt:',
          },
          reportTypes: {
            all: 'Alle',
            work: 'Arbeiten',
            duels: 'Duelle',
            achvmnt: 'Erfolge',
            fort: 'Fortkämpfe',
            other: 'Sonstige',
          },
          add: 'Benachrichtigung hinzufügen',
          wayFinishedInfo: 'Wird ausgelöst, wenn du dein Ziel erreicht hast.',
          reportInfo: '<b>Achtung!</b> Diese Einstellung verursacht ein Problem mit der blinkenden Nachrichten-Schaltfläche am unteren Bildrand.<br>Die Option <i>Alle</i> behebt dieses Problem.',
          noQueueInfo: 'Wird ausgelöst, wenn du keine Arbeiten mehr in der Warteschlange hast.',
          messagesInfo: 'Wird ausgelöst, wenn du ein Telegramm erhälst.',
          friendListInfo: 'Trenne mehrere Freunde mit einem Semikolon (;)',
          townforumInfo: 'Wird ausgelöst, wenn jemand einen Beitrag im Stadtforum<span id="selectedForum"></span> verfasst.',
          newItemInfo: 'Wird ausgelöst wenn du ein neues Item findest oder kaufst.',
          nickInChatInfo: 'Wird ausgelöst wenn dein Name im Chat steht. Trenne weitere Nicks mit einem Semikolon (;)',
          install: 'Installieren',
          cancel: 'Abbrechen',
        };
        break;
      case ('pl'):
        TWN.lang = {
          translator: 'Darius II',
          notifications: 'Powiadomienia',
          confirmationTitle: 'Potwierdzenie',
          confirmation: 'Chcesz usunąć to powiadomienie?',
          types: {
            messages: 'Wiadomości',
            reports: 'Raporty',
            townforum: 'Forum',
            friends: 'Znajomi',
            wayFinished: 'Dotarcie do celu',
            noQueue: 'Brak zadań',
            newItem: 'New item',
            nickInChat: 'Nickname in chat',
          },
          sounds: {
            bum: 'Bum',
            chime: 'Kurant',
            coin: 'Kucie',
            coin2: 'Kucie 2',
            icq: 'ICQ',
            qip: 'QIP',
            tinkle: 'Dzwonek',
            trumpet: 'Trąbka',
            vk: 'VK',
            custom: 'Własny',
          },
          event: 'Zdarzenie',
          remove: 'Usuń zdarzenie',
          listen: 'Odsłuchaj',
          sound: 'Dźwięk',
          soundFile: 'Plik dźwięku',
          soundInfo: 'Uwaga! Nie wszystkie typy plików dźwiękowych mogą być odtwarzane w przeglądarce.',
          desc: {
            messages: 'Otrzymano wiadomość:',
            reports: 'Typ raportu:',
            townforum: 'Nowy wpis w:',
            friends: 'Pojawił się znajomy/a :',
            wayFinished: 'Ośiągnięto cel:',
            noQueue: 'Brak zadań:',
            newItem: 'New item in inventory:',
            nickInChat: 'Nickname typed in chat:',
          },
          reportTypes: {
            all: 'Wszystkie',
            work: 'Praca',
            duels: 'Pojedynki',
            achvmnt: 'Osiągnięcia',
            fort: 'Fortowe',
            other: 'Pozostałe',
          },
          add: 'Dodaj powiadomienie',
          wayFinishedInfo: 'Odtworzy dźwięk kiedy dotrzesz na wyznaczoną pozycję.',
          reportInfo: '<b>Uwaga!</b> Ten wybór powoduje problemy z migotaniem przycisku "wiadomości/raporty", wybrór <i>Wszystkie</i> rozwiąże ten problem.',
          noQueueInfo: 'Odtworzy dźwięk, kiedy zostaną wykonane wszystkie zadania.',
          messagesInfo: 'Odtworzy dźwięk, kiedy otrzymasz telegram.',
          friendListInfo: 'Oddziel znajomych średnikiem (;)',
          townforumInfo: 'Odtworzy dźwięk, kiedy ktoś napisze wiadomośc na forum w zakładce: <span id="selectedForum"></span>.',
          newItemInfo: 'Triggers when you find, buy or get a new item.',
          nickInChatInfo: 'Triggers when your name was typed in the chat. Seperate more nicks with a semicolon (;)',
          install: 'Zainstaluj',
          cancel: 'Anuluj',
        };
        break;
      case ('pt'):
        TWN.lang = {
          translator: 'jccwest',
          notifications: 'Notificações',
          confirmationTitle: 'confirmação',
          confirmation: 'Tem certeza que deseja remover esta notificação?',
          types: {
            messages: 'Mensagens',
            reports: 'Relatórios',
            townforum: 'Fórum da cidade',
            friends: 'Amigos',
            wayFinished: 'Chegou ao destino',
            noQueue: 'Sem trabalhos',
            newItem: 'Novo item no inventário',
            nickInChat: 'Nickname in chat',
          },
          sounds: {
            bum: 'Bum',
            chime: 'Chime',
            coin: 'Coin',
            coin2: 'Coin 2',
            icq: 'ICQ',
            qip: 'QIP',
            tinkle: 'Tinkle',
            trumpet: 'Trompete',
            vk: 'VK',
            custom: 'Custom',
          },
          event: 'Evento',
          info: 'Informação',
          remove: 'Remover esta notificação',
          listen: 'reproduzir o som',
          sound: 'Som',
          soundFile: 'arquivo de som',
          soundInfo: 'Aviso! Nem todos os arquivos podem ser reproduzidos no seu navegador.',
          desc: {
            messages: 'Telegrama recebido:',
            reports: 'Relatório recebeu do tipo:',
            townforum: 'Novo post no fórum:',
            friends: 'Amigo(s) on-line:',
            wayFinished: 'Chegou ao destino:',
            noQueue: 'Sem trabalhos:',
            newItem: 'Novo item no inventário:',
            nickInChat: 'Nickname typed in chat:',
          },
          reportTypes: {
            all: 'Todos',
            work: 'Trabalho',
            duels: 'Duelos',
            achvmnt: 'Conquistas',
            fort: 'Batalhas no forte',
            other: 'Outro',
          },
          add: 'Adicionar notificação',
          wayFinishedInfo: 'Avisa quando tiver terminado o meu caminho e a chegada ao destino.',
          reportInfo: '<b>Aviso!</b> Isto irá causar problemas com o botão piscando mensagens na tela inferior seleção <i>Todos</i> vai resolver estes problemas.',
          noQueueInfo: 'Avisa quando não há mais trabalhos atribuídos.',
          messagesInfo: 'Avisa quando recebe um telegrama.',
          friendListInfo: 'Separe vários amigos com um ponto e vírgula (;)',
          townforumInfo: 'Avisa quando alguém escreve um post no fórum <span id="selectedForum"></span>.',
          newItemInfo: 'Avisa quando encontra,ou compra um novo item.',
          nickInChatInfo: 'Triggers when your name was typed in the chat. Seperate more nicks with a semicolon (;)',
          install: 'Instalar',
          cancel: 'Cancelar',
        };
        break;
      case ('el'):
        TWN.lang = {
          translator: 'Timemod Herkumo',
          notifications: 'Ειδοποιήσεις',
          confirmationTitle: 'Επιβεβαίωση',
          confirmation: 'Είστε βέβαιοι ότι θέλετε να καταργήσετε αυτήν την ειδοποίηση;',
          types: {
            messages: 'Μυνήματα',
            reports: 'Αναφορές',
            townforum: 'Φόρουμ πόλης',
            friends: 'Φιλοι',
            wayFinished: 'Τέλος προορισμού',
            noQueue: 'Κενή ουρά εργασίας',
            newItem: 'Νέο αντικείμενο',
            nickInChat: 'Ψευδώνυμο στην συνομιλία',
          },
          sounds: {
            bum: 'Bum',
            chime: 'Κουδούνι',
            coin: 'Νόμισμα',
            coin2: 'Νόμισμα 2',
            icq: 'ICQ',
            qip: 'QIP',
            tinkle: 'Λάμψη',
            trumpet: 'Τρομπέτα',
            vk: 'VK',
            custom: 'Προσαρμοσμένο',
          },
          event: 'Εκδήλωση',
          info: 'Πληροφορίες',
          remove: 'Κατάργηση αυτής της ειδοποίησης',
          listen: 'Ακούστε αυτόν τον ήχο',
          sound: 'Ήχοι',
          soundFile: 'Αρχείο ήχου',
          soundInfo: '<b>Προειδοποίηση!</b><br>Δεν είναι δυνατή η αναπαραγωγή όλων των αρχείων στο πρόγραμμα περιήγησής σας.',
          desc: {
            messages: 'Λάβατε νέο τηλεγάφημα:',
            reports: 'Λάβατε νέα αναφορά:',
            townforum: 'Νέο θέμα στο Φόρουμ:',
            friends: 'Συνδεδεμένος φίλος:',
            wayFinished: 'Προορισμός:',
            noQueue: 'Κενή ουρά εργασίας:',
            newItem: 'Νέο αντικείμενο:',
            nickInChat: 'Ψευδόνυμο στο τσατ:',
          },
          reportTypes: {
            all: 'Όλα',
            work: 'Εργασίες',
            duels: 'Μονομαχίες',
            achvmnt: 'Επιτεύγματα',
            fort: 'Μάχες Οχυρού',
            other: 'Άλλο',
          },
          add: 'Προσθήκη ειδοποίησης',
          wayFinishedInfo: 'Ενεργοποιείται όταν φτάσετε στον προορισμό σας.',
          reportInfo: '<b>Προειδοποίηση!</b><br>Αυτό θα προκαλέσει προβλήματα με την αναλαμπή του κουμπιού μηνυμάτων στην κάτω μπάρα μενού.<br>Η επιλογή <i>"Όλα"</i> θα λύσει αυτά τα προβλήματα.',
          noQueueInfo: 'Ενεργοποιείται όταν δεν υπάρχουν εργασίες στην ουρά εργασίας.',
          messagesInfo: 'Ενεργοποιείται όταν λαμβάνετε ένα τηλεγράφημα.',
          friendListInfo: 'Ξεχωρίστε πολλούς φίλους με ένα ερωτηματικό (;)',
          townforumInfo: 'Ενεργοποιείται όταν κάποιος γράφει μια ανάρτηση στο φόρουμ .',
          newItemInfo: 'Ενεργοποιείται όταν βρίσκετε, αγοράζετε ή λαμβάνετε ένα νέο αντικείμενο.',
          nickInChatInfo: 'Ενεργοποιείται όταν αναφέρεται το όνομά σας στη συζήτηση. Seperate more nicks with a semicolon (;)',
          install: 'Εγκατάσταση',
          cancel: 'Ματαίωση',
        };
        break;
      } // Init all modules of TWNotifier

      TWN.initStyleSheet();
      TWN.settings.init();
      TWN.notifications.init();
    },
    roomsListening: [
    ],
    // init the global stylesheet
    initStyleSheet: function () {
      var css = $('<style id="TWNotifierStyles"></style>');
      $(document.head || document.body || document.documentElement).append(css);
    },
    // add global CSS information
    addStyle: function (css) {
      var styles = $('#TWNotifierStyles');
      styles.html(styles.html() + '\n' + css);
    },
    // returns a value from our storage
    get: function (key, val) {
      return (localStorage.getItem('TWNotifier_' + key) || val);
    },
    // sets a value pair in our storage
    set: function (key, val) {
      localStorage.setItem('TWNotifier_' + key, val);
    },
    // removes a key-value pair from our storage
    remove: function (key) {
      localStorage.removeItem('TWNotifier_' + key);
    },
    showMessage: function (text, icon) {
      new UserMessage(text, icon).show();
    },
    // append the specified function
    appendFunction: function (oldFn, newFn, _thisOld, _thisNew) {
      var fn = parent,
      i = 1; // start for finding the function to replace
      // every loop we get one step deeper/closer to our function to replace/append to
      while (fn[oldFn[i - 1]][oldFn[i]]) {
        fn = fn[oldFn[i - 1]];
        i++;
      }
      var tmpFn = fn[oldFn[i - 1]]; // avoid recursion
      fn[oldFn[i - 1]] = function () {
        newFn.apply(_thisNew, arguments); // and afterwards our new
        return tmpFn.apply(this, arguments); // call the old function;
      };
    }
  };
  TWN.images =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65f7urV9V2aug7GGJWmiXjfKOc8WkGWpohAVdfKGCONc3gfJLJWoUBCQLwQghBFkShQEEQQVTeeynlEaYmjyGURlfqp9VwD+viR+WS+U8jFKzuIiERGq2lVSZbGqqxdSK3RTlRIrNZeEAleTRsf4shq571oUEprSeNYNa4RrVCxNWigDiIueFU3QbI4opPZ5r8GAGcfcWQL+fgwAAAAAElFTkSuQmCC',
    right_menu_hover: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAoCAYAAACfKfiZAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAA0BSURBVHjaxJhJjKZXdYafO3z3m/6x6q/qrsE9t+12O5j20NAMZnCwzWRCEoKlRIEo8zYbQImyirLIKmGRDYqURJFYEISZBHJMbAMGmwTjAdttN+0ud3d1dXVNf/3jN9whi7YdypGSZc7+6jz31Xte3XMF10vw/1NBvN5cve+2g9H27lAarSht8HgngvciTuJgtBLD8TRIIYQQAut8UEphjBTW+pDGRlR1RWVdkAShlEYoHYQAE2lR+xAiiQyIMJkWwURKxJEOc63YaUAD6eJsY3lnZxS8A+EskRYibeZeEKSzNY1U42zAmJgo0sI7F5SWwTsvautCM8sQUom6rrDWhdgYYZ3F1RZbW4KSxMZgpMJXDo+wVUWhgRjodRrJRyKthMS7JE1kpHUQUoKzBKSIlMQJD1i0lEgJcaKoKwJehEhGsijLUBYF1ntGu0NpjAlKaYJ1VJXF2+AJHqO1iFVU+sptaSABFrvN9IFWbhA4ASJopWRdWy+lFmligvcOKUVIk1hoLYUQMlRlQVGXGK0DboIINZ12KrXWQSqNtXUopoXwIcaYSGitg3cWAK1Uga1331BgrpmZk40sElpGCAFKSUKQoaqsqGpLbGSITYSSQtTWBrwQ0kc083ZAOOqqpqornK1FcD4EUYm6tkEqJYzQQQsppuNxEEIIJRUyCEeQxRseyE2k2qNhSZo2CUpR9LeIZUDGMc1Wg9lmzGgyp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CAJ89DFgswxcSSDbDagIMFpDVKn2on6/U7UJRxCGK8FEbJiNFfUCa2BNwM5OM19dg8sLQBTYaQD9DLB5AQFACmijBcoLjHb7mf/g/XdWXnhx/9dKXylFgmFKMy9CZVmkbPtjQuv5e5cvL6xtgIKAXYnQ7gy7qSuhquAgiEJA7EqMMUC/e/PSpSDz56Ds0rTdW1tfvVOf2bd7dqY+Bmybe3f/deWtP314Kc0QeQ/jSoTCAc6BWARwDpLl4DRDtZ8i7qfwqw+KzcV7trbTGj+wtJLMXHivXeTlgQNnv/Hj07b61Myt5ditb2IjzeB6KTTNgBCAIFA7LB/qPUoRFN7DATCdnmtCy16adSXrtzZiq91uZ7P9/uV3Zu7eX5d2u9PMcvSI0fceQRWgL/hMiAhSJ4gAIMs0C6EsRSgklYplY2wUxWTjBESQwmmvcOiBkEMhn0KYP/dDARAApACsD+qCD0GsyrB/qCtySXvd4LzPfdAugAyKEo8p+18oAHgApar6Xpb1Sh+o3087ZVmmeRlyUePzvOgXRdEd2obPA/gLoArAdLvdh0t3lz+Ymt59MHO+zPK8cefO0rWF27e3C1fkS0t3/41HYXxsfNFhDGAKwIi1tnbixJMvp1ne3N7avi1BZGZu9mSn3Vne3Ni4MgxVD5/2lf8DJQAJgNpwBRH5KIomVQTERCFIEUJIh7b9Ifgx6H8HAHDhGKPwnDmkAAAAAElFTkSuQmCC',
  };
  TWN.sounds = [
    'bum', 'chime', 'coin', 'coin2', 'icq', 'qip', 'tinkle', 'trumpet', 'vk',
  ];
  TWN.notifications = {
    list: {
      length: 0
    },
    init: function () {
      // Load notifications
      this.list.length = TWN.get('notificationCount', 0);
      for (var i = 0; i < this.list.length; i++) {
        var data = TWN.get('notification_' + i, '');
        if (data == '') {
          this.remove(i);
          i = 0;
          continue;
        }
        data = JSON.parse(data);
        this.list[i] = data;
      }
      // append TW-functions with TWNotifier-functionality
      // friend online
      TWN.appendFunction([
          'west', 'notification', 'ToastOnlineNotification', 'prototype', 'init'
        ], function (name) {
        var sound = '';
        for (var i = 0; i < this.list.length; i++) {
          if (this.list[i].event == 'friends') {
            if (this.list[i].info == '*')
              sound = this.list[i].sound;
            else if (this.list[i].info.split(';').includes(name)) {
              sound = this.list[i].sound;
              break;
            }
          }
        }
        TWN.notifications.playSound(sound);
      }, west.notification.ToastOnlineNotification.prototype._super.prototype, this);
      // new report
      TWN.appendFunction(['Character', 'setToRead'], function (type, status) {
        if (status == false)
          return;
        // TOWNFORUM
        if (type == 'townforum') {
          var notifications = {
            length: 0
          };
          var custom = 0; // 0 = no notification,   1 = only all;   2 = custom notification
          for (var notification in TWN.notifications.list) {
            if (TWN.notifications.list[notification].event == 'townforum') {
              notifications[notifications.length] = TWN.notifications.list[notification].info;
              notifications.length++;
              if (TWN.notifications.list[notification].info == '*' && custom == 0)
                custom = 1;
              else
                custom = 2;
            }
          } // No notifications for forum

          if (custom == 0 || notifications.length == 0)
            return;
          // no custom notifications
          if (custom == 1) {
            TWN.notifications.playSound(TWN.notifications.list[TWN.notifications.getIndex('townforum', '*')].sound);
            return;
          } // custom notifications

          $.ajax('forum.php', {
            complete: function (data) {
              var DOM = $.parseHTML(data.responseText);
              var forumList = $('#forum_list', DOM);
              forumList.children().each(function (i, el) {
                if ($(el).hasClass('background')) {
                  var index = TWN.notifications.getIndex('townforum', $(el).find('span').text());
                  if (index != -1) {
                    TWN.notifications.playSound(TWN.notifications.list[index].sound);
                    return false;
                  }
                }
              });
            }
          });
          return;
        }
        // MESSAGES
        if (type == 'messages') {
          var index = TWN.notifications.getIndex('messages');
          if (index != -1)
            TWN.notifications.playSound(TWN.notifications.list[index].sound);
          return;
        }
        // REPORTS
        if (type == 'reports') {
          // If no report types are specified, just play the sound for 'all reports', if specified (no requests)
          var allSound = 'data:audio/ogg;base64,;';
          for (var noti in TWN.notifications.list) {
            if (TWN.notifications.list[noti].event == 'reports') {
              if (TWN.notifications.list[noti].info != 'all') {
                allSound = '';
                break;
              } else
                allSound = TWN.notifications.list[noti].sound;
            }
          }
          if (allSound != '') {
            TWN.notifications.playSound(allSound);
            return;
          }
          // Send requests to check if there are new reports for the specified report types
          Ajax.remoteCall('reports', 'get_reports', {
            page: 0,
            folder: 'all'
          }, function (json) {
            if (json.error != false || !json.reports[0])
              return;
            var report_id = json.reports[0].report_id; // latest report
            // create counter
            var sounds = {},
            counter = (TWN.notifications.getIndex('reports', 'all') == -1 ? -6 : 0);
            for (type in TWN.lang.reportTypes) {
              var index = TWN.notifications.getIndex('reports', type);
              if (index != -1) {
                sounds[type] = TWN.notifications.list[index].sound;
                counter++;
              } else
                sounds[type] = '';
            }
            var gen = function (type, report) {
              return function (json) {
                if (json.error != false || !json.reports[0] || sounds[type] == '')
                  return;
                if (json.reports[0].report_id == report) {
                  counter = 0;
                  TWN.notifications.playSound(sounds[type]);
                } else {
                  counter--;
                  if (counter == 0)
                    TWN.notifications.playSound(sounds.all);
                }
              };
            };
            for (type in sounds)
              Ajax.remoteCall('reports', 'get_reports', {
                page: 0,
                folder: type
              }, gen(type, report_id));
          });
          return;
        }
      }, Character, this);
      // way finished
      TWN.appendFunction(['OnGoingWayFinishedEntry'], function () {
        for (var i = 0; i < this.list.length; i++) {
          if (this.list[i].event == 'wayFinished') {
            this.playSound(this.list[i].sound);
            break;
          }
        }
      }, OnGoingEntry, TWN.notifications);
      OnGoingWayFinishedEntry.prototype = new OnGoingEntry;
      // empty job queue
      EventHandler.listen('taskqueue-updated', function () {
        if (TaskQueueUi.isEmpty) {
          var index = TWN.notifications.getIndex('noQueue');
          if (index != -1)
            TWN.notifications.playSound(TWN.notifications.list[index].sound);
        }
      });
      // new item in inventory
      TWN.appendFunction(['WestUi',
          'showInventoryChanged'], function (type, item_id, count) {
        if (type == 'add') {
          var index = TWN.notifications.getIndex('newItem');
          if (index != -1)
            TWN.notifications.playSound(TWN.notifications.list[index].sound);
        }
      }, WestUi);
      // nickname in chat
      TWN.addListeners = function () {
        var roomChanged = function (room, type, data) {
          var index = TWN.notifications.getIndex('nickInChat');
          if (index != -1 && type == 'NewMessage') {
            var div = $(data[0]);
            var cText = div.find('.chat_text').html().toLowerCase();
            var nli = TWN.notifications.list[index];
            var nList = [Character.name];
            if (nli.info != '*')
              nList.push(...nli.info.split(';'));
            for (var n of nList)
              if (cText.includes(n.toLowerCase())) {
                TWN.notifications.playSound(nli.sound);
                break;
              }
          }
        };
        var rooms = Chat.Resource.Manager.getRooms();
        for (var r in rooms) {
          var room = Chat.Resource.Manager.getRoom(r);
          if (TWN.roomsListening.indexOf(room.id) == -1) {
            TWN.roomsListening.push(room.id);
            room.addListener(roomChanged);
          }
        }
      };
      if (EventHandler.hasOwnProperty('add')) {
        EventHandler.add('chat_room_added', function (room) {
          TWN.addListeners();
        });
      } else {
        EventHandler.listen('chat_room_added', function (room) {
          TWN.addListeners();
        });
      }
    },
    // Add notification
    add: function (event, info, sound) {
      TWN.set('notification_' + this.list.length, JSON.stringify({
          event: event,
          info: info,
          sound: sound
        }));
      this.list[this.list.length++] = {
        event: event,
        info: info,
        sound: sound
      };
      TWN.set('notificationCount', this.list.length);
    },
    // Remove specified notification
    remove: function (id) {
      for (var i = id; i < this.list.length; i++) {
        TWN.set('notification_' + i, TWN.get('notification_' + (i + 1), ''));
        this.list[i] = this.list[i + 1];
      }
      TWN.remove('notification_' + (--this.list.length));
      this.list[this.list.length] = {};
      TWN.set('notificationCount', this.list.length);
    },
    getIndex: function (event, info) {
      for (var i = 0; i < this.list.length; i++)
        if (this.list[i].event == event && (this.list[i].info == info || info == undefined))
          return i;
      return -1;
    },
    // Play the specified sound
    playSound: function (src) {
      if (src && $('#ui-loader').css('display') == 'none') {
        var audio = TWN.sounds.includes(src) ? 'https://tomrobert.safe-ws.de/' + src + '.mp3' : src;
        new Audio(audio).play();
      }
    }
  };
  TWN.settings = {
    gui: {
      window: {},
      comboboxes: {}
    },
    table: null,
    townforumTopics: {
      length: 0
    },
    init: function () {
      var rightBar = $('.ui_menucontainer');
      var optionEl = $('<div id="TWNotifierSettingsBtn" onclick="TWN.settings.open ();" title="' + TWN.name + '"></div>');
      if (rightBar && rightBar[1]) {
        rightBar = $(rightBar[1]);
        rightBar.css('max-height', (rightBar.children('div').length * 30 - 2) + 'px');
        rightBar.append(optionEl);
      }
      TWN.addStyle('#TWNotifierSettingsBtn { width:32px; height:41px; margin:-8px -16px 0 -7px; cursor:pointer; background:url(' + TWN.images.right_menu + '); }' +
        '#TWNotifierSettingsBtn:hover { background:url(' + TWN.images.right_menu_hover + '); }' +
        '.TWNotifier-event-col { min-width:175px; font-weight:bold; }' +
        '.TWNotifier-sound-col, .TWNotifier-remove-col { float:right; }' +
        '.TWNotifier-sound-col { margin-right:-2px; }' +
        '.TWNotifier-sound-col img, .TWNotifier-remove-col img { margin-top:-3px; cursor:pointer; }' +
        '.tbody .TWNotifier-event-col, .tbody .TWNotifier-info-col { margin-left:4px; }' +
        '.TWNotifierButton { background:rgba(29,28,28,0.5); border:1px solid #646464; border-radius:2px; box-shadow:0 0 1px 1px #000; display:inline-block; margin-left:8px; padding:1px 2px; }' +
        '.TWNotifierSettings #TWNotifierSettings { padding:4px 0 0 4px; border-top:1px solid rgba(0,0,0,0.77); margin:2px -2px; }' +
        '.TWNotifierSettings #reportWarning { margin:5px 5px 0 0; padding:5px 5px; display:none; border:1px solid #C33; }' +
        '.TWNotifierSettings .tfoot { padding:0 !important; height:6px; }' +
        '.TWNotifierSettings #settingInfo { margin:5px 5px 0 0; padding:5px 5px; text-align:center; border:1px solid #000; background:rgba(0,0,0,0.32); }' +
        '.TWNotifierSettings #settingInfo img { margin:0 16px; vertical-align:middle; }' +
        '.TWNotifierSettings #selectedForum { font-style:italic; }');
    },
    open: function () {
      this.gui.window = wman.open('TWNotifierSettings', TWN.name, 'noreload').setMiniTitle(TWN.name);
      TWN.settings.gui.window.showLoader();
      // Create table
      this.table = new west.gui.Table(false);
      this.table.addColumn('TWNotifier-event-col').addColumn('TWNotifier-info-col').addColumn('TWNotifier-remove-col').addColumn('TWNotifier-sound-col');
      this.table.appendToCell('head', 'TWNotifier-event-col', TWN.lang.event).appendToCell('head', 'TWNotifier-info-col', TWN.lang.info).appendToCell('head', 'TWNotifier-remove-col', '&nbsp;').appendToCell('head', 'TWNotifier-sound-col', '&nbsp;');
      this.table.setScrollbar();
      // Fill table
      TWN.settings.refreshTable();
      TWN.settings.gui.window.appendToContentPane(this.table.getMainDiv());
      // Create settings
      var settings = $('<div id="TWNotifierSettings"></div>');
      var dropdown = new west.gui.Combobox('TWNotifierNotificationType').setWidth(130).addListener(function () {
          TWN.settings.changeSettings(dropdown.getValue());
        });
      for (var type in TWN.lang.types)
        dropdown.addItem(type, TWN.lang.types[type]);
      // TODO: Correct width (depending on other elements)
      var soundName = new west.gui.Textfield('TWNotifierSoundName').setWidth(165).setPlaceholder('https://             .mp3');
      var soundBox = new west.gui.Combobox('TWNotifierSoundBox').setWidth(130);
      for (var sound of TWN.sounds)
        soundBox.addItem(sound, TWN.lang.sounds[sound]);
      soundBox.addItem('custom', TWN.lang.sounds.custom).addListener(function () {
        if (soundBox.getValue() == 'custom')
          soundName.getMainDiv().css('display', 'inline-block');
        else
          soundName.getMainDiv().css('display', 'none');
      });
      var testSound = $('<div class="TWNotifierButton" title="' + TWN.lang.listen + '"><img src="' + TWN.images.listen + '" style="cursor:pointer;"></div>').click(function () {
          if (soundBox.getValue() != 'custom')
            TWN.notifications.playSound(soundBox.getValue());
          else
            TWN.notifications.playSound(soundName.getValue());
        });
      var addButton = $('<div class="TWNotifierButton" title="' + TWN.lang.add + '"><img src="' + TWN.images.add + '" style="cursor:pointer;"></div>').click(function () {
          var event = dropdown.getValue();
          var info = TWN.settings.getInfo(event);
          var sound = soundBox.getValue();
          if (sound == 'custom')
            sound = soundName.getValue();
          TWN.notifications.add(event, info, sound);
          TWN.settings.refreshTable();
        });
      TWN.settings.gui.window.appendToContentPane($('<span>' + TWN.lang.event + ': </span>')).appendToContentPane(dropdown.getMainDiv()).appendToContentPane($('<span style="margin-left:8px;">' + TWN.lang.sound + ': </span>'));
      TWN.settings.gui.window.appendToContentPane(soundBox.getMainDiv()).appendToContentPane(soundName.getMainDiv().css({
          'display': 'none',
          'margin-top': '1px'
        })).appendToContentPane(testSound).appendToContentPane(addButton).appendToContentPane(settings);
      TWN.settings.changeSettings();
      TWN.settings.gui.window.hideLoader();
    },
    removeConfirmation: function (id) {
      var dialog = new west.gui.Dialog(TWN.lang.confirmationTitle, TWN.lang.confirmation);
      dialog.addButton('yes', function () {
        TWN.notifications.remove(id);
        $('.TWNotifierSettings .row_' + id).remove();
        TWN.settings.refreshTable();
      }).addButton('no', function () {
        dialog.hide();
      }).show();
    },
    refreshTable: function () {
      this.table.clearBody();
      for (var i = 0; i < TWN.notifications.list.length; i++) {
        var inl = TWN.notifications.list[i];
        var sound = inl.sound;
        this.table.appendRow(null, '');
        this.table.appendToCell(-1, 'TWNotifier-event-col', TWN.lang.desc[inl.event] || inl.event);
        this.table.appendToCell(-1, 'TWNotifier-info-col', TWN.settings.getDescription(inl));
        this.table.appendToCell(-1, 'TWNotifier-remove-col', $('<img src="' + TWN.images.remove + '" onclick="TWN.settings.removeConfirmation (' + i + ');" title="' + TWN.lang.remove + '">'));
        this.table.appendToCell(-1, 'TWNotifier-sound-col', $('<img src="' + TWN.images.sound + '" onclick="TWN.notifications.playSound(\'' + sound + '\');" title="' + TWN.lang.listen + '">'));
      }
    },
    changeSettings: function (val) {
      var settings = $('#TWNotifierSettings').html('');
      switch (val) {
      case ('friends'):
        settings.append($('<label for="friendsName" style="cursor:pointer;">' + TWN.lang.types.friends + ':</label>'), new west.gui.Textfield('friendsName').getMainDiv(), this.infoBox(val));
        break;
      case ('wayFinished'):
        settings.append(this.infoBox(val));
        break;
      case ('noQueue'):
        settings.append(this.infoBox(val));
        break;
      case ('townforum'):
        var dropdown = new west.gui.Combobox('TWNotifierTownforumTopic');
        $.ajax('forum.php', {
          complete: function (data) {
            var DOM = $.parseHTML(data.responseText);
            $('#forum_list', DOM).children('div').each(function (i, el) {
              if ($(el).find('span').text() == '')
                return;
              TWN.settings.townforumTopics[TWN.settings.townforumTopics.length] = $(el).find('span').text();
              TWN.settings.townforumTopics.length++;
            });
            dropdown.addListener(function () {
              $('#selectedForum').html((dropdown.getValue() != '*' ? ' ' + dropdown.getValue() : ''));
            });
            dropdown.addItem('*', TWN.lang.reportTypes.all);
            for (var i = 0; i < TWN.settings.townforumTopics.length; i++)
              dropdown.addItem(TWN.settings.townforumTopics[i], TWN.settings.townforumTopics[i]);
            TWN.settings.gui.comboboxes.townforumTopics = dropdown;
            settings.append($('<span>' + TWN.lang.types.townforum + ': </span>'), dropdown.getMainDiv(), TWN.settings.infoBox(val));
          }
        });
        break;
      case ('reports'):
        var dropdown = new west.gui.Combobox('TWNotifierReportType');
        var types = [
          'all',
          'work',
          'duels',
          'achvmnt',
          'fort',
          'other'
        ];
        for (var i = 0; i < types.length; i++)
          dropdown.addItem(types[i], TWN.lang.reportTypes[types[i]]);
        dropdown.addListener(function (selected) {
          if (selected != 'all')
            $('#reportWarning').css('display', 'block');
          else
            $('#reportWarning').css('display', 'none');
        });
        settings.append($('<span>' + TWN.lang.types.reports + ': </span>'), dropdown.getMainDiv(), $('<div id="reportWarning">' + TWN.lang.reportInfo + '</div>'));
        TWN.settings.gui.comboboxes.reportTypes = dropdown;
        break;
      case ('newItem'):
        settings.append(this.infoBox(val));
        break;
      case ('nickInChat'):
        settings.append($('<label for="TWNnicks" style="cursor:pointer;">' + TWN.lang.types.nickInChat + ':</label>'), new west.gui.Textfield('TWNnicks').getMainDiv(), this.infoBox(val));
        break;
        //case ('messages'):
      default:
        settings.append(this.infoBox('messages'));
        break;
      }
    },
    infoBox: function (text) {
      return $('<div id="settingInfo"><img src="' + TWN.images.info + '"> ' + TWN.lang[text + 'Info'] + ' <img src="' + TWN.images.info + '"></div>');
    },
    getInfo: function (i) {
      switch (i) {
      case ('reports'):
        return TWN.settings.gui.comboboxes.reportTypes.getValue() || 'all';
      case ('townforum'):
        return TWN.settings.gui.comboboxes.townforumTopics.getValue() || '*';
      case ('friends'):
        var fTF = $('#friendsName').val();
        return fTF ? fTF.replace(/;\s+/g, ';').replace(/;$/g, '') : '*';
      case ('nickInChat'):
        var nTF = $('#TWNnicks').val();
        return nTF ? nTF.replace(/;\s+/g, ';').replace(/;$/g, '') : '*';
      default:
        return '';
      }
    },
    getDescription: function (e) {
      var info = e.info;
      switch (e.event) {
      case ('reports'):
        return TWN.lang.reportTypes[info] || info;
      case ('townforum'):
        if (info == '*')
          return TWN.lang.reportTypes.all;
        return info;
      case ('friends'):
        if (info == '*')
          return TWN.lang.reportTypes.all;
        var res = '';
        info = info.split(';');
        for (var i = 0; i < info.length; i++) {
          if (i != 0 && info[i] != '')
            res += ', ';
          res += '<a href="javascript:PlayerProfileWindow.open (encodeURIComponent (\'' + info[i].replace(/'/g, '\\\'') + '\') );">' + info[i] + '</a>';
        }
        return res;
      case ('nickInChat'):
        var res = Character.name;
        if (info == '*')
          return res;
        info = info.split(';');
        for (var nick of info)
          res += ', ' + nick;
        return res;
      default:
        return TWN.lang[e.event + 'Info'];
      }
    },
  };
  TWN.init();
});