Advertisement
T3RRYT3RR0R

$Cout Batch color text macro

Apr 9th, 2021 (edited)
1,370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 18.42 KB | None | 0 0
  1. ::: Author T3RRY : Created 09/04/2021 : Version 1.0.7
  2. ::: Version changes:
  3. ::: - ADDED /A switch to allow absolute Y;X value to be supplied as a single switch subarg
  4. ::: - ADDED /@ switch to allow saving of cursor position. Subarg allows custom return var to store multiple positions.
  5. ::: - ADDED random subarg for /C color switch.
  6. ::: - ADDED optional companion switch to /C - '/B'
  7. :::  - When /C random subarg is used, /B may be used with any ONE of the following: R G B C M Y
  8. :::    to bias the output color towards Red Green Blue Cyan Magenta or Yellow
  9. ::: - ADDED support for switches with common prefix.
  10. ::: - ADDED /T timeout switch for subsecond delays
  11. ::: - CORRECTED Switch validation method to handle Switches at EOL with no subargs
  12. ::: - ADDED /E Switch to allow /C value to be preserved or Color to be changed at EOL with an integer subarg.
  13. ::: - Support REMOVED for switch usage pattern /Switch:value
  14. :::
  15. ::: Purpose      : Color and cursor position macro for windows 10 batch files
  16. ::: - Allows rapid display of colored output at specified screen position.
  17. :::   For more information, read the usage.
  18. :::
  19. ::: Uses macro parameter and switch handling template.
  20. :::  - See :  https://pastebin.com/gzL7AYpC
  21.  
  22. @Echo off
  23. mode 200,60
  24. :# Windows Version control. Assigns flag true if system is windows 10.
  25.  Set "Win10="
  26.  Ver | Findstr /LIC:" 10." > nul && Set "Win10=true"
  27.  
  28. :# Test if virtual terminal codes enabled ; enable if false
  29. :# removes win10 flag definition if version does not support Virtual Terminal sequences
  30.  If defined Win10 (
  31.   Reg Query HKCU\Console | %SystemRoot%\System32\findstr.exe /LIC:"VirtualTerminalLevel    REG_DWORD    0x1" > nul || (
  32.     Reg Add HKCU\Console /f /v VirtualTerminalLevel /t REG_DWORD /d 1
  33.   ) > Nul || Set "Win10="
  34.  )
  35.  If not defined Win10 (
  36.   Echo(Virtual terminal sequences not supported on your system
  37.   Exit /B 1
  38.  )
  39.  
  40.  If "%~1" == "" (
  41.   Mode 200,150
  42.   Cls
  43.  )
  44.  
  45. :# /@ Switch requires clean working driectory to execute in.
  46.  RD "%TEMP%\%~n0_Run" 2> nul && Timeout 1 > nul
  47.  MD "%TEMP%\%~n0_Run"
  48.  
  49. (Set \n=^^^
  50.  
  51. %= \n macro newline variable. Do not modify =%)
  52.  
  53. :# assign virtual terminal control character 0x27 'escape' variable \E
  54.  For /F %%a in ( 'Echo prompt $E ^| cmd' )Do Set "\E=%%a"
  55.  
  56. ::# usage: %$Cout% [/?] | [/Alt | /Main] [/H [-|+]] [/T Int] [/X Int | /L Int | /R Int]
  57. ::#                [/Y Int | /U Int | /D Int] [/K |/Del Int | /I Int] [/N] [/@ {Optional:ReturnVar}]
  58. ::#                [/C Int | /C Int,Int | /C Int;Int | /C random] [/S "String"] [/E {Optional:0|Int}]
  59. ::# -----------------------------------------------------------------------------------------------------
  60. ::# Available Switches     : Description:
  61. ::# -----------------------------------------------------------------------------------------------------
  62. ::# /?                     : This help screen
  63. ::#
  64. ::# /S String              : String to be output. Tested for strings of 500 characters.
  65. ::# /S String{Substituion} : The following characters must be substituted for output:
  66. ::# /S ^!Variable:/={FS}^! : {AS}:* {DQ}:" {FS}:/ {EQ}:=
  67. ::#
  68. ::# /C Integer             : Declare output color using VT sequence
  69. ::# /C Integer,Integer     : Chain   mulitple VT color sequences
  70. ::# /C Integer;Integer     : Combine multiple VT values into the one sequence
  71. ::# /C random              : Random RGB foreground color
  72. ::# /B R|G|B|C|M|Y         : Bias /C random color toward Red Green Blue
  73. ::#                        : Cyan Magenta or Yellow. /C random must be used.
  74. ::# /E                     : Preserves /C Color value until /E 0 is used. /C must be used.
  75. ::# /E 0                   : Restores color to Black BG White FG after string output.
  76. ::# /E Integer             : Change color after string output to supplied value.
  77. ::#
  78. ::# /A Integer;Integer     : Move cursor to Line;Column    [ absolute   ]
  79. ::# /Y Integer             : Move cursor to Line Integer   [ absolute Y ]
  80. ::# /X Integer             : Move cursor to Column Integer [ absolute X ]
  81. ::# /U Integer             : Move cursor Up by Integer
  82. ::# /D Integer             : Move cursor Down by Integer
  83. ::# /R Integer             : Move cursor Right by Integer
  84. ::# /L Integer             : Move cursor Left by Integer
  85. ::#
  86. ::# /H -                   : Hide the cursor  : Note - If Cursor state is changed during a code block
  87. ::#                          redirected to a file, it cannot be changed again except within a code block.
  88. ::# /H +                   : Show the cursor
  89. ::# /Alt                   : Switch to alternate   buffer [ main buffer is preserved ]
  90. ::# /Main                  : Return to main screen buffer [ alternate buffer is cleared ]
  91. ::# /K                     : Clears text to right of current cursor position
  92. ::# /Del Integer           : Deletes Integer columns right of the cursor, shifting existing text left
  93. ::# /I Integer             : Inserts whitespace into Integer columns right of Cursor, shifting text right
  94. ::# /N                     : Output a newline after other switches are executed.
  95. ::# /T Integer             : Subsecond Delay after output. 25000 = ~1 Second [ Depending on clockspeed ]
  96. ::#
  97. ::# /@                     : Stores cursor position after execution in variables: $Cout{Y} , $Cout{X}
  98. ::#                        : and $Cout{pos} ( VT format 'IntY;IntX' )
  99. ::# /@ String-ReturnVar    : Return values to ReturnVar{pos} ReturnVar{Y} ReturnVar{X}
  100. ::#                    *!* : This switch MUST NOT be used during codeblocks that redirect output
  101. ::#                        : Slow execution time. ~ 17x slower than typical $Cout expansion
  102. ::#                        : 12/100th's vs 0.7/100th's of a second [with a clockspeed of 2904]
  103. ::#
  104. ::#                                               Notes:
  105. ::# - $Cout Macro does not support Concatenation of Expansions.
  106. ::# - No error validation is performed on switch Integer subargs. Invalid Virtual Terminal sequences
  107. ::#   will be disregarded and output as a string.
  108. ::#
  109. ::# Virtual Terminal sequence resource:
  110. ::#  https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences
  111. ::#
  112. ::# Virtual terminal cursor position capture code source:
  113. ::#  https://stackoverflow.com/a/38240300/12343998
  114. ::# -----------------------------------------------------------------------------------------------------
  115.  
  116.  Set $Cout_Switches="A" "Y" "X" "U" "D" "R" "L" "H" "Alt" "Main" "K" "Del" "I" "N" "T" "B" "C" "E" "S" "@"
  117.  
  118.  Set $Cout=For %%n in (1 2)Do if %%n==2 (%\n%
  119.   For %%G in ( %$Cout_Switches% )Do Set "$Cout_Switch[%%~G]="%\n%
  120.   If not "!$Cout_args:* /=!" == "!$Cout_args!" (%\n: build $Cout.Args[!$Cout_i.Arg!] array if args present =%
  121.    Set "$Cout_leading.args=!$Cout_args:*/=!"%\n%
  122.    For /F "Delims=" %%G in ("!$Cout_leading.args!")Do Set "$Cout_leading.args=!$Cout_args:/%%G=!"%\n%
  123.    Set ^"$Cout_args=!$Cout_args:"=!"%\n%
  124.    Set "$Cout_i.arg=0"%\n%
  125.    For %%G in (!$Cout_leading.args!)Do (%\n%
  126.     Set /A "$Cout_i.arg+=1"%\n%
  127.     Set "$Cout_arg[!$Cout_i.arg!]=%%~G"%\n%
  128.    )%\n%
  129.   ) Else (%\n: remove doublequotes from args before switch processing =%
  130.    Set ^"$Cout_args=!$Cout_args:"=!"%\n%
  131.   )%\n%
  132.   Set "$Cout_LastSwitch="%\n%
  133.   For /L %%L in (2 1 4)Do If "!$Cout_LastSwitch!" == "" (%\n%
  134.    If "!$Cout_Args:~-%%L,1!" == " " Set "$Cout_LastSwitch=_"%\n%
  135.    If "!$Cout_Args:~-%%L,1!" == "/" (%\n: Flag last switch true if no subargs; Works for character switches of up to 3 characters =%
  136.     For /F "Delims=" %%v in ('Set /A "%%L-1"')Do Set "$Cout_Switch[!$Cout_Args:~-%%v!]=true"%\n%
  137.     If not "!$Cout_Args:/?=!." == "!$Cout_Args!." Set "$Cout_Switch[help]=true"%\n%
  138.     Set "$Cout_Args=!$Cout_Args:~0,-%%L!"%\n%
  139.     Set "$Cout_LastSwitch=_"%\n%
  140.    )%\n%
  141.   )%\n%
  142.   For %%G in ( %$Cout_Switches% )Do If not "!$Cout_args:/%%~G =!" == "!$Cout_args!" (%\n%
  143.    Set "$Cout_Switch[%%~G]=!$Cout_Args:*/%%~G =!"%\n%
  144.    If not "!$Cout_Switch[%%~G]:*/=!" == "!$Cout_Switch[%%~G]!" (%\n%
  145.     Set "$Cout_Trail[%%~G]=!$Cout_Switch[%%~G]:*/=!"%\n%
  146.     For %%v in ("!$Cout_Trail[%%~G]!")Do (%\n%
  147.      Set "$Cout_Switch[%%~G]=!$Cout_Switch[%%~G]: /%%~v=!"%\n%
  148.      Set "$Cout_Switch[%%~G]=!$Cout_Switch[%%~G]:/%%~v=!"%\n%
  149.     )%\n%
  150.     Set "$Cout_Trail[%%~G]="%\n%
  151.     If "!$Cout_Switch[%%~G]:~-1!" == " " Set "$Cout_Switch[%%~G]=!$Cout_Switch[%%~G]:~0,-1!"%\n%
  152.     If "!$Cout_Switch[%%~G]!" == "" Set "$Cout_Switch[%%~G]=true"%\n%
  153.    )%\n%
  154.   )%\n%
  155.   If /I "!$Cout_Switch[C]!" == "random" (%\n%
  156.    If not "!$Cout_Switch[B]!" == ""   (Set "$Cout_MOD=100")Else Set "$Cout_MOD=200"%\n%
  157.    Set /A "$Cout_RR=!random! %% !$Cout_MOD! + 50,$Cout_GG=!random! %% !$Cout_MOD! + 50,$Cout_BB=!random! %% !$Cout_MOD! + 50"%\n%
  158.    If /I "!$Cout_Switch[B]!" == "R" Set "$Cout_RR=250"%\n%
  159.    If /I "!$Cout_Switch[B]!" == "G" Set "$Cout_GG=250"%\n%
  160.    If /I "!$Cout_Switch[B]!" == "B" Set "$Cout_BB=250"%\n%
  161.    If /I "!$Cout_Switch[B]!" == "M" Set /A "$Cout_RR=!Random! %% 50 + 200,Cout_GG=0,$Cout_BB=!Random! %% 50 + 200"%\n%
  162.    If /I "!$Cout_Switch[B]!" == "Y" Set /A "$Cout_RR=!Random! %% 90 + 100,Cout_GG=!Random! %% 90 + 90,$Cout_BB=0"%\n%
  163.    If /I "!$Cout_Switch[B]!" == "C" Set /A "$Cout_RR=0,Cout_GG=!Random! %% 120 + 30,$Cout_BB=175"%\n%
  164.    Set "$Cout_Switch[C]=38;2;!$Cout_RR!;!$Cout_GG!;!$Cout_BB!"%\n%
  165.   )%\n%
  166.   If "!$Cout_Switch[help]!" == "true" ((For /F "Tokens=1,2 Delims=#" %%Y in ('findstr /BLIC:"::#" "%~f0"')Do @Echo(%%Z)^| @More)%\n%
  167.   If not "!$Cout_Switch[C]!" == ""    (Set "$Cout_Color=%\E%[!$Cout_Switch[C]:,=m%\E%[!m")Else Set "$Cout_Color="%\n%
  168.   If not "!$Cout_Switch[Y]!" == ""    (Set "$Cout_Ypos=%\E%[!$Cout_Switch[Y]!d")Else Set "$Cout_Ypos="%\n%
  169.   If not "!$Cout_Switch[X]!" == ""    (Set "$Cout_Xpos=%\E%[!$Cout_Switch[X]!G")Else Set "$Cout_Xpos="%\n%
  170.   For %%d in (U D L R)Do if not "!$Cout_Switch[%%d]!" == "" (Set /A "$Cout_Switch[%%d]=!$Cout_Switch[%%d]!")%\n%
  171.   If not "!$Cout_Switch[U]!" == ""    (Set "$Cout_Yoffset=%\E%[!$Cout_Switch[U]!A")Else Set "$Cout_Yoffset="%\n%
  172.   If not "!$Cout_Switch[D]!" == ""    Set "$Cout_Yoffset=%\E%[!$Cout_Switch[D]!B"%\n%
  173.   If not "!$Cout_Switch[R]!" == ""    (Set "$Cout_Xoffset=%\E%[!$Cout_Switch[R]!C")Else Set "$Cout_Xoffset="%\n%
  174.   If not "!$Cout_Switch[L]!" == ""    Set "$Cout_Xoffset=%\E%[!$Cout_Switch[L]!D"%\n%
  175.   If "!$Cout_Switch[H]!" == "-"       Set "$Cout_Cursor=%\E%[?25l"%\n%
  176.   If "!$Cout_Switch[H]!" == "+"       Set "$Cout_Cursor=%\E%[?25h"%\n%
  177.   If "!$Cout_Switch[Main]!" == "true" (Set "$Cout_Buffer=%\E%[?1049l")Else Set "$Cout_Buffer="%\n%
  178.   If "!$Cout_Switch[Alt]!" == "true"  Set "$Cout_Buffer=%\E%[?1049h"%\n%
  179.   If not "!$Cout_Switch[A]!" == ""    (Set "$Cout_Absolutepos=%\E%[!$Cout_Switch[A]!H")Else Set "$Cout_Absolutepos="%\n%
  180.   If not "!$Cout_Switch[K]!" == ""    (Set "$Cout_LineClear=%\E%[K")Else Set "$Cout_LineClear="%\n%
  181.   If not "!$Cout_Switch[Del]!" == ""  (Set "$Cout_Delete=%\E%[!$Cout_Switch[Del]!P")Else Set "$Cout_Delete="%\n%
  182.   If not "!$Cout_Switch[I]!" == ""    (Set "$Cout_Insert=%\E%[!$Cout_Switch[I]!@")Else Set "$Cout_Insert="%\n%
  183.   If not "!$Cout_Switch[S]!" == ""    (%\n%
  184.    Set "$Cout_String=!$Cout_Switch[S]:{FS}=/!"%\n%
  185.    Set "$Cout_String=!$Cout_String:{EQ}==!"%\n%
  186.    Set "$Cout_String=!$Cout_String:{AS}=*!"%\n%
  187.    Set ^"$Cout_String=!$Cout_String:{DQ}="!"%\n%
  188.   )Else (Set "$Cout_String=")%\n%
  189.   If "!$Cout_Switch[E]!" == "true"    (Set "$Cout_EOLC=!$Cout_Color!")%\n%
  190.   If not "!$Cout_Switch[E]!" == ""    (Set "$Cout_EOLC=%\E%[!$Cout_Switch[E]!m")%\n%
  191.   If "!$Cout_EOLC!" == ""             (Set "$Cout_EOLC=%\E%[0m")%\n%
  192.   ^< nul set /P "=!$Cout_Buffer!!$Cout_Cursor!!$Cout_Absolutepos!!$Cout_Ypos!!$Cout_YOffset!!$Cout_Xpos!!$Cout_XOffset!!$Cout_Delete!!$Cout_Insert!!$Cout_Color!!$Cout_LineClear!!$Cout_String!!$COUT_EOLC!"%\n%
  193.   If "!$Cout_Switch[N]!" == "true"    Echo(%\n%
  194.   If not "!$Cout_Switch[T]!" == ""    (For /L %%T in (1 1 !$Cout_Switch[T]!)Do (Call )%= Delay resetting Errorlevel to 0 =%)%\n%
  195.   If "!$Cout_Switch[help]!" == "true" Pause%\n%
  196.   If not "!$Cout_Switch[@]!" == "" (%\n%
  197.    PUSHD "%TEMP%\%~n0_Run"%\n%
  198.    Set "$Cout{pos}=" ^&Set "$Cout[Char]="%\n%
  199.    For /L %%l in (2 1 8)Do (%\n%
  200.     If not "!$Cout[Char]!" == "R" (%\n%
  201.      ^<nul set /p "=%\E%[6n" %\n%
  202.      FOR /L %%z in (1 1 %%l) DO pause ^< CON ^> NUL%\n%
  203.      Set "$Cout[Char]=;"%\n%
  204.      for /F "tokens=1 skip=1 delims=*" %%C in ('"REPLACE /W ? . < con"') DO (Set "$Cout[Char]=%%C")%\n%
  205.      If "!$Cout{pos}!" == "" (Set "$Cout{pos}=!$Cout[Char]!")Else (set "$Cout{pos}=!$Cout{pos}!!$Cout[Char]:R=!")%\n%
  206.    ))%\n%
  207.    For /F "tokens=1,2 Delims=;" %%X in ("!$Cout{pos}!")Do Set "$Cout{Y}=%%X" ^& Set "$Cout{X}=%%Y" %\n%
  208.    If not "!$Cout_Switch[@]!" == "true" (%\n%
  209.     Set "{Pos}!$Cout_Switch[@]!=!$Cout{pos}!"%\n%
  210.     Set /A "{Y}!$Cout_Switch[@]!=$Cout{Y},{X}!$Cout_Switch[@]!=$Cout{X}"%\n%
  211.    )%\n%
  212.    POPD "%TEMP%\%~n0_Run"%\n%
  213.   )%\n%
  214.  ) Else Set $Cout_args=
  215.  
  216. :# enable macro
  217. Setlocal EnableExtensions EnableDelayedExpansion
  218.  
  219. :# facilitate testing of the macro using parameters from the command line; or Call %~n0.bat /? to see help.
  220.  
  221.  if not "%~1" == ""  (
  222.   %$Cout% %*
  223.   Exit /B !Errorlevel!
  224.  )
  225.  
  226. :# usage example Ascii art ; Bird with animation
  227.  
  228. :# ensures Y;X axis at screen home
  229. %$Cout% /A 1;1
  230.  
  231. (
  232. %$Cout% /H - /C 1,33 /S "                ,      .-;" /N
  233. %$Cout% /C 1,33 /S "             ,  |\    {FS} {FS}  __," /N
  234. %$Cout% /C 1,33 /S "             |\ '.`-.|  |.'.-'" /N
  235. %$Cout% /C 1,33 /S "              \`'-:  `; : {FS}" /N
  236. %$Cout% /C 1,33 /S "               `-._'.  \'|" /N
  237. %$Cout% /C 1,33 /S "              ,_.-` ` `  ~,_" /N
  238. %$Cout% /C 1,33 /S "               '--,.    "
  239. %$Cout% /C 31 /S ".-. "
  240. %$Cout% /C 1,33 /S ",{EQ}{DQ}{EQ}." /N
  241. %$Cout% /C 1,33 /S "                 {FS}     "
  242. %$Cout% /C 31 /S "{ "
  243. %$Cout% /C 1,36 /S "} "
  244. %$Cout% /C 31 /S ")"
  245. %$Cout% /C 1,33 /S "`"
  246. %$Cout% /C 33 /S ";-."
  247. %$Cout% /C 1,33 /S "}" /N
  248. %$Cout% /C 1,33 /S "                 |      "
  249. %$Cout% /C 31 /S "'-' "
  250. %$Cout% /C 33 /S "{FS}__ |" /N
  251. %$Cout% /C 1,33 /S "                 {FS}          "
  252. %$Cout% /C 33 /S "\_,\|" /N
  253. %$Cout% /C 1,33 /S "                 |          (" /N
  254. %$Cout% /C 1,33 /S "             "
  255. %$Cout% /C 31 /S "__ "
  256. %$Cout% /C 1,33 /S "{FS} '          \" /N
  257. %$Cout% /C random /B G /S "     {FS}\_    "
  258. %$Cout% /C 31 /S "{FS},'`"
  259. %$Cout% /C 1,33 /S "|     '   "
  260. %$Cout% /C 31 /S ".-~^~~-." /N
  261. %$Cout% /C random /B G /S "     |`.\_ "
  262. %$Cout% /C 31 /S "|   "
  263. %$Cout% /C 1,33 /S "{FS}  ' ,    "
  264. %$Cout% /C 31 /S "{FS}        \" /N
  265. %$Cout% /C random /B G /S "   _{FS}  `, \"
  266. %$Cout% /C 31 /S "|  "
  267. %$Cout% /C 1,33 /S "; ,     . "
  268. %$Cout% /C 31 /S "|  ,  '  . |" /N
  269. %$Cout% /C random /B G /S "   \   `,  "
  270. %$Cout% /C 31 /S "|  "
  271. %$Cout% /C 1,33 /S "|  ,  ,   "
  272. %$Cout% /C 31 /S "|  :  !!  : !!| /N
  273. %$Cout% /C random /B G /S "   _\  `,  "
  274. %$Cout% /C 31 /S "\  "
  275. %$Cout% /C 1,33 /S "|.     ,  "
  276. %$Cout% /C 31 /S "|  |  |  | |" /N
  277. %$Cout% /C random /B G /S "   \`  `.   "
  278. %$Cout% /C 31 /S "\ "
  279. %$Cout% /C 1,33 /S "|   '     "
  280. %$Cout% /C 1,32 /S "|"
  281. %$Cout% /C 31 /S "\_|-'|_,'\|" /N
  282. %$Cout% /C random /B G /S "   _\   `,   "
  283. %$Cout% /C 1,32 /S "`"
  284. %$Cout% /C 1,33 /S "\  '  . ' "
  285. %$Cout% /C 1,32 /S "| |  | |  |           "
  286. %$Cout% /C random /B G /S "__" /N
  287. %$Cout% /C random /B G /S "   \     `,   "
  288. %$Cout% /C 33 /S "| ,  '    "
  289. %$Cout% /C 1,32 /S "|_{FS}'-|_\_{FS}     "
  290. %$Cout% /C random /B G /S "__ ,-;` {FS}" /N
  291. %$Cout% /C random /B G /S "    \    `,    "
  292. %$Cout% /C 33 /S "\ .  , ' .| | | | |   "
  293. %$Cout% /C random /B G /S "_{FS}' ` _-`|" /N
  294. %$Cout% /C random /B G /S "     `\    `,   "
  295. %$Cout% /C 33 /S "\     ,  | | | | |"
  296. %$Cout% /C random /B G /S "_{FS}'   .{EQ}{DQ}  {FS}" /N
  297. %$Cout% /C random /B G /S "     \`     `,   "
  298. %$Cout% /C 33 /S "`\      \{FS}|,| ;"
  299. %$Cout% /C random /B G /S "{FS}'   .{EQ}{DQ}    |" /N
  300. %$Cout% /C random /B G /S "      \      `,    "
  301. %$Cout% /C 33 /S "`\' ,  | ; "
  302. %$Cout% /C random /B G /S "{FS}'    {EQ}{DQ}    _{FS}" /N
  303. %$Cout% /C random /B G /S "       `\     `,  "
  304. %$Cout% /C random /B M /S ".{EQ}{DQ}-. "
  305. %$Cout% /C 1,33 /S "': "
  306. %$Cout% /C random /B G /S "{FS}'     {EQ}{DQ}    .{FS}" /N
  307. %$Cout% /C random /B G /S "    jgs _`\    ;"
  308. %$Cout% /C random /B M /S "_{  '   ; "
  309. %$Cout% /C random /B G /S "{FS}'    {EQ}{DQ}      {FS}" /N
  310. %$Cout% /C random /B G /S "       _\`-{FS}__"
  311. %$Cout% /C random /B M /S ".~  `."
  312. %$Cout% /C 1,35,7,48;2;130;100;0 /S "8"
  313. %$Cout% /C random /B M /S ".'.^`~-. "
  314. %$Cout% /C random /B G /S "{EQ}{DQ}     _,{FS}" /N
  315. %$Cout% /C random /B G /S "    __\      "
  316. %$Cout% /C random /B M /S "{   '-."
  317. %$Cout% /C 1,35,7,48;2;150;130;0 /S "|"
  318. %$Cout% /C random /B M /S ".'.--~'`}"
  319. %$Cout% /C random /B G /S "     _{FS}" /N
  320. %$Cout% /C random /B G /S "    \    .{EQ}{DQ}` "
  321. %$Cout% /C random /B M /S "}.-~^'"
  322. %$Cout% /C 1,35,7,48;2;170;150;0 /S "@"
  323. %$Cout% /C random /B M /S "'-. '-..'  "
  324. %$Cout% /C random /B G /S "__{FS}" /N
  325. %$Cout% /C random /B G /S "   _{FS}  .{DQ}    "
  326. %$Cout% /C random /B M /S "{  -'.~('-._,.'"
  327. %$Cout% /C random /B G /S "\_,{FS}" /N
  328. %$Cout% /C random /B G /S "  {FS}  .{DQ}    _{FS}'"
  329. %$Cout% /C random /B M /S "`--; ;  `.  ;" /N
  330. %$Cout% /C random /B G /S "   .{EQ}{DQ}   _{FS}'      "
  331. %$Cout% /C random /B M /S "`-..__,-'" /N
  332. %$Cout% /C random /B G /S "     __{FS}'" /N
  333. ) > "%~dp0parrot.brd"
  334. TYPE "%~dp0parrot.brd"
  335. DEL "%~dp0parrot.brd"
  336.  
  337. :# Just a bit of animation
  338. For /L %%i in (0 1 25)Do (
  339.  %$Cout% /Y 25 /X 19 /C random /B M /S ".{EQ}{DQ}-. "
  340.  %$Cout% /D 1 /X 17 /C random /B M /S "_{  '   ; "
  341.  %$Cout% /D 1 /X 15 /C random /B M /S ".~  `."
  342.  %$Cout% /R 1 /C random /B M /S ".'.^`~-. "
  343.  %$Cout% /D 1 /X 14 /C random /B M /S "{   '-."
  344.  %$Cout% /R 1 /C random /B M /S ".'.--~'`}"
  345.  %$Cout% /D 1 /X 15 /C random /B M /S "}.-~^'"
  346.  %$Cout% /R 1 /C random /B M /S "'-. '-..'  "
  347.  %$Cout% /D 1 /X 14 /C random /B M /S "{  -'.~('-._,.'"
  348.  %$Cout% /D 1 /X 15 /C random /B M /S "`--; ;  `.  ;"
  349.  %$Cout% /D 1 /X 19 /C random /B M /S "`-..__,-'"
  350.  %$Cout% /T 15 /Y 8 /X 26 /C random /B C /S }
  351.  %$Cout% /D 2 /R 5 /I 2
  352.  %$Cout% /U 1 /R 1 /C 33 /S \
  353.  %$Cout% /Y 25 /X 19 /C random /B M /S ".{EQ}{DQ}-. "
  354.  %$Cout% /D 1 /X 17 /C random /B M /S "_{  '   ; "
  355.  %$Cout% /D 1 /X 15 /C random /B M /S ".~  `."
  356.  %$Cout% /R 1 /C random /B M /S ".'.^`~-. "
  357.  %$Cout% /D 1 /X 14 /C random /B M /S "{   '-."
  358.  %$Cout% /R 1 /C random /B M /S ".'.--~'`}"
  359.  %$Cout% /D 1 /X 15 /C random /B M /S "}.-~^'"
  360.  %$Cout% /R 1 /C random /B M /S "'-. '-..'  "
  361.  %$Cout% /D 1 /X 14 /C random /B M /S "{  -'.~('-._,.'"
  362.  %$Cout% /D 1 /X 15 /C random /B M /S "`--; ;  `.  ;"
  363.  %$Cout% /D 1 /X 19 /C random /B M /S "`-..__,-'"
  364.  %$Cout% /T 15 /Y 8 /X 26 /C random /B B /S {EQ}
  365.  %$Cout% /D 2 /R 5 /Del 2
  366.  %$Cout% /U 1 /R 1 /C 33 /S "|"
  367.  If %%i EQU 25 %$Cout% /H + /Y 34 /X 1 /N
  368. )
  369.  
  370. Goto :Eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement