add noob option
This commit is contained in:
parent
1ad5d25abd
commit
9517eb8028
@ -6,11 +6,12 @@
|
|||||||
// @match https://www.gamosaurus.com/jeux/dofus/*
|
// @match https://www.gamosaurus.com/jeux/dofus/*
|
||||||
// @match https://dofus-map.com/*
|
// @match https://dofus-map.com/*
|
||||||
// @match https://dofus-portals.fr/*
|
// @match https://dofus-portals.fr/*
|
||||||
// @version 1.3
|
// @version 1.4
|
||||||
// @author Mazoyer Alexis
|
// @author Mazoyer Alexis
|
||||||
// @description Permet de rendre cliquable toutes les positions [x,y] indiquées sur le site dofuspourlesnoobs
|
// @description Permet de rendre cliquable toutes les positions [x,y] indiquées sur le site dofuspourlesnoobs
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
const travelCommand = '/travel '
|
const travelCommand = '/travel '
|
||||||
|
const parameters = new URLSearchParams(window.location.search)
|
||||||
const displayPopup = (text, status) => {
|
const displayPopup = (text, status) => {
|
||||||
let popupDiv = document.createElement('div')
|
let popupDiv = document.createElement('div')
|
||||||
let popupText = document.createElement('p')
|
let popupText = document.createElement('p')
|
||||||
@ -93,7 +94,11 @@ if (!window.location.href.includes('dofus-map')) {
|
|||||||
if (mutation.addedNodes.length) {
|
if (mutation.addedNodes.length) {
|
||||||
const position = getPositionArray(result.innerHTML.replace( /(<([^>]+)>)/ig, '').replace(';', ',').replace(/\s/g, ''))
|
const position = getPositionArray(result.innerHTML.replace( /(<([^>]+)>)/ig, '').replace(';', ',').replace(/\s/g, ''))
|
||||||
if(position && position.length === 2) {
|
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] + ']')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user