smoothretro82

character replacer

Nov 8th, 2025 (edited)
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. const RADIUS = 60; // Circle radius
  2. const charsToFind = ['e', '█', 'r', 'D'];
  3. const charToReplaceWith = ' ';
  4.  
  5. const cx = Number(cursor.x);
  6. const cy = Number(cursor.y);
  7.  
  8. for (let x = cx - RADIUS; x <= cx + RADIUS; x++) {
  9. for (let y = cy - RADIUS; y <= cy + RADIUS; y++) {
  10. // Check if the point is within the circle
  11. const dx = x - cx;
  12. const dy = y - cy;
  13. if (dx * dx + dy * dy <= RADIUS * RADIUS) {
  14. const info = getCharInfoXY(x, y);
  15.  
  16. if (charsToFind.includes(info.char) && !info.deco.bold) {
  17. writeCharAt(
  18. charToReplaceWith,
  19. prsFmt({ color: info.color, bold: false }),
  20. x,
  21. y
  22. );
  23. }
  24. }
  25. }
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment