r/Tf2Scripts • u/tmobley03 • Aug 06 '23
Script A wait-less, spam-less, Vaccinator quick-switch script for Medic
/r/tf2/comments/15jfl3m/an_all_new_waitless_spamless_vaccinator/
8
Upvotes
r/Tf2Scripts • u/tmobley03 • Aug 06 '23
2
u/Link_x2 Sep 28 '23
This is really impressive, i had no idea about the "+reload 1; -reload 1" mechanic. is there anywhere I can read to see exactly how this keycode thing works?
1
u/bythepowerofscience May 16 '25 edited May 16 '25
Can't believe no one told me about this. You've outplayed me.
Well done.
1
u/Skaib1 Aug 08 '23
This is really nice! I have to concede that I am part of the problem and once wrote such a script containing wait. I didn't know you could cheat +reload and -reload into a single alias and actually have it work. In fact, I remember trying and it didn't work.
Am I right in remembering that replacing all the "moveone" commands with "+reload; -reload" would break the script?
Does it only work when defining a separate "moveone" alias? Or is the crucial point to use +reload 1 instead of +reload? I would try it myself but I don't have tf2 installed at the moment ^^. Thanks!
1
u/bythepowerofscience May 08 '26 edited May 08 '26
Here's an easier-to-understand version for anyone trying to learn how this script works.
The problem that was being solved with wait is that no bind can have its
+and-called more than once on a single button press without it. For example, you can't dobind 1 "+reload; -reload; +reload; -reload"and expect it to reload twice.For the script itself, it's pretty clever: the core idea is that since there are only 3 resistances, we only have to move a maximum of two times to get to any other resistance. Since pressing and releasing a key are two different actions, we just need to wire the presses and releases differently on each bind to change to any resistance.
If we only want to move once, we make it so pressing the key moves and releasing it doesn't. If we want to move twice, pressing the key moves it once and then releasing the key moves it again.
(NOTE:
"alias <name>;"makes that alias do nothing when executed. You're aliasing it to an empty command, basically.)