Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

Auto Spy Disguise Weapon Switcher

A Config Script for Team Fortress 2

Members see zero ads. Membership is 100% free
36 944 bytes Raw Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
echo "spy.cfg running..."

alias none ""
alias disguisecheck "none"

alias wepslot4 "slot4; alias disguisecheck lastdisguise"

alias +disguisedattack "alias disguisecheck none; +attack;"
alias -disguisedattack "-attack;"

alias +dattack "+attack;"
alias -dattack "-attack;"

alias scrup "wepslot2"
alias scrdown "wepslot1"


alias wepslot1 "slot1; disguisecheck; alias +dattack +disguisedattack; alias scrup wepslot3; alias scrdown wepslot2;"

alias wepslot2 "slot2; disguisecheck; alias +dattack +attack; alias scrup wepslot1; alias scrdown wepslot3;"

alias wepslot3 "slot3; disguisecheck; alias +dattack +disguisedattack; alias scrup wepslot2; alias scrdown wepslot1;"

alias wepslot5 "disguisecheck none"

bind "1" "wepslot1"
bind "2" "wepslot2"
bind "3" "wepslot3"    
bind "4" "wepslot4"
bind "5" "wepslot5"

bind "MOUSE1" "+dattack"
bind "MWHEELUP" "scrdown"
bind "MWHEELDOWN" "scrup"

echo "spy.cfg ran!"

A quality of life script for the TF2 Spy

Splight Of Hand

A quality of life script for the Spy


This script allows you to change your disguise's weapon at the same time as you do. This means you can make your disguise switch weapon much, much faster than would ever be possible otherwise.
What's more - It's completely automatic*! It activates itself whenever you disguise, and deactivates when you lose that disguise.
This will give you a bit more believability when trying to blend in with the enemy team!

Installation:

This config is designed to be put in your spy.cfg file, located at \Steam\steamapps\common\Team Fortress 2\tf\cfg
You can either paste my code in to your spy.cfg file, or you can download my well commented file and put simply put it in the above directory.

Bindings:

I had to bind actions to certain keys, so if you use custom bindings, you'll need to change the following:

1 = Revolver
2 = Sapper
3 = Knife
4 = Disguise kit
mouse1 = Attack
mwheelup = Go "Up" in the weapon list. From top to bottom: Primary > Melee > Secondary > Primary > Melee...
mwheeldown = The opposite of the above command.

"5" sets "disguisecheck" to "false" until you hold the disguise kit again. This basically turns off the automated weapon switching until then.
This binding should be used after each death to ensure disguisecheck isn't still set to true. If it is, the first time you switch your weapon in your next life, you'll also disguise, which you might not want to do, but it shouldn't be that bad.

Here's a complementary video that demonstrates the script in action, and explains my reasoning behind making this:


Lastly, I highly encourage you to download the source file instead of just copying and pasting the script code.
My source file is full of comments, explanations, and other nice things I removed from the script above to condense it down. It can be found here, or in the description of the video.

Limitations:

*By automatic I mean it requires no set up besides putting the code in. As mentioned above, you should try to get in to the habit of pressing "5" after you die, just to be safe.

I did try to code in support for quick switching (q by default), however after many hours and anomalous errors, I couldn't find a solution right now.
Quick switching will still work, but if you do it between your sapper and something else, it might cause something unexpected.
I do intend to update this in the future to add support, however I cannot estimate how long that may take.

You should make a reset.cfg file! As far as I know this shouldn't impact other classes, but it's a good idea to clear up all of my weird bindings and the like in case they end up conflicting with something else.
A reset.cfg file runs every time you change class, before your class.cfg file runs. This is mostly use to reset bindings back to what you had prior to playing that class. If you don't know what to put in your reset.cfg, you can likely just place exec config.cfg in your reset.cfg.

Scroll wheel currently does not scroll past the disguise kit. Frankly I just completely forgot to add this, but it'll be added soon enough.

Quack <3

Comments

Sign up to access this!

No comments yet

Embed

menu
Share banner
Image URL
HTML embed code
BB embed code
Markdown embed code

Credits

Author
CrunchyDuck
CrunchyDuck Joined 24d ago
Offline
Everything :)

Submitter

CrunchyDuck avatar
CrunchyDuck Joined 24d ago
Offline
CrunchyDuck
Creator
Sign up to access this!
Sign up to access this!
Sign up to access this!

Game

Sign up to access this!

Category

License

menu

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • favorite 1
  • remove_red_eye 549
  • access_time 24d
  • access_time 24d

More Action Scripts Scripts