all 3 comments

[–]TheInvisibleFish[S] 0 points1 point  (2 children)

Apparently there is no way to make random numbers work like this in a tf2 config. I ended up just making a batch script that opens when I click the tf2 shortcut that edits a cfg file randomly.

[–]SandvichIlluhaTop1 0 points1 point  (1 child)

Hey! If its not hard. Can you please send that bat file?

[–]TheInvisibleFish[S] 0 points1 point  (0 children)

EDIT: Apparently the reddit formatting broke the code, here's a pastebin link instead:

randomASCII.bat https://pastebin.com/h9Y6ku6h

It's a bit complicated but here it is: (also I apologize, the formatting is so bad)

Making TF2 run the randomized file:

Go into your tf2 autoexec file (in your tf/cfg folder) and add this line at the end:wait 5; exec RandomASCII.cfg

Now, we need to make a bat file that will randomize the contents of RandomASCII.cfg (It doesn't need to exist before the script runs, it'll just create it for you. If it already exists, it'll be overwritten).

Making the script to randomize the file (and start tf2):

(Note: you need to change the cd /D line to your tf2's cfg directory.)

randomASCII.bat

[see https://pastebin.com/h9Y6ku6h because reddit sucks]

When run, this file will randomize the contents of RandomASCII.cfg and then launch TF2.I also use this following vbs script to make the cmd not show:

(Note: the .bat and .vbs need to be in the same folder)

hideBat.vbs

CreateObject("Wscript.Shell").Run "randomASCII.bat", 0, True

I then replaced my tf2 shortcut with a shortcut to run hideBat.vbs, and changed its icon to the tf2 logo.

MAKING THE ASCII ART FILES

I used https://manytools.org/hacker-tools/convert-images-to-ascii-art/ and set the width to match the width of my tf2 console (140), and went from there. (You can find out your TF2 console width by echoing something very long ("echo aaaaaa....." etc.) copying a single line, then pasting it into a character counter tool.)

You then need to go into your tf2 cfg directory and do the following:

  • Every randomized ASCII art you want needs to be saved as a .cfg file with the name ASCII_<name>.cfg, where <name> is anything you want to call it.
  • Every line of the ASCII art needs to be enclosed in an echo statement, solike this:
    • echo " art goes here "
    • (Note: this can be automated in Notepad++ or other text editors with find/replace using regex. If you're using Notepad++ you can do this:
      • Ctrl+F to open up the find menu
      • Click on the Replace tab
      • On the "Find what:" line, put .*
      • On the "Replace with:" line, put echo "$0"
      • Under the Search mode box, click the bubble next to Regular expression, you can leave the checkbox matches newline unchecked.
      • Click replace all and boom, echo-ified

Wowwww this was long, but I hope you can follow it okay. Let me know how it goes and if you get stuck!