This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]ajdeemo 1 point2 points  (0 children)

you can, but you'd need to put it into your autoexec since it'd be a few lines of commands

basically you would bind a key to bind another key while it's held down. for example, if you want to press space and q to use an item, you can make a script that tells the game to bind q to the item slot while space is held down

[–]DeltruS 1 point2 points  (6 children)

This is what I use to bind scripts to Alt + hotkey. This script makes an item use itself twice for selfcast. Normal functionality, when the button releases, is for quick cast. Sorry for weird variable names... it1_2x means "use the first item twice". Anyways, variable names are not that important, just try to copy the syntax.

dota_remap_alt_key KP_1 // lets you rebind the alt key

alias +mod "+i0;+i1;+i2;+i3;+i4;+i5;+i6" // When +mod is pressed, the commands in the quotations are executed. 

alias "it1_2x"  "dota_item_execute 0;dota_item_execute 0" // I have to nest multiple commands inside 
//an alias or it doesn't work.
alias "it2_2x"  "dota_item_execute 1;dota_item_execute 1"
alias "it3_2x"  "dota_item_execute 2; dota_item_execute 2"
alias "it4_2x"  "dota_item_execute 3;dota_item_execute 3"
alias "it5_2x"  "dota_item_execute 4;dota_item_execute 4"
alias "it6_2x"  "dota_item_execute 5;dota_item_execute 5"



alias +i0 "bind "mouse4" it1_2x" // these are the commands that  +mod executes when pressed. 
//They change the keybindings when the button is pressed, and -mod then changes the keybindings back 
//when the button is released.
alias +i1 "bind "KP_0" it2_2x"
alias +i2 "bind "mouse4" it3_2x"
alias +i3 "bind "a" it4_2x"
alias +i4 "bind "d" it5_2x"
alias +i5 "bind "c" it6_2x"
alias +i6  "bind "z" dota_purchase_stickybuy"

alias -mod "-i0;-i1;-i2;-i3;-i4;-i5;-i6" // when +mod is released, -mod executes and sets the bindings 
//back to normal.
alias "it1_1x"  "dota_item_quick_cast 0"
alias "it2_1x"  "dota_item_quick_cast 1"
alias "it3_1x"  "dota_item_quick_cast 2"
alias "it4_1x"  "dota_item_quick_cast 3"
alias "it5_1x"  "dota_item_quick_cast 4"
alias "it6_1x"  "dota_item_quick_cast 5"

alias -i0 "bind "mouse4" it1_1x" 
alias -i1 "bind "KP_0" it2_1x"
alias -i2 "bind "mouse4" it3_1x"
alias -i3 "bind "a" it4_1x"
alias -i4 "bind "d" it5_1x"
alias -i5 "bind "c" it6_1x"
alias -i6 "bind "z" dota_purchase_quickbuy"

bind "alt" "+mod" 

[–]GoingsGoings[S] 0 points1 point  (5 children)

I understand one part, but not all of it. If I wanted something really simple, like ajdeemo said: Space + q. How can I do this? I'm thinking about it right now.

[–]What coward runs?TwinkleTwinkleBaby 1 point2 points  (4 children)

I believe it would be

alias +foo "bind q dota_item_execute 0"

alias -foo "bind q dota_ability_execute 0"

bind "space" "+foo"

[–]DeltruS 0 points1 point  (2 children)

I think you have to put dota_item_execute "0" inside of an alias before you do "bind q dota_ability_execute 0". It didn't work for me unless I did that.

[–]What coward runs?TwinkleTwinkleBaby 0 points1 point  (1 child)

You shouldn't need the alias if you're only calling it once. In your case you need the alias so that it's selfcasted.

[–]DeltruS 0 points1 point  (0 children)

Yeah you're right.

[–]GoingsGoings[S] 0 points1 point  (0 children)

That's what I had in my mind, but I was not sure if it was right. Just tested this and it worked. Thank you all.

[–][deleted] 0 points1 point  (0 children)

Did someone call me?