IsQuestCompleted

Simple macro that check you completed that quest before.

  1. // ==UserScript==
  2. // @name IsQuestCompleted
  3. // @namespace http://tampermonkey.net/
  4. // @version 3.0
  5. // @description Simple macro that check you completed that quest before.
  6. // @author Przemekb88 / Yalahari
  7. // @license MIT
  8. // @match https://www.wowhead.com/quest=*
  9. // @match https://wowpedia.fandom.com/wiki/*
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13.  
  14. var host = window.location.hostname
  15. var url = window.location.href
  16. if (host === 'wowpedia.fandom.com') {
  17. url = document.querySelector('.elinks .wowhead').firstChild.href
  18. }
  19.  
  20. var page = url.substring(url.lastIndexOf('quest=') + 6)
  21. var result = page.split('/')
  22.  
  23. var button = document.createElement('button')
  24.  
  25. button.onclick = function() {
  26. navigator.clipboard.writeText('/script print(IsQuestFlaggedCompleted('+result[0]+'))')
  27. button.textContent = 'Copied'
  28. setTimeout(function() {
  29. button.textContent = 'Is quest completed?'
  30. }, 3000)
  31. }
  32. button.textContent = 'Is quest completed?'
  33.  
  34. if (host === 'wowpedia.fandom.com') {
  35. var tr = document.createElement('tr')
  36. var th = document.createElement('th')
  37. th.setAttribute('scope', 'row')
  38. th.style.textAlign = 'left'
  39. th.style.backgroundColor = 'transparent'
  40. th.innerHTML = 'Check'
  41. tr.appendChild(th)
  42. tr.appendChild(button)
  43. var questbox = document.querySelector('.infobox.darktable.questbox')
  44. questbox.appendChild(tr)
  45. } else {
  46. var node = document.createElement('li')
  47. node.appendChild(button)
  48. var myList = document.getElementById('infobox-contents-0').getElementsByTagName('ul')[0]
  49. myList.appendChild(node)
  50. }