Satisfactory Map Icon Filter

Filter some icons

  1. // ==UserScript==
  2. // @name Satisfactory Map Icon Filter
  3. // @version 2020.06.05
  4. // @description Filter some icons
  5. // @include https://satisfactory-calculator.com/ru/interactive-map
  6. // @icon https://www.google.com/s2/favicons?domain=satisfactory-calculator.com
  7. // @namespace https://greasyfork.org/users/7568
  8. // @homepage https://greasyfork.org/ru/users/7568-dr-yukon
  9. // @author Rainbow-Spike
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. /*
  14. For items detection in savegame files
  15. If you need to leave some items on a map - comment their strings by //, reload site page, reupload savegame file
  16. */
  17. var db = [
  18. /* Hard Drives */
  19. // 'HardDrive',
  20. 'Bolt', // Electrolocked only
  21.  
  22. /* Ores */
  23. 'iron_new',
  24. 'copper_new',
  25. 'Stone',
  26. 'CoalOre',
  27. // 'CateriumOre',
  28. // 'Sulfur',
  29. // 'QuartzCrystal',
  30. // 'Bauxite',
  31. 'UraniumOre',
  32. // 'SAMOre',
  33.  
  34. /* Items */
  35. 'IronScrews',
  36. // 'ReinforcedIronPlates',
  37. // 'Engine',
  38. // 'ModularFrame',
  39. // 'ModularFrameHeavy',
  40. // 'EncasedSteelBeam',
  41. 'Wire',
  42. 'Cables',
  43. // 'CircuitBoard',
  44. // 'AILimiter',
  45. // 'HighSpeedConnector',
  46. // 'Computer',
  47. // 'SuperComputer',
  48. // 'RadioControlUnit',
  49. // 'Heatsink',
  50. // 'Battery',
  51. 'NuclearWaste'
  52. ];
  53.  
  54. function action ( ) {
  55. document.querySelectorAll ( '.leaflet-data-marker' ).forEach ( function ( e ) {
  56. var img = e.querySelector ( 'image' ).getAttribute ( 'xlink:href' );
  57. for ( var i in db ) {
  58. if ( img.search ( db[i] ) != -1 ) e.style = "display: none"
  59. }
  60. } )
  61. }
  62. setInterval ( action, 100 );