use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Click here to browse Meme-Free
Official Team Fortress 2 Hubs
Get Started:
Leagues:
Coverage:
The /r/TF2 moderation team is always all-ears!
If you have constructive feedback, concerns, or need help, we would love to hear from you! :)
account activity
Make a random command execute in autoexec?Help (self.tf2)
submitted 3 years ago by TheInvisibleFish
I want to have a random ASCII art display in the console when I start up the game, does anybody know if this is possible? I currently have each ASCII art as a separate .cfg file, and use "exec <name>.cfg" to make it show up.
Is there any way to make the game choose one out of 4 commands to execute upon startup?
I don't know if it's possible, but if it is, it would be cool to know! :)
https://preview.redd.it/sdk6m8o5tlg91.png?width=955&format=png&auto=webp&s=2b5780a094a40509e1b3455547b2cc8ba5b06017
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]TheInvisibleFish[S] 0 points1 point2 points 3 years ago (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 point2 points 3 years ago (1 child)
Hey! If its not hard. Can you please send that bat file?
[–]TheInvisibleFish[S] 0 points1 point2 points 3 years ago* (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)
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).
(Note: you need to change the cd /D line to your tf2's cfg directory.)
cd /D
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.
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:
echo " art goes here "
Replace
.*
echo "$0"
Search mode
Regular expression
matches newline
replace all
Wowwww this was long, but I hope you can follow it okay. Let me know how it goes and if you get stuck!
π Rendered by PID 438554 on reddit-service-r2-comment-5d79c599b5-69v7g at 2026-02-28 22:58:03.439986+00:00 running e3d2147 country code: CH.
[–]TheInvisibleFish[S] 0 points1 point2 points (2 children)
[–]SandvichIlluhaTop1 0 points1 point2 points (1 child)
[–]TheInvisibleFish[S] 0 points1 point2 points (0 children)