Some holiday animations (from Vt100.net)

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
miskox
Posts: 363
Joined: 28 Jun 2010 03:46

Some holiday animations (from Vt100.net)

#1 Post by miskox » 01 Nov 2020 05:40

Here https://www.vt100.net/dec/animation/ you can see some .txt files that you can
type *.txt
and see some animation. Some might work some will not display correctly (they are for original DEC Video Terminals).

All .txt files are included in the .zip.
xmas.zip
(18.53 KiB) Downloaded 31 times
Saso

aGerman
Expert
Posts: 4008
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Some holiday animations (from Vt100.net)

#2 Post by aGerman » 01 Nov 2020 08:22

The Windows Terminal is able to handle those escape sequences pretty well
https://aka.ms/terminal
But I'm afraid my machine is way too fast and I can't see any animation.

Steffen

penpen
Expert
Posts: 1872
Joined: 23 Jun 2013 06:15
Location: Germany

Re: Some holiday animations (from Vt100.net)

#3 Post by penpen » 01 Nov 2020 20:04

I suspect some vt100 sequences are (actually) not supported by the console, but this fast hack might help:

Code: Select all

@echo off
setlocal enableExtensions enableDelayedExpansion

set "xmas2.speed=800"
for %%a in (*.txt) do (
	cls
	call :play "%%~a" !%%~na.speed!
	pause
)
goto :eof
call :play file [skip] [speed]


:play
setlocal
set "file=%~1"
set /a "delay=1000-%~2+0"
for /f "tokens=1* delims=:" %%a in ('findstr /n "^" "%file%"') do (
	for /l %%w in (1, 1, %delay%) do rem:
	echo(%%b
)
endlocal
goto :eof
penpen

miskox
Posts: 363
Joined: 28 Jun 2010 03:46

Re: Some holiday animations (from Vt100.net)

#4 Post by miskox » 02 Nov 2020 02:32

@penpen: thanks. This works very well. Though I see some 'undefined' characters on my Win10.

Yes, original DEC Video Terminals were not that fast.

Saso

jfl
Posts: 146
Joined: 26 Oct 2012 06:40
Location: Saint Hilaire du Touvet, France
Contact:

Re: Some holiday animations (from Vt100.net)

#5 Post by jfl » 02 Nov 2020 03:04

Cute, thanks for sharing :-)

IcarusLives
Posts: 122
Joined: 17 Jan 2016 23:55

Re: Some holiday animations (from Vt100.net)

#6 Post by IcarusLives » 03 Nov 2020 22:33

I have a question for @penpen!

Why add 0 to this? :)

Code: Select all

set /a "delay=1000-%~2+0"
I was inspecting your code, but I am curious if I am missing something here?

ShadowThief
Expert
Posts: 993
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: Some holiday animations (from Vt100.net)

#7 Post by ShadowThief » 03 Nov 2020 22:54

IcarusLives wrote:
03 Nov 2020 22:33
I have a question for @penpen!

Why add 0 to this? :)

Code: Select all

set /a "delay=1000-%~2+0"
I was inspecting your code, but I am curious if I am missing something here?
I'm guessing it's to prevent syntax errors if %2 isn't provided

Post Reply