smoothretro82

Infinity bot (update 2)

Nov 17th, 2025 (edited)
67
0
Never
7
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. a = []
  2. b = 0
  3. c = ""
  4. d = 0
  5. h = 0
  6. num = 0
  7. t = new Date()
  8. time = t.getTime()
  9. save = 0
  10. u = 0
  11. ud = 0
  12.  
  13. // NEW tracking variables
  14. lastX = null
  15. lastY = null
  16. lastLen = 0
  17.  
  18. // Toggle milliseconds display
  19. showMillis = true
  20.  
  21. function omega(n) {
  22. num = 1
  23. a = []
  24. h = 64
  25. while (n > h) {
  26. h = h + h
  27. }
  28. while (h != 32) {
  29. ud = (n * num) % h
  30. u = 1
  31. while (ud >= h / 2) {
  32. u = u * 2
  33. ud = (ud * 2) % h
  34. }
  35. num = num * u
  36. a = a.concat(u)
  37. h = h / 2
  38. }
  39. return a
  40. }
  41.  
  42. function infinity(n) {
  43. return omega(n)
  44. }
  45.  
  46. function update() {
  47. if (d % 7 == 0) {
  48.  
  49. // current cursor position (where ticker should appear)
  50. let x = cursor.x
  51. let y = cursor.y
  52.  
  53. // ERASE old ticker text if it existed
  54. if (lastX !== null) {
  55. cursor.x = lastX
  56. cursor.y = lastY
  57. for (let i = 0; i < lastLen; i++) {
  58. writeChar(" ", 1)
  59. }
  60. }
  61.  
  62. // format b based on showMillis
  63. let bStr = showMillis ? (Math.floor(b * 1000) / 1000) : Math.floor(b)
  64.  
  65. // update string
  66. c = bStr + " ~ [" + infinity(b).join() + "]"
  67. t = new Date()
  68. b = (t.getTime() - time) / 1000 + save
  69.  
  70. // DRAW new text at the current cursor location
  71. cursor.x = x
  72. cursor.y = y
  73. for (let i = 0; i < c.length; i++) {
  74. writeChar(c[i], 1)
  75. }
  76.  
  77. // REMEMBER where it was drawn this frame
  78. lastX = x
  79. lastY = y
  80. lastLen = c.length
  81.  
  82. // RESTORE cursor to original location
  83. cursor.x = x
  84. cursor.y = y
  85. }
  86.  
  87. d++
  88. requestAnimationFrame(update)
  89. }
  90.  
  91. requestAnimationFrame(update)
  92.  
  93. w.on("msg", (data) => {
  94. // save command
  95. if (data.msg.startsWith("save ") && data.nick == "CalculatorBot") {
  96. save = Number(data.msg.substring(5)) - b
  97. }
  98.  
  99. // toggle milliseconds display
  100. if (data.msg === "toggleMillis" && data.nick == "CalculatorBot") {
  101. showMillis = !showMillis
  102. }
  103. })
  104.  
Advertisement
Comments
  • smoothretro82
    255 days
    # text 0.03 KB | 0 0
    1. Update: Now it follows you
  • smoothretro82
    245 days
    # text 0.06 KB | 0 0
    1. Added a toggle that lets you show or hide the milliseconds
    2.  
  • User was banned
  • User was banned
  • User was banned
  • smoothretro1982
    20 days
    # text 0.53 KB | 0 0
    1. btw, to stop the script run this in console:
    2.  
    3. running = false;
    4. if (lastX !== null) {
    5. let currentX = cursor.x;
    6. let currentY = cursor.y;
    7. cursor.x = lastX;
    8. cursor.y = lastY;
    9. for (let i = 0; i < lastLen; i++) {
    10. writeChar(" ", 1);
    11. }
    12. cursor.x = currentX;
    13. cursor.y = currentY;
    14. }
  • User was banned
Add Comment
Please, Sign In to add comment