Results 1 to 8 of 8

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

  1. #1
    Private First Class G-Stuff002's Avatar
    Join Date
    Jan 2018
    Posts
    212
    Thanks
    42
    Thanked 109 Times in 107 Posts

    One key - two different scripts. It's possible ? Bind for Capslock.

    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
    Last edited by G-Stuff002; 5th August 2019 at 23:25.

  2. The Following User Says Thank You to G-Stuff002 For This Useful Post:

    kung foo man (6th August 2019)

  3. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    set abc "set timescale 0.3; bind capslock vstr def"
    set def "set timescale 1; bind capslock vstr abc"
    bind capslock vstr abc

    done.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  4. The Following 2 Users Say Thank You to IzNoGoD For This Useful Post:

    G-Stuff002 (6th August 2019),kung foo man (6th August 2019)

  5. #3
    Private First Class G-Stuff002's Avatar
    Join Date
    Jan 2018
    Posts
    212
    Thanks
    42
    Thanked 109 Times in 107 Posts
    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)
    Last edited by G-Stuff002; 6th August 2019 at 14:22.

  6. #4
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,083 Times in 753 Posts
    CS:GO is host_timescale and not timescale
    timescale 0.01

  7. The Following User Says Thank You to kung foo man For This Useful Post:

    G-Stuff002 (6th August 2019)

  8. #5
    Private First Class G-Stuff002's Avatar
    Join Date
    Jan 2018
    Posts
    212
    Thanks
    42
    Thanked 109 Times in 107 Posts
    Quote Originally Posted by kung foo man View Post
    CS:GO is host_timescale and not timescale

    Dont understand you

    Ahhh, missing "host_" in code
    Last edited by G-Stuff002; 6th August 2019 at 21:10.

  9. #6
    ... connecting
    Join Date
    Jul 2018
    Posts
    6
    Thanks
    0
    Thanked 2 Times in 2 Posts
    You were close enough. The command you're looking for is the following:

    Code:
    bind "capslock" "toggle host_timescale 0.3 1"
    I have tested it and made sure it works.

  10. The Following User Says Thank You to somewhat windy For This Useful Post:

    G-Stuff002 (6th August 2019)

  11. #7
    Private First Class G-Stuff002's Avatar
    Join Date
    Jan 2018
    Posts
    212
    Thanks
    42
    Thanked 109 Times in 107 Posts
    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.

  12. #8
    Private First Class G-Stuff002's Avatar
    Join Date
    Jan 2018
    Posts
    212
    Thanks
    42
    Thanked 109 Times in 107 Posts
    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
    Last edited by G-Stuff002; 13th August 2019 at 20:11.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •