Sniper scripts

From TF2 Wiki

Share/Save/Bookmark
Jump to: navigation, search
Community script navigation
General scripts
Weapon scripts
General class scripts
Collection scripts
Class scripts
Scout scripts
Soldier scripts
Pyro scripts
Engineer scripts
Heavy scripts
Demoman scripts
Medic scripts
Sniper scripts
Spy scripts


Contents

Quick Jarate Switch

Quickly Switch to Jarate and back to Previously selected item. By Beaker Bongload.

alias +jarate "slot2;+attack;wait 25"
alias -jarate "-attack;lastinv"
bind q "+jarate"

Quick Scope and Shot

This scripts works well on 100 fps (use "max_fps 100")
bind mouse3 "+qz;"
alias +qz "+attack2; wait 33; -attack2; +attack; wait 3; -attack;"

Disable Crosshair While Scoped

This script will simply disable your crosshair while scoped.
Made By CupOfTea - --By (µÞ{}fT¡34¡™ 20:27, 10 February 2009 (UTC)
//Disable Crosshair By CupOfTea
alias "+zoom" "+attack 2; crosshair 0"
alias "-zoom" "-attack 2; crosshair 1"
alias "+shoot" "+attack 1; crosshair 1"
alias "-shoot" "-attack 1"
alias "+inair" "+jump, crosshair 1"
alias "-inair" "-jump"
bind "mouse 1" "+shoot" // Your Primary fire key
bind "mouse2" "+zoom" // Your Secondary fire key
bind "space" "+inair" // Your Jump key
NOTE - The crosshair 0 command does not work for the crosshairs you can choose in options->multiplayer. I'll try to fix this. Need to find the command first.

Disable Custom Crosshair While Scoped

Similar to the above script, this script will remove custom crosshairs while scoped. There are two different versions, one for auto-rezoom enabled, the other disabled.
IMPORTANT, BEFORE USE: Take note of your cl_crosshair_scale value and replace the 21.51 with that value.
Made By Wofiel 7:39, 16 September 2009 (UTC)
With auto-rezoom enabled:
bind mouse2 +scope1  //YOUR SCOPE(SECONDARY FIRE) BUTTON
bind space +inair  //YOUR JUMP BUTTON
alias oldval "cl_crosshair_scale 21.51" //EDIT THIS VALUE TO YOUR CURRENT ONE

alias +scope1 "+scoperem"
alias -scope1 "-scoperem"
alias +scoperem "+attack2;cl_crosshair_scale 0"
alias -scoperem "-attack2; alias +scope1 +crossb; alias -scope1 -crossb"
alias +crossb "+attack2;oldval"
alias -crossb "-attack2;alias +scope1 +scoperem; alias -scope1 -scoperem"
alias "+inair" "+jump; oldval"
alias "-inair" "-jump; alias +scope1 +scoperem; alias -scope1 -scoperem"

With auto-rezoom disabled:
bind mouse2 +scope1  //YOUR SCOPE(SECONDARY FIRE) BUTTON
bind mouse1 +scatk  //YOUR SHOOT(PRIMARY FIRE) BUTTON
bind space +inair  //YOUR JUMP BUTTON
alias oldval "cl_crosshair_scale 21.51" //EDIT THIS VALUE TO YOUR CURRENT ONE

alias +scope1 "+scoperem"
alias -scope1 "-scoperem"
alias +scoperem "+attack2;cl_crosshair_scale 0"
alias -scoperem "-attack2; alias +scope1 +crossb; alias -scope1 -crossb; alias +scatk +etk; alias -scatk -etk"
alias +crossb "+attack2;oldval"
alias -crossb "-attack2;alias +scope1 +scoperem; alias -scope1 -scoperem"
alias +etk "+attack;oldval"
alias -etk "-attack;alias +scope1 +scoperem; alias -scope1 -scoperem; alias +scatk +attack; alias -scatk -attack"
alias +inair "+jump; oldval"
alias -inair "-jump; alias +scope1 +scoperem; alias -scope1 -scoperem"

Change sensitivity while scoped

This script will change the mouse sensitivity only when you are scoped. There are obvious benefits to this... you can have a high sensitivity when with secondary weapons, and a slower more accurate rifle while scoped.

Change 1.4 and 4.5 in the sensitivity area to whatever you want. 1.4 is the sensitivity I like when scoped, and 4.5 is the sensitivity the rest of the time.

-aim                                                 // This resets the sensitivity.

alias "aim"    "+aim"
alias "+aim"   "sensitivity 1.4; alias aim -aim"     // Sensitivity when scoped.
alias "-aim"   "sensitivity 4.5; alias aim +aim"     // Sensitivity when non-scoped.

bind  "space"  "+jump; -aim"                         // If the sensitivity messes up, hit SPACE.
bind  "mouse2" "aim; +attack2; wait 40; -attack2"    // You can change mouse2 to whatever you use for scoping.

Alternately, use the cvar: zoom_sensitivity_ratio "#" where # is the multiple of your regular sensitivity you want.

For example: 4.5 normal and 1.4 zoomed = 0.311 (1.4/4.5) so: zoom_sensitivity_ratio "0.311"

Improved Changed sensitivity while scoped

Changes the sensitivity when you are scoped, and changes it back when you unscope.
Improved part: Hitting left click while with your kukri or your SMG will not toggle the sensitivity change.
Made by sloppy_joes
-aim    

alias "aim"    "+aim"
alias "+aim"   "sensitivity 2.5; alias aim -aim"   //Scoped sensitivity
alias "-aim"   "sensitivity 6.5; alias aim +aim"   //Regular sensitivity

bind "space"  "+jump; -aim"         //Change space to your jump button. Resets the sensitivity.

bind 1 "slot1; enablescope"
bind 2 "slot2; disablescope; -aim"  //The -aim is incase you are like me, take a shot, then quickly switch weapons without rescoping
bind 3 "slot3; disablescope; -aim"  //doing this would leave you at the lower sensitivity.
bind mouse2 scoped 
                      
alias enablescope "bind mouse2 scoped"
alias scoped "+attack2; aim; wait 20; -attack2" //Change the 20 to something higher if you quickly zoom in and out when you scope.
alias disablescope "bind mouse2 +attack2"
Space makes you jump and resets your sensitivity back to normal. Hitting 2 or 3 will also reset the sensitivity.
This is my first script, I have tested it, however you may need to change a few things to make it right for you.

Sensitivity scripts are a waste (the above 2)

Changes the sensitivity when you are scoped.
   
zoom_sensitivity_ratio "1.0"  //is the default modify at will
 
I don't know if the 2 scripts above mine were written during a time and this command didn't exist but was added later or if the writers, like me, were wasting their time trying to ice skate uphill.

TFC Sniper Style

Posted by Hitman101
//OLD SKOOL TFC SNIPER STYLE
alias +tfcsniper "+attack2; wait 25; -attack2"
alias -tfcsniper "+attack; wait 100; -attack; +attack2; wait 25; -attack2"
bind mouse1 +tfcsniper

TFC Sniper w/ Toggle

Another script posted by me but not created by me, found on a message board somewhere that I cannot find again. Props to whomever made it. It allows you to turn the Sniper script on and off by selecting the rifle, but when you switch away from it, normal firing resumes. Excellent for being able to use your other weapons without reloading scripts.
Posted by Shifty54

//Sniper Toggle
//=============
alias sniperToggle "sniper1"
alias sniper1 "use tf_weapon_sniperrifle; bind mouse1 +sniperstyle; alias sniperToggle sniper2; dev1; echo Release Firing: ON; wait 100; dev0; " 
alias sniper2 "bind mouse1 +attack; alias sniperToggle sniper1; dev1; echo Release Firing: OFF; wait 100; dev0; "
alias +sniperstyle "+attack2; wait 25; -attack2"
alias -sniperstyle "+attack; wait 100; -attack; +attack2; wait 25; -attack2"
alias smg "-attack; sniper2; use tf_weapon_smg"
alias blade "-attack; sniper2; use tf_weapon_club"

//Sniper Toggle Key Binding:
bind "1" snipertoggle
bind "2" smg
bind "3" blade

Sniper Quick Submachine Gun

Tap the +toggle_sec button to switch to Submachine gun and immediately back to Sniper Rifle, which accomplishes the "quick out of scope" behavior from scripts above. When you want to use the Submachine gun, just hold down +toggle_sec and start firing; release to return to Sniper Rifle. Binding listed below works for this assuming you can hold your thumb on SPACE while you move around.
NOTE: As of December 31st, 2007's patch, "quick scoping" is no longer possible. This script is now only useful in switching to and from the Submachine Gun and has no other advantages. All other scripts that were made to "quick scope" have been removed from the page.
Posted by Essobie
// Sniper Quick Submachine Gun
// ===========================
alias +toggle_sec "use tf_weapon_smg"
alias -toggle_sec "use tf_weapon_sniperrifle"
bind SHIFT +toggle_sec // Hold to use Submachine Gun. Release to go back to Sniper Rifle.


Zoom On Hold

Hold down the zoom button to zoom in, and release the button to zoom out.

Tap the zoom button, and you will zoom in as normal. You may want to change the bind. A script for those who prefer a more responsive zoom.

Posted by Shazam!
// Zoom On Hold
// ===========================
Alias "+scope" "+attack2; wait 5; -attack2"
alias "-scope" "+attack2; wait 5; -attack2"

bind "MOUSE5" "+scope"

Sensitivity Change on hold

Hold down the bound key to change your sensitivity to a set number, and release the key to reset it to another.

A script meant to make long distance sniping easier. Works alright with the Spy's revolver, too.

Posted by Shazam!
//Sensivity Adjustment On hold function.
alias "+sensetoggle" "sensitivity 7.5";
alias "-sensetoggle" "sensitivity 9.55";
bind "\" "+sensetoggle";

Holek's Biggy Script

My script follows the Shazam's scripts, but unlike his Sniper script, mine works also with Huntsman.

Before you use this script, I recommend you create a clear.cfg file in your script folder. Putting the line "exec clear.cfg" at the beginning of your scripts once you have done this helps prevent multiple commands binding to one key, and thus helps prevent errors. Here is my clear.cfg script, which will work great with all of my scripts. (Yes, I'm that lame to just copy/pase Shazam's clear.cfg instuctions).

// clear.cfg // resets the binds my scripts use to default in between class changes // Put the line clear.cfg in the beginning of a script to execute as a subscript

sensitivity 10 
-attack
-reload
-attack2
-rs

unbind "MOUSE1"unbind "MOUSE2"unbind "MOUSE3"
unbind "MOUSE4" unbind "MOUSE5" unbind "q" 
unbind "1"unbind "2" unbind "3" 
unbind "4" unbind "5" unbind "6" 
unbind "7"unbind "8" unbind "9"
unbind "w"unbind "a"unbind "s"
unbind "d"unbind "ctrl"

bind "MOUSE1" "+attack"bind "MOUSE2" "+attack2"
bind "q" "lastinv"bind "1" "Slot1"
bind "2" "Slot2"bind "3" "slot3"
bind "4" "Slot4"bind "5" "slot5"
bind "6" "slot6"bind "7" "slot7"
bind "8" "slot8"bind "9" "slot9"
bind "w" "+forward"bind "a" "+moveleft"
bind "s" "+back"Bind "d" "+moveright"
bind "ctrl" "+duck"
bind "space" "+jump"

So, again. My script works also with Huntsman. Just like Shazam's mouse, mine also has 5 buttons, so you'll have to change the MOUSE5 binding to whatever you like as a scoping button. This script uses much of Shazam's Scout script and the Improved Changed sensitivity while scoped above.

This script gives you ability to change sensitivity of mouse while scoped. At the start it is disabled, because you may use Huntsman. Be advised that this firemode (with sensitivity changing) works only on Sniper rifle. The other firemode (without sensitivity changing) works great on Sniper rifle and the Huntsman. Also if you are equipped with Sniper rifle, you can change firemodes as you wish, whether you like auto-sensitivity or not.

Also my script gives you similar voice commands at 1-5 as Shazam's.

Manual:

  • Mouse1 (left click) - fire
  • Mouse2 (right click) - kukri
  • Mouse3 (middle click) - weapon firemode change
  • Mouse5 (additional button) - scoping, stopping arrow (change as you wish if you don't have additional buttons in your mouse)
Posted by Hołek
Patch: aiming didn't work very good. Now if you'll have any problems with sensitivity, one simple shot should take care of it.

//Reduces Errors
developer 1; echo Sniper Script Loaded.; Wait 200;developer 0
exec clear.cfg
Unbind "1"
Unbind "2"
Unbind "3"
Unbind "4"
Unbind "5"
Unbind "q"

//Firemodes for Primary
///Sniper rifle
alias "aim"    "+aim"
alias "+aim"   "sensitivity 3; alias aim -aim"   //Scoped sensitivity
alias "-aim"   "sensitivity 10; alias aim +aim"   //Regular sensitivity

bind "space"  "+jump; -aim"         //Change space to your jump button. Resets the sensitivity.

alias scoped "+attack2; aim; wait 20; -attack2" //Change the 20 to something higher if you quickly zoom in and out when you scope.

alias +primary1 "bind mouse5 scoped;alias aim +aim;sensitivity 10;slot1;+attack"
alias -primary1 "-attack;"

///Huntsman
alias +primary2 "slot1; bind mouse5 +attack2;+attack"
alias -primary2 "-attack;"


//Kukri
alias +melee "sensitivity 10;slot3;unbind mouse5;+attack"
alias -melee "-attack;primaryfiremode;Developer 0"
Bind mouse2 +melee


//Scroll Wheel binds
alias "Hunttoggle" "sensitivity 10;slot1; bind mouse1 +primary2;bind mouse5 +attack2"
alias "standardtoggle" "slot1; bind mouse1 +primary1;bind mouse5 scoped;"
alias "secondarytoggle" "slot2; sensitivity 9; bind mouse1 +attack;bind mouse5 +reload"
bind mwheelup standardtoggle
bind mwheeldown secondarytoggle

//Toggle firemodes
alias "PrimaryFireMode"
alias "Unlock" "bind mouse1 +primary2;bind mouse5 +attack2;  bind mwheelup Hunttoggle; bind mouse3 standard;developer 1; echo Huntsman/no sensitivity changing firemode engaged.; Wait 200;developer 0; alias primaryfiremode unlock"
alias "Standard" "bind mouse1 +primary1;bind mouse5 scoped;bind mwheelup standardtoggle; bind mouse3 unlock;developer 1; echo Sniper rifle firemode engaged.; Wait 200;developer 0; alias primaryfiremode standard"
bind mouse3 unlock
unlock

//voicemenu shortcuts
alias "spy" "voicemenu 1 1"
alias "sentryahead" "voicemenu 1 2"
alias "incoming" "voicemenu 1 0"
alias "uberme" "voicemenu 1 6"
alias "thanks" "voicemenu 0 1"
alias "go" "voicemenu 0 2"
//binds
bind 1 sentryahead
bind 2 spy
bind 3 incoming
bind 4 go
bind 5 uberme
bind 6 thanks


Personal tools