T3RRYT3RR0R

basic Batch ANSI animation

Dec 16th, 2019
637
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.90 KB | None | 0 0
  1. @echo off
  2. :reset
  3. Set count=0
  4. Set delay=0
  5. Set break=0
  6. Set linepos=[1;!count!H
  7. Set lowlinepos=[32;!count!H
  8.  
  9. Mode Con: cols=120 lines=33
  10. Setlocal EnableDelayedExpansion
  11.  
  12. :main
  13. Set /a break=%break% + 1
  14. IF %break% GTR 399 goto end
  15. Set /a count=%count% + 1
  16. ECHO %linepos%ROYGBIV
  17. ECHO %lowlinepos%^>^>^>^>^>^>^>
  18. IF %count%==114 GOTO second
  19. Call :delay
  20. GOTO main
  21. pause
  22.  
  23. :second
  24. Set /a count=%count% - 1
  25. Set /a break=%break% + 1
  26. IF %break% GTR 399 goto end
  27. ECHO %linepos%ROYGBIV
  28. ECHO %lowlinepos%^<^<^<^<^<^<
  29. IF %count%==0 GOTO main
  30. Call :delay
  31. GOTO second
  32.  
  33. :delay
  34. Set /a delay=%delay% + 1
  35. IF %delay%==3 Set delay=0
  36. If %delay%==0 GOTO :EOF
  37. GOTO delay
  38.  
  39. :end
  40. endlocal EnableDelayedExpansion
  41. ECHO Done
  42. pause >nul
  43. GOTO reset
Advertisement
Add Comment
Please, Sign In to add comment