Guest User

OKFAMS

a guest
Apr 28th, 2025
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Highlight and Pin OKFAMS
  3. // @namespace Violentmonkey Scripts
  4. // @match https://boards.holotower.org/*
  5. // @grant none
  6. // @version 1.0
  7. // @author -
  8. // @description 4/25/2025, 11:31:44 PM
  9. // ==/UserScript==
  10. function checkThreads() {
  11. const threads = document.querySelectorAll('.thread');
  12.  
  13. for (let thread of threads) {
  14. const replies = thread.querySelector('.replies');
  15. if (!replies) continue;
  16.  
  17. const subject = replies.querySelector('.subject');
  18. if (!subject) continue;
  19.  
  20. if (subject.textContent.trim() === '/OKFAMS/ Thread') {
  21. const strong = thread.querySelector('strong');
  22. if (!strong) continue;
  23.  
  24. const parts = strong.textContent.split('/');
  25. const rPart = parts.find(part => part.includes('R'));
  26. if (!rPart) continue;
  27.  
  28. const number = parseInt(rPart.replace(/\D/g, ''), 10);
  29. if (isNaN(number)) continue;
  30.  
  31. const mix = thread.closest('.mix'); // Find the parent with class "mix"
  32. const grid = document.getElementById('Grid'); // Find the #Grid parent
  33.  
  34. if (!mix || !grid) continue; // Safety check
  35.  
  36. thread.style.border = '';
  37. if (number < 1500) {
  38. thread.style.border = '3px solid red';
  39.  
  40. // Move the entire .mix to be the first child of #Grid
  41. if (grid.firstChild !== mix) {
  42. grid.insertBefore(mix, grid.firstChild);
  43. }
  44. } else {
  45. thread.style.border = '';
  46. }
  47. // Only handle the first matching thread
  48. break;
  49. }
  50. }
  51. }
  52.  
  53. // Run once on page load
  54. window.addEventListener('load', checkThreads);
  55.  
  56. // Run every 20 seconds
  57. setInterval(checkThreads, 20000);
Advertisement
Add Comment
Please, Sign In to add comment