Console In PluginPosted on: March 15th, 2010 by cmptrwz
I got tired of having to find odd places on my keyboard to assign G-Keys to on my Logitech keyboard in TF2.
I wanted to be able to bind my G-Keys to build and destroy buildings and to specific disguises.
So I wrote a simple plugin (see link below) to enable that. Extracted to the tf folder, normally found in
<steam install dir>\steamapps\<username>\team fortress 2
it will create a “Named Pipe” whenever the game is running. Dumping commands into this pipe will run them as though you typed them into the console directly.
This will ONLY work when you are actually in a game. It will not work in menus, or after being disconnected. It is also one way, console output and command output from the commands you run are not fed back the other way. There is also, due to the way it is coded, a built-in rate limit of sorts.
The named pipe is \\.\pipe\SourceConsole and, for me, I use a program that allows me to run cmd.exe invisibly. I then pass it parameters like so:
cmd.exe /C echo "build 1" > \\.\pipe\SourceConsole
The entire command line (entered into the G-series Key Profiler via “Assign Shortcut”) actually ends up including the program I use, but this is enough for now. What this will do, when bound to a key, is tell TF2 to build a teleporter entrance, as though you typed “build 1″ into the game console or had it bound to a key normally.
This plugin is written in a very simplistic manner, and a number of things can prevent it from working properly. A major thing being something grabbing onto the named pipe and not wanting to release control. It works for me, and as people were asking me about it, I am posting it here.
And for the record, it will NOT allow you to do things that you can’t do by typing into the console already. I will not make it do anything like that either.
To get the plugin, click here: