Upvote Upvoted 6 Downvote Downvoted
Advanced Mouse-Button weapon switcher
posted in Customization
1
#1
0 Frags +

I created a script that allows you to switch to, and fire either your primary, secondary, or melee weapon using solely your left-click, right-click, or scroll-wheel-click respectively.

It's different from existing scripts, I swear. I'll try and explain it as best I can in this post.

By pressing and holding any of these buttons, the appropriate weapon will be switched to, and will start firing while the button is held. Briefly tapping the button corresponding to a weapon other than the one that is currently out will switch your weapon without firing.

What makes this script so EPIC! and ADVANCED!??

Unlike other simple weapon switchers, (which simply bind the slot-change command in addition to the +attack command) this script allows for null-cancelling mouse clicks, and remembers buttons that are held down after a different button is briefly used.

No more using your number keys to switch weapons! That means you can now spam wasd unimpeded.

This script is intended for scout, but could be adapted for usage with other classes, depending on if their weapons have an alt-fire.

The script works with the sandman and the wrap-assassin, firing the ball when the melee button is pressed.

The script, and its installation directions in plaintext are located here:
https://raw.githubusercontent.com/Sveniveniven/tf2-scripts-cfg/main/mouse_prim_sec_melee.cfg

Github Page:
https://github.com/Sveniveniven/tf2-scripts-cfg/blob/main/mouse_prim_sec_melee.cfg

Raw Script (You will need to update your class-specific configs for it to turn on/off correctly!),

bind "1" ""
bind "2" ""
bind "3" ""

bind "MOUSE1" "+scattergun"
bind "MOUSE2" "+pistol"
bind "MOUSE3" "+melee"

alias "+scattergun" "slot1; +attack; alias checkScatter scatterOn"
alias "-scattergun" "-attack; checkPistol; checkMelee; alias checkScatter"

alias "+pistol" "slot2; +attack; alias checkPistol pistolOn"
alias "-pistol" "-attack; checkScatter; checkMelee; alias checkPistol"

alias "+melee" "slot3; +attack; +attack2; alias checkMelee meleeOn"
alias "-melee" "-attack; -attack2; checkScatter; checkPistol; alias checkMelee"

alias "checkScatter" ""
alias "checkPistol" ""
alias "checkMelee" ""

alias "scatterOn" "+attack; slot1"
alias "pistolOn" "+attack; slot2"
alias "meleeOn" "+attack; slot3"

Lemme know if you run into any issues, or have any ideas for it.
Also if this already exists (with the null-cancelling stuff), then I'm angry

I created a script that allows you to switch to, and fire either your primary, secondary, or melee weapon using solely your left-click, right-click, or scroll-wheel-click respectively.

It's different from existing scripts, I swear. I'll try and explain it as best I can in this post.

By pressing and holding any of these buttons, the appropriate weapon will be switched to, and will start firing while the button is held. Briefly tapping the button corresponding to a weapon other than the one that is currently out will switch your weapon without firing.

[b]What makes this script so EPIC! and ADVANCED!??[/b]

Unlike other simple weapon switchers, (which simply bind the slot-change command in addition to the +attack command) this script allows for null-cancelling mouse clicks, and remembers buttons that are held down after a different button is briefly used.

No more using your number keys to switch weapons! That means you can now spam wasd unimpeded.

[i]This script is intended for scout, but could be adapted for usage with other classes, depending on if their weapons have an alt-fire.
[/i]

The script works with the sandman and the wrap-assassin, firing the ball when the melee button is pressed.

[b]The script, and its installation directions in plaintext are located here:[/b]
https://raw.githubusercontent.com/Sveniveniven/tf2-scripts-cfg/main/mouse_prim_sec_melee.cfg

[b]Github Page:[/b]
https://github.com/Sveniveniven/tf2-scripts-cfg/blob/main/mouse_prim_sec_melee.cfg

[b]Raw Script (You will need to update your class-specific configs for it to turn on/off correctly!),[/b]
[code]
bind "1" ""
bind "2" ""
bind "3" ""

bind "MOUSE1" "+scattergun"
bind "MOUSE2" "+pistol"
bind "MOUSE3" "+melee"

alias "+scattergun" "slot1; +attack; alias checkScatter scatterOn"
alias "-scattergun" "-attack; checkPistol; checkMelee; alias checkScatter"

alias "+pistol" "slot2; +attack; alias checkPistol pistolOn"
alias "-pistol" "-attack; checkScatter; checkMelee; alias checkPistol"

alias "+melee" "slot3; +attack; +attack2; alias checkMelee meleeOn"
alias "-melee" "-attack; -attack2; checkScatter; checkPistol; alias checkMelee"

alias "checkScatter" ""
alias "checkPistol" ""
alias "checkMelee" ""

alias "scatterOn" "+attack; slot1"
alias "pistolOn" "+attack; slot2"
alias "meleeOn" "+attack; slot3"
[/code]

Lemme know if you run into any issues, or have any ideas for it.
Also if this already exists (with the null-cancelling stuff), then I'm angry
2
#2
0 Frags +

i hate to break it to you...

https://www.teamfortress.tv/24398/trouble-with-class-cfg-scripts

i hate to break it to you...

https://www.teamfortress.tv/24398/trouble-with-class-cfg-scripts
3
#3
5 Frags +
Brimstonei hate to break it to you...

https://www.teamfortress.tv/24398/trouble-with-class-cfg-scripts

It's much older than even that, I got it from a friend back in like 2011/2012.

Not to shit on the work put in here ofc,just saying it's been done before a bunch.

[quote=Brimstone]i hate to break it to you...

https://www.teamfortress.tv/24398/trouble-with-class-cfg-scripts[/quote]

It's much older than even that, I got it from a friend back in like 2011/2012.

Not to shit on the work put in here ofc,just saying it's been done before a bunch.
4
#4
5 Frags +
Brimstonei hate to break it to you...

https://www.teamfortress.tv/24398/trouble-with-class-cfg-scripts

My script actually adds some functionality from this script, allowing for simultaneous/null-cancelling button presses without breaking/having unintuitive consequences.
It fixes issues regarding holding one mouse button down then clicking another while the first is still held down (Which could happen unintentionally with quick presses).

[quote=Brimstone]i hate to break it to you...

https://www.teamfortress.tv/24398/trouble-with-class-cfg-scripts[/quote]

My script actually adds some functionality from this script, allowing for simultaneous/null-cancelling button presses without breaking/having unintuitive consequences.
It fixes issues regarding holding one mouse button down then clicking another while the first is still held down (Which could happen unintentionally with quick presses).
5
#5
0 Frags +
_KermitBrimstonei hate to break it to you...

https://www.teamfortress.tv/24398/trouble-with-class-cfg-scripts

It's much older than even that, I got it from a friend back in like 2011/2012.

Not to shit on the work put in here ofc,just saying it's been done before a bunch.

Chris's original med cfg from like 2009 had this even.

[quote=_Kermit][quote=Brimstone]i hate to break it to you...

https://www.teamfortress.tv/24398/trouble-with-class-cfg-scripts[/quote]

It's much older than even that, I got it from a friend back in like 2011/2012.

Not to shit on the work put in here ofc,just saying it's been done before a bunch.[/quote]


Chris's original med cfg from like 2009 had this even.
6
#6
4 Frags +

The "feature" that this script adds is memory of what mouse buttons are pressed down.

What that means is that you can execute the following inputs:
Press and hold mouse1 to shoot your scattergun
Keeping mouse1 held down, press and hold mouse2 to swap to pistol
Release mouse2, keeping mouse1 held down, will swap back to scattergun and shoot.

I have used this script a lot and I have never found it lacking this feature, but cool, its a feature. However, it introduces a bug with the following inputs:
Press and hold mouse1 to shoot your scattergun.
Keeping mouse1 held, press mouse2 to shoot your pistol.
Release mouse1, while keeping mouse2 held.

This is a stupid input sequence that can only really occur if you use the script utilising the input memory that has been added to this version. But the fact it can happen makes it a direct downgrade imo.

lmao im a retard

what it actually does is stop the exact bug i mentioned from happening on the original script. good job

[s]The "feature" that this script adds is memory of what mouse buttons are pressed down.

What that means is that you can execute the following inputs:
Press and hold mouse1 to shoot your scattergun
Keeping mouse1 held down, press and hold mouse2 to swap to pistol
Release mouse2, keeping mouse1 held down, will swap back to scattergun and shoot.

I have used this script a lot and I have never found it lacking this feature, but cool, its a feature. However, it introduces a bug with the following inputs:
Press and hold mouse1 to shoot your scattergun.
Keeping mouse1 held, press mouse2 to shoot your pistol.
Release mouse1, while keeping mouse2 held.

This is a stupid input sequence that can only really occur if you use the script utilising the input memory that has been added to this version. But the fact it can happen makes it a direct downgrade imo.[/s]

lmao im a retard

what it actually does is stop the exact bug i mentioned from happening on the original script. good job
7
#7
2 Frags +
scrambledwhat it actually does is stop the exact bug i mentioned from happening on the original script. good job

ayo thanks

[quote=scrambled]
what it actually does is stop the exact bug i mentioned from happening on the original script. good job[/quote]

ayo thanks
8
#8
1 Frags +

omg ty i rely on th old script so itll be nice to try this

omg ty i rely on th old script so itll be nice to try this
9
#9
8 Frags +

https://cdn.discordapp.com/attachments/817548635948580874/963910871040532560/unknown.png

clickbait thread

[img]https://cdn.discordapp.com/attachments/817548635948580874/963910871040532560/unknown.png[/img]
clickbait thread
Please sign in through STEAM to post a comment.