Page 1 of 1

TF2 Script Issue

Posted: Thu May 18, 2017 10:23 pm
by Bench
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.

Text Being Spammed in Console
Spoiler

Code: Select all

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
Script
Spoiler

Code: Select all

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"

Re: TF2 Script Issue

Posted: Thu May 18, 2017 11:24 pm
by MoneyKidKing
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"

Re: TF2 Script Issue

Posted: Thu May 18, 2017 11:28 pm
by fishermatt3552
It seems your quotation marks are out of place

bind "key" "command"

Re: TF2 Script Issue

Posted: Fri May 19, 2017 1:17 am
by Bench
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.

Re: TF2 Script Issue

Posted: Fri May 19, 2017 3:15 am
by MoneyKidKing
I mean, the other option is to just go overkill on the quotations.
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" "taunt 1"
alias "keyB" "bind kp_downarrow" "taunt 2"
alias "keyC" "bind kp_pgdn" "taunt 3"
alias "keyD" "bind kp_leftarrow" "taunt 4"
alias "keyE" "bind kp_5" "taunt 5"
alias "keyF" "bind kp_rightarrow" "taunt 6"
alias "keyG" "bind kp_home" "taunt 7"
alias "keyH" "bind kp_uparrow" "taunt 8"
alias "keyI" "bind kp_pgup" "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"

Re: TF2 Script Issue

Posted: Fri May 19, 2017 11:59 am
by Mitch
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.

Re: TF2 Script Issue

Posted: Tue May 23, 2017 6:55 pm
by Bench
Issue has been resolved, thread no longer needed.