ClearNotes

remove all notes and custom colours from planets and ships (notes type 1 & 2).

  1. // ==UserScript==
  2. // @name ClearNotes
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description remove all notes and custom colours from planets and ships (notes type 1 & 2).
  6. // @author Daniel Vale
  7. // @match http://*/*
  8. // @grant none
  9. // @include https://planets.nu/#/*
  10. // @include https://planets.nu/*
  11. // @include http://play.planets.nu/*
  12. // @include http://test.planets.nu/*
  13. // ==/UserScript==
  14. function wrapper () {// wrapper for injection
  15. 'use strict';
  16.  
  17. // instantiate a new object, and register it as a plugin
  18. var version = "0.1";
  19. var name = "Celar Notes";
  20.  
  21. // Declare an object type (constructor)
  22. function ClearNotes() {
  23.  
  24. this.showmap = function() {
  25. console.log("Clear Notes - running");
  26.  
  27. for (var i = 0; i < vgap.notes.length; i++){
  28. var note = vgap.notes[i];
  29. if (note !== null) {
  30. if (note.targettype == 1 || note.targettype == 2) {
  31. // planet or ship note
  32. note.body = "";
  33. note.color = "";
  34. note.changed = 1;
  35. }
  36. }
  37. }
  38. vgap.map.clearcace
  39. vgap.map.draw();
  40. }
  41. }
  42. // create an instance of the plugin and register it
  43. var plugin = new ClearNotes();
  44. vgap.registerPlugin(plugin, "TestPlugin");
  45. console.log(name + " " + version + " planets.nu plugin registered");
  46. }
  47.  
  48.  
  49. var script = document.createElement("script");
  50. script.type = "application/javascript";
  51. script.textContent = "(" + wrapper + ")();";
  52.  
  53. document.body.appendChild(script);
  54.  
  55.