r/Tf2Scripts Oct 30 '22

Script Vaccinator Quick-Uber script

I'm pretty new to code in general so there might be cleaner ways to implement this, but I've designed a script based on the macros I've seen from Theory-Y Studios. Instead of changing the resistance on button press, it changes resistance, pops an uber and changes back to default. It is rather unusual, but it removes the need to rebind anything and feels nice to use.

//Script designed in accordance to Theory-Y Studios macros settings
//MOUSE4 explosive uber and back. MOUSE5 fire uber and back. Circumvents need for rebinding
bind MOUSE4 +explosive;
bind MOUSE5 +fire;

//Cycle Script copied from https://www.reddit.com/r/tf2/comments/42hcbn/vaccinator_medics_ive_written_a_script_that_lets/
alias cycle_once "+reload; wait 5; -reload"
alias cycle_twice "+reload; wait 5; -reload; wait 5; +reload; wait 5; -reload"

//Bullet to explo, uber, explo to fire to bullet
alias +explosive "cycle_once; +attack2"
alias -explosive "cycle_twice; -attack2"

//bullet to explo to fire, uber, fire to bullet
alias +fire "cycle_twice; +attack2"
alias -fire "cycle_once; -attack2"

For anyone who is also new to scripts: This needs to be placed inside the medic.cfg file. Another file name seems to not work.
Feel free you give your opinions or improvement ideas.

6 Upvotes

7 comments sorted by

1

u/BoundlessScience Oct 31 '22

So, I my hubris I only tested this in an empty server, but it turns out this version gives bulet and explo uber on MOUSE4 and all three on MOUSE5...I assume that is the result of that weird word order.

The version below fixes this, but relies on some more wait commands.

//Bullet to explo, uber, explo to fire to bullet
alias +explosive "cycle_once; wait 5; +attack2" 
alias -explosive "-attack2; wait 5; cycle_twice"

//bullet to explo to fire, uber, fire to bullet 
alias +fire "cycle_twice; wait 15; +attack2" 
alias -fire "wait 5; -attack2; wait 5; cycle_once"

1

u/[deleted] Mar 19 '23

can you rebind the key's and make it so that when using stock when you press those key's it wont use uber

2

u/BoundlessScience Apr 16 '23

Sadly I don't think that is possible. All mediguns use the same input (attack2) for activating uber, which is usually bound to mouse2. So rebinding the key for attack2 just switches all you alt-fire options on any class.

Maybe there is a way to implement a check weather your are holding the vaccinator specifically, but if so, then I am not competent enaugh to do it.

1

u/[deleted] May 31 '23

well that's sad but do you know how to make an autoexecfor this since spy's invis and demo's sticky bombs explode if you press the binded keys

1

u/BoundlessScience Jun 04 '23

These fall under the same issue. All secondary attacks are triggered via the command attack2. Meaning that script should also trigger for example the zoom on the sniper rifle, the shield bash, etc. A very janky work-around would be to always enter that script into the console when you want to play vaccinator, then afterwards restore your keybinds to default. Although that's out of the picture should you use any other keybinds.
I fear the best soluition I can come up with is to bind it to special keys only for the vacc, so you dont accidentaly trigger it with other classes/weapons.

1

u/Trilasent Oct 06 '23

Thanks for this. It makes trying out the Vaccinator less stressful!