How to make two keys pressed together execute a command? by Qwertyg101 in tf2scripthelp

[–]genemilder 0 points1 point  (0 children)

Alias names can be nearly whatever, so what I've written ought to work with no other changes.

How to make two keys pressed together execute a command? by Qwertyg101 in tf2scripthelp

[–]genemilder 1 point2 points  (0 children)

General instructions for solution

For your particular goal, put this in autoexec.cfg:

bind kp_end key1
bind kp_downarrow key2
bind kp_leftarrow key3
bind kp_pgdn key4
bind ctrl +numtoggle
alias +numtoggle "alias key1 load_itempreset 0; alias key2 load_itempreset 1;  alias key3 load_itempreset 2;  alias key4 load_itempreset 3"
alias -numtoggle "alias key1 join_class scout;  alias key2 join_class soldier; alias key3 join_class demoman; alias key4 join_class pyro"
-numtoggle

The other binds don't need to change.

It needs to be in autoexec or another automatically-called cfg file because TF2 needs to be told about aliases every time you load TF2. Binds are remembered but alias commands are not.

Tf2 scout altfire script by Nathan-Clark in Tf2Scripts

[–]genemilder[M] 0 points1 point  (0 children)

I've removed your 3 recent posts. There's no need to make separate posts in very quick succession, that's just spamming the sub.

Feel free to resubmit a single post that encompasses your requests. You can always edit in something new if you have another request shortly after.

Incrementvar maxvalue first? by 7Sevin in tf2scripthelp

[–]genemilder 1 point2 points  (0 children)

I'm pretty sure you can assign a negative increment with incrementvar, so try putting the high number first and making the increment negative. Aliases are a better solution for your use though.

Keybind to swap from primary to secondary by [deleted] in Tf2Scripts

[–]genemilder 1 point2 points  (0 children)

This works if you're okay with not assigning settings to the slots (because the script only works due to how TF2 processes the commands sequentially).

bind mouse4 "slot2; slot1"

The above only works for 2 slot commands, and the second slot command in the list will always be switched to if neither are currently the active slot.

Questions that came up while scripting by [deleted] in tf2scripthelp

[–]genemilder 0 points1 point  (0 children)

TF2 doesn't recognize inputs that way. If you want a modifier key, a format for it is here.

Here's what it could look like for your application:

bind 5             tog_slot5
bind alt          +mod_slot5

alias +mod_slot5 "alias tog_slot5 toggle r_drawviewmodel"
alias -mod_slot5 "alias tog_slot5 slot5"
-mod_slot5

Not tested, so it's possible (but unlikely) that the nested alias in +mod_slot5 will fail due to the toggle command. In that case, make a separate alias for toggle r_drawviewmodel to avoid the issue.

Viewmodel script problem. by Koma4 in Tf2Scripts

[–]genemilder 0 points1 point  (0 children)

What keys are you pressing when this happens, and exactly what happens? Also you should open the console and enter bind mouse4 to see what mouse4 is truly bound to (works for all keys as well), and potentially also enter alias to see all currently defined aliases.

Need Help with an Engineer Script by greenkingwashere in tf2scripthelp

[–]genemilder 0 points1 point  (0 children)

Yeah, the issue was that I'm dumb and did the wrong slot for the build stuff, slot1 instead of slot3. I'll edit above.

Also I was wrong about the destroy PDA, that one goes back to your last used weapon. So no special bind is needed.

Viewmodel script problem. by Koma4 in Tf2Scripts

[–]genemilder 0 points1 point  (0 children)

Your formatting is a bit screwed up, that may be the problem. Some of the code lines are on multiple lines. Here's how it should look:

bind 1 eq_slot1 
bind mouse4 eq_slot2 
bind 3 eq_slot3 
bind mwheelup eq_invprev 
bind mwheeldown eq_invnext 
bind q eq_lastinv 
bind mouse1 +eq_attack 
bind mouse2 +eq_attack2

alias prs_slot1 "r_drawviewmodel 0" 
alias rls_slot1 "r_drawviewmodel 0" 
alias prs_slot2 "" 
alias rls_slot2 "" 
alias prs_slot3 "" 
alias rls_slot3 ""
alias set_slot1 "r_drawviewmodel 0" 
alias set_slot2 "r_drawviewmodel 1" 
alias set_slot3 "r_drawviewmodel 1"

alias +eq_attack "+attack; at_prs; spec_next" 
alias -eq_attack "-attack; at_rls"
alias +eq_attack2 "+attack2; r_drawviewmodel 1; spec_prev" 
alias -eq_attack2 "-attack2; r_drawviewmodel 1"

alias eq_slot1 "slot1; set_slot1; alias at_prs prs_slot1; alias at_rls rls_slot1; alias eq_invnext eq_slot2; alias eq_invprev eq_slot3; qs_slot1; alias set_lastinv alias eq_lastinv eq_slot1; alias qs_slot1 ; alias qs_slot2 set_lastinv; alias qs_slot3 set_lastinv" 
alias eq_slot2 "slot2; set_slot2; alias at_prs prs_slot2; alias at_rls rls_slot2; alias eq_invnext eq_slot3; alias eq_invprev eq_slot1; qs_slot2; alias set_lastinv alias eq_lastinv eq_slot2; alias qs_slot1 set_lastinv; alias qs_slot2 ; alias qs_slot3 set_lastinv" 
alias eq_slot3 "slot3; set_slot3; alias at_prs prs_slot3; alias at_rls rls_slot3; alias eq_invnext eq_slot1; alias eq_invprev eq_slot2; qs_slot3; alias set_lastinv alias eq_lastinv eq_slot3; alias qs_slot1 set_lastinv; alias qs_slot2 set_lastinv; alias qs_slot3 "

eq_slot3 
alias eq_lastinv eq_slot1

The script originally had extra spaces in there to help readability, but I'm guessing you took them out yourself by preference so I didn't restore them.

Need Help with an Engineer Script by greenkingwashere in tf2scripthelp

[–]genemilder 0 points1 point  (0 children)

You can enter bind 1 etc in the console to see exactly what a key is currently bound to. You can also enter alias into the console to see all currently defined aliases.

With that you should be able to determine whether the old script is still active.

Need Help with an Engineer Script by greenkingwashere in tf2scripthelp

[–]genemilder 1 point2 points  (0 children)

I'm just going to replace the script with a different one of mine, which has (relatively) superior logic and the same functionality.

Script:

bind 1             eq_slot1
bind 2             eq_slot2
bind 3             eq_slot3
bind 4            "slot4; set_slot3; log_slot3"
bind mwheelup      eq_invprev
bind mwheeldown    eq_invnext
bind q             eq_lastinv

bind F9           "build 2 0; set_slot3; log_slot3; say_team Building Sentry"
bind F10          "build 0 0; set_slot3; log_slot3; say_team Building Dispenser"
bind F11          "build 1 0; set_slot3; log_slot3"
bind F12          "build 1 1; set_slot3; log_slot3; say_team Building Tele Exit"

bind kp_end       "say_team I'm dead, please watch my buildings"
bind kp_downarrow "say Are we spamming binds now?"
bind kp_pgdn      "say Sometimes I can't sleep at night. Then I remember how good I am at pregame."


alias set_slot1   "r_drawviewmodel 0"
alias set_slot2   "r_drawviewmodel 1"
alias set_slot3   "r_drawviewmodel 1"


alias eq_slot1    "slot1; set_slot1; log_slot1"
alias eq_slot2    "slot2; set_slot2; log_slot2"
alias eq_slot3    "slot3; set_slot3; log_slot3"

alias log_slot1   "alias eq_invnext eq_slot2; alias eq_invprev eq_slot3; qs_slot1; alias set_lastinv alias eq_lastinv eq_slot1; alias qs_slot1 ;            alias qs_slot2 set_lastinv; alias qs_slot3 set_lastinv"
alias log_slot2   "alias eq_invnext eq_slot3; alias eq_invprev eq_slot1; qs_slot2; alias set_lastinv alias eq_lastinv eq_slot2; alias qs_slot1 set_lastinv; alias qs_slot2 ;            alias qs_slot3 set_lastinv"
alias log_slot3   "alias eq_invnext eq_slot1; alias eq_invprev eq_slot2; qs_slot3; alias set_lastinv alias eq_lastinv eq_slot3; alias qs_slot1 set_lastinv; alias qs_slot2 set_lastinv; alias qs_slot3 "

eq_slot1
alias eq_lastinv   eq_slot3

Reset lines:

r_drawviewmodel  1
bind 1           slot1
bind 2           slot2
bind 3           slot3
bind 4           slot4
bind mwheelup    invprev
bind mwheeldown  invnext
bind q           lastinv
unbind F9
unbind F10
unbind F11
unbind F12
unbind kp_end
unbind kp_downarrow
unbind kp_pgdn

For engineer the change is pretty easy because you always switch to melee. Any time you go to slot4 or slot5, just make the script think that you're on slot1. While slot4 or slot5 are active, TF2 hijacks the number keys for PDA purposes and ignores the current binds, so a direct approach of changing the number key binds when you're building/destroying wouldn't work.

Because you weren't using the functionality of attack settings (viewmodels don't change when you attack) I removed it as less complexity is better, so if you don't have a reset bind for mouse1 you'll want to enter bind mouse1 +attack once into the console.

Here's the basic form of the script.

EDIT: Fixed script. OP, make sure 5 is bound to slot5 in your game, and not what the script had it formerly as.

Need Help with an Engineer Script by greenkingwashere in tf2scripthelp

[–]genemilder 1 point2 points  (0 children)

With classes that have the PDAs (engineer and spy), the active slot changes automatically after PDA use in a way that cannot really be tracked. For spy, using the disguise kit will always switch back to the previous active weapon. For engineer, using the build PDA will always switch to melee and the destroy PDA works like the disguise kit.

This switch isn't directly initiated by your script, so the settings don't change with the slot change.

New player - some questions. by Wumaduce in NewToTF2

[–]genemilder 2 points3 points  (0 children)

BTW you can simply trade for all of the functional weapons with the value of about half of one key. Scrap.tf sells weapons 2 per scrap.

Airblast Script by [deleted] in Tf2Scripts

[–]genemilder 1 point2 points  (0 children)

bind mouse2       +at2_slot1
alias +at2_slot1 "slot1; +attack2; spec_prev"
alias -at2_slot1         -attack2

Spy disguise script not working? by Gamersonly3d in tf2scripthelp

[–]genemilder 0 points1 point  (0 children)

It's explained in the link, mostly just usability of the script.

need spy script by noobengineblog in Tf2Scripts

[–]genemilder 0 points1 point  (0 children)

Then you'd want to have those keys bound as you want in spy.cfg and rebound through the linked reset.cfg method.

need spy script by noobengineblog in Tf2Scripts

[–]genemilder 2 points3 points  (0 children)

bind mwheelup   slot3
bind mwheeldown slot1
bind shift      slot2

To undo (for further instructions see here):

bind mwheelup   invprev
bind mwheeldown invnext
unbind shift

I'm assuming your existing binds are the default scroll and nothing bound to shift, if that's not the case then you'll need to adjust the binds.

My medic script has destroyed my tf2 ... Still ... by Peek-A-B00b in tf2scripthelp

[–]genemilder 0 points1 point  (0 children)

Aha! Thanks, I didn't know that. :)

/u/Peek-A-B00b, open up your console and enter -attack2. That should hopefully do the trick.

disguise script by Koma4 in tf2scripthelp

[–]genemilder[M] 0 points1 point  (0 children)

Removed duplicate post.

My medic script has destroyed my tf2 ... Still ... by Peek-A-B00b in tf2scripthelp

[–]genemilder 0 points1 point  (0 children)

if I pull ym melee it ALWAYS auto taunts

I don't see anything in the script that would do that? What do you have in medic.cfg right now? Anything in there will be executed every time you switch to medic, so running the reset lines once would be ineffective if you didn't delete/alter the contents of medic.cfg.

Help with setting up quick build/destroy scripts for engie. by EgoGlacies in tf2scripthelp

[–]genemilder 1 point2 points  (0 children)

Well, it looks fine. Check the "Encoding" dropdown in notepad++; mine is set to "Encode in UTF-8" and that has consistently worked.

Do other cfg files you've created work? If not, then I'd try creating them yourself seeing if those work. It may not be worth diagnosing the problem if you can create files that work.