So I was modifying a script for TF2 that would essentially allow the keys on my number pad have two bound commands. In order for this to work, I have an action key bound to toggle between each command to use. The issue is how the activator key would print the message in console for when you use the incorrect layout when using the bind command upon being pressed. It would print nine times when pressed, being as how I have nine keys with the multiple commands, I presume. If anyone has a fix, please help.
bind <key> [command] : attach a command to a key
bind <key> [command] : attach a command to a key
bind <key> [command] : attach a command to a key
bind <key> [command] : attach a command to a key
bind <key> [command] : attach a command to a key
bind <key> [command] : attach a command to a key
bind <key> [command] : attach a command to a key
bind <key> [command] : attach a command to a key
bind <key> [command] : attach a command to a key
alias defA "bind kp_end taunt 4"
alias defB "bind kp_downarrow say (????)?"
alias defC "bind kp_pgdn say Leaxeaus {C²°} : bench tastes butt everyday"
alias defD "bind kp_leftarrow toggle cl_disablehtmlmotd"
alias defE "bind kp_5 say ( ?° ?? ?°)"
alias defF "bind kp_rightarrow say Listen here you fuck twat dick licker - Soup"
alias defG "bind kp_home toggle r_drawviewmodel"
alias defH "bind kp_uparrow say \(?? ?? ??)/"
alias defI "bind kp_pgup say --- ??•?•??"
alias keyA "bind kp_end keyAA"
alias keyB "bind kp_downarrow keyBB"
alias keyC "bind kp_pgdn keyCC"
alias keyD "bind kp_leftarrow keyDD"
alias keyE "bind kp_5 keyEE"
alias keyF "bind kp_rightarrow keyFF"
alias keyG "bind kp_home keyGG"
alias keyH "bind kp_uparrow keyHH"
alias keyI "bind kp_pgup keyII"
alias keyAA "taunt 1"
alias keyBB "taunt 2"
alias keyCC "taunt 3"
alias keyDD "taunt 4"
alias keyEE "taunt 5"
alias keyFF "taunt 6"
alias keyGG "taunt 7"
alias keyHH "taunt 8"
alias keyII "taunt"
alias +keybinds "keyA; keyB; keyC; keyD; keyE; keyF; keyG; keyH; keyI"
alias -keybinds "defA; defB; defC; defD; defE; defF; defG; defH; defI"
bind kp_ins "+keybinds"
Last edited by Bench on Thu May 18, 2017 10:23 pm, edited 1 time in total.
From what I can tell, your issue is the location of your quotation marks. I would test the fixed code myself, but I don't want to mess with my own binds, so let me know if the following code works.
Spoiler
alias defA bind kp_end "taunt 4"
alias defB bind kp_downarrow "say (????)?"
alias defC bind kp_pgdn "say Leaxeaus {C²°} : bench tastes butt everyday"
alias defD bind kp_leftarrow "toggle cl_disablehtmlmotd"
alias defE bind kp_5 say "( ?° ?? ?°)"
alias defF bind kp_rightarrow "say Listen here you fuck twat dick licker - Soup"
alias defG bind kp_home "toggle r_drawviewmodel"
alias defH bind kp_uparrow "say \(?? ?? ??)/"
alias defI bind kp_pgup "say --- ??•?•??"
alias keyA bind kp_end "keyAA"
alias keyB bind kp_downarrow "keyBB"
alias keyC bind kp_pgdn "keyCC"
alias keyD bind kp_leftarrow "keyDD"
alias keyE bind kp_5 "keyEE"
alias keyF bind kp_rightarrow "keyFF"
alias keyG bind kp_home "keyGG"
alias keyH bind kp_uparrow "keyHH"
alias keyI bind kp_pgup "keyII"
alias keyAA "taunt 1"
alias keyBB "taunt 2"
alias keyCC "taunt 3"
alias keyDD "taunt 4"
alias keyEE "taunt 5"
alias keyFF "taunt 6"
alias keyGG "taunt 7"
alias keyHH "taunt 8"
alias keyII "taunt"
alias +keybinds "keyA;keyB;keyC;keyD;keyE;keyF;keyG;keyH;keyI"
alias -keybinds "defA;defB;defC;defD;defE;defF;defG;defH;defI"
bind kp_ins "+keybinds"
Last edited by MoneyKidKing on Thu May 18, 2017 11:24 pm, edited 2 times in total.
Didn't fix the problem with the action key and now the number pad keys will do the secondary command (taunt) without using the action key. Holding the action key and pressing the key has no effect.
EDIT: Quotes did not solve the problem.
My quote location was correct since I have <alias script "bind key say text"> instead of <alias script bind key "say text">. This is because the quote is separating the whole bind, key, and say from the alias. Having the quotes would be incorrect in how it would make be only say. Fuck this hurts my brain.
Last edited by Bench on Fri May 19, 2017 1:17 am, edited 3 times in total.
Theres a small trick to doing binds, you will need to creat .cfg files that have each bind in it, and make the aliases exec the cfg instead. This is how I would do it in cs:s.