diff --git a/dofusTravel.js b/dofusTravel.js index 24cf5a7..e547adb 100644 --- a/dofusTravel.js +++ b/dofusTravel.js @@ -6,11 +6,12 @@ // @match https://www.gamosaurus.com/jeux/dofus/* // @match https://dofus-map.com/* // @match https://dofus-portals.fr/* -// @version 1.3 +// @version 1.4 // @author Mazoyer Alexis // @description Permet de rendre cliquable toutes les positions [x,y] indiquées sur le site dofuspourlesnoobs // ==/UserScript== const travelCommand = '/travel ' +const parameters = new URLSearchParams(window.location.search) const displayPopup = (text, status) => { let popupDiv = document.createElement('div') let popupText = document.createElement('p') @@ -93,7 +94,11 @@ if (!window.location.href.includes('dofus-map')) { if (mutation.addedNodes.length) { const position = getPositionArray(result.innerHTML.replace( /(<([^>]+)>)/ig, '').replace(';', ',').replace(/\s/g, '')) if(position && position.length === 2) { - copyTextToClipboard(travelCommand + position[0] + ',' + position[1]) + if (parameters.has('noob')) { + copyTextToClipboard('[' + position[0] + ',' + position[1]) + } else { + copyTextToClipboard(travelCommand + position[0] + ',' + position[1] + ']') + } } } })