# How to play VT100 animations



## Deleted member 10519 (Oct 3, 2010)

Ok, it might be a stretch to ask this is the multimedia section...

Over at textfiles.com there are VT100 animations, which appear to be text files that can be played like primitive movies.  I've tried to view the files with `cat`, but they whiz by at unviewable speed.

Can anyone tell me how to view the animations properly?


----------



## wblock@ (Oct 3, 2010)

Download the file, and feed it to a program that delays between each character, like this (tested):

vtplayer

```
#!/usr/bin/env ruby

pausetime = 0.0005

vtfile = IO.read(ARGV[0])
$stdout.sync = true
vtfile.each_char do |char|
  print char
  sleep pausetime
end
```
`% chmod +x vtplayer`
`% ./vtplayer /tmp/bambi.vt`

You may have to adjust the *pausetime* value.


----------



## Dereckson (Oct 3, 2010)

To see the final result, just cat the file on a console, using the page code 437:
`$ cat xmas-07.vt`

To solve the prompt problem on some files (your new prompt will overwrite the last line:
`$ cat xmas-07.vt ; echo ""`

So what we need is a new slowcat command with a little sleep after some position/delete control codes.

By the way, the best results I were able to get were with PuTTY:


----------



## Dereckson (Oct 3, 2010)

Indeed, your script is nice wblock!

Do you think it would be interesting to offer a telnet server allowing to select one of those files and playing it?


----------



## wblock@ (Oct 4, 2010)

Dereckson said:
			
		

> Indeed, your script is nice wblock!
> 
> Do you think it would be interesting to offer a telnet server allowing to select one of those files and playing it?



Maybe.  Although most of these get old fairly quickly, like aalib.

It should be possible to get Firefox to use vtplayer as a "Helper Application", running it in an xterm:


```
xterm -bg black -fg green +cm -e 'vtplayer "$1"; read x'
```

For maximum realism, that's a greenscreen supporting color if the file has color sequences.  To simulate 1200 baud, pausetime should be .007 or .008.  It appears that sleep has a minimum time higher than that.

I can't recall exactly where to set this in Firefox; extensions.rdf?.


----------



## Dereckson (Oct 4, 2010)

Speed seems also to depends from the file.

sship.vt requests a 400ms sleep time (0.0000004) to play smoothly.


----------



## wblock@ (Oct 4, 2010)

Dereckson said:
			
		

> Speed seems also to depends from the file.
> 
> sship.vt requests a 400ms sleep time (0.0000004) to play smoothly.



Maybe you mean 400 microseconds?  Where did you find that?


----------



## Deleted member 10519 (Oct 4, 2010)

Cheers, wblock.  Your program worked a treat.  I found there is also a program in ports, sysutils/throttle that rate limits data passed from standard input to standard output.

`% throttle -s 1 -b 9600 <globe.vt`


----------

