Team Fortress 2

Team Fortress 2

27 ratings
> Vaccinator Easy-Switch Script (2/3 buttons) <
By Señor Maracuyá
>>> Vaccinator Easy-Switch Script (2 layouts) <<<
- Tired of having to cycle between resistance types instead of just CHOOSING the one you want?
- Tired of having to count modulo 3 in the middle of TF2 havoc?
- Then this script / guide is for YOU!
At the end of the guide you will have either a key for each resistance type, or a key to toggle between bullets and explosives and a key for fire resistance, so as to be able to enjoy this high skill cap medigun without any unnecessary overthinking. Enjoy.
   
Award
Favorite
Favorited
Unfavorite
Intro
So, if you are reading this guide, it's probably because you are sick of the one-key-only loop:

Now, with the help of this script, you will be able to have one of the two following layouts:
Autohotkey (AHK)
The script will quite often need to emulate a double reload key press, and this cannot be achieved by simple .cfg scripts when the server does not allow the wait command!
There are four ways to work around that :
  1. Not doing anything, and deciding to use this script only when the wait command is unlocked/available. In that case you will have to uncomment (remove the pair of initial slashes at) the 3 binds at the beginning of the cfg, and won't be needing AutoHotkey.
  2. Getting used to always double pressing the buttons between resistance types[gist.github.com]
  3. Using Kered13's Workaround
  4. Using AutoHotkey (http://www.autohotkey.com/) : be warned it is a third-party program, so Valve could in theory ban you for that (and I take no responsibility in it, use this script at your own risk), but if you search a bit at the Steam forums, you'll find that AHK is not flagged as a cheat by Valve, something coherent with the fact AHK gives no advantage compared to a fully stuffed keyboard for instance (keyboards with macros in it).
    TL,DR : it's a program you need to download and install, without any fear / worry whatsoever 'cause you should not be VAC-banned for using this VAC-script (lol).
Installation
  1. Download either the 3-keys layout script[pastebin.com] or the old 2-keys layout script[pastebin.com] and rename the file as "medic.cfg"
    (make sure the file type switches from TXT FILE to CFG. If Windows is hiding the extension, either unhide it (Google), or copy/paste the raw text into Notepad and save the file as medic.cfg after having chosen All file types (*.*)).

  2. Place it inside (C:\Program Files (x86)\) Steam\SteamApps\common\Team Fortress 2\tf\cfg\ folder

  3. Download and install AutoHotkey (http://www.autohotkey.com/)

  4. Do the same with the following file (3-keys layout[pastebin.com] || old 2-keys layout[pastebin.com]) and the .ahk extension (you can name it however you like, as long as it has the right extension, and place it wherever you like it, too : for instance, the desktop, where you can find it easily and quickly).

  5. Enable auto-reload in TF2, as your reload key won't be working anymore. Manually reloading in this game is the most idiotic thing to do, as you lose nothing with automatic reloading on (in TF2, the reload is instantly interrupted when a shot is fired). For the Eureka users, I recommend using an Eureka script : it can save a full second for each teleportation.

What the AutoHotkey script does is adding to the R,F,C keys a second key press, of the 'Numpad 5' key (the one that does nothing when typing). The AHK script being quite self-explanatory you should be able to tweak it to your needs, as long as you adapt the bindings from the initials lines of the medic.cfg file accordingly. Check here the key names list from AutoHotkey[ahkscript.org].

Remember you can pause the hotkeys at the icon tray.
Usage
  1. Double click the .ahk file. The AutoHotkey green icon should appear at the system tray (bottom-right icons). There is a white 'H' on it when the script is working, and a white 'S' when the hotkeys are suspended (in which case obviously the script won't be working)

  2. Equip the Vaccinator and pick Medic (the order does not matter).

  3. Important : whenever you respawn, you have to press the 'Numpad 8' key (Numpad 5 if using the old 2-keys layout) to reset the script's vaccinator state to bullets (sadly it cannot be done automatically). If you'd like to use another key for that, change the reset_vaccinator binding at the beginning of the medic.cfg file.

  4. Enjoy.
If Pastebin doesn't work
Here is the raw code too.
  • 3-keys layout :
    bind r +explosives_key bind f +fire_key bind c +bullets_key bind KP_UPARROW reset_vaccinator // Press the "KP_8" key when respawning (bullets sync) /////// AutoHotkey equivalent // Uncomment if not using AutoHotkey // //bind r "+explosives_key;wait 4;-explosives_key;wait 30;+special;wait 4;-special" //bind f "+fire_key;wait 4;-fire_key;wait 30;+special;wait 4;-special" //bind c "+bullets_key;wait 4;-bullets_key;wait 30;+special;wait 4;-special" // /////// //// Uncomment the following lines if you tend to press the reload button //// when the syringe gun or the melee is dropped even if it CHANGES NOTHING //// (even better : place those lines in a file called autoexec.cfg) // //bind 1 slott1 //bind 2 slott2 //bind 3 slott3 //alias slott1 "slot1; alias +explosives_key +reload" //alias slott2 "slot2; alias +explosives_key explosives_key_down" //alias slott3 "slot3; alias +explosives_key +reload" // ///// ///// ====== \\\\\ M A I N --- S C R I P T ///// ====== \\\\\ bind KP_5 +special alias +explosives_key explosives_key_down alias -explosives_key -reload alias +bullets_key bullets_key_down alias -bullets_key -reload alias +fire_key fire_key_down alias -fire_key -reload alias -special -reload alias reset_vaccinator "set_bullets; print_reset" /// Some output text about current script state developer 1 con_filter_enable 1 alias print_bullets "con_filter_text Bullets; wait 3; echo Bullets" alias print_fire "con_filter_text Fire; wait 3; echo Fire" alias print_explosives "con_filter_text Explosives; wait 3; echo Explosives" alias print_reset "con_filter_text Reset_to_Bullets; wait 3; echo Reset_to_Bullets" /// Magic happens at the following lines alias goto_bullets "+reload; set_bullets" alias goto_bullets_toexplosives "+reload; set_bullets; alias +special pgoto_explosives" alias goto_fire "+reload; set_fire" alias goto_fire_tobullets "+reload; set_fire; alias +special pgoto_bullets" alias goto_explosives "+reload; set_explosives" alias goto_explosives_tofire "+reload; set_explosives; alias +special pgoto_fire" alias pgoto_bullets "print_bullets; goto_bullets" alias pgoto_fire "print_fire; goto_fire" alias pgoto_explosives "print_explosives; goto_explosives" alias set_bullets "alias +special set_bullets; alias bullets_key_down set_bullets; alias fire_key_down goto_explosives_tofire; alias explosives_key_down pgoto_explosives" alias set_explosives "alias +special set_explosives; alias explosives_key_down set_explosives; alias fire_key_down pgoto_fire; alias bullets_key_down goto_fire_tobullets" alias set_fire "alias +special set_fire;;alias fire_key_down set_fire; alias explosives_key_down goto_bullets_toexplosives; alias bullets_key_down pgoto_bullets" /// Start with bullets resistance reset_vaccinator

  • 2-keys layout :
    /////// AutoHotkey equivalent // Uncomment if not using AutoHotkey // bind r "+explosives_key;wait 4;-explosives_key;wait 30;+explosives_key;wait 4;-explosives_key" // bind f "+fire_key;wait 4;-fire_key;wait 30;+fire_key;wait 4;-fire_key" ////Uncomment the following lines if you tend to press the reload button ////when the syringe gun or the melee is dropped even if it CHANGES NOTHING //bind 1 slott1 //bind 2 slott2 //bind 3 slott3 //alias slott1 "slot1; alias +explosives_key +reload" //alias slott2 "slot2; alias +explosives_key explosives_key_down" //alias slott3 "slot3; alias +explosives_key +reload" bind KP_PGUP +explosives_key bind KP_UPARROW +fire_key bind KP_5 reset_vaccinator alias +explosives_key explosives_key_down alias -explosives_key -reload alias +fire_key fire_key_down alias -fire_key -reload alias reset_vaccinator set_bullets alias goto_set_bullets "+reload; set_bullets" alias goto_set_fire "+reload; set_fire" alias goto_set_explosives "+reload; set_explosives" alias goto_tmp_bullets "+reload; tmp_bullets" alias goto_tmp_fire "+reload; tmp_fire" alias goto_tmp_explosives "+reload; tmp_explosives" //Some output text about current state (for the script) developer 1 con_filter_enable 1 alias print_bullets "con_filter_text Bullets; wait 3; echo Bullets" alias print_fire "con_filter_text Fire; wait 3; echo Fire" alias print_explosives "con_filter_text Explosives; wait 3; echo Explosives" alias set_bullets "print_bullets; alias fire_key_down goto_tmp_explosives; alias explosives_key_down goto_tmp_explosives" alias tmp_bullets "alias fire_key_down set_bullets; alias explosives_key_down set_bullets" alias set_explosives "print_explosives; alias fire_key_down goto_tmp_fire; alias explosives_key_down goto_tmp_fire" alias tmp_explosives "alias fire_key_down goto_set_fire; alias explosives_key_down set_explosives" alias set_fire "print_fire; alias fire_key_down goto_tmp_bullets; alias explosives_key_down goto_tmp_bullets" alias tmp_fire "alias fire_key_down set_fire; alias explosives_key_down goto_set_bullets" //start with bullets resistance set_bullets

  • AutoHotkey:
    • (3-keys layout)
      $r:: send {r down} sleep 35 send {r up} random,sleeptime,54,69 sleep %sleeptime% send {NumpadClear down} sleep 35 send {NumpadClear up} sleep %sleeptime% return $f:: send {f down} sleep 35 send {f up} random,sleeptime,54,69 sleep %sleeptime% send {NumpadClear down} sleep 35 send {NumpadClear up} sleep %sleeptime% return $c:: send {c down} sleep 35 send {c up} random,sleeptime,54,69 sleep %sleeptime% send {NumpadClear down} sleep 35 send {NumpadClear up} sleep %sleeptime% return
    • (old 2-keys layout)
      r:: send {Numpad9 down} sleep 35 send {Numpad9 up} random,sleeptime,54,69 sleep %sleeptime% send {Numpad9 down} sleep 35 send {Numpad9 up} sleep %sleeptime% return f:: send {Numpad8 down} sleep 35 send {Numpad8 up} random,sleeptime,54,69 sleep %sleeptime% send {Numpad8 down} sleep 35 send {Numpad8 up} sleep %sleeptime% return
Uninstall
  • Right click the Autohotkey icon tray (if it's still running) and click exit to stop it.

  • Delete all the text inside the medic.cfg file, and replace it with the following 3 lines :
    bind r +reload binc c voice_menu_3
22 Comments
Daddy Bobo 31 May @ 11:16am 
does this still work?
Kookoorooza 27 Aug, 2023 @ 4:25am 
Bruh, dude, its just looks ugly asf

"Enable auto-reload in TF2, as your reload key won't be working anymore. Manually reloading in this game is the most idiotic thing to do, as you lose nothing with automatic reloading on (in TF2, the reload is instantly interrupted when a shot is fired)"
Edwyn Yusef Lateef Al-Qayyim 18 Jan, 2023 @ 5:56pm 
I didn't understand what i'm supossed to do with the AutoHotKey thing
32 Hairless Frogs from Idaho 27 Jul, 2022 @ 6:28pm 
Is there a way to bind mouse 4 and 5 to this script?
Medic BF 6 Jul, 2021 @ 2:01pm 
@Darth Serious Thank you for the help! I appreciate it :)
Señor Maracuyá  [author] 6 Jul, 2021 @ 12:55pm 
@Medic BF (https://gtm.steamproxy.vip/profiles/76561198197422098) I haven't tested this script in while, but changing the key bindings ought to be easy enough not to need testing from me: you'd have to change the r:: and f:: in that AutoHotkey script file with e:: and r:: respectively.

Regarding the delays, you can try tweaking down the numbers after the `sleep` commands.

To summarize both things, the new script file would start with something like:


e::
........send {Numpad9 down}
........sleep 10
........send {Numpad9 up}
........random,sleeptime,15,24

Getting the timings right may require some tweaking, since if they're too fast the game may ignore the new input. Hope it helps
Medic BF 10 Jun, 2021 @ 9:24am 
I know this is an old guide, but I have two questions.

First, how low can I lower the sleep command (which influences how long it takes to switch from one resistance to another)? Right now, its much slower then how fast I could physically press it, which isn't as useful to me.

Secondly, how do I change the old 2 button script so that I can use the "e" key for bullet/explosive, and "r" for fire?

Thank you so much in advance!
SloppySloth 3 Aug, 2019 @ 4:30pm 
Hey I know this comment section is old but whenever I use this script I see a line of text along the top right of my screen and its really annoying.Any way to remove it?
pepe 20 Sep, 2018 @ 2:38pm 
''be warned it is a third-party program, so Valve could in theory ban you for that''
bye
Señor Maracuyá  [author] 4 May, 2018 @ 3:07pm 
Yeah, I suppose so too. They most probably fine tuned the switching functionnalities and more commands should be used for the script to work :/