PDA

View Full Version : One key - two different scripts. It's possible ? Bind for Capslock.



G-Stuff002
5th August 2019, 22:17
Hello, is it possible to bind two different scripts on one button, for Capslock ?

There are two enable and disable commands which i need to integrate on one button:

Bind "capslock" "host_timescale 0.3"
Bind "capslock" "host_timescale 1.0" -------Maybe when the capslock is turned on, it is written like: capslocktoggle


My bind doesn’t work, unite it like this:

Bind "capslock" "host_timescale 0.3"; "host_timescale 1.0"
the first script works the second no



1. Found example from the net (May help to understand)

I know that there is a command: Bindtoggle
How to use the BindToggle command So, the BindToggle command, like the light on button — pressed once — turned on, turned on the second time. The principle of the team is exactly the same. Consider the simplest example of the cl_showfps command, with which you can view the FPS in the game. Bind example BindToggle F2 "cl_showfps 1" It turns out, if you press F2, then in the upper right corner you will see the inscription: NUMBER of fps on map THE MAP WHICH YOU ARE PLAYING


2. Found example from the net from different game(May help to understand how to script capslock)


I know that there is a command: alias (is important)

Script to enable - disable auto-attack

dota_player_units_auto_attack 1
bind CAPSLOCK "AutoAttack"
alias AutoAttack AutoAttackOff alias AutoAttackOff "dota_player_units_auto_attack 0; clear; echo AutoAttack-Off; say_team AutoAttack-Off; alias AutoAttack AutoAttackOn"
alias AutoAttackOn "dota_player_units_auto_attack 1; clear; echo AutoAttack-On; say_team AutoAttack-On; alias AutoAttack AutoAttackOff"


Sorry to write here, but here on this site have the best programmers

IzNoGoD
6th August 2019, 04:14
set abc "set timescale 0.3; bind capslock vstr def"
set def "set timescale 1; bind capslock vstr abc"
bind capslock vstr abc

done.

G-Stuff002
6th August 2019, 11:17
Sorry but this is not working.

I created cfg file and executed him from game, that's what wrote to me:

] exec capslock.cfg
bind <key> [command] : attach a command to a key
Unknown command: set
Unknown command: set


sorry this is for CS:GO script, maybe the command is not suitable. This is slowmo script


When i separately use 2 command it's work fine,
Bind "capslock" "host_timescale 0.3"
Bind "capslock" "host_timescale 1.0"

but how to combine two command on one button capslock


I also tried to bind separately in console (take turns)


set abc "set timescale 0.3; bind capslock vstr def"

set def "set timescale 1; bind capslock vstr abc"

bind capslock vstr abc


sv_cheats 1 (for this enabled)

kung foo man
6th August 2019, 13:26
CS:GO is host_timescale and not timescale

G-Stuff002
6th August 2019, 16:26
CS:GO is host_timescale and not timescale


Dont understand you

Ahhh, missing "host_" in code

somewhat windy
6th August 2019, 19:36
You were close enough. The command you're looking for is the following:


bind "capslock" "toggle host_timescale 0.3 1"

I have tested it and made sure it works.

G-Stuff002
6th August 2019, 20:08
Wow, Thank you very much! it work. Super!

I asked in three forums and no one could help. I tried many combinations but yours didn’t.

G-Stuff002
6th August 2019, 21:59
Checked over LAN, it’s bad that only the server can run this parameter. Tomorrow i’ll check, maybe through Rcon password can manage the server and enable it on the client side


it worked