Skip to content

Instantly share code, notes, and snippets.

@kbrougham
Last active November 25, 2023 18:12
Show Gist options
  • Save kbrougham/7090528 to your computer and use it in GitHub Desktop.
Save kbrougham/7090528 to your computer and use it in GitHub Desktop.
Vaccinator No-Wait Specific Toggle Script
//The gist of this script is: we have three states. Bullet selected, explosive selected, and fire selected.
//When bullet is selected, we make the 'go to bullet' button do nothing, whereas the other two advance one, and update their current state.
//This way, you can continually hit a key, which will advance state, until you hit your current desired state, and it will stop advancing.
//We always start on spawn with bullet, so we set bullet blank, as to not change resist type
alias +go_to_bullet;
alias -go_to_bullet "-reload";
//Since we start on bullet, going to explosive is one use
alias +go_to_explosive "bullet_to_explosive";
alias -go_to_explosive "-reload";
//Since we start on bullet, going to fire will first require bullet_to_explosive
alias +go_to_fire "bullet_to_explosive";
alias -go_to_fire "-reload";
alias bullet_to_explosive "+reload; alias +go_to_bullet explosive_to_fire; alias +go_to_explosive; alias +go_to_fire explosive_to_fire;"
alias explosive_to_fire "+reload; alias +go_to_bullet fire_to_bullet; alias +go_to_explosive fire_to_bullet; alias +go_to_fire;"
alias fire_to_bullet "+reload; alias +go_to_bullet; alias +go_to_explosive bullet_to_explosive; alias +go_to_fire bullet_to_explosive"
//Edit these Q, E, and F keys as your desired key for go_to_type
bind Q +go_to_bullet;
bind E +go_to_explosive;
bind F +go_to_fire;
//Unfortunately, as TF2 is incapable of logic in scripting, we need a 'reset' key for each death, or we need to manually swap to bullet at the start
//of each life in order to line yourself up with the script. I use a reset key, but you may use whatever you like.
//Note, if you name this anything other than vaccinator.cfg, you will need to change the config in this line as well.
//Remove the two slashes at the start of the next line to use a reset key.
//bind Z "exec vaccinator.cfg";
@mozi-h
Copy link

mozi-h commented Aug 9, 2020

Great idea. Sadly TF2 won't allow the go_tos to be bound to the mouse wheel to make double-"clicking" easier. So default R-spamming it stays then...

@confusedshoe
Copy link

Great idea. Sadly TF2 won't allow the go_tos to be bound to the mouse wheel to make double-"clicking" easier. So default R-spamming it stays then...

Wait so this script doesn't work anymore? Can't we bind it to another key then?!

@kbrougham
Copy link
Author

No, to my knowledge the script still works on keys, it's just a quirk of how mouse wheel handles + - aliases that you can't use this with mouse wheels.

@mozi-h
Copy link

mozi-h commented Aug 24, 2020

Yeah, keys work fine, only the mouse wheel won’t.

@spacto
Copy link

spacto commented Mar 14, 2022

Great idea. Sadly TF2 won't allow the go_tos to be bound to the mouse wheel to make double-"clicking" easier. So default R-spamming it stays then...

So only Keys can be used and not mouse wheel? Like "Bind mousescroll_up" Will not work?

@kbrougham
Copy link
Author

So only Keys can be used and not mouse wheel? Like "Bind mousescroll_up" Will not work?

Unfortunately, yeah. The engine just doesn't properly trigger separate + / - events when using scroll wheel, so this script wouldn't be apply to be bound to it.

@peacefulpyro
Copy link

peacefulpyro commented Aug 21, 2022

Is this giving anyone trouble lately? Valve server and training with bots I get the same results where it jumbles after the 2nd or 3rd keypress. Z gets it back where you'd expect, but it'll jumble and do flame when selecting explosives a couple presses later. No scroll wheels or anything, just the default keys and clean tf2 bindings before applying this. Trying to get away from the old wait-based one.

@fZirus
Copy link

fZirus commented Sep 27, 2022

Is this giving anyone trouble lately? Valve server and training with bots I get the same results where it jumbles after the 2nd or 3rd keypress. Z gets it back where you'd expect, but it'll jumble and do flame when selecting explosives a couple presses later. No scroll wheels or anything, just the default keys and clean tf2 bindings before applying this. Trying to get away from the old wait-based one.

Yea I'm having the same issue, I thought my macro was pressing it too fast but mabey not if you have the same issue

@szero
Copy link

szero commented Feb 21, 2023

@peacefulpyro @fZirus Script will brake if you press the shield type switch key while vaccinator isn't deployed or you press reload key, its probably that.

@peacefulpyro
Copy link

@szero we know. it's like something you figure out within a minute of using any vac script. this is different.

@foxf4ce
Copy link

foxf4ce commented Jul 22, 2023

@szero we know. it's like something you figure out within a minute of using any vac script. this is different.

The writer of the script shows the usage in this video
Turns out that when you want to swap to a resistance that would normally be "backwards" on the resistance rotation you will need to press it twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment