smoothretro82

Script to write text at all cursors or just one cursor

Dec 26th, 2025
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. //script to write text at all cursors or just one cursor, by DG_
  2.  
  3. // variables
  4. const cursorNameText = c => c.n // or use any cursors name
  5. const cursorText = "*BARF*" // custom text
  6.  
  7. // write centered text at a cursor
  8. const r3c = (t, c) => {
  9. const startX = c.rawx - Math.floor(t.length / 2)
  10.  
  11. for (let i = 0; i < t.length; i++) {
  12. writeCharAt(t[i], c.c ?? 0, startX + i, c.rawy)
  13. }
  14. }
  15.  
  16. // draw text for all cursors
  17. for (const c of w.cursors.values()) {
  18. r3c(cursorNameText(c), c) // name
  19. r3c(cursorText, c) // custom text
  20. }
Add Comment
Please, Sign In to add comment