Friday, March 23, 2012

How to script autobuy of specific items

Question

i was told / i read that it was possible to buy from shop via hotkeys. (not quickbuy)

i tried to build a script:

bind KP_8 shop_nav_to_search    //with the shop open, makes the search box active
bind KP_9 shop_nav_to_tab       //switch to a particular shop tab ( 0 - 12 )
bind KP_4 shop_select_itemrow   //not a real command? //buy ( or set quickbuy with shift held ) a particular displayed row 

but this commands dont do anything. does any1 know more about these commands?

/edit:

i found this code:

alias "tpscroll" "dota_shop_force_hotkeys 1;toggleshoppanel;shop_nav_to_tab 0;shop_select_itemrow 5;toggleshoppanel;dota_shop_force_hotkeys 0"
bind KP_7 "tpscroll"

this works. i will experiment with this tomorrow (it should be doable to send even more buycommands to 1 key)

cheers

Asked by Wandang

Answer

enter image description here

As you can see the shop is a grid of items.

Commands needed:

the command shop_nav_to_tab x is the column you want in x(0-9)

the command shop_select_itemrow x is the row you want in x(1-11)

example: you want town portal. this would be shop_nav_to_tab 0 and shop_select_itemrow 5

to buy items you need 2 more commands:

dota_shop_force_hotkeys x activates shopkeys(1) or disables them(0) toggleshoppanel just brings up the shop itself

Building:

we need to combine them all into one command:

bind k "dota_shop_force_hotkeys 1;toggleshoppanel;shop_nav_to_tab 0;shop_select_itemrow 5;toggleshoppanel;dota_shop_force_hotkeys 0"

would bind buying a town portal to the key k.

you can bind as many items as u want to one key. just add them after toggleshoppanel:

bind j "clarity+tango+healing_salve" "dota_shop_force_hotkeys 1;toggleshoppanel;shop_nav_to_tab 0;shop_select_itemrow 1;shop_nav_to_tab 0;shop_select_itemrow 2;shop_nav_to_tab 0;shop_select_itemrow 3;toggleshoppanel;dota_shop_force_hotkeys 0"
//                                                                                    (0/1)=clarity                             (0/2)=Tango                           (0/3)=Healing_Salve

Extras:

for a better overview of the things you do you can use alias "namethecommandiwant"

for example:

alias "tp" "dota_shop_force_hotkeys 1;toggleshoppanel;shop_nav_to_tab 0;shop_select_itemrow 5;toggleshoppanel;dota_shop_force_hotkeys 0"bind k "tp"

is the same code as above! you can just see the binding more clearly.

the clarity combo would be the following:

alias "clarity+tango+healing_salve" "dota_shop_force_hotkeys 1;toggleshoppanel;shop_nav_to_tab 0;shop_select_itemrow 1;shop_nav_to_tab 0;shop_select_itemrow 2;shop_nav_to_tab 0;shop_select_itemrow 3;toggleshoppanel;dota_shop_force_hotkeys 0"
//                                                                                    (0/1)=clarity                             (0/2)=Tango                           (0/3)=Healing_Salve
bind j "clarity+tango+healing_salve"
Answered by Wandang

No comments:

Post a Comment