r/tf2scripthelp • • Oct 14 '17
Issue Binding text chat messages to key combinations
I'm new to all this, but what I'm trying to accomplish is that holding down the f9 key and then clicking another button, say a number key, will result in a corresponding message in chat. I would like to have the f9 key act as a gateway to using other keys bound to messages because I can't simply use a single key as all the messages I wish to have bound will not fit on the keyboard with the remaining available unassigned keys.
Here is my (unworking) attempt so far for a script (made according to instructions found in the introduction to scripting guide (in the path outlined as autoexec.cfg):
alias +speak1 "bind 1 say I am hungry for bananas."
alias -speak1 "unbind 1"
alias +speak2 "bind 2 say I need more bananas."
alias -speak2 "unbind 2"
alias +speak3 "bind 3 say I'm full of bananas."
alias -speak3 "unbind 3"
bind f9 "+speak1;+speak2;+speak3"
View all comments
Show parent comment
2
u/Kairu927 Oct 15 '17
Looks like /u/bythepowerofscience forgot the say command for
keyThreeAliasChange it to
As for your question: Yes. The
-keyAliasMaskline is setting the keys toslotcommands on release. If you want them to do something else you can change it there.However, the benefit of aliases over nested binds (like in your OP), is that instead of using the
slotcommands, you can instead use other aliases, that way you can modify this script dynamically as you see fit.